denko 0.13.1 → 0.13.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (455) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/build_avr.yml +2 -4
  3. data/.github/workflows/build_esp32.yml +2 -3
  4. data/.github/workflows/build_esp8266.yml +2 -3
  5. data/.github/workflows/build_megaavr.yml +3 -5
  6. data/.github/workflows/build_ra4m1.yml +57 -0
  7. data/.github/workflows/build_rp2040.yml +2 -4
  8. data/.github/workflows/build_sam3x.yml +1 -3
  9. data/.github/workflows/build_samd.yml +2 -4
  10. data/CHANGELOG.md +100 -0
  11. data/DEPS_CLI.md +13 -6
  12. data/DEPS_IDE.md +14 -7
  13. data/HARDWARE.md +104 -80
  14. data/README.md +19 -28
  15. data/benchmarks/i2c_ssd1306_refresh.rb +79 -0
  16. data/examples/analog_io/ads1115.rb +57 -0
  17. data/examples/analog_io/ads1118.rb +8 -9
  18. data/examples/analog_io/dac_loopback.rb +6 -4
  19. data/examples/analog_io/input.rb +39 -36
  20. data/examples/connection/tcp.rb +1 -1
  21. data/examples/display/hd44780.rb +3 -3
  22. data/examples/display/ssd1306.rb +1 -1
  23. data/lib/denko/analog_io/ads1115.rb +61 -0
  24. data/lib/denko/analog_io/ads1118.rb +10 -120
  25. data/lib/denko/analog_io/ads111x.rb +123 -0
  26. data/lib/denko/analog_io/output.rb +2 -1
  27. data/lib/denko/analog_io.rb +2 -0
  28. data/lib/denko/behaviors/reader.rb +14 -13
  29. data/lib/denko/behaviors/subcomponents.rb +2 -2
  30. data/lib/denko/board/core.rb +1 -1
  31. data/lib/denko/board/i2c.rb +1 -4
  32. data/lib/denko/board/led_array.rb +3 -6
  33. data/lib/denko/board/map.rb +9 -0
  34. data/lib/denko/board/servo.rb +2 -6
  35. data/lib/denko/board.rb +32 -20
  36. data/lib/denko/connection/board_uart.rb +3 -3
  37. data/lib/denko/connection/flow_control.rb +10 -2
  38. data/lib/denko/digital_io/output.rb +1 -1
  39. data/lib/denko/display/hd44780.rb +18 -18
  40. data/lib/denko/led/seven_segment.rb +18 -19
  41. data/lib/denko/message.rb +7 -15
  42. data/lib/denko/pulse_io/ir_transmitter.rb +1 -2
  43. data/lib/denko/version.rb +1 -1
  44. data/lib/denko_cli/packages.rb +7 -1
  45. data/lib/denko_cli/targets.rb +8 -5
  46. data/lib/denko_cli/usage.txt +8 -4
  47. data/src/denko_ethernet.ino +15 -23
  48. data/src/denko_serial.ino +3 -14
  49. data/src/denko_wifi.ino +72 -52
  50. data/src/lib/Denko.cpp +14 -6
  51. data/src/lib/Denko.h +6 -17
  52. data/src/lib/DenkoCoreIO.cpp +3 -3
  53. data/src/lib/DenkoDefines.h +73 -19
  54. data/src/lib/DenkoEEPROM.cpp +9 -1
  55. data/src/lib/DenkoI2C.cpp +11 -9
  56. data/src/lib/DenkoLEDArray.cpp +5 -11
  57. data/test/analog_io/input_test.rb +3 -3
  58. data/test/analog_io/output_test.rb +1 -1
  59. data/test/analog_io/potentiometer_test.rb +2 -2
  60. data/test/behaviors/bus_peripheral_addressed.rb +1 -1
  61. data/test/behaviors/bus_peripheral_test.rb +1 -1
  62. data/test/behaviors/callbacks_test.rb +4 -4
  63. data/test/behaviors/component_test.rb +2 -2
  64. data/test/behaviors/listener_test.rb +3 -3
  65. data/test/behaviors/poller_test.rb +3 -3
  66. data/test/behaviors/reader_test.rb +11 -4
  67. data/test/behaviors/subcomponents_test.rb +1 -1
  68. data/test/behaviors/threaded_test.rb +7 -7
  69. data/test/board/board_test.rb +8 -8
  70. data/test/board/core_test.rb +12 -12
  71. data/test/board/eeprom_test.rb +2 -2
  72. data/test/board/helper_test.rb +0 -4
  73. data/test/board/i2c_test.rb +5 -5
  74. data/test/board/infrared_test.rb +1 -1
  75. data/test/board/message_test.rb +1 -1
  76. data/test/board/one_wire_test.rb +4 -4
  77. data/test/board/pulse_test.rb +2 -2
  78. data/test/board/servo_test.rb +3 -3
  79. data/test/board/spi_test.rb +3 -3
  80. data/test/board/tone_test.rb +2 -2
  81. data/test/connection/serial_test.rb +13 -13
  82. data/test/digital_io/input_test.rb +7 -7
  83. data/test/digital_io/output_test.rb +5 -5
  84. data/test/digital_io/rotary_encoder_test.rb +4 -4
  85. data/test/display/hd44780_test.rb +11 -1
  86. data/test/eeprom/built_in_test.rb +1 -1
  87. data/test/i2c/bus_test.rb +5 -5
  88. data/test/i2c/peripheral_test.rb +4 -4
  89. data/test/led/base_test.rb +2 -2
  90. data/test/led/rgb_test.rb +6 -6
  91. data/test/led/seven_segment_test.rb +36 -14
  92. data/test/motor/servo_test.rb +6 -6
  93. data/test/motor/stepper_test.rb +5 -5
  94. data/test/one_wire/bus_test.rb +9 -9
  95. data/test/one_wire/peripheral_test.rb +17 -17
  96. data/test/pulse_io/buzzer_test.rb +4 -4
  97. data/test/pulse_io/ir_transmitter_test.rb +2 -2
  98. data/test/pulse_io/pwm_output_test.rb +4 -4
  99. data/test/rtc/ds3231_test.rb +4 -4
  100. data/test/sensor/dht_test.rb +3 -3
  101. data/test/sensor/ds18b20_test.rb +9 -9
  102. data/test/spi/bus_test.rb +4 -4
  103. data/test/spi/input_register_test.rb +8 -8
  104. data/test/spi/output_register_test.rb +4 -4
  105. data/test/test_helper.rb +17 -2
  106. data/test/uart/bitbang_test.rb +3 -3
  107. metadata +7 -350
  108. data/vendor/board-maps/.gitignore +0 -56
  109. data/vendor/board-maps/.gitmodules +0 -21
  110. data/vendor/board-maps/BoardMap.h +0 -1364
  111. data/vendor/board-maps/README.md +0 -51
  112. data/vendor/board-maps/lib/boards_parser.rb +0 -66
  113. data/vendor/board-maps/lib/header_parser.rb +0 -164
  114. data/vendor/board-maps/run.rb +0 -47
  115. data/vendor/board-maps/yaml/0XCB_HELIOS.yml +0 -48
  116. data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_ESP32S2.yml +0 -25
  117. data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_ESP32S2_REVTFT.yml +0 -25
  118. data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_ESP32S2_TFT.yml +0 -27
  119. data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_ESP32S3.yml +0 -29
  120. data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_ESP32S3_NOPSRAM.yml +0 -29
  121. data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_ESP32S3_REVTFT.yml +0 -25
  122. data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_ESP32S3_TFT.yml +0 -27
  123. data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_ESP32_V2.yml +0 -30
  124. data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_RP2040.yml +0 -48
  125. data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_RP2040_CAN.yml +0 -48
  126. data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_RP2040_DVI.yml +0 -48
  127. data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_RP2040_PROP_MAKER.yml +0 -48
  128. data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_RP2040_RFM.yml +0 -48
  129. data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_RP2040_SCORPIO.yml +0 -48
  130. data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_RP2040_THINKINK.yml +0 -48
  131. data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_RP2040_USB_HOST.yml +0 -48
  132. data/vendor/board-maps/yaml/ADAFRUIT_ITSYBITSY_ESP32.yml +0 -24
  133. data/vendor/board-maps/yaml/ADAFRUIT_ITSYBITSY_RP2040.yml +0 -48
  134. data/vendor/board-maps/yaml/ADAFRUIT_KB2040_RP2040.yml +0 -48
  135. data/vendor/board-maps/yaml/ADAFRUIT_MACROPAD_RP2040.yml +0 -48
  136. data/vendor/board-maps/yaml/ADAFRUIT_MATRIXPORTAL_ESP32S3.yml +0 -16
  137. data/vendor/board-maps/yaml/ADAFRUIT_QTPY_ESP32C3.yml +0 -12
  138. data/vendor/board-maps/yaml/ADAFRUIT_QTPY_ESP32S2.yml +0 -22
  139. data/vendor/board-maps/yaml/ADAFRUIT_QTPY_ESP32S3_NOPSRAM.yml +0 -20
  140. data/vendor/board-maps/yaml/ADAFRUIT_QTPY_ESP32_PICO.yml +0 -27
  141. data/vendor/board-maps/yaml/ADAFRUIT_QTPY_RP2040.yml +0 -48
  142. data/vendor/board-maps/yaml/ADAFRUIT_STEMMAFRIEND_RP2040.yml +0 -48
  143. data/vendor/board-maps/yaml/ADAFRUIT_TRINKEYQT_RP2040.yml +0 -48
  144. data/vendor/board-maps/yaml/ALKS.yml +0 -34
  145. data/vendor/board-maps/yaml/AMPERKA_WIFI_SLOT.yml +0 -16
  146. data/vendor/board-maps/yaml/AVR_ADK.yml +0 -24
  147. data/vendor/board-maps/yaml/AVR_BT.yml +0 -16
  148. data/vendor/board-maps/yaml/AVR_CIRCUITPLAY.yml +0 -14
  149. data/vendor/board-maps/yaml/AVR_DUEMILANOVE.yml +0 -16
  150. data/vendor/board-maps/yaml/AVR_ESPLORA.yml +0 -20
  151. data/vendor/board-maps/yaml/AVR_ETHERNET.yml +0 -16
  152. data/vendor/board-maps/yaml/AVR_FIO.yml +0 -16
  153. data/vendor/board-maps/yaml/AVR_GEMMA.yml +0 -6
  154. data/vendor/board-maps/yaml/AVR_INDUSTRIAL101.yml +0 -20
  155. data/vendor/board-maps/yaml/AVR_LEONARDO.yml +0 -20
  156. data/vendor/board-maps/yaml/AVR_LEONARDO_ETH.yml +0 -20
  157. data/vendor/board-maps/yaml/AVR_LILYPAD.yml +0 -16
  158. data/vendor/board-maps/yaml/AVR_LILYPAD_USB.yml +0 -20
  159. data/vendor/board-maps/yaml/AVR_LININO_ONE.yml +0 -20
  160. data/vendor/board-maps/yaml/AVR_MEGA.yml +0 -24
  161. data/vendor/board-maps/yaml/AVR_MEGA2560.yml +0 -24
  162. data/vendor/board-maps/yaml/AVR_MICRO.yml +0 -20
  163. data/vendor/board-maps/yaml/AVR_MINI.yml +0 -16
  164. data/vendor/board-maps/yaml/AVR_NANO.yml +0 -16
  165. data/vendor/board-maps/yaml/AVR_NANO_EVERY.yml +0 -22
  166. data/vendor/board-maps/yaml/AVR_NG.yml +0 -16
  167. data/vendor/board-maps/yaml/AVR_PRO.yml +0 -16
  168. data/vendor/board-maps/yaml/AVR_ROBOT_CONTROL.yml +0 -22
  169. data/vendor/board-maps/yaml/AVR_ROBOT_MOTOR.yml +0 -19
  170. data/vendor/board-maps/yaml/AVR_UNO.yml +0 -16
  171. data/vendor/board-maps/yaml/AVR_UNO_WIFI_DEV_ED.yml +0 -16
  172. data/vendor/board-maps/yaml/AVR_UNO_WIFI_REV2.yml +0 -22
  173. data/vendor/board-maps/yaml/AVR_YUN.yml +0 -20
  174. data/vendor/board-maps/yaml/AVR_YUNMINI.yml +0 -20
  175. data/vendor/board-maps/yaml/AirM2M_CORE_ESP32C3.yml +0 -14
  176. data/vendor/board-maps/yaml/BEE_DATA_LOGGER.yml +0 -39
  177. data/vendor/board-maps/yaml/BPI_BIT.yml +0 -9
  178. data/vendor/board-maps/yaml/BPI_LEAF_S3.yml +0 -31
  179. data/vendor/board-maps/yaml/BRIDGETEK_IDM2040-7A.yml +0 -48
  180. data/vendor/board-maps/yaml/BeeMotionS3.yml +0 -40
  181. data/vendor/board-maps/yaml/Bee_Motion.yml +0 -27
  182. data/vendor/board-maps/yaml/Bee_Motion_Mini.yml +0 -1
  183. data/vendor/board-maps/yaml/Bee_S3.yml +0 -38
  184. data/vendor/board-maps/yaml/CHALLENGER_2040_LORA_RP2040.yml +0 -39
  185. data/vendor/board-maps/yaml/CHALLENGER_2040_LTE_RP2040.yml +0 -38
  186. data/vendor/board-maps/yaml/CHALLENGER_2040_NFC_RP2040.yml +0 -32
  187. data/vendor/board-maps/yaml/CHALLENGER_2040_SDRTC_RP2040.yml +0 -36
  188. data/vendor/board-maps/yaml/CHALLENGER_2040_SUBGHZ_RP2040.yml +0 -39
  189. data/vendor/board-maps/yaml/CHALLENGER_2040_UWB_RP2040.yml +0 -39
  190. data/vendor/board-maps/yaml/CHALLENGER_2040_WIFI_BLE_RP2040.yml +0 -42
  191. data/vendor/board-maps/yaml/CHALLENGER_2040_WIFI_RP2040.yml +0 -38
  192. data/vendor/board-maps/yaml/CHALLENGER_NB_2040_WIFI_RP2040.yml +0 -38
  193. data/vendor/board-maps/yaml/CRABIK_SLOT_ESP32_S3.yml +0 -19
  194. data/vendor/board-maps/yaml/CYTRON_MAKER_FEATHER_AIOT_S3.yml +0 -26
  195. data/vendor/board-maps/yaml/CYTRON_MAKER_NANO_RP2040.yml +0 -48
  196. data/vendor/board-maps/yaml/CYTRON_MAKER_PI_RP2040.yml +0 -48
  197. data/vendor/board-maps/yaml/CoreESP32.yml +0 -49
  198. data/vendor/board-maps/yaml/D1_MINI32.yml +0 -36
  199. data/vendor/board-maps/yaml/D1_UNO32.yml +0 -28
  200. data/vendor/board-maps/yaml/DATANOISETV_PICOADK.yml +0 -48
  201. data/vendor/board-maps/yaml/DENKY.yml +0 -26
  202. data/vendor/board-maps/yaml/DENKY_PICOV3.yml +0 -26
  203. data/vendor/board-maps/yaml/DENKY_WROOM32.yml +0 -26
  204. data/vendor/board-maps/yaml/DEPARTMENT_OF_ALCHEMY_MINIMAIN_ESP32S2.yml +0 -26
  205. data/vendor/board-maps/yaml/DFROBOT_BEETLE_ESP32_C3.yml +0 -14
  206. data/vendor/board-maps/yaml/DFROBOT_BEETLE_RP2040.yml +0 -48
  207. data/vendor/board-maps/yaml/DFROBOT_FIREBEETLE_2_ESP32E.yml +0 -44
  208. data/vendor/board-maps/yaml/DFROBOT_FIREBEETLE_2_ESP32S3.yml +0 -38
  209. data/vendor/board-maps/yaml/DFROBOT_ROMEO_ESP32S3.yml +0 -7
  210. data/vendor/board-maps/yaml/DPU_ESP32.yml +0 -26
  211. data/vendor/board-maps/yaml/DYDK.yml +0 -38
  212. data/vendor/board-maps/yaml/DYDK1A.yml +0 -37
  213. data/vendor/board-maps/yaml/DYDK1Av2.yml +0 -45
  214. data/vendor/board-maps/yaml/DYG.yml +0 -20
  215. data/vendor/board-maps/yaml/DYM.yml +0 -40
  216. data/vendor/board-maps/yaml/DYMv2.yml +0 -39
  217. data/vendor/board-maps/yaml/D_Duino_32.yml +0 -29
  218. data/vendor/board-maps/yaml/ELECTRONICCATS_HUNTERCAT_NFC.yml +0 -44
  219. data/vendor/board-maps/yaml/ESP320.yml +0 -8
  220. data/vendor/board-maps/yaml/ESP32C3_DEV.yml +0 -14
  221. data/vendor/board-maps/yaml/ESP32C3_M1_I_KIT.yml +0 -13
  222. data/vendor/board-maps/yaml/ESP32S2_DEV.yml +0 -33
  223. data/vendor/board-maps/yaml/ESP32S2_THING_PLUS.yml +0 -34
  224. data/vendor/board-maps/yaml/ESP32S2_USB.yml +0 -33
  225. data/vendor/board-maps/yaml/ESP32S3_CAM_LCD.yml +0 -7
  226. data/vendor/board-maps/yaml/ESP32S3_DEV.yml +0 -38
  227. data/vendor/board-maps/yaml/ESP32_DEV.yml +0 -26
  228. data/vendor/board-maps/yaml/ESP32_DEVKIT_LIPO.yml +0 -26
  229. data/vendor/board-maps/yaml/ESP32_EVB.yml +0 -7
  230. data/vendor/board-maps/yaml/ESP32_GATEWAY.yml +0 -13
  231. data/vendor/board-maps/yaml/ESP32_GATEWAY_C.yml +0 -13
  232. data/vendor/board-maps/yaml/ESP32_GATEWAY_E.yml +0 -13
  233. data/vendor/board-maps/yaml/ESP32_GATEWAY_F.yml +0 -13
  234. data/vendor/board-maps/yaml/ESP32_IOT_REDBOARD.yml +0 -27
  235. data/vendor/board-maps/yaml/ESP32_MICROMOD.yml +0 -24
  236. data/vendor/board-maps/yaml/ESP32_PICO.yml +0 -26
  237. data/vendor/board-maps/yaml/ESP32_POE.yml +0 -7
  238. data/vendor/board-maps/yaml/ESP32_POE_ISO.yml +0 -7
  239. data/vendor/board-maps/yaml/ESP32_S3_BOX.yml +0 -16
  240. data/vendor/board-maps/yaml/ESP32_S3_USB_OTG.yml +0 -11
  241. data/vendor/board-maps/yaml/ESP32_THING.yml +0 -27
  242. data/vendor/board-maps/yaml/ESP32_THING_PLUS.yml +0 -30
  243. data/vendor/board-maps/yaml/ESP32_THING_PLUS_C.yml +0 -30
  244. data/vendor/board-maps/yaml/ESP32_WROOM_DA.yml +0 -26
  245. data/vendor/board-maps/yaml/ESP32_WROVER_KIT.yml +0 -26
  246. data/vendor/board-maps/yaml/ESP8266_ADAFRUIT_HUZZAH.yml +0 -9
  247. data/vendor/board-maps/yaml/ESP8266_AGRUMINO_LEMON_V4.yml +0 -8
  248. data/vendor/board-maps/yaml/ESP8266_ARDUINO_PRIMO.yml +0 -7
  249. data/vendor/board-maps/yaml/ESP8266_ARDUINO_STAR_OTTO.yml +0 -7
  250. data/vendor/board-maps/yaml/ESP8266_ARDUINO_UNOWIFI.yml +0 -9
  251. data/vendor/board-maps/yaml/ESP8266_ESP01.yml +0 -9
  252. data/vendor/board-maps/yaml/ESP8266_ESP07.yml +0 -20
  253. data/vendor/board-maps/yaml/ESP8266_ESP12.yml +0 -20
  254. data/vendor/board-maps/yaml/ESP8266_ESP13.yml +0 -17
  255. data/vendor/board-maps/yaml/ESP8266_ESP210.yml +0 -9
  256. data/vendor/board-maps/yaml/ESP8266_ESPECTRO_CORE.yml +0 -9
  257. data/vendor/board-maps/yaml/ESP8266_ESPINO_ESP12.yml +0 -9
  258. data/vendor/board-maps/yaml/ESP8266_ESPINO_ESP13.yml +0 -9
  259. data/vendor/board-maps/yaml/ESP8266_ESPRESSO_LITE_V1.yml +0 -9
  260. data/vendor/board-maps/yaml/ESP8266_ESPRESSO_LITE_V2.yml +0 -9
  261. data/vendor/board-maps/yaml/ESP8266_GENERIC.yml +0 -9
  262. data/vendor/board-maps/yaml/ESP8266_INVENT_ONE.yml +0 -22
  263. data/vendor/board-maps/yaml/ESP8266_NODEMCU_ESP12.yml +0 -20
  264. data/vendor/board-maps/yaml/ESP8266_NODEMCU_ESP12E.yml +0 -20
  265. data/vendor/board-maps/yaml/ESP8266_OAK.yml +0 -9
  266. data/vendor/board-maps/yaml/ESP8266_PHOENIX_V1.yml +0 -9
  267. data/vendor/board-maps/yaml/ESP8266_PHOENIX_V2.yml +0 -9
  268. data/vendor/board-maps/yaml/ESP8266_SCHIRMILABS_EDUINO_WIFI.yml +0 -25
  269. data/vendor/board-maps/yaml/ESP8266_SONOFF_BASIC.yml +0 -9
  270. data/vendor/board-maps/yaml/ESP8266_SONOFF_S20.yml +0 -9
  271. data/vendor/board-maps/yaml/ESP8266_SONOFF_SV.yml +0 -9
  272. data/vendor/board-maps/yaml/ESP8266_SONOFF_TH.yml +0 -9
  273. data/vendor/board-maps/yaml/ESP8266_THING.yml +0 -9
  274. data/vendor/board-maps/yaml/ESP8266_THING_DEV.yml +0 -9
  275. data/vendor/board-maps/yaml/ESP8266_WEMOS_D1MINI.yml +0 -18
  276. data/vendor/board-maps/yaml/ESP8266_WEMOS_D1MINILITE.yml +0 -18
  277. data/vendor/board-maps/yaml/ESP8266_WEMOS_D1MINIPRO.yml +0 -18
  278. data/vendor/board-maps/yaml/ESP8266_WEMOS_D1R1.yml +0 -25
  279. data/vendor/board-maps/yaml/ESP8266_WEMOS_D1WROOM02.yml +0 -18
  280. data/vendor/board-maps/yaml/ESP8266_WIO_LINK.yml +0 -9
  281. data/vendor/board-maps/yaml/ESP8266_XINABOX_CW01.yml +0 -9
  282. data/vendor/board-maps/yaml/ESPECTRO32.yml +0 -27
  283. data/vendor/board-maps/yaml/ESPea32.yml +0 -27
  284. data/vendor/board-maps/yaml/ESPino32.yml +0 -27
  285. data/vendor/board-maps/yaml/ET-Board.yml +0 -26
  286. data/vendor/board-maps/yaml/EXTREMEELEXTRONICS_RC2040.yml +0 -46
  287. data/vendor/board-maps/yaml/Edgebox-ESP-100.yml +0 -7
  288. data/vendor/board-maps/yaml/FEATHERS2.yml +0 -33
  289. data/vendor/board-maps/yaml/FEATHERS2NEO.yml +0 -30
  290. data/vendor/board-maps/yaml/FEATHERS3.yml +0 -29
  291. data/vendor/board-maps/yaml/FEATHER_ESP32.yml +0 -28
  292. data/vendor/board-maps/yaml/FLYBOARD2040_CORE.yml +0 -48
  293. data/vendor/board-maps/yaml/FRANZININHO_WIFI.yml +0 -33
  294. data/vendor/board-maps/yaml/FRANZININHO_WIFI_MSC.yml +0 -33
  295. data/vendor/board-maps/yaml/FROG_ESP32.yml +0 -26
  296. data/vendor/board-maps/yaml/FUNHOUSE_ESP32S2.yml +0 -22
  297. data/vendor/board-maps/yaml/GEN4_IOD.yml +0 -9
  298. data/vendor/board-maps/yaml/GENERIC_RP2040.yml +0 -48
  299. data/vendor/board-maps/yaml/HEALTHYPI_4.yml +0 -27
  300. data/vendor/board-maps/yaml/HONEYLEMON.yml +0 -27
  301. data/vendor/board-maps/yaml/HORNBILL_ESP32_DEV.yml +0 -27
  302. data/vendor/board-maps/yaml/HORNBILL_ESP32_MINIMA.yml +0 -16
  303. data/vendor/board-maps/yaml/ILABS_2040_RPICO32_RP2040.yml +0 -47
  304. data/vendor/board-maps/yaml/IMBRIOS_LOGSENS_V1P1.yml +0 -19
  305. data/vendor/board-maps/yaml/INTOROBOT_ESP32_DEV.yml +0 -34
  306. data/vendor/board-maps/yaml/LILYGO_T_DISPLAY_S3.yml +0 -26
  307. data/vendor/board-maps/yaml/LOLIN32.yml +0 -27
  308. data/vendor/board-maps/yaml/LOLIN32_LITE.yml +0 -27
  309. data/vendor/board-maps/yaml/LOLIN_C3_MINI.yml +0 -14
  310. data/vendor/board-maps/yaml/LOLIN_D32.yml +0 -27
  311. data/vendor/board-maps/yaml/LOLIN_D32_PRO.yml +0 -27
  312. data/vendor/board-maps/yaml/LOLIN_S2_MINI.yml +0 -34
  313. data/vendor/board-maps/yaml/LOLIN_S2_PICO.yml +0 -34
  314. data/vendor/board-maps/yaml/LOLIN_S3.yml +0 -32
  315. data/vendor/board-maps/yaml/LOLIN_S3_MINI.yml +0 -32
  316. data/vendor/board-maps/yaml/LOLIN_S3_PRO.yml +0 -32
  317. data/vendor/board-maps/yaml/Lion_Bit_Dev_Board.yml +0 -18
  318. data/vendor/board-maps/yaml/LoPy.yml +0 -27
  319. data/vendor/board-maps/yaml/LoPy4.yml +0 -27
  320. data/vendor/board-maps/yaml/M5STACK_CORES3.yml +0 -8
  321. data/vendor/board-maps/yaml/M5STACK_Core2.yml +0 -9
  322. data/vendor/board-maps/yaml/M5STACK_FIRE.yml +0 -10
  323. data/vendor/board-maps/yaml/M5Stack-Timer-CAM.yml +0 -10
  324. data/vendor/board-maps/yaml/M5Stack_ATOM.yml +0 -10
  325. data/vendor/board-maps/yaml/M5Stack_ATOMS3.yml +0 -7
  326. data/vendor/board-maps/yaml/M5Stack_CoreInk.yml +0 -9
  327. data/vendor/board-maps/yaml/M5Stack_Core_ESP32.yml +0 -10
  328. data/vendor/board-maps/yaml/M5Stack_Station.yml +0 -10
  329. data/vendor/board-maps/yaml/M5Stick_C.yml +0 -10
  330. data/vendor/board-maps/yaml/MAGTAG29_ESP32S2.yml +0 -21
  331. data/vendor/board-maps/yaml/MELOPERO_COOKIE_RP2040.yml +0 -48
  332. data/vendor/board-maps/yaml/MELOPERO_SHAKE_RP2040.yml +0 -48
  333. data/vendor/board-maps/yaml/METRO_ESP32S2.yml +0 -34
  334. data/vendor/board-maps/yaml/MGBOT_IOTIK32A.yml +0 -27
  335. data/vendor/board-maps/yaml/MGBOT_IOTIK32B.yml +0 -27
  336. data/vendor/board-maps/yaml/MH_ET_LIVE_ESP32DEVKIT.yml +0 -27
  337. data/vendor/board-maps/yaml/MH_ET_LIVE_ESP32MINIKIT.yml +0 -27
  338. data/vendor/board-maps/yaml/MICROS2.yml +0 -34
  339. data/vendor/board-maps/yaml/MOD_WIFI_ESP8266.yml +0 -9
  340. data/vendor/board-maps/yaml/Metro.yml +0 -8
  341. data/vendor/board-maps/yaml/NANO32.yml +0 -27
  342. data/vendor/board-maps/yaml/NANO_RP2040_CONNECT.yml +0 -35
  343. data/vendor/board-maps/yaml/NEBULAS3.yml +0 -33
  344. data/vendor/board-maps/yaml/NEKOSYSTEMS_BL2040_MINI.yml +0 -48
  345. data/vendor/board-maps/yaml/NULLBITS_BIT_C_PRO.yml +0 -48
  346. data/vendor/board-maps/yaml/Node32s.yml +0 -27
  347. data/vendor/board-maps/yaml/NodeMCU_32S.yml +0 -27
  348. data/vendor/board-maps/yaml/ODROID_ESP32.yml +0 -10
  349. data/vendor/board-maps/yaml/ONEHORSE_ESP32_DEV.yml +0 -24
  350. data/vendor/board-maps/yaml/OROCA_EDUBOT.yml +0 -33
  351. data/vendor/board-maps/yaml/PIMORONI_PGA2040.yml +0 -48
  352. data/vendor/board-maps/yaml/PROS3.yml +0 -28
  353. data/vendor/board-maps/yaml/PYCOM_GPY.yml +0 -27
  354. data/vendor/board-maps/yaml/Piranha.yml +0 -16
  355. data/vendor/board-maps/yaml/Pocket32.yml +0 -27
  356. data/vendor/board-maps/yaml/QUANTUM.yml +0 -26
  357. data/vendor/board-maps/yaml/RASPBERRY_PI_PICO.yml +0 -48
  358. data/vendor/board-maps/yaml/RASPBERRY_PI_PICO_W.yml +0 -48
  359. data/vendor/board-maps/yaml/REDPILL_ESP32S3.yml +0 -32
  360. data/vendor/board-maps/yaml/RMP.yml +0 -33
  361. data/vendor/board-maps/yaml/SAMD_CIRCUITPLAYGROUND_EXPRESS.yml +0 -12
  362. data/vendor/board-maps/yaml/SAMD_MKR1000.yml +0 -20
  363. data/vendor/board-maps/yaml/SAMD_MKRFox1200.yml +0 -19
  364. data/vendor/board-maps/yaml/SAMD_MKRGSM1400.yml +0 -15
  365. data/vendor/board-maps/yaml/SAMD_MKRNB1500.yml +0 -15
  366. data/vendor/board-maps/yaml/SAMD_MKRVIDOR4000.yml +0 -19
  367. data/vendor/board-maps/yaml/SAMD_MKRWAN1300.yml +0 -18
  368. data/vendor/board-maps/yaml/SAMD_MKRWAN1310.yml +0 -18
  369. data/vendor/board-maps/yaml/SAMD_MKRWIFI1010.yml +0 -19
  370. data/vendor/board-maps/yaml/SAMD_MKRZERO.yml +0 -19
  371. data/vendor/board-maps/yaml/SAMD_NANO_33_IOT.yml +0 -13
  372. data/vendor/board-maps/yaml/SAMD_TIAN.yml +0 -15
  373. data/vendor/board-maps/yaml/SAMD_ZERO.yml +0 -14
  374. data/vendor/board-maps/yaml/SAM_DUE.yml +0 -26
  375. data/vendor/board-maps/yaml/SAM_ZERO.yml +0 -15
  376. data/vendor/board-maps/yaml/SEEED_INDICATOR_RP2040.yml +0 -47
  377. data/vendor/board-maps/yaml/SEEED_XIAO_RP2040.yml +0 -29
  378. data/vendor/board-maps/yaml/SOLDERPARTY_RP2040_STAMP.yml +0 -48
  379. data/vendor/board-maps/yaml/SONOFF_DUALR3.yml +0 -26
  380. data/vendor/board-maps/yaml/SPARKFUN_PROMICRO_RP2040.yml +0 -48
  381. data/vendor/board-maps/yaml/SPARKFUN_THINGPLUS_RP2040.yml +0 -48
  382. data/vendor/board-maps/yaml/STAMP_S3.yml +0 -4
  383. data/vendor/board-maps/yaml/TAMC_TERMOD_S3.yml +0 -31
  384. data/vendor/board-maps/yaml/TBEAM_USE_RADIO_SX1262.yml +0 -23
  385. data/vendor/board-maps/yaml/TBEAM_USE_RADIO_SX1268.yml +0 -23
  386. data/vendor/board-maps/yaml/TBEAM_USE_RADIO_SX1276.yml +0 -23
  387. data/vendor/board-maps/yaml/TBEAM_USE_RADIO_SX1278.yml +0 -23
  388. data/vendor/board-maps/yaml/TBEAM_USE_RADIO_SX1280.yml +0 -23
  389. data/vendor/board-maps/yaml/TBeam.yml +0 -23
  390. data/vendor/board-maps/yaml/TINYPICO.yml +0 -26
  391. data/vendor/board-maps/yaml/TINYS2.yml +0 -33
  392. data/vendor/board-maps/yaml/TINYS3.yml +0 -25
  393. data/vendor/board-maps/yaml/TTGO-T-OI-PLUS_DEV.yml +0 -11
  394. data/vendor/board-maps/yaml/TTGO_LoRa32_V1.yml +0 -28
  395. data/vendor/board-maps/yaml/TTGO_LoRa32_V2.yml +0 -28
  396. data/vendor/board-maps/yaml/TTGO_LoRa32_v21new.yml +0 -28
  397. data/vendor/board-maps/yaml/TTGO_T1.yml +0 -27
  398. data/vendor/board-maps/yaml/TTGO_T7_V13_Mini32.yml +0 -27
  399. data/vendor/board-maps/yaml/TTGO_T7_V14_Mini32.yml +0 -27
  400. data/vendor/board-maps/yaml/TWATCH_2020_V1.yml +0 -10
  401. data/vendor/board-maps/yaml/TWATCH_2020_V2.yml +0 -10
  402. data/vendor/board-maps/yaml/TWATCH_2020_V3.yml +0 -10
  403. data/vendor/board-maps/yaml/TWATCH_BASE.yml +0 -10
  404. data/vendor/board-maps/yaml/TWatch.yml +0 -10
  405. data/vendor/board-maps/yaml/Trueverit_ESP32_Universal_IoT_Driver.yml +0 -18
  406. data/vendor/board-maps/yaml/Trueverit_ESP32_Universal_IoT_Driver_MK_II.yml +0 -18
  407. data/vendor/board-maps/yaml/UBLOX_NINA_W10.yml +0 -48
  408. data/vendor/board-maps/yaml/UBLOX_NORA_W10.yml +0 -43
  409. data/vendor/board-maps/yaml/UPESY_RP2040_DEVKIT.yml +0 -48
  410. data/vendor/board-maps/yaml/VALTRACK_V4_MFW_ESP32_C3.yml +0 -23
  411. data/vendor/board-maps/yaml/VALTRACK_V4_VTS_ESP32_C3.yml +0 -23
  412. data/vendor/board-maps/yaml/VIYALAB_MIZU_RP2040.yml +0 -48
  413. data/vendor/board-maps/yaml/WATCHY.yml +0 -7
  414. data/vendor/board-maps/yaml/WATCHY_V10.yml +0 -7
  415. data/vendor/board-maps/yaml/WATCHY_V15.yml +0 -7
  416. data/vendor/board-maps/yaml/WATCHY_V20.yml +0 -7
  417. data/vendor/board-maps/yaml/WAVESHARE_RP2040_LCD_0_96.yml +0 -47
  418. data/vendor/board-maps/yaml/WAVESHARE_RP2040_LCD_1_28.yml +0 -47
  419. data/vendor/board-maps/yaml/WAVESHARE_RP2040_ONE.yml +0 -47
  420. data/vendor/board-maps/yaml/WAVESHARE_RP2040_PLUS.yml +0 -48
  421. data/vendor/board-maps/yaml/WAVESHARE_RP2040_ZERO.yml +0 -47
  422. data/vendor/board-maps/yaml/WESP32.yml +0 -17
  423. data/vendor/board-maps/yaml/WIDORA_AIR.yml +0 -34
  424. data/vendor/board-maps/yaml/WIFIDUINO_ESP8266.yml +0 -23
  425. data/vendor/board-maps/yaml/WIFINFO.yml +0 -20
  426. data/vendor/board-maps/yaml/WIPY3.yml +0 -27
  427. data/vendor/board-maps/yaml/WIZNET_5100S_EVB_PICO.yml +0 -48
  428. data/vendor/board-maps/yaml/WIZNET_5500_EVB_PICO.yml +0 -48
  429. data/vendor/board-maps/yaml/WIZNET_WIZFI360_EVB_PICO.yml +0 -48
  430. data/vendor/board-maps/yaml/WT32_ETH01.yml +0 -8
  431. data/vendor/board-maps/yaml/WiFiduino32S3.yml +0 -27
  432. data/vendor/board-maps/yaml/WiFiduinoV2.yml +0 -27
  433. data/vendor/board-maps/yaml/Wifiduino32.yml +0 -40
  434. data/vendor/board-maps/yaml/XIAO_ESP32C3.yml +0 -22
  435. data/vendor/board-maps/yaml/XIAO_ESP32S3.yml +0 -36
  436. data/vendor/board-maps/yaml/YD_RP2040.yml +0 -48
  437. data/vendor/board-maps/yaml/atmegazero_esp32s2.yml +0 -30
  438. data/vendor/board-maps/yaml/connaxio_espoir.yml +0 -18
  439. data/vendor/board-maps/yaml/esp32vn_iot_uno.yml +0 -22
  440. data/vendor/board-maps/yaml/fm_devkit.yml +0 -15
  441. data/vendor/board-maps/yaml/heltec_wifi_32_lora_V3.yml +0 -31
  442. data/vendor/board-maps/yaml/heltec_wifi_kit_32.yml +0 -28
  443. data/vendor/board-maps/yaml/heltec_wifi_kit_32_V3.yml +0 -32
  444. data/vendor/board-maps/yaml/heltec_wifi_lora_32.yml +0 -27
  445. data/vendor/board-maps/yaml/heltec_wifi_lora_32_V2.yml +0 -27
  446. data/vendor/board-maps/yaml/heltec_wireless_stick.yml +0 -27
  447. data/vendor/board-maps/yaml/heltec_wireless_stick_LITE.yml +0 -27
  448. data/vendor/board-maps/yaml/openkb.yml +0 -27
  449. data/vendor/board-maps/yaml/roboheart_hercules.yml +0 -17
  450. data/vendor/board-maps/yaml/sensesiot_weizen.yml +0 -26
  451. data/vendor/board-maps/yaml/uPesy_WROOM.yml +0 -27
  452. data/vendor/board-maps/yaml/uPesy_WROVER.yml +0 -27
  453. data/vendor/board-maps/yaml/unphone8.yml +0 -32
  454. data/vendor/board-maps/yaml/unphone9.yml +0 -32
  455. data/vendor/board-maps/yaml/wifi_kit_8.yml +0 -15
