platformio.ini 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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. lib_deps =
  26. askuric/Simple FOC @ 2.2.0
  27. infineon/TLV493D-Magnetic-Sensor @ 1.0.3
  28. bxparks/AceButton @ 1.9.1
  29. build_flags =
  30. -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_DEBUG
  31. -DMONITOR_SPEED=921600
  32. [env:view]
  33. extends = base_config
  34. board = esp32doit-devkit-v1
  35. lib_deps =
  36. ${base_config.lib_deps}
  37. bodmer/TFT_eSPI@2.4.25
  38. fastled/FastLED @ 3.5.0
  39. bogde/HX711 @ 0.7.5
  40. adafruit/Adafruit VEML7700 Library @ 1.1.1
  41. bakercp/PacketSerial @ 1.4.0
  42. nanopb/Nanopb @ 0.4.7 ; Ideally this would reference the nanopb submodule, but that would require
  43. ; everyone to check out submodules to just compile, so we use the library
  44. ; registry for the runtime. The submodule is available for manually updating
  45. ; the pre-compiled (checked in) .pb.h/c files when proto files change, but is
  46. ; otherwise not used during application firmware compilation.
  47. knolleary/PubSubClient @ 2.8
  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. -DSENSOR_MT6701=1
  59. ; Strain-gauge press input enabled: 1=enable, 0=disable
  60. -DSK_STRAIN=1
  61. ; Invert direction of angle sensor (motor direction is detected relative to angle sensor as part of the calibration procedure)
  62. -DSK_INVERT_ROTATION=1
  63. ; Ambient light sensor (VEML7700) enabled: 1=enable (display/LEDs match ambient brightness), 0=disable (100% brightness all the time)
  64. -DSK_ALS=1
  65. ; Enable MQTT (wifi must be configured in secrets.h first)
  66. -DSK_MQTT=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. ; 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