platformio.ini 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  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. board_build.partitions = default_ffat.csv
  41. lib_deps =
  42. ${base_config.lib_deps}
  43. askuric/Simple FOC @ 2.2.0
  44. bodmer/TFT_eSPI@2.4.25
  45. fastled/FastLED @ 3.5.0
  46. bogde/HX711 @ 0.7.5
  47. adafruit/Adafruit VEML7700 Library @ 1.1.1
  48. build_flags =
  49. ${base_config.build_flags}
  50. ; Display enabled: 1=enable, 0=disable
  51. -DSK_DISPLAY=1
  52. ; Display orientation: 0=usb bottom, 2=usb top
  53. -DSK_DISPLAY_ROTATION=0
  54. ; LEDs enabled: 1=enable, 0=disable
  55. -DSK_LEDS=1
  56. ; Number of LEDs
  57. -DNUM_LEDS=8
  58. ; Strain-gauge press input enabled: 1=enable, 0=disable
  59. -DSK_STRAIN=1
  60. ; Ambient light sensor (VEML7700) enabled: 1=enable (display/LEDs match ambient brightness), 0=disable (100% brightness all the time)
  61. -DSK_ALS=1
  62. ; Use MT6701 magnetic encoder
  63. -DSENSOR_MT6701=1
  64. ; Invert direction of angle sensor (motor direction is detected relative to angle sensor as part of the calibration procedure)
  65. -DSK_INVERT_ROTATION=1
  66. -DMOTOR_WANZHIDA_ONCE_TOP=1
  67. ; Pin configurations
  68. -DPIN_UH=26
  69. -DPIN_UL=25
  70. -DPIN_VH=27
  71. -DPIN_VL=32
  72. -DPIN_WH=12
  73. -DPIN_WL=33
  74. -DPIN_BUTTON_NEXT=-1
  75. -DPIN_BUTTON_PREV=-1
  76. -DPIN_SDA=15
  77. -DPIN_SCL=8
  78. -DPIN_MT_DATA=37
  79. -DPIN_MT_CLOCK=13
  80. -DPIN_MT_CSN=14
  81. -DPIN_LED_DATA=7
  82. -DPIN_LCD_BACKLIGHT=19
  83. -DDESCRIPTION_FONT=Roboto_Thin_24
  84. -DDESCRIPTION_Y_OFFSET=20
  85. -DVALUE_OFFSET=30
  86. -DDRAW_ARC=0
  87. ; TFT_eSPI setup
  88. -DUSER_SETUP_LOADED=1
  89. -DGC9A01_DRIVER=1
  90. -DCGRAM_OFFSET=1
  91. -DTFT_WIDTH=240
  92. -DTFT_HEIGHT=240
  93. -DTFT_MISO=-1
  94. -DTFT_MOSI=5
  95. -DTFT_SCLK=20
  96. -DTFT_CS=21
  97. -DTFT_DC=22
  98. -DTFT_RST=4
  99. -DTFT_BL=-1
  100. -DLOAD_GLCD=1
  101. -DLOAD_GFXFF=1
  102. -DSPI_FREQUENCY=40000000
  103. ; Reduce loop task stack size (only works on newer IDF Arduino core)
  104. ; -DARDUINO_LOOP_STACK_SIZE=2048
  105. -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_DEBUG
  106. ; FastLED setup
  107. ; Modify the default unusable pin mask to allow GPIO 7 (allowed to use on ESP32-PICO-V3-02)
  108. ; Unusable bits: 6, 8, 9, 10, 20
  109. ; (0ULL | _FL_BIT(6) | _FL_BIT(8) | _FL_BIT(9) | _FL_BIT(10) | _FL_BIT(20))
  110. -DFASTLED_UNUSABLE_PIN_MASK=0x100740LL
  111. ; 0~39 except from 24, 28~31 are valid
  112. ; (0xFFFFFFFFFFULL & ~(0ULL | _FL_BIT(24) | _FL_BIT(28) | _FL_BIT(29) | _FL_BIT(30) | _FL_BIT(31)))
  113. -DSOC_GPIO_VALID_GPIO_MASK=0xFF0EFFFFFF
  114. ; GPIO >= 34 are input only
  115. ; (SOC_GPIO_VALID_GPIO_MASK & ~(0ULL | _FL_BIT(34) | _FL_BIT(35) | _FL_BIT(36) | _FL_BIT(37) | _FL_BIT(38) | _FL_BIT(39)))
  116. -DSOC_GPIO_VALID_OUTPUT_GPIO_MASK=0x30EFFFFFF
  117. [env:nanofoc]
  118. extends = base_config
  119. platform = espressif32@6.3.1
  120. board = adafruit_feather_esp32s3
  121. board_build.partitions = firmware/partitions-4MB-fat.csv
  122. lib_deps =
  123. ${base_config.lib_deps}
  124. askuric/Simple FOC@^2.3.0
  125. bodmer/TFT_eSPI@2.5.0
  126. build_flags =
  127. ${base_config.build_flags}
  128. ; Display enabled: 1=enable, 0=disable
  129. -DSK_DISPLAY=0
  130. ; Display orientation: 0=usb bottom, 2=usb top
  131. -DSK_DISPLAY_ROTATION=0
  132. ; LEDs enabled: 1=enable, 0=disable
  133. -DSK_LEDS=0
  134. ; Number of LEDs
  135. -DNUM_LEDS=8
  136. ; Strain-gauge press input enabled: 1=enable, 0=disable
  137. -DSK_STRAIN=0
  138. ; Ambient light sensor (VEML7700) enabled: 1=enable (display/LEDs match ambient brightness), 0=disable (100% brightness all the time)
  139. -DSK_ALS=0
  140. -DSENSOR_MAQ430=1
  141. -DPIN_MAQ_SCK=6
  142. -DPIN_MAQ_MISO=7
  143. -DPIN_MAQ_MOSI=5
  144. -DPIN_MAQ_SS=4
  145. ; Invert direction of angle sensor (motor direction is detected relative to angle sensor as part of the calibration procedure)
  146. -DSK_INVERT_ROTATION=1
  147. -DMOTOR_MAD2804=1
  148. ; Pin configurations
  149. -DPIN_UH=21
  150. -DPIN_UL=12
  151. -DPIN_VH=14
  152. -DPIN_VL=10
  153. -DPIN_WH=13
  154. -DPIN_WL=11
  155. -DPIN_BUTTON_NEXT=-1
  156. -DPIN_BUTTON_PREV=-1
  157. -DPIN_LED_DATA=7
  158. -DPIN_LCD_BACKLIGHT=08
  159. -DPIO_FRAMEWORK_ARDUINO_ENABLE_CDC=1
  160. -DUSBCON=1
  161. -DARDUINO_USB_CDC_ON_BOOT=1
  162. -DARDUINO_USB_MODE=1
  163. -DCORE_DEBUG_LEVEL=2
  164. -DHSPI_SPEED=100000 ; MA/MAQ Nominal SPI Speed in Mhz (HSPI)
  165. -DVSPI_SPEED=400000 ; TFt Nominal SPI Speed in Mhz (VSPI)
  166. ; Reduce loop task stack size (only works on newer IDF Arduino core)
  167. ; -DARDUINO_LOOP_STACK_SIZE=2048