platformio.ini 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. ; PlatformIO Project Configuration File
  2. ;
  3. ; Build options: build flags, source filter
  4. ; Upload options: custom upload port, speed and extra flags
  5. ; Library options: dependencies, extra library storages
  6. ; Advanced options: extra scripting
  7. ;
  8. ; Please visit documentation for the other options and examples
  9. ; https://docs.platformio.org/page/projectconf.html
  10. [platformio]
  11. default_envs = view
  12. src_dir = firmware/src
  13. lib_dir = firmware/lib
  14. include_dir = firmware/include
  15. test_dir = firmware/test
  16. data_dir = firmware/data
  17. [base_config]
  18. platform = espressif32@3.4
  19. framework = arduino
  20. monitor_speed = 921600
  21. monitor_flags =
  22. --eol=CRLF
  23. --echo
  24. --filter=esp32_exception_decoder
  25. upload_speed = 921600
  26. lib_deps =
  27. infineon/TLV493D-Magnetic-Sensor @ 1.0.3
  28. bxparks/AceButton @ 1.9.1
  29. bakercp/PacketSerial @ 1.4.0
  30. nanopb/Nanopb @ 0.4.6 ; Ideally this would reference the nanopb submodule, but that would require
  31. ; everyone to check out submodules to just compile, so we use the library
  32. ; registry for the runtime. The submodule is available for manually updating
  33. ; the pre-compiled (checked in) .pb.h/c files when proto files change, but is
  34. ; otherwise not used during application firmware compilation.
  35. build_flags =
  36. -DMONITOR_SPEED=921600
  37. [env:view]
  38. extends = base_config
  39. board = esp32doit-devkit-v1
  40. lib_deps =
  41. ${base_config.lib_deps}
  42. askuric/Simple FOC @ 2.2.0
  43. bodmer/TFT_eSPI@2.4.25
  44. fastled/FastLED @ 3.5.0
  45. bogde/HX711 @ 0.7.5
  46. adafruit/Adafruit VEML7700 Library @ 1.1.1
  47. build_flags =
  48. ${base_config.build_flags}
  49. ; Display enabled: 1=enable, 0=disable
  50. -DSK_DISPLAY=1
  51. ; Display orientation: 0=usb bottom, 2=usb top
  52. -DSK_DISPLAY_ROTATION=0
  53. ; LEDs enabled: 1=enable, 0=disable
  54. -DSK_LEDS=1
  55. ; Number of LEDs
  56. -DNUM_LEDS=8
  57. ; Strain-gauge press input enabled: 1=enable, 0=disable
  58. -DSK_STRAIN=1
  59. ; Ambient light sensor (VEML7700) enabled: 1=enable (display/LEDs match ambient brightness), 0=disable (100% brightness all the time)
  60. -DSK_ALS=1
  61. ; Use MT6701 magnetic encoder
  62. -DSENSOR_MT6701=1
  63. ; Invert direction of angle sensor (motor direction is detected relative to angle sensor as part of the calibration procedure)
  64. -DSK_INVERT_ROTATION=1
  65. -DMOTOR_WANZHIDA_ONCE_TOP=1
  66. ; Pin configurations
  67. -DPIN_UH=26
  68. -DPIN_UL=25
  69. -DPIN_VH=27
  70. -DPIN_VL=32
  71. -DPIN_WH=12
  72. -DPIN_WL=33
  73. -DPIN_BUTTON_NEXT=-1
  74. -DPIN_BUTTON_PREV=-1
  75. -DPIN_SDA=15
  76. -DPIN_SCL=8
  77. -DPIN_MT_DATA=37
  78. -DPIN_MT_CLOCK=13
  79. -DPIN_MT_CSN=14
  80. -DPIN_LED_DATA=7
  81. -DPIN_LCD_BACKLIGHT=19
  82. -DDESCRIPTION_FONT=Roboto_Thin_24
  83. -DDESCRIPTION_Y_OFFSET=20
  84. -DVALUE_OFFSET=30
  85. -DDRAW_ARC=0
  86. ; TFT_eSPI setup
  87. -DUSER_SETUP_LOADED=1
  88. -DGC9A01_DRIVER=1
  89. -DCGRAM_OFFSET=1
  90. -DTFT_WIDTH=240
  91. -DTFT_HEIGHT=240
  92. -DTFT_MISO=-1
  93. -DTFT_MOSI=5
  94. -DTFT_SCLK=20
  95. -DTFT_CS=21
  96. -DTFT_DC=22
  97. -DTFT_RST=4
  98. -DTFT_BL=-1
  99. -DLOAD_GLCD=1
  100. -DLOAD_GFXFF=1
  101. -DSPI_FREQUENCY=40000000
  102. ; Reduce loop task stack size (only works on newer IDF Arduino core)
  103. ; -DARDUINO_LOOP_STACK_SIZE=2048
  104. -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_DEBUG
  105. ; FastLED setup
  106. ; Modify the default unusable pin mask to allow GPIO 7 (allowed to use on ESP32-PICO-V3-02)
  107. ; Unusable bits: 6, 8, 9, 10, 20
  108. ; (0ULL | _FL_BIT(6) | _FL_BIT(8) | _FL_BIT(9) | _FL_BIT(10) | _FL_BIT(20))
  109. -DFASTLED_UNUSABLE_PIN_MASK=0x100740LL
  110. ; 0~39 except from 24, 28~31 are valid
  111. ; (0xFFFFFFFFFFULL & ~(0ULL | _FL_BIT(24) | _FL_BIT(28) | _FL_BIT(29) | _FL_BIT(30) | _FL_BIT(31)))
  112. -DSOC_GPIO_VALID_GPIO_MASK=0xFF0EFFFFFF
  113. ; GPIO >= 34 are input only
  114. ; (SOC_GPIO_VALID_GPIO_MASK & ~(0ULL | _FL_BIT(34) | _FL_BIT(35) | _FL_BIT(36) | _FL_BIT(37) | _FL_BIT(38) | _FL_BIT(39)))
  115. -DSOC_GPIO_VALID_OUTPUT_GPIO_MASK=0x30EFFFFFF
  116. [env:nanofoc]
  117. extends = base_config
  118. platform = espressif32
  119. board = adafruit_feather_esp32s3
  120. lib_deps =
  121. ${base_config.lib_deps}
  122. askuric/Simple FOC@^2.3.0
  123. bodmer/TFT_eSPI@2.5.0
  124. build_flags =
  125. ${base_config.build_flags}
  126. ; Display enabled: 1=enable, 0=disable
  127. -DSK_DISPLAY=0
  128. ; Display orientation: 0=usb bottom, 2=usb top
  129. -DSK_DISPLAY_ROTATION=0
  130. ; LEDs enabled: 1=enable, 0=disable
  131. -DSK_LEDS=0
  132. ; Number of LEDs
  133. -DNUM_LEDS=8
  134. ; Strain-gauge press input enabled: 1=enable, 0=disable
  135. -DSK_STRAIN=0
  136. ; Ambient light sensor (VEML7700) enabled: 1=enable (display/LEDs match ambient brightness), 0=disable (100% brightness all the time)
  137. -DSK_ALS=0
  138. -DSENSOR_MAQ430=1
  139. -DPIN_MAQ_SCK=6
  140. -DPIN_MAQ_MISO=7
  141. -DPIN_MAQ_MOSI=5
  142. -DPIN_MAQ_SS=4
  143. ; Invert direction of angle sensor (motor direction is detected relative to angle sensor as part of the calibration procedure)
  144. -DSK_INVERT_ROTATION=1
  145. -DMOTOR_MAD2804=1
  146. ; Pin configurations
  147. -DPIN_UH=21
  148. -DPIN_UL=12
  149. -DPIN_VH=14
  150. -DPIN_VL=10
  151. -DPIN_WH=13
  152. -DPIN_WL=11
  153. -DPIN_BUTTON_NEXT=-1
  154. -DPIN_BUTTON_PREV=-1
  155. -DPIN_LED_DATA=7
  156. -DPIN_LCD_BACKLIGHT=08
  157. -DPIO_FRAMEWORK_ARDUINO_ENABLE_CDC=1
  158. -DUSBCON=1
  159. -DARDUINO_USB_CDC_ON_BOOT=1
  160. -DARDUINO_USB_MODE=1
  161. -DCORE_DEBUG_LEVEL=2
  162. -DHSPI_SPEED=100000 ; MA/MAQ Nominal SPI Speed in Mhz (HSPI)
  163. -DVSPI_SPEED=400000 ; TFt Nominal SPI Speed in Mhz (VSPI)
  164. ; Reduce loop task stack size (only works on newer IDF Arduino core)
  165. ; -DARDUINO_LOOP_STACK_SIZE=2048