@@ -1,51 +0,0 @@
1
- # Arduino Board Maps in YAML Format
2
-
3
- The aim of this script is to map common identifiers used in the [Arduino](https://github.com/arduino) IDE to their integer pin numbers. For example, on many Arduino boards, the analog input pin labeled `A0` maps to an integer pin number of `14`, but this isn't always the case. With the large variety of boards the Arduino IDE supports, it's difficult to keep track of mappings manually.
4
-
5
- ### How to identify the board?
6
-
7
- Along with the maps inside the `yaml` folder, there is `BoardMap.h`. Include that in a sketch, and it will `#define BOARD_MAP`, based on your board selection in Arduino. The value of `BOARD_MAP` is the filename for that board's map, minus the `.yml` extension.
8
-
9
- ### Why map the pins?
10
-
11
- If the sketch tells a remote machine its `BOARD_MAP`, the map can be loaded from its file. From there, the remote machine uses it to translate between pin identifiers and integers, before sending instructions to the board, or receiving messages from it.
12
-
13
- This is the exact use case this was deisgned for, in support of the [denko](https://github.com/denko-rb/denko) Ruby gem. It allows more intuitive pin referencing in Ruby, while simplifying the Arduino sketch so it only handles pins as integers.
14
-
15
- ## Supported Arduino Cores
16
-
17
- - [avr](https://github.com/arduino/ArduinoCore-avr)
18
- - [megaavr](https://github.com/arduino/ArduinoCore-megaavr)
19
- - [sam](https://github.com/arduino/ArduinoCore-sam)
20
- - [samd](https://github.com/arduino/ArduinoCore-samd)
21
- - [esp8266](https://github.com/esp8266/Arduino)
22
- - [esp32](https://github.com/espressif/arduino-esp32)
23
- - [rp2040](https://github.com/earlephilhower/arduino-pico)
24
-
25
- ## Mappings
26
-
27
- - `A0` analog input pins (sequential on AVR, disordered on others)
28
- - `DAC0` digital-to-analog-pins
29
- - `D0` pins (some on RP2040. Many on ESP8266 where DX doesn't map to GPIOX)
30
- - `T0` pins (capacitive touch pins on ESP32)
31
- - `SCL`, `SDA`, `SCLX`, `SDAX`, default and numbered hardware I2C pins
32
- - `MOSI`, `MISO`, `SCK`, `SS`, `MOSIX`, `MISOX`, `SCKX`, `SSX`, default and numbered hardware SPI pins
33
- - `LED_BUILTIN` which is usually defined for the on-board LED
34
-
35
- TODO: Add UART and CAN?
36
-
37
- ## Usage
38
-
39
- Clone or download this repo. Use `BoardMap.h` and all the files inside `yaml` as descibed above.
40
-
41
- Each map is a flat dictionary where each key (an identifier) maps to one integer.
42
-
43
- **Note:** All keys are prefixed with `:`, so they automatically translate to Ruby symbols when loaded.
44
-
45
- ## Development
46
-
47
- Be warned. This is mostly a hack that runs a bunch of regex matches on `boards.txt` and header files from each Arduino core. :man_shrugging:
48
-
49
- - Clone this repo.
50
- - Clone the submodules inside the `core` folder with `git submodule init` and `git submodule update`. No need for recursion, but will still be close to 4GB.
51
- - Make changes and `ruby run.rb` to udpate `BoardMap.h` and all the YAML files.
@@ -1,66 +0,0 @@
1
- class BoardsParser
2
- #
3
- # This catches the following styles of edge cases (only seen in ESP8266 core so far):
4
- #
5
- # 1) Main board defines a variant (header) folder, sub-models define none, so they all use the main folder:
6
- # sonoff.build.board=ESP8266_SONOFF_SV
7
- # sonoff.build.variant=itead
8
- # sonoff.menu.BoardModel.sonoffBasic.build.board=ESP8266_SONOFF_BASIC
9
- # sonoff.menu.BoardModel.sonoffS20.build.board=ESP8266_SONOFF_S20
10
- # sonoff.menu.BoardModel.sonoffSV.build.board=ESP8266_SONOFF_SV
11
- # sonoff.menu.BoardModel.sonoffTH.build.board=ESP8266_SONOFF_TH
12
- #
13
- # 2) Main board is defined. Sub-models each define their own variant (header) folder:
14
- # arduino-esp8266.build.board=ESP8266_ARDUINO
15
- # arduino-esp8266.menu.BoardModel.primo.build.board=ESP8266_ARDUINO_PRIMO
16
- # arduino-esp8266.menu.BoardModel.primo.build.variant=arduino_spi
17
- # arduino-esp8266.menu.BoardModel.starottodeved.build.board=ESP8266_ARDUINO_STAR_OTTO
18
- # arduino-esp8266.menu.BoardModel.starottodeved.build.variant=arduino_uart
19
- # arduino-esp8266.menu.BoardModel.unowifideved.build.board=ESP8266_ARDUINO_UNOWIFI
20
- # arduino-esp8266.menu.BoardModel.unowifideved.build.variant=arduino_uart
21
- #
22
- # If both of these are ever combined in the same variant, this parser WILL fail.
23
- #
24
- def self.parse(core_root_path)
25
- boards = {}
26
- board_identifier = nil
27
- header_folder = nil
28
-
29
- File.readlines("#{core_root_path}/boards.txt").each do |line|
30
- # Lines matching this define a board or board sub-model.
31
- match = line.match(/build.board=(.*)\s*\z/)
32
- if match
33
- board_identifier = "ARDUINO_#{match[1]}"
34
-
35
- # If there's a board and header set, add it to the hash.
36
- # Will catch when a sub-model with different name reuses the main board header.
37
- if board_identifier && header_folder
38
- boards[board_identifier] = header_folder
39
- end
40
- next
41
- end
42
-
43
- # Lines matching this give the folder name for the board's header file.
44
- match = line.match(/build.variant=(.*)\s*\z/)
45
- if match
46
- header_folder = "#{core_root_path}/variants/#{match[1]}"
47
-
48
- # If there's a board and header set, add it to the hash.
49
- # Will catch when sub-models use different headers.
50
- if board_identifier && header_folder
51
- boards[board_identifier] = header_folder
52
- end
53
- next
54
- end
55
-
56
- # Reset state if end of board section reached.
57
- match = line.match(/######/)
58
- if match
59
- board_identifier = nil
60
- header_folder = nil
61
- end
62
- end
63
-
64
- return boards
65
- end
66
- end
@@ -1,164 +0,0 @@
1
- class HeaderParser
2
- attr_reader :map
3
-
4
- def initialize(folder)
5
- # Empty hash to fill and return with the pin map.
6
- @map = {}
7
- @folder = folder
8
-
9
- # Gotta try all .h files since there's no naming consistency...
10
- # No idea if this puts them in the right order, but it shouldn't matter.
11
- header_files = Dir["#{@folder}/*.h"]
12
- header_files.each do |path|
13
- parse_file(path)
14
- end
15
-
16
- clean_map
17
- end
18
-
19
- def parse_file(path)
20
- begin
21
- file = File.open(path)
22
- rescue => exception
23
- # Fail silently if file not found. Some of these headers include standard libs...
24
- return
25
- end
26
-
27
- file.each_line do |line|
28
- # Reject comments.
29
- next if line.match /\A\/\//
30
-
31
- # Reject lines that end with pin-style identifiers, instead of numbers.
32
- next if line.match /(PIN_)*(A|D|DAC|T)(\d+)\s*;*\s*\z/
33
- next if line.match /(PIN_SPI_|PIN_WIRE_)*(SDA|SCL|SS|MOSI|MISO|SCK)\s*;*\s*\z/
34
-
35
- # Recursively parse included headers...smh
36
- included = line.match /\A\s*#include\s*("|<)(.*)("|>)/
37
- if included
38
- path = File.expand_path(included[2], @folder)
39
- parse_file(path)
40
- end
41
-
42
- # Match RP2040 analog overrides and store them with prefixed keys like :_A0
43
- # Will substitute them later in #clean_map
44
- rp2040_analog = line.match /__PIN(_A\d+)\s*\(?(\d+)\w*\)?/
45
- if rp2040_analog
46
- @map[rp2040_analog[1].to_sym] = rp2040_analog[2].to_i
47
- next
48
- end
49
-
50
- #
51
- # Match analog input and DAC pins declared like:
52
- # #define PIN_A0 (14ul)
53
- # #define PIN_DAC0 (14)
54
- # #define PIN_A0 14
55
- # #define A0 14
56
- #
57
- pin = line.match /(PIN_)*((A|DAC)\d+)\s*\(?(\d+)\w*\)?/
58
- if pin
59
- @map[pin[2].to_sym] = pin[4].to_i
60
- next
61
- end
62
-
63
- #
64
- # Match I2C/SPI pins declared like:
65
- # #define PIN_WIRE_SDA (20ul)
66
- # #define PIN_SPI0_MOSI (51)
67
- # #define PIN_WIRE2_SDA 20
68
- # #define WIRE1_SDA 21
69
- #
70
- pin = line.match /(PIN_)*((WIRE|SPI)\d*_\w+)\s*\(?(\d+)\w*\)?/
71
- if pin
72
- @map[pin[2].to_sym] = pin[4].to_i
73
- next
74
- end
75
-
76
- #
77
- # Match custom labeled D* pins (eg. ESP8266) declared like:
78
- # static const uint D4 = (2)
79
- #
80
- # Match analog pins declared like:
81
- # static const uint8_t A0 = 14
82
- #
83
- # Match DAC pins declared like:
84
- # static const uint8_t DAC1 = 25
85
- #
86
- # Match capacitive touch pins declared like:
87
- # static const uint8_t T0 = 4
88
- #
89
- pin = line.match /((A|D|DAC|T)\d+)\s*=\s*\(?(\d+)\w*\)?/
90
- if pin
91
- @map[pin[1].to_sym] = pin[3].to_i
92
- next
93
- end
94
-
95
- #
96
- # Match I2C/SPI pins declared like:
97
- # static const uint8_t SDA = 21
98
- #
99
- pin = line.match /(SDA|SCL|SS|MOSI|MISO|SCK)\s*=\s*\(?(\d+)\w*\)?/
100
- if pin
101
- @map[pin[1].to_sym] = pin[2].to_i
102
- next
103
- end
104
-
105
- #
106
- # Match LED_BUILTIN declared like:
107
- # #define LED_BUILTIN 13
108
- # #define PIN_LED 2
109
- # #define PIN_LED13 13
110
- #
111
- led = line.match /(PIN_LED|LED_BUILTIN)(_13)*\s+\(?(\d+)\w*\)?/
112
- if led
113
- @map[:LED_BUILTIN] = led[3].to_i unless line.match /2812/
114
- next
115
- end
116
-
117
- #
118
- # Match LED_BUILTIN declared like:
119
- # static const uint8_t LED_BUILTIN = 2
120
- # static const uint8_t LED_BUILTIN13 = 13
121
- # static const uint8_t PIN_LED = 4
122
- #
123
- led = line.match /(PIN_LED|LED_BUILTIN)(_13)*\s*=\s*\(?(\d+)\w*\)?/
124
- if led
125
- @map[:LED_BUILTIN] = led[3].to_i unless line.match /2812/
126
- next
127
- end
128
- end
129
- end
130
-
131
- def clean_map
132
- # Updated references to merge with the map after.
133
- map_updates = {}
134
-
135
- @map.each do |key, value|
136
- # One board double defines SPI_SS and SPI_CS.
137
- @map.delete(key) if key.to_s.match /CS/
138
-
139
- # Filter out some stuff we shouldn't be catching.
140
- if key.to_s.match /(HOWMANY|PIN_DEFINED|INTERFACES_COUNT|CHANNELS_NUM|PAD)/
141
- @map.delete(key)
142
- next
143
- end
144
-
145
- # Fix RP2040 analog pin overrides.
146
- if key.to_s.match /_A\d+/
147
- new_key = key.to_s.gsub("_", "")
148
- map_updates[new_key.to_sym] = value
149
- @map.delete(key)
150
- end
151
-
152
- # Standardize SPI / WIRE styling.
153
- spi_match = key.to_s.match /(SPI|WIRE)(\d*)_(\w+)/
154
- if spi_match
155
- new_key = "#{spi_match[3]}#{spi_match[2]}"
156
- map_updates[new_key.to_sym] = value
157
- @map.delete(key)
158
- next
159
- end
160
- end
161
-
162
- @map = @map.merge(map_updates)
163
- end
164
- end
@@ -1,47 +0,0 @@
1
- require_relative "lib/boards_parser"
2
- require_relative "lib/header_parser"
3
-
4
- CORES = ["avr", "esp32", "esp8266", "megaavr", "rp2040", "sam3x", "samd"]
5
-
6
- # This will end up containing a map for each board identified. Each key
7
- # is a board's identifier and the value is its pin map as a hash.
8
- board_maps = {}
9
-
10
- CORES.each do |core|
11
- core_root = "#{Dir.pwd}/cores/#{core}"
12
-
13
- # Get a hash that maps each board to its variant folder.
14
- board_headers = BoardsParser.parse(core_root)
15
-
16
- # For each board, parse its header and add it to the hash of maps.
17
- board_headers.each do |board, header_folder|
18
- parser = HeaderParser.new(header_folder)
19
- board_maps[board] = parser.map
20
- end
21
- end
22
-
23
- # Remove chars from board identifier that won't work in a filename.
24
- def board_to_filename(board_identifier)
25
- board_identifier.gsub(":", "_").gsub(",", "_").gsub(/\AARDUINO_/, "")
26
- end
27
-
28
- # Define every board name in BoardMap.h
29
- File.open("#{Dir.pwd}/BoardMap.h", "w") do |file|
30
- board_maps.each_key do |board_identifier|
31
- file.write "#ifdef #{board_identifier}\n"
32
- file.write " #define BOARD_MAP \"#{board_to_filename(board_identifier)}\"\n"
33
- file.write "#endif\n"
34
- file.write "\n"
35
- end
36
- end
37
-
38
- # Generate a YAML file for each board.
39
- require 'yaml'
40
- board_maps.each do |board_identifier, map|
41
- filename = board_to_filename(board_identifier)
42
- File.open("#{Dir.pwd}/yaml/#{filename}.yml", "w") do |file|
43
- file.write(map.to_yaml)
44
- end
45
- end
46
-
47
- puts "Parsed #{board_maps.count} boards."
@@ -1,48 +0,0 @@
1
- ---
2
- :LED_BUILTIN: 17
3
- :D0: 0
4
- :D1: 1
5
- :D2: 2
6
- :D3: 3
7
- :D4: 4
8
- :D5: 5
9
- :D6: 6
10
- :D7: 7
11
- :D8: 8
12
- :D9: 9
13
- :D10: 10
14
- :D11: 11
15
- :D12: 12
16
- :D13: 13
17
- :D14: 14
18
- :D15: 15
19
- :D16: 16
20
- :D17: 17
21
- :D18: 18
22
- :D19: 19
23
- :D20: 20
24
- :D21: 21
25
- :D22: 22
26
- :D23: 23
27
- :D24: 24
28
- :D25: 25
29
- :D26: 26
30
- :D27: 27
31
- :D28: 28
32
- :D29: 29
33
- :A0: 26
34
- :A1: 27
35
- :A2: 28
36
- :A3: 29
37
- :MISO0: 20
38
- :MOSI0: 23
39
- :SCK0: 22
40
- :SS0: 21
41
- :MISO1: 31
42
- :MOSI1: 31
43
- :SCK1: 31
44
- :SS1: 31
45
- :SDA0: 31
46
- :SCL0: 31
47
- :SDA1: 2
48
- :SCL1: 3
@@ -1,25 +0,0 @@
1
- ---
2
- :LED_BUILTIN: 13
3
- :SDA: 3
4
- :SCL: 4
5
- :SS: 42
6
- :MOSI: 35
7
- :SCK: 36
8
- :MISO: 37
9
- :A0: 18
10
- :A1: 17
11
- :A2: 16
12
- :A3: 15
13
- :A4: 14
14
- :A5: 8
15
- :T5: 5
16
- :T6: 6
17
- :T8: 8
18
- :T9: 9
19
- :T10: 10
20
- :T11: 11
21
- :T12: 12
22
- :T13: 13
23
- :T14: 14
24
- :DAC1: 17
25
- :DAC2: 18
@@ -1,25 +0,0 @@
1
- ---
2
- :LED_BUILTIN: 13
3
- :SDA: 3
4
- :SCL: 4
5
- :SS: 42
6
- :MOSI: 35
7
- :SCK: 36
8
- :MISO: 37
9
- :A0: 18
10
- :A1: 17
11
- :A2: 16
12
- :A3: 15
13
- :A4: 14
14
- :A5: 8
15
- :T5: 5
16
- :T6: 6
17
- :T8: 8
18
- :T9: 9
19
- :T10: 10
20
- :T11: 11
21
- :T12: 12
22
- :T13: 13
23
- :T14: 14
24
- :DAC1: 17
25
- :DAC2: 18
@@ -1,27 +0,0 @@
1
- ---
2
- :LED_BUILTIN: 13
3
- :SDA: 42
4
- :SCL: 41
5
- :SS: 7
6
- :MOSI: 35
7
- :SCK: 36
8
- :MISO: 37
9
- :A0: 18
10
- :A1: 17
11
- :A2: 16
12
- :A3: 15
13
- :A4: 14
14
- :A5: 8
15
- :T1: 1
16
- :T2: 2
17
- :T5: 5
18
- :T6: 6
19
- :T8: 8
20
- :T9: 9
21
- :T10: 10
22
- :T11: 11
23
- :T12: 12
24
- :T13: 13
25
- :T14: 14
26
- :DAC1: 17
27
- :DAC2: 18
@@ -1,29 +0,0 @@
1
- ---
2
- :LED_BUILTIN: 13
3
- :SDA: 3
4
- :SCL: 4
5
- :SS: 42
6
- :MOSI: 35
7
- :SCK: 36
8
- :MISO: 37
9
- :A0: 18
10
- :A1: 4
11
- :A2: 16
12
- :A3: 15
13
- :A4: 14
14
- :A5: 8
15
- :A6: 3
16
- :A7: 4
17
- :A8: 5
18
- :A9: 6
19
- :T3: 3
20
- :T4: 4
21
- :T5: 5
22
- :T6: 6
23
- :T8: 8
24
- :T9: 9
25
- :T10: 10
26
- :T11: 11
27
- :T12: 12
28
- :T13: 13
29
- :T14: 14
@@ -1,29 +0,0 @@
1
- ---
2
- :LED_BUILTIN: 13
3
- :SDA: 3
4
- :SCL: 4
5
- :SS: 42
6
- :MOSI: 35
7
- :SCK: 36
8
- :MISO: 37
9
- :A0: 18
10
- :A1: 4
11
- :A2: 16
12
- :A3: 15
13
- :A4: 14
14
- :A5: 8
15
- :A6: 3
16
- :A7: 4
17
- :A8: 5
18
- :A9: 6
19
- :T3: 3
20
- :T4: 4
21
- :T5: 5
22
- :T6: 6
23
- :T8: 8
24
- :T9: 9
25
- :T10: 10
26
- :T11: 11
27
- :T12: 12
28
- :T13: 13
29
- :T14: 14
@@ -1,25 +0,0 @@
1
- ---
2
- :LED_BUILTIN: 13
3
- :SDA: 3
4
- :SCL: 4
5
- :SS: 42
6
- :MOSI: 35
7
- :SCK: 36
8
- :MISO: 37
9
- :A0: 18
10
- :A1: 17
11
- :A2: 16
12
- :A3: 15
13
- :A4: 14
14
- :A5: 8
15
- :T5: 5
16
- :T6: 6
17
- :T8: 8
18
- :T9: 9
19
- :T10: 10
20
- :T11: 11
21
- :T12: 12
22
- :T13: 13
23
- :T14: 14
24
- :DAC1: 17
25
- :DAC2: 18
@@ -1,27 +0,0 @@
1
- ---
2
- :LED_BUILTIN: 13
3
- :SDA: 42
4
- :SCL: 41
5
- :SS: 7
6
- :MOSI: 35
7
- :SCK: 36
8
- :MISO: 37
9
- :A0: 18
10
- :A1: 17
11
- :A2: 16
12
- :A3: 15
13
- :A4: 14
14
- :A5: 8
15
- :T1: 1
16
- :T2: 2
17
- :T5: 5
18
- :T6: 6
19
- :T8: 8
20
- :T9: 9
21
- :T10: 10
22
- :T11: 11
23
- :T12: 12
24
- :T13: 13
25
- :T14: 14
26
- :DAC1: 17
27
- :DAC2: 18
@@ -1,30 +0,0 @@
1
- ---
2
- :LED_BUILTIN: 13
3
- :SDA: 22
4
- :SCL: 20
5
- :SS: 33
6
- :MOSI: 19
7
- :MISO: 21
8
- :SCK: 5
9
- :A0: 26
10
- :A1: 3
11
- :A2: 34
12
- :A3: 39
13
- :A4: 36
14
- :A5: 4
15
- :A6: 14
16
- :A7: 32
17
- :A8: 15
18
- :A9: 33
19
- :T0: 4
20
- :T1: 0
21
- :T2: 2
22
- :T3: 15
23
- :T4: 13
24
- :T5: 12
25
- :T6: 14
26
- :T7: 27
27
- :T8: 33
28
- :T9: 32
29
- :DAC1: 25
30
- :DAC2: 26
@@ -1,48 +0,0 @@
1
- ---
2
- :LED_BUILTIN: 13
3
- :D0: 0
4
- :D1: 1
5
- :D2: 2
6
- :D3: 3
7
- :D4: 4
8
- :D5: 5
9
- :D6: 6
10
- :D7: 7
11
- :D8: 8
12
- :D9: 9
13
- :D10: 10
14
- :D11: 11
15
- :D12: 12
16
- :D13: 13
17
- :D14: 14
18
- :D15: 15
19
- :D16: 16
20
- :D17: 17
21
- :D18: 18
22
- :D19: 19
23
- :D20: 20
24
- :D21: 21
25
- :D22: 22
26
- :D23: 23
27
- :D24: 24
28
- :D25: 25
29
- :D26: 26
30
- :D27: 27
31
- :D28: 28
32
- :D29: 29
33
- :A0: 26
34
- :A1: 27
35
- :A2: 28
36
- :A3: 29
37
- :MISO0: 20
38
- :MOSI0: 19
39
- :SCK0: 18
40
- :SS0: 17
41
- :MISO1: 31
42
- :MOSI1: 31
43
- :SCK1: 31
44
- :SS1: 31
45
- :SDA0: 2
46
- :SCL0: 3
47
- :SDA1: 24
48
- :SCL1: 25
@@ -1,48 +0,0 @@
1
- ---
2
- :LED_BUILTIN: 13
3
- :D0: 0
4
- :D1: 1
5
- :D2: 2
6
- :D3: 3
7
- :D4: 4
8
- :D5: 5
9
- :D6: 6
10
- :D7: 7
11
- :D8: 8
12
- :D9: 9
13
- :D10: 10
14
- :D11: 11
15
- :D12: 12
16
- :D13: 13
17
- :D14: 14
18
- :D15: 15
19
- :D16: 16
20
- :D17: 17
21
- :D18: 18
22
- :D19: 19
23
- :D20: 20
24
- :D21: 21
25
- :D22: 22
26
- :D23: 23
27
- :D24: 24
28
- :D25: 25
29
- :D26: 26
30
- :D27: 27
31
- :D28: 28
32
- :D29: 29
33
- :A0: 26
34
- :A1: 27
35
- :A2: 28
36
- :A3: 29
37
- :MISO0: 8
38
- :MOSI0: 15
39
- :SCK0: 14
40
- :SS0: 13
41
- :MISO1: 31
42
- :MOSI1: 31
43
- :SCK1: 31
44
- :SS1: 31
45
- :SDA0: 2
46
- :SCL0: 3
47
- :SDA1: 31
48
- :SCL1: 31