denko 0.13.5 → 0.14.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/{build_avr.yml → build_atmega_avr.yml} +18 -18
- data/.github/workflows/{build_megaavr.yml → build_atmega_megaavr.yml} +18 -18
- data/.github/workflows/{build_sam3x.yml → build_atsam3x.yml} +17 -17
- data/.github/workflows/{build_samd.yml → build_atsamd21.yml} +18 -18
- data/.github/workflows/build_esp32.yml +17 -17
- data/.github/workflows/build_esp32c3.yml +57 -0
- data/.github/workflows/build_esp32c6.yml +57 -0
- data/.github/workflows/build_esp32h2.yml +56 -0
- data/.github/workflows/build_esp32s2.yml +57 -0
- data/.github/workflows/build_esp32s3.yml +57 -0
- data/.github/workflows/build_esp8266.yml +15 -15
- data/.github/workflows/build_ra4m1.yml +16 -16
- data/.github/workflows/build_rp2040.yml +17 -16
- data/.github/workflows/ruby.yml +20 -20
- data/CHANGELOG.md +195 -11
- data/DEPS_CLI.md +9 -9
- data/DEPS_IDE.md +17 -18
- data/HARDWARE.md +50 -51
- data/README.md +61 -53
- data/Rakefile +1 -1
- data/benchmarks/analog_listen.rb +49 -0
- data/benchmarks/digital_write.rb +28 -0
- data/benchmarks/i2c_ssd1306_refresh.rb +13 -6
- data/build +1 -1
- data/denko.gemspec +5 -2
- data/examples/advanced/{m5_env.rb → m5_env3.rb} +12 -14
- data/examples/advanced/rotary_encoder_mac_volume.rb +18 -13
- data/examples/advanced/ssd1306_time_temp_rh.rb +8 -13
- data/examples/analog_io/ads1100.rb +48 -0
- data/examples/analog_io/ads1115.rb +2 -2
- data/examples/analog_io/ads1118.rb +3 -11
- data/examples/analog_io/input.rb +17 -16
- data/examples/analog_io/input_smoothing.rb +27 -0
- data/examples/analog_io/potentiometer.rb +31 -0
- data/examples/connection/binary_echo.rb +34 -0
- data/examples/connection/tcp.rb +12 -27
- data/examples/digital_io/button.rb +7 -3
- data/examples/digital_io/relay.rb +17 -0
- data/examples/digital_io/rotary_encoder.rb +21 -11
- data/examples/display/hd44780.rb +13 -5
- data/examples/display/ssd1306.rb +20 -17
- data/examples/display/ssd1306_s2_pico.rb +2 -2
- data/examples/i2c/search.rb +10 -26
- data/examples/led/apa102_bounce.rb +3 -4
- data/examples/led/apa102_fade.rb +44 -0
- data/examples/led/builtin_blink.rb +3 -1
- data/examples/led/builtin_fade.rb +19 -0
- data/examples/led/rgb_led.rb +31 -0
- data/examples/led/seven_segment_char_echo.rb +4 -2
- data/examples/led/ws2812_bounce.rb +5 -7
- data/examples/led/ws2812_builtin_blink.rb +3 -2
- data/examples/led/ws2812_fade.rb +43 -0
- data/examples/motor/l298.rb +10 -8
- data/examples/motor/servo.rb +4 -3
- data/examples/motor/stepper.rb +13 -13
- data/examples/one_wire/search.rb +32 -0
- data/examples/pulse_io/buzzer.rb +8 -3
- data/examples/pulse_io/ir_output.rb +51 -0
- data/examples/pulse_io/pwm_output.rb +30 -0
- data/examples/rtc/ds3231.rb +18 -35
- data/examples/sensor/aht10.rb +4 -6
- data/examples/sensor/aht20.rb +4 -6
- data/examples/sensor/bme280.rb +4 -4
- data/examples/sensor/bmp180.rb +9 -5
- data/examples/sensor/dht.rb +20 -15
- data/examples/sensor/ds18b20.rb +20 -21
- data/examples/sensor/generic_pir.rb +4 -2
- data/examples/sensor/hcsr04.rb +5 -2
- data/examples/sensor/htu21d.rb +9 -20
- data/examples/sensor/htu31d.rb +7 -9
- data/examples/sensor/neat_tph_readings.rb +15 -9
- data/examples/sensor/qmp6988.rb +5 -7
- data/examples/sensor/rcwl9620.rb +3 -3
- data/examples/sensor/sht3x.rb +4 -6
- data/examples/spi/bitbang_loopback.rb +46 -0
- data/examples/spi/input_register.rb +9 -19
- data/examples/spi/output_register.rb +9 -17
- data/examples/spi/ssd_through_registers.rb +28 -0
- data/examples/spi/two_registers.rb +18 -24
- data/examples/uart/bit_bang_demo.rb +25 -0
- data/examples/uart/board_passthrough.rb +19 -13
- data/examples/uart/hardware_loopback.rb +1 -1
- data/lib/denko/analog_io/ads1100.rb +127 -0
- data/lib/denko/analog_io/ads1115.rb +8 -25
- data/lib/denko/analog_io/ads1118.rb +10 -25
- data/lib/denko/analog_io/ads111x.rb +25 -11
- data/lib/denko/analog_io/input.rb +29 -55
- data/lib/denko/analog_io/input_helper.rb +42 -0
- data/lib/denko/analog_io/output.rb +5 -5
- data/lib/denko/analog_io/potentiometer.rb +6 -8
- data/lib/denko/analog_io.rb +2 -1
- data/lib/denko/behaviors/board_proxy.rb +13 -1
- data/lib/denko/behaviors/bus_controller.rb +1 -0
- data/lib/denko/behaviors/bus_controller_addressed.rb +1 -0
- data/lib/denko/behaviors/bus_peripheral.rb +3 -4
- data/lib/denko/behaviors/bus_peripheral_addressed.rb +8 -6
- data/lib/denko/behaviors/callbacks.rb +9 -7
- data/lib/denko/behaviors/component.rb +16 -14
- data/lib/denko/behaviors/input_pin.rb +14 -15
- data/lib/denko/behaviors/lifecycle.rb +51 -0
- data/lib/denko/behaviors/multi_pin.rb +22 -18
- data/lib/denko/behaviors/output_pin.rb +9 -4
- data/lib/denko/behaviors/single_pin.rb +1 -0
- data/lib/denko/behaviors/state.rb +15 -9
- data/lib/denko/behaviors/subcomponents.rb +72 -12
- data/lib/denko/behaviors.rb +2 -1
- data/lib/denko/board/core.rb +36 -18
- data/lib/denko/board/i2c.rb +14 -14
- data/lib/denko/board/i2c_bit_bang.rb +49 -0
- data/lib/denko/board/infrared.rb +6 -6
- data/lib/denko/board/led_array.rb +6 -5
- data/lib/denko/board/spi.rb +15 -10
- data/lib/denko/board/spi_bit_bang.rb +9 -7
- data/lib/denko/board.rb +35 -33
- data/lib/denko/connection/binary_echo.rb +17 -0
- data/lib/denko/connection/flow_control.rb +11 -15
- data/lib/denko/connection/handshake.rb +2 -0
- data/lib/denko/digital_io/button.rb +4 -0
- data/lib/denko/digital_io/c_bit_bang.rb +15 -0
- data/lib/denko/digital_io/input.rb +4 -5
- data/lib/denko/digital_io/output.rb +7 -6
- data/lib/denko/digital_io/relay.rb +2 -0
- data/lib/denko/digital_io/rotary_encoder.rb +78 -60
- data/lib/denko/digital_io.rb +1 -0
- data/lib/denko/display/hd44780.rb +136 -93
- data/lib/denko/display/sh1106.rb +42 -0
- data/lib/denko/display/ssd1306.rb +105 -45
- data/lib/denko/display.rb +1 -0
- data/lib/denko/eeprom/built_in.rb +19 -16
- data/lib/denko/i2c/bit_bang.rb +31 -0
- data/lib/denko/i2c/bus.rb +8 -36
- data/lib/denko/i2c/bus_common.rb +45 -0
- data/lib/denko/i2c/peripheral.rb +28 -19
- data/lib/denko/i2c.rb +2 -0
- data/lib/denko/led/apa102.rb +43 -29
- data/lib/denko/led/base.rb +8 -2
- data/lib/denko/led/rgb.rb +5 -7
- data/lib/denko/led/seven_segment.rb +24 -9
- data/lib/denko/led/ws2812.rb +10 -7
- data/lib/denko/message.rb +5 -0
- data/lib/denko/motor/l298.rb +11 -10
- data/lib/denko/motor/servo.rb +22 -10
- data/lib/denko/motor/stepper.rb +11 -14
- data/lib/denko/mutex_stub.rb +7 -0
- data/lib/denko/one_wire/bus.rb +9 -5
- data/lib/denko/one_wire/peripheral.rb +0 -3
- data/lib/denko/pulse_io/buzzer.rb +9 -3
- data/lib/denko/pulse_io/{ir_transmitter.rb → ir_output.rb} +9 -4
- data/lib/denko/pulse_io/pwm_output.rb +69 -15
- data/lib/denko/pulse_io.rb +3 -3
- data/lib/denko/rtc/ds3231.rb +11 -13
- data/lib/denko/sensor/aht.rb +22 -21
- data/lib/denko/sensor/bme280.rb +60 -63
- data/lib/denko/sensor/bmp180.rb +41 -38
- data/lib/denko/sensor/dht.rb +22 -5
- data/lib/denko/sensor/ds18b20.rb +40 -34
- data/lib/denko/sensor/hcsr04.rb +7 -5
- data/lib/denko/sensor/helper.rb +37 -0
- data/lib/denko/sensor/htu21d.rb +44 -55
- data/lib/denko/sensor/htu31d.rb +32 -33
- data/lib/denko/sensor/qmp6988.rb +25 -23
- data/lib/denko/sensor/rcwl9620.rb +2 -5
- data/lib/denko/sensor/sht3x.rb +23 -21
- data/lib/denko/sensor.rb +1 -2
- data/lib/denko/spi/base_register.rb +22 -22
- data/lib/denko/spi/bit_bang.rb +17 -51
- data/lib/denko/spi/bus.rb +15 -29
- data/lib/denko/spi/bus_common.rb +36 -0
- data/lib/denko/spi/input_register.rb +36 -30
- data/lib/denko/spi/output_register.rb +25 -40
- data/lib/denko/spi/peripheral.rb +93 -24
- data/lib/denko/spi.rb +6 -1
- data/lib/denko/uart/bit_bang.rb +5 -3
- data/lib/denko/uart/hardware.rb +9 -8
- data/lib/denko/version.rb +1 -1
- data/lib/denko.rb +10 -0
- data/lib/denko_cli/generator.rb +2 -2
- data/lib/denko_cli/packages.rb +8 -10
- data/lib/denko_cli/targets.rb +8 -8
- data/lib/denko_cli/targets.txt +4 -4
- data/lib/denko_cli/usage.txt +1 -1
- data/src/denko_ethernet.ino +0 -14
- data/src/denko_serial.ino +0 -14
- data/src/denko_wifi.ino +6 -15
- data/src/lib/Denko.cpp +39 -3
- data/src/lib/Denko.h +42 -26
- data/src/lib/DenkoCoreIO.cpp +60 -103
- data/src/lib/DenkoDefines.h +36 -31
- data/src/lib/DenkoI2C.cpp +54 -45
- data/src/lib/DenkoI2CBB.cpp +238 -0
- data/src/lib/DenkoIROut.cpp +12 -7
- data/src/lib/DenkoLEDArray.cpp +36 -13
- data/src/lib/DenkoSPI.cpp +6 -5
- data/src/lib/DenkoSPIBB.cpp +7 -6
- data/target.yml +37 -2
- data/test/analog_io/potentiometer_test.rb +10 -10
- data/test/behaviors/board_proxy_test.rb +1 -1
- data/test/behaviors/callbacks_test.rb +11 -3
- data/test/behaviors/component_test.rb +17 -9
- data/test/behaviors/input_pin_test.rb +14 -9
- data/test/behaviors/multi_pin_test.rb +14 -4
- data/test/behaviors/output_pin_test.rb +11 -8
- data/test/behaviors/poller_test.rb +1 -0
- data/test/behaviors/reader_test.rb +3 -2
- data/test/behaviors/subcomponents_test.rb +22 -2
- data/test/board/core_test.rb +15 -11
- data/test/board/i2c_test.rb +39 -33
- data/test/board/infrared_test.rb +1 -1
- data/test/board/message_test.rb +17 -11
- data/test/board/spi_test.rb +21 -21
- data/test/digital_io/button_test.rb +15 -0
- data/test/digital_io/relay_test.rb +18 -0
- data/test/digital_io/rotary_encoder_test.rb +80 -60
- data/test/eeprom/built_in_test.rb +9 -9
- data/test/i2c/bus_test.rb +30 -14
- data/test/i2c/peripheral_test.rb +36 -17
- data/test/led/base_test.rb +2 -1
- data/test/led/rgb_test.rb +6 -6
- data/test/led/seven_segment_test.rb +7 -7
- data/test/motor/servo_test.rb +1 -1
- data/test/motor/stepper_test.rb +2 -2
- data/test/one_wire/bus_test.rb +1 -0
- data/test/pulse_io/buzzer_test.rb +7 -4
- data/test/pulse_io/{ir_transmitter_test.rb → ir_output_test.rb} +10 -10
- data/test/pulse_io/pwm_output_test.rb +74 -18
- data/test/rtc/ds3231_test.rb +11 -13
- data/test/sensor/dht_test.rb +1 -1
- data/test/sensor/ds18b20_test.rb +4 -8
- data/test/spi/bus_test.rb +7 -7
- data/test/spi/input_register_test.rb +15 -15
- data/test/spi/output_register_test.rb +10 -28
- data/test/spi/peripheral_multi_pin_test.rb +53 -0
- data/test/spi/peripheral_single_pin_test.rb +48 -0
- data/test/test_helper.rb +36 -33
- data/tutorial/02-button/button.rb +5 -4
- data/tutorial/03-potentiometer/potentiometer.rb +9 -5
- data/tutorial/04-pwm_led/pwm_led.rb +14 -16
- data/tutorial/05-rgb_led/rgb_led.rb +6 -6
- data/tutorial/05-rgb_led/rgb_mapping.rb +11 -11
- data/vendor/board-maps/.gitignore +56 -0
- data/vendor/board-maps/.gitmodules +24 -0
- data/vendor/board-maps/BoardMap.h +1852 -0
- data/vendor/board-maps/README.md +52 -0
- data/vendor/board-maps/lib/boards_parser.rb +66 -0
- data/vendor/board-maps/lib/header_parser.rb +199 -0
- data/vendor/board-maps/run.rb +57 -0
- data/vendor/board-maps/yaml/0XCB_HELIOS.yml +48 -0
- data/vendor/board-maps/yaml/ADAFRUIT_CAMERA_ESP32S3.yml +11 -0
- data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_ESP32C6.yml +15 -0
- data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_ESP32S2.yml +25 -0
- data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_ESP32S2_REVTFT.yml +25 -0
- data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_ESP32S2_TFT.yml +27 -0
- data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_ESP32S3.yml +34 -0
- data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_ESP32S3_NOPSRAM.yml +34 -0
- data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_ESP32S3_REVTFT.yml +25 -0
- data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_ESP32S3_TFT.yml +27 -0
- data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_ESP32_V2.yml +34 -0
- data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_RP2040.yml +48 -0
- data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_RP2040_ADALOGGER.yml +44 -0
- data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_RP2040_CAN.yml +48 -0
- data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_RP2040_DVI.yml +48 -0
- data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_RP2040_PROP_MAKER.yml +48 -0
- data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_RP2040_RFM.yml +48 -0
- data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_RP2040_SCORPIO.yml +48 -0
- data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_RP2040_THINKINK.yml +48 -0
- data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_RP2040_USB_HOST.yml +48 -0
- data/vendor/board-maps/yaml/ADAFRUIT_ITSYBITSY_ESP32.yml +24 -0
- data/vendor/board-maps/yaml/ADAFRUIT_ITSYBITSY_RP2040.yml +48 -0
- data/vendor/board-maps/yaml/ADAFRUIT_KB2040_RP2040.yml +48 -0
- data/vendor/board-maps/yaml/ADAFRUIT_MACROPAD_RP2040.yml +48 -0
- data/vendor/board-maps/yaml/ADAFRUIT_MATRIXPORTAL_ESP32S3.yml +16 -0
- data/vendor/board-maps/yaml/ADAFRUIT_METRO_RP2040.yml +48 -0
- data/vendor/board-maps/yaml/ADAFRUIT_QTPY_ESP32C3.yml +13 -0
- data/vendor/board-maps/yaml/ADAFRUIT_QTPY_ESP32S2.yml +23 -0
- data/vendor/board-maps/yaml/ADAFRUIT_QTPY_ESP32S3_N4R2.yml +21 -0
- data/vendor/board-maps/yaml/ADAFRUIT_QTPY_ESP32S3_NOPSRAM.yml +21 -0
- data/vendor/board-maps/yaml/ADAFRUIT_QTPY_ESP32_PICO.yml +29 -0
- data/vendor/board-maps/yaml/ADAFRUIT_QTPY_RP2040.yml +48 -0
- data/vendor/board-maps/yaml/ADAFRUIT_STEMMAFRIEND_RP2040.yml +48 -0
- data/vendor/board-maps/yaml/ADAFRUIT_TRINKEYQT_RP2040.yml +48 -0
- data/vendor/board-maps/yaml/ALKS.yml +34 -0
- data/vendor/board-maps/yaml/AMKEN_BB.yml +48 -0
- data/vendor/board-maps/yaml/AMKEN_ES.yml +48 -0
- data/vendor/board-maps/yaml/AMKEN_REVELOP.yml +48 -0
- data/vendor/board-maps/yaml/AMKEN_REVELOP_PLUS.yml +48 -0
- data/vendor/board-maps/yaml/AMPERKA_WIFI_SLOT.yml +16 -0
- data/vendor/board-maps/yaml/ARTRONSHOP_RP2_NANO.yml +32 -0
- data/vendor/board-maps/yaml/ASL_CAN_X2.yml +41 -0
- data/vendor/board-maps/yaml/ATD143_S3.yml +41 -0
- data/vendor/board-maps/yaml/AVENTEN_S3_SYNC.yml +38 -0
- data/vendor/board-maps/yaml/AVR_ADK.yml +24 -0
- data/vendor/board-maps/yaml/AVR_BT.yml +16 -0
- data/vendor/board-maps/yaml/AVR_CIRCUITPLAY.yml +14 -0
- data/vendor/board-maps/yaml/AVR_DUEMILANOVE.yml +16 -0
- data/vendor/board-maps/yaml/AVR_ESPLORA.yml +20 -0
- data/vendor/board-maps/yaml/AVR_ETHERNET.yml +16 -0
- data/vendor/board-maps/yaml/AVR_FIO.yml +16 -0
- data/vendor/board-maps/yaml/AVR_GEMMA.yml +6 -0
- data/vendor/board-maps/yaml/AVR_INDUSTRIAL101.yml +20 -0
- data/vendor/board-maps/yaml/AVR_LEONARDO.yml +20 -0
- data/vendor/board-maps/yaml/AVR_LEONARDO_ETH.yml +20 -0
- data/vendor/board-maps/yaml/AVR_LILYPAD.yml +16 -0
- data/vendor/board-maps/yaml/AVR_LILYPAD_USB.yml +20 -0
- data/vendor/board-maps/yaml/AVR_LININO_ONE.yml +20 -0
- data/vendor/board-maps/yaml/AVR_MEGA.yml +24 -0
- data/vendor/board-maps/yaml/AVR_MEGA2560.yml +24 -0
- data/vendor/board-maps/yaml/AVR_MICRO.yml +20 -0
- data/vendor/board-maps/yaml/AVR_MINI.yml +16 -0
- data/vendor/board-maps/yaml/AVR_NANO.yml +16 -0
- data/vendor/board-maps/yaml/AVR_NANO_EVERY.yml +22 -0
- data/vendor/board-maps/yaml/AVR_NG.yml +16 -0
- data/vendor/board-maps/yaml/AVR_PRO.yml +16 -0
- data/vendor/board-maps/yaml/AVR_ROBOT_CONTROL.yml +22 -0
- data/vendor/board-maps/yaml/AVR_ROBOT_MOTOR.yml +19 -0
- data/vendor/board-maps/yaml/AVR_UNO.yml +16 -0
- data/vendor/board-maps/yaml/AVR_UNO_WIFI_DEV_ED.yml +16 -0
- data/vendor/board-maps/yaml/AVR_UNO_WIFI_REV2.yml +22 -0
- data/vendor/board-maps/yaml/AVR_YUN.yml +20 -0
- data/vendor/board-maps/yaml/AVR_YUNMINI.yml +20 -0
- data/vendor/board-maps/yaml/AirM2M_CORE_ESP32C3.yml +14 -0
- data/vendor/board-maps/yaml/BEE_DATA_LOGGER.yml +39 -0
- data/vendor/board-maps/yaml/BLING.yml +25 -0
- data/vendor/board-maps/yaml/BPI_BIT.yml +9 -0
- data/vendor/board-maps/yaml/BPI_LEAF_S3.yml +42 -0
- data/vendor/board-maps/yaml/BRIDGETEK_IDM2040_43A.yml +48 -0
- data/vendor/board-maps/yaml/BRIDGETEK_IDM2040_7A.yml +48 -0
- data/vendor/board-maps/yaml/BeeMotionS3.yml +45 -0
- data/vendor/board-maps/yaml/Bee_Motion.yml +30 -0
- data/vendor/board-maps/yaml/Bee_Motion_Mini.yml +13 -0
- data/vendor/board-maps/yaml/Bee_S3.yml +38 -0
- data/vendor/board-maps/yaml/Breadstick_Raspberry.yml +31 -0
- data/vendor/board-maps/yaml/CHALLENGER_2040_LORA_RP2040.yml +39 -0
- data/vendor/board-maps/yaml/CHALLENGER_2040_LTE_RP2040.yml +38 -0
- data/vendor/board-maps/yaml/CHALLENGER_2040_NFC_RP2040.yml +32 -0
- data/vendor/board-maps/yaml/CHALLENGER_2040_SDRTC_RP2040.yml +36 -0
- data/vendor/board-maps/yaml/CHALLENGER_2040_SUBGHZ_RP2040.yml +39 -0
- data/vendor/board-maps/yaml/CHALLENGER_2040_UWB_RP2040.yml +39 -0
- data/vendor/board-maps/yaml/CHALLENGER_2040_WIFI6_BLE_RP2040.yml +42 -0
- data/vendor/board-maps/yaml/CHALLENGER_2040_WIFI_BLE_RP2040.yml +42 -0
- data/vendor/board-maps/yaml/CHALLENGER_2040_WIFI_RP2040.yml +38 -0
- data/vendor/board-maps/yaml/CHALLENGER_NB_2040_WIFI_RP2040.yml +38 -0
- data/vendor/board-maps/yaml/CONNECTIVITY_2040_LTE_WIFI_BLE_RP2040.yml +48 -0
- data/vendor/board-maps/yaml/CRABIK_SLOT_ESP32_S3.yml +19 -0
- data/vendor/board-maps/yaml/CYTRON_MAKER_FEATHER_AIOT_S3.yml +29 -0
- data/vendor/board-maps/yaml/CYTRON_MAKER_NANO_RP2040.yml +48 -0
- data/vendor/board-maps/yaml/CYTRON_MAKER_PI_RP2040.yml +48 -0
- data/vendor/board-maps/yaml/CYTRON_MAKER_UNO_RP2040.yml +48 -0
- data/vendor/board-maps/yaml/CoreESP32.yml +53 -0
- data/vendor/board-maps/yaml/D1_MINI32.yml +45 -0
- data/vendor/board-maps/yaml/D1_UNO32.yml +28 -0
- data/vendor/board-maps/yaml/DATANOISETV_PICOADK.yml +48 -0
- data/vendor/board-maps/yaml/DEGZ_SUIBO_RP2040.yml +48 -0
- data/vendor/board-maps/yaml/DENKY.yml +35 -0
- data/vendor/board-maps/yaml/DENKY_PICOV3.yml +35 -0
- data/vendor/board-maps/yaml/DENKY_WROOM32.yml +35 -0
- data/vendor/board-maps/yaml/DEPARTMENT_OF_ALCHEMY_MINIMAIN_ESP32S2.yml +26 -0
- data/vendor/board-maps/yaml/DFROBOT_BEETLE_ESP32C6.yml +8 -0
- data/vendor/board-maps/yaml/DFROBOT_BEETLE_ESP32_C3.yml +14 -0
- data/vendor/board-maps/yaml/DFROBOT_BEETLE_RP2040.yml +48 -0
- data/vendor/board-maps/yaml/DFROBOT_FIREBEETLE_2_ESP32C6.yml +20 -0
- data/vendor/board-maps/yaml/DFROBOT_FIREBEETLE_2_ESP32E.yml +49 -0
- data/vendor/board-maps/yaml/DFROBOT_FIREBEETLE_2_ESP32S3.yml +38 -0
- data/vendor/board-maps/yaml/DFROBOT_FIREBEETLE_ESP32.yml +46 -0
- data/vendor/board-maps/yaml/DFROBOT_ROMEO_ESP32S3.yml +7 -0
- data/vendor/board-maps/yaml/DPTECHNICS_WALTER.yml +39 -0
- data/vendor/board-maps/yaml/DPU_ESP32.yml +35 -0
- data/vendor/board-maps/yaml/DYDK.yml +38 -0
- data/vendor/board-maps/yaml/DYDK1A.yml +37 -0
- data/vendor/board-maps/yaml/DYDK1Av2.yml +45 -0
- data/vendor/board-maps/yaml/DYG.yml +20 -0
- data/vendor/board-maps/yaml/DYM.yml +40 -0
- data/vendor/board-maps/yaml/DYMv2.yml +39 -0
- data/vendor/board-maps/yaml/D_Duino_32.yml +37 -0
- data/vendor/board-maps/yaml/ELECROW_CROWPANEL_7.yml +8 -0
- data/vendor/board-maps/yaml/ELECTRONICCATS_HUNTERCAT_NFC.yml +44 -0
- data/vendor/board-maps/yaml/ESP320.yml +8 -0
- data/vendor/board-maps/yaml/ESP32C2_DEV.yml +12 -0
- data/vendor/board-maps/yaml/ESP32C3_DEV.yml +14 -0
- data/vendor/board-maps/yaml/ESP32C3_DEVKIT_LIPO.yml +14 -0
- data/vendor/board-maps/yaml/ESP32C3_M1_I_KIT.yml +13 -0
- data/vendor/board-maps/yaml/ESP32C6_DEV.yml +15 -0
- data/vendor/board-maps/yaml/ESP32C6_EVB.yml +15 -0
- data/vendor/board-maps/yaml/ESP32C6_QWIIC_POCKET.yml +15 -0
- data/vendor/board-maps/yaml/ESP32C6_THING_PLUS.yml +15 -0
- data/vendor/board-maps/yaml/ESP32H2_DEV.yml +13 -0
- data/vendor/board-maps/yaml/ESP32H2_DEVKIT_LIPO.yml +13 -0
- data/vendor/board-maps/yaml/ESP32S2_DEV.yml +44 -0
- data/vendor/board-maps/yaml/ESP32S2_DEVKIT_LIPO.yml +44 -0
- data/vendor/board-maps/yaml/ESP32S2_DEVKIT_LIPO_USB.yml +44 -0
- data/vendor/board-maps/yaml/ESP32S2_THING_PLUS.yml +44 -0
- data/vendor/board-maps/yaml/ESP32S2_USB.yml +43 -0
- data/vendor/board-maps/yaml/ESP32S3_CAM_LCD.yml +7 -0
- data/vendor/board-maps/yaml/ESP32S3_DEV.yml +38 -0
- data/vendor/board-maps/yaml/ESP32S3_DEVKIT_LIPO.yml +42 -0
- data/vendor/board-maps/yaml/ESP32S3_POWERFEATHER.yml +22 -0
- data/vendor/board-maps/yaml/ESP32_DEV.yml +35 -0
- data/vendor/board-maps/yaml/ESP32_DEVKIT_LIPO.yml +35 -0
- data/vendor/board-maps/yaml/ESP32_EVB.yml +7 -0
- data/vendor/board-maps/yaml/ESP32_GATEWAY.yml +13 -0
- data/vendor/board-maps/yaml/ESP32_GATEWAY_C.yml +13 -0
- data/vendor/board-maps/yaml/ESP32_GATEWAY_E.yml +13 -0
- data/vendor/board-maps/yaml/ESP32_GATEWAY_F.yml +13 -0
- data/vendor/board-maps/yaml/ESP32_IOT_REDBOARD.yml +36 -0
- data/vendor/board-maps/yaml/ESP32_MICROMOD.yml +24 -0
- data/vendor/board-maps/yaml/ESP32_PICO.yml +35 -0
- data/vendor/board-maps/yaml/ESP32_POE.yml +7 -0
- data/vendor/board-maps/yaml/ESP32_POE_ISO.yml +7 -0
- data/vendor/board-maps/yaml/ESP32_S3R8N16.yml +3 -0
- data/vendor/board-maps/yaml/ESP32_S3_BOX.yml +19 -0
- data/vendor/board-maps/yaml/ESP32_S3_USB_OTG.yml +11 -0
- data/vendor/board-maps/yaml/ESP32_SBC_FABGL.yml +35 -0
- data/vendor/board-maps/yaml/ESP32_THING.yml +36 -0
- data/vendor/board-maps/yaml/ESP32_THING_PLUS.yml +33 -0
- data/vendor/board-maps/yaml/ESP32_THING_PLUS_C.yml +33 -0
- data/vendor/board-maps/yaml/ESP32_WROOM_DA.yml +35 -0
- data/vendor/board-maps/yaml/ESP32_WROVER_KIT.yml +35 -0
- data/vendor/board-maps/yaml/ESP8266_ADAFRUIT_HUZZAH.yml +9 -0
- data/vendor/board-maps/yaml/ESP8266_AGRUMINO_LEMON_V4.yml +8 -0
- data/vendor/board-maps/yaml/ESP8266_ARDUINO_PRIMO.yml +7 -0
- data/vendor/board-maps/yaml/ESP8266_ARDUINO_STAR_OTTO.yml +7 -0
- data/vendor/board-maps/yaml/ESP8266_ARDUINO_UNOWIFI.yml +9 -0
- data/vendor/board-maps/yaml/ESP8266_ESP01.yml +9 -0
- data/vendor/board-maps/yaml/ESP8266_ESP07.yml +20 -0
- data/vendor/board-maps/yaml/ESP8266_ESP12.yml +20 -0
- data/vendor/board-maps/yaml/ESP8266_ESP13.yml +17 -0
- data/vendor/board-maps/yaml/ESP8266_ESP210.yml +9 -0
- data/vendor/board-maps/yaml/ESP8266_ESPECTRO_CORE.yml +9 -0
- data/vendor/board-maps/yaml/ESP8266_ESPINO_ESP12.yml +9 -0
- data/vendor/board-maps/yaml/ESP8266_ESPINO_ESP13.yml +9 -0
- data/vendor/board-maps/yaml/ESP8266_ESPRESSO_LITE_V1.yml +9 -0
- data/vendor/board-maps/yaml/ESP8266_ESPRESSO_LITE_V2.yml +9 -0
- data/vendor/board-maps/yaml/ESP8266_GENERIC.yml +9 -0
- data/vendor/board-maps/yaml/ESP8266_INVENT_ONE.yml +22 -0
- data/vendor/board-maps/yaml/ESP8266_NODEMCU_ESP12.yml +20 -0
- data/vendor/board-maps/yaml/ESP8266_NODEMCU_ESP12E.yml +20 -0
- data/vendor/board-maps/yaml/ESP8266_OAK.yml +9 -0
- data/vendor/board-maps/yaml/ESP8266_PHOENIX_V1.yml +9 -0
- data/vendor/board-maps/yaml/ESP8266_PHOENIX_V2.yml +9 -0
- data/vendor/board-maps/yaml/ESP8266_SCHIRMILABS_EDUINO_WIFI.yml +25 -0
- data/vendor/board-maps/yaml/ESP8266_SONOFF_BASIC.yml +9 -0
- data/vendor/board-maps/yaml/ESP8266_SONOFF_S20.yml +9 -0
- data/vendor/board-maps/yaml/ESP8266_SONOFF_SV.yml +9 -0
- data/vendor/board-maps/yaml/ESP8266_SONOFF_TH.yml +9 -0
- data/vendor/board-maps/yaml/ESP8266_THING.yml +9 -0
- data/vendor/board-maps/yaml/ESP8266_THING_DEV.yml +9 -0
- data/vendor/board-maps/yaml/ESP8266_WEMOS_D1MINI.yml +18 -0
- data/vendor/board-maps/yaml/ESP8266_WEMOS_D1MINILITE.yml +18 -0
- data/vendor/board-maps/yaml/ESP8266_WEMOS_D1MINIPRO.yml +18 -0
- data/vendor/board-maps/yaml/ESP8266_WEMOS_D1R1.yml +25 -0
- data/vendor/board-maps/yaml/ESP8266_WEMOS_D1WROOM02.yml +18 -0
- data/vendor/board-maps/yaml/ESP8266_WIO_LINK.yml +9 -0
- data/vendor/board-maps/yaml/ESP8266_XINABOX_CW01.yml +9 -0
- data/vendor/board-maps/yaml/ESPECTRO32.yml +36 -0
- data/vendor/board-maps/yaml/ESPea32.yml +36 -0
- data/vendor/board-maps/yaml/ESPino32.yml +36 -0
- data/vendor/board-maps/yaml/ET-Board.yml +26 -0
- data/vendor/board-maps/yaml/EVN_ALPHA.yml +48 -0
- data/vendor/board-maps/yaml/EXTREMEELEXTRONICS_RC2040.yml +46 -0
- data/vendor/board-maps/yaml/Edgebox-ESP-100.yml +7 -0
- data/vendor/board-maps/yaml/FEATHERS2.yml +43 -0
- data/vendor/board-maps/yaml/FEATHERS2NEO.yml +31 -0
- data/vendor/board-maps/yaml/FEATHERS3.yml +32 -0
- data/vendor/board-maps/yaml/FEATHERS3NEO.yml +32 -0
- data/vendor/board-maps/yaml/FEATHER_ESP32.yml +32 -0
- data/vendor/board-maps/yaml/FLYBOARD2040_CORE.yml +48 -0
- data/vendor/board-maps/yaml/FRANZININHO_WIFI.yml +43 -0
- data/vendor/board-maps/yaml/FRANZININHO_WIFI_MSC.yml +43 -0
- data/vendor/board-maps/yaml/FROG_ESP32.yml +35 -0
- data/vendor/board-maps/yaml/FUNHOUSE_ESP32S2.yml +22 -0
- data/vendor/board-maps/yaml/GEEKBLE_ESP32C3.yml +14 -0
- data/vendor/board-maps/yaml/GEN4_IOD.yml +9 -0
- data/vendor/board-maps/yaml/GENERIC_RP2040.yml +48 -0
- data/vendor/board-maps/yaml/HEALTHYPI_4.yml +36 -0
- data/vendor/board-maps/yaml/HELTEC_CAPSULE_SENSOR_V3.yml +43 -0
- data/vendor/board-maps/yaml/HELTEC_WIFI_LORA_32_V3.yml +42 -0
- data/vendor/board-maps/yaml/HELTEC_WIRELESS_BRIDGE.yml +8 -0
- data/vendor/board-maps/yaml/HELTEC_WIRELESS_MINI_SHELL.yml +13 -0
- data/vendor/board-maps/yaml/HELTEC_WIRELESS_PAPER.yml +42 -0
- data/vendor/board-maps/yaml/HELTEC_WIRELESS_SHELL_V3.yml +42 -0
- data/vendor/board-maps/yaml/HELTEC_WIRELESS_STICK_LITE_V3.yml +30 -0
- data/vendor/board-maps/yaml/HELTEC_WIRELESS_STICK_V3.yml +41 -0
- data/vendor/board-maps/yaml/HELTEC_WIRELESS_TRACKER.yml +41 -0
- data/vendor/board-maps/yaml/HONEYLEMON.yml +36 -0
- data/vendor/board-maps/yaml/HORNBILL_ESP32_DEV.yml +36 -0
- data/vendor/board-maps/yaml/HORNBILL_ESP32_MINIMA.yml +19 -0
- data/vendor/board-maps/yaml/HT_DE01.yml +42 -0
- data/vendor/board-maps/yaml/ILABS_2040_RPICO32_RP2040.yml +47 -0
- data/vendor/board-maps/yaml/IMBRIOS_LOGSENS_V1P1.yml +23 -0
- data/vendor/board-maps/yaml/INTOROBOT_ESP32_DEV.yml +34 -0
- data/vendor/board-maps/yaml/IOXESP32.yml +36 -0
- data/vendor/board-maps/yaml/IOXESP32PS.yml +36 -0
- data/vendor/board-maps/yaml/LILYGO_T3S3_LR1121.yml +9 -0
- data/vendor/board-maps/yaml/LILYGO_T3S3_SX1262.yml +9 -0
- data/vendor/board-maps/yaml/LILYGO_T3S3_SX1276.yml +9 -0
- data/vendor/board-maps/yaml/LILYGO_T3S3_SX1278.yml +9 -0
- data/vendor/board-maps/yaml/LILYGO_T3S3_SX1280.yml +9 -0
- data/vendor/board-maps/yaml/LILYGO_T3S3_SX1280PA.yml +8 -0
- data/vendor/board-maps/yaml/LILYGO_T_DISPLAY.yml +35 -0
- data/vendor/board-maps/yaml/LILYGO_T_DISPLAY_S3.yml +32 -0
- data/vendor/board-maps/yaml/LILYGO_T_ETH_LITE.yml +21 -0
- data/vendor/board-maps/yaml/LIONBITS3_DEV.yml +34 -0
- data/vendor/board-maps/yaml/LOLIN32.yml +36 -0
- data/vendor/board-maps/yaml/LOLIN32_LITE.yml +36 -0
- data/vendor/board-maps/yaml/LOLIN_C3_MINI.yml +14 -0
- data/vendor/board-maps/yaml/LOLIN_C3_PICO.yml +14 -0
- data/vendor/board-maps/yaml/LOLIN_D32.yml +36 -0
- data/vendor/board-maps/yaml/LOLIN_D32_PRO.yml +36 -0
- data/vendor/board-maps/yaml/LOLIN_S2_MINI.yml +44 -0
- data/vendor/board-maps/yaml/LOLIN_S2_PICO.yml +44 -0
- data/vendor/board-maps/yaml/LOLIN_S3.yml +40 -0
- data/vendor/board-maps/yaml/LOLIN_S3_MINI.yml +40 -0
- data/vendor/board-maps/yaml/LOLIN_S3_MINI_PRO.yml +40 -0
- data/vendor/board-maps/yaml/LOLIN_S3_PRO.yml +40 -0
- data/vendor/board-maps/yaml/Lion_Bit_Dev_Board.yml +16 -0
- data/vendor/board-maps/yaml/LoPy.yml +38 -0
- data/vendor/board-maps/yaml/LoPy4.yml +38 -0
- data/vendor/board-maps/yaml/M5STACK_CAPSULE.yml +8 -0
- data/vendor/board-maps/yaml/M5STACK_CARDPUTER.yml +8 -0
- data/vendor/board-maps/yaml/M5STACK_CORE.yml +10 -0
- data/vendor/board-maps/yaml/M5STACK_CORES3.yml +8 -0
- data/vendor/board-maps/yaml/M5STACK_Core2.yml +9 -0
- data/vendor/board-maps/yaml/M5STACK_DIAL.yml +8 -0
- data/vendor/board-maps/yaml/M5STACK_FIRE.yml +9 -0
- data/vendor/board-maps/yaml/M5STACK_NANOC6.yml +17 -0
- data/vendor/board-maps/yaml/M5STACK_PAPER.yml +9 -0
- data/vendor/board-maps/yaml/M5STACK_POE_CAM.yml +5 -0
- data/vendor/board-maps/yaml/M5STACK_STAMP_C3.yml +13 -0
- data/vendor/board-maps/yaml/M5STACK_STAMP_PICO.yml +7 -0
- data/vendor/board-maps/yaml/M5STACK_STAMP_S3.yml +4 -0
- data/vendor/board-maps/yaml/M5STACK_STICKC.yml +9 -0
- data/vendor/board-maps/yaml/M5STACK_STICKC_PLUS.yml +9 -0
- data/vendor/board-maps/yaml/M5STACK_STICKC_PLUS2.yml +9 -0
- data/vendor/board-maps/yaml/M5STACK_TIMER_CAM.yml +10 -0
- data/vendor/board-maps/yaml/M5STACK_TOUGH.yml +9 -0
- data/vendor/board-maps/yaml/M5STACK_UNIT_CAM.yml +10 -0
- data/vendor/board-maps/yaml/M5STACK_UNIT_CAMS3.yml +4 -0
- data/vendor/board-maps/yaml/M5Stack_ATOM.yml +9 -0
- data/vendor/board-maps/yaml/M5Stack_ATOMS3.yml +7 -0
- data/vendor/board-maps/yaml/M5Stack_CoreInk.yml +9 -0
- data/vendor/board-maps/yaml/M5Stack_Station.yml +10 -0
- data/vendor/board-maps/yaml/MAGTAG29_ESP32S2.yml +31 -0
- data/vendor/board-maps/yaml/MAKERGO_C3_SUPERMINI.yml +14 -0
- data/vendor/board-maps/yaml/MARBLE_PICO.yml +48 -0
- data/vendor/board-maps/yaml/MELOPERO_COOKIE_RP2040.yml +48 -0
- data/vendor/board-maps/yaml/MELOPERO_SHAKE_RP2040.yml +48 -0
- data/vendor/board-maps/yaml/METEHOCA_AKANA_R1.yml +46 -0
- data/vendor/board-maps/yaml/METRO_ESP32S2.yml +44 -0
- data/vendor/board-maps/yaml/METRO_ESP32S3.yml +42 -0
- data/vendor/board-maps/yaml/MGBOT_IOTIK32A.yml +36 -0
- data/vendor/board-maps/yaml/MGBOT_IOTIK32B.yml +36 -0
- data/vendor/board-maps/yaml/MH_ET_LIVE_ESP32DEVKIT.yml +36 -0
- data/vendor/board-maps/yaml/MH_ET_LIVE_ESP32MINIKIT.yml +36 -0
- data/vendor/board-maps/yaml/MICROS2.yml +44 -0
- data/vendor/board-maps/yaml/MINIMA.yml +15 -0
- data/vendor/board-maps/yaml/MOD_WIFI_ESP8266.yml +9 -0
- data/vendor/board-maps/yaml/Metro.yml +8 -0
- data/vendor/board-maps/yaml/NAMINO_ARANCIO.yml +3 -0
- data/vendor/board-maps/yaml/NAMINO_BIANCO.yml +13 -0
- data/vendor/board-maps/yaml/NAMINO_ROSSO.yml +3 -0
- data/vendor/board-maps/yaml/NANO32.yml +36 -0
- data/vendor/board-maps/yaml/NANOS3.yml +25 -0
- data/vendor/board-maps/yaml/NANO_ESP32.yml +18 -0
- data/vendor/board-maps/yaml/NANO_RP2040_CONNECT.yml +35 -0
- data/vendor/board-maps/yaml/NEBULAS3.yml +32 -0
- data/vendor/board-maps/yaml/NEKOSYSTEMS_BL2040_MINI.yml +48 -0
- data/vendor/board-maps/yaml/NEWSAN_ARCHI.yml +48 -0
- data/vendor/board-maps/yaml/NOLOGO_ESP32C3_SUPER_MINI.yml +14 -0
- data/vendor/board-maps/yaml/NOLOGO_ESP32S3_PICO.yml +12 -0
- data/vendor/board-maps/yaml/NULLBITS_BIT_C_PRO.yml +48 -0
- data/vendor/board-maps/yaml/Node32s.yml +36 -0
- data/vendor/board-maps/yaml/NodeMCU_32S.yml +36 -0
- data/vendor/board-maps/yaml/ODROID_ESP32.yml +10 -0
- data/vendor/board-maps/yaml/OLIMEX_RP2040_PICO30_16MB.yml +48 -0
- data/vendor/board-maps/yaml/OLIMEX_RP2040_PICO30_2MB.yml +48 -0
- data/vendor/board-maps/yaml/ONEHORSE_ESP32_DEV.yml +34 -0
- data/vendor/board-maps/yaml/OPTA_ANALOG.yml +7 -0
- data/vendor/board-maps/yaml/OPTA_DIGITAL.yml +5 -0
- data/vendor/board-maps/yaml/OROCA_EDUBOT.yml +33 -0
- data/vendor/board-maps/yaml/PIMORONI_PGA2040.yml +48 -0
- data/vendor/board-maps/yaml/PIMORONI_PLASMA2040.yml +29 -0
- data/vendor/board-maps/yaml/PIMORONI_TINY2040.yml +44 -0
- data/vendor/board-maps/yaml/PINTRONIX_PINMAX.yml +42 -0
- data/vendor/board-maps/yaml/PORTENTA_C33.yml +28 -0
- data/vendor/board-maps/yaml/PROS3.yml +33 -0
- data/vendor/board-maps/yaml/PYCOM_GPY.yml +38 -0
- data/vendor/board-maps/yaml/Piranha.yml +22 -0
- data/vendor/board-maps/yaml/Pocket32.yml +36 -0
- data/vendor/board-maps/yaml/QUALIA_S3_RGB666.yml +15 -0
- data/vendor/board-maps/yaml/QUANTUM.yml +35 -0
- data/vendor/board-maps/yaml/RAKWIRELESS_RAK11300.yml +47 -0
- data/vendor/board-maps/yaml/RASPBERRY_PI_PICO.yml +48 -0
- data/vendor/board-maps/yaml/RASPBERRY_PI_PICO_W.yml +48 -0
- data/vendor/board-maps/yaml/REDPILL_ESP32S3.yml +41 -0
- data/vendor/board-maps/yaml/REDSCORP_RP2040_EINS.yml +35 -0
- data/vendor/board-maps/yaml/REDSCORP_RP2040_PROMINI.yml +35 -0
- data/vendor/board-maps/yaml/SAMD_CIRCUITPLAYGROUND_EXPRESS.yml +11 -0
- data/vendor/board-maps/yaml/SAMD_MKR1000.yml +20 -0
- data/vendor/board-maps/yaml/SAMD_MKRFox1200.yml +19 -0
- data/vendor/board-maps/yaml/SAMD_MKRGSM1400.yml +15 -0
- data/vendor/board-maps/yaml/SAMD_MKRNB1500.yml +15 -0
- data/vendor/board-maps/yaml/SAMD_MKRVIDOR4000.yml +19 -0
- data/vendor/board-maps/yaml/SAMD_MKRWAN1300.yml +18 -0
- data/vendor/board-maps/yaml/SAMD_MKRWAN1310.yml +18 -0
- data/vendor/board-maps/yaml/SAMD_MKRWIFI1010.yml +19 -0
- data/vendor/board-maps/yaml/SAMD_MKRZERO.yml +19 -0
- data/vendor/board-maps/yaml/SAMD_NANO_33_IOT.yml +13 -0
- data/vendor/board-maps/yaml/SAMD_TIAN.yml +15 -0
- data/vendor/board-maps/yaml/SAMD_ZERO.yml +14 -0
- data/vendor/board-maps/yaml/SAM_DUE.yml +28 -0
- data/vendor/board-maps/yaml/SAM_ZERO.yml +15 -0
- data/vendor/board-maps/yaml/SEA_PICRO.yml +48 -0
- data/vendor/board-maps/yaml/SEEED_INDICATOR_RP2040.yml +47 -0
- data/vendor/board-maps/yaml/SEEED_XIAO_RP2040.yml +29 -0
- data/vendor/board-maps/yaml/SENSEBOX_MCU_ESP32S2.yml +12 -0
- data/vendor/board-maps/yaml/SILICOGNITION_RP2040_SHIM.yml +30 -0
- data/vendor/board-maps/yaml/SOLDERPARTY_RP2040_STAMP.yml +48 -0
- data/vendor/board-maps/yaml/SONOFF_DUALR3.yml +35 -0
- data/vendor/board-maps/yaml/SPARKFUN_MICROMOD_RP2040.yml +48 -0
- data/vendor/board-maps/yaml/SPARKFUN_PROMICRO_RP2040.yml +48 -0
- data/vendor/board-maps/yaml/SPARKFUN_PRO_MICRO_ESP32C3.yml +24 -0
- data/vendor/board-maps/yaml/SPARKFUN_THINGPLUS_RP2040.yml +48 -0
- data/vendor/board-maps/yaml/TAMC_TERMOD_S3.yml +41 -0
- data/vendor/board-maps/yaml/TBEAM_USE_RADIO_SX1262.yml +28 -0
- data/vendor/board-maps/yaml/TBEAM_USE_RADIO_SX1268.yml +28 -0
- data/vendor/board-maps/yaml/TBEAM_USE_RADIO_SX1276.yml +28 -0
- data/vendor/board-maps/yaml/TBEAM_USE_RADIO_SX1278.yml +28 -0
- data/vendor/board-maps/yaml/TBEAM_USE_RADIO_SX1280.yml +28 -0
- data/vendor/board-maps/yaml/TBeam.yml +28 -0
- data/vendor/board-maps/yaml/THINGPULSE_EPULSE_FEATHER.yml +31 -0
- data/vendor/board-maps/yaml/THINGPULSE_EPULSE_FEATHER_C6.yml +15 -0
- data/vendor/board-maps/yaml/TINYC6.yml +25 -0
- data/vendor/board-maps/yaml/TINYPICO.yml +35 -0
- data/vendor/board-maps/yaml/TINYS2.yml +43 -0
- data/vendor/board-maps/yaml/TINYS3.yml +25 -0
- data/vendor/board-maps/yaml/TTGO-T-OI-PLUS_DEV.yml +11 -0
- data/vendor/board-maps/yaml/TTGO_LoRa32_V1.yml +38 -0
- data/vendor/board-maps/yaml/TTGO_LoRa32_V2.yml +38 -0
- data/vendor/board-maps/yaml/TTGO_LoRa32_v21new.yml +38 -0
- data/vendor/board-maps/yaml/TTGO_T1.yml +36 -0
- data/vendor/board-maps/yaml/TTGO_T7_V13_Mini32.yml +36 -0
- data/vendor/board-maps/yaml/TTGO_T7_V14_Mini32.yml +36 -0
- data/vendor/board-maps/yaml/TWATCH_2020_V1.yml +9 -0
- data/vendor/board-maps/yaml/TWATCH_2020_V2.yml +9 -0
- data/vendor/board-maps/yaml/TWATCH_2020_V3.yml +9 -0
- data/vendor/board-maps/yaml/TWATCH_BASE.yml +9 -0
- data/vendor/board-maps/yaml/TWatch.yml +9 -0
- data/vendor/board-maps/yaml/Trueverit_ESP32_Universal_IoT_Driver.yml +18 -0
- data/vendor/board-maps/yaml/Trueverit_ESP32_Universal_IoT_Driver_MK_II.yml +18 -0
- data/vendor/board-maps/yaml/UBLOX_NINA_W10.yml +57 -0
- data/vendor/board-maps/yaml/UBLOX_NORA_W10.yml +43 -0
- data/vendor/board-maps/yaml/UNOWIFIR4.yml +17 -0
- data/vendor/board-maps/yaml/UPESY_EDU_ESP32.yml +28 -0
- data/vendor/board-maps/yaml/UPESY_ESP32C3_BASIC.yml +13 -0
- data/vendor/board-maps/yaml/UPESY_ESP32C3_MINI.yml +12 -0
- data/vendor/board-maps/yaml/UPESY_ESP32S3_BASIC.yml +42 -0
- data/vendor/board-maps/yaml/UPESY_RP2040_DEVKIT.yml +48 -0
- data/vendor/board-maps/yaml/VALTRACK_V4_MFW_ESP32_C3.yml +23 -0
- data/vendor/board-maps/yaml/VALTRACK_V4_VTS_ESP32_C3.yml +23 -0
- data/vendor/board-maps/yaml/VIRALINK_GATE32_01.yml +6 -0
- data/vendor/board-maps/yaml/VIRALINK_GATE32_11.yml +7 -0
- data/vendor/board-maps/yaml/VIYALAB_MIZU_RP2040.yml +48 -0
- data/vendor/board-maps/yaml/WATCHY.yml +7 -0
- data/vendor/board-maps/yaml/WATCHY_V10.yml +7 -0
- data/vendor/board-maps/yaml/WATCHY_V15.yml +7 -0
- data/vendor/board-maps/yaml/WATCHY_V20.yml +7 -0
- data/vendor/board-maps/yaml/WAVESHARE_ESP32S3_TOUCH_LCD_128.yml +8 -0
- data/vendor/board-maps/yaml/WAVESHARE_RP2040_LCD_0_96.yml +47 -0
- data/vendor/board-maps/yaml/WAVESHARE_RP2040_LCD_1_28.yml +47 -0
- data/vendor/board-maps/yaml/WAVESHARE_RP2040_MATRIX.yml +48 -0
- data/vendor/board-maps/yaml/WAVESHARE_RP2040_ONE.yml +48 -0
- data/vendor/board-maps/yaml/WAVESHARE_RP2040_PIZERO.yml +47 -0
- data/vendor/board-maps/yaml/WAVESHARE_RP2040_PLUS.yml +48 -0
- data/vendor/board-maps/yaml/WAVESHARE_RP2040_ZERO.yml +48 -0
- data/vendor/board-maps/yaml/WEACT_STUDIO_ESP32C3.yml +14 -0
- data/vendor/board-maps/yaml/WESP32.yml +17 -0
- data/vendor/board-maps/yaml/WIDORA_AIR.yml +34 -0
- data/vendor/board-maps/yaml/WIFIDUINO_ESP8266.yml +23 -0
- data/vendor/board-maps/yaml/WIFINFO.yml +20 -0
- data/vendor/board-maps/yaml/WIPY3.yml +38 -0
- data/vendor/board-maps/yaml/WIZNET_5100S_EVB_PICO.yml +48 -0
- data/vendor/board-maps/yaml/WIZNET_5500_EVB_PICO.yml +48 -0
- data/vendor/board-maps/yaml/WIZNET_WIZFI360_EVB_PICO.yml +48 -0
- data/vendor/board-maps/yaml/WT32_ETH01.yml +8 -0
- data/vendor/board-maps/yaml/WT32_SC01_PLUS.yml +7 -0
- data/vendor/board-maps/yaml/WiFiduino32S3.yml +27 -0
- data/vendor/board-maps/yaml/WiFiduinoV2.yml +28 -0
- data/vendor/board-maps/yaml/Wifiduino32.yml +40 -0
- data/vendor/board-maps/yaml/XIAO_ESP32C3.yml +21 -0
- data/vendor/board-maps/yaml/XIAO_ESP32C6.yml +22 -0
- data/vendor/board-maps/yaml/XIAO_ESP32S3.yml +37 -0
- data/vendor/board-maps/yaml/YD_RP2040.yml +48 -0
- data/vendor/board-maps/yaml/atmegazero_esp32s2.yml +30 -0
- data/vendor/board-maps/yaml/connaxio_espoir.yml +24 -0
- data/vendor/board-maps/yaml/esp32vn_iot_uno.yml +31 -0
- data/vendor/board-maps/yaml/fm_devkit.yml +15 -0
- data/vendor/board-maps/yaml/heltec_wifi_kit_32.yml +38 -0
- data/vendor/board-maps/yaml/heltec_wifi_kit_32_V3.yml +42 -0
- data/vendor/board-maps/yaml/heltec_wifi_lora_32.yml +36 -0
- data/vendor/board-maps/yaml/heltec_wifi_lora_32_V2.yml +36 -0
- data/vendor/board-maps/yaml/heltec_wireless_stick.yml +36 -0
- data/vendor/board-maps/yaml/heltec_wireless_stick_LITE.yml +36 -0
- data/vendor/board-maps/yaml/openkb.yml +37 -0
- data/vendor/board-maps/yaml/roboheart_hercules.yml +26 -0
- data/vendor/board-maps/yaml/sensesiot_weizen.yml +35 -0
- data/vendor/board-maps/yaml/uPesy_WROOM.yml +36 -0
- data/vendor/board-maps/yaml/uPesy_WROVER.yml +36 -0
- data/vendor/board-maps/yaml/unphone8.yml +42 -0
- data/vendor/board-maps/yaml/unphone9.yml +50 -0
- data/vendor/board-maps/yaml/wifi_kit_8.yml +15 -0
- metadata +541 -22
- data/examples/led/apa102_breathe.rb +0 -45
- data/examples/pulse_io/ir_transmitter.rb +0 -55
- data/examples/spi/ssd_through_register.rb +0 -40
- data/examples/uart/bit_bang_read.rb +0 -16
- data/examples/uart/bit_bang_write.rb +0 -16
- data/lib/denko/analog_io/sensor.rb +0 -6
- data/lib/denko/sensor/virtual.rb +0 -42
- data/src/lib/DenkoIROutESP.cpp +0 -26
@@ -4,31 +4,37 @@
|
|
4
4
|
# For this example, board1 (direct) is an Arduino Mega. board2 (passthrough) is an Uno,
|
5
5
|
# running Denko, with its UART pins (0, 1) connected to the Mega's UART1 pins (18, 19)
|
6
6
|
#
|
7
|
-
# This isn't 100% reliable. The Rx buffer on the direct board is periodically read,
|
8
|
-
#
|
9
|
-
#
|
7
|
+
# This isn't 100% reliable. The Rx buffer on the direct board is periodically read, instead
|
8
|
+
# of using an interrupt. It can potentially overflow, causing data from the passthrough board
|
9
|
+
# to be lost. If flow control data is lost, the connection will halt.
|
10
10
|
#
|
11
11
|
# Use at your own risk, but for the best possible performance:
|
12
|
-
# 1) Avoid long running commands on the direct board (eg. IR
|
13
|
-
# These block the CPU enough that the Rx buffer
|
14
|
-
# 2) Use the lowest practical baud rate on the passthrough board
|
15
|
-
#
|
12
|
+
# 1) Avoid long running commands on the direct board (eg. IR output, WS2812 etc.).
|
13
|
+
# These block the CPU enough that the Rx buffer may not be read in time to avoid overflow.
|
14
|
+
# 2) Use the lowest practical baud rate on the passthrough board, so the direct board's Rx
|
15
|
+
# buffer takes as long as possible to fill, reducing the chance of data loss.
|
16
16
|
#
|
17
17
|
require 'bundler/setup'
|
18
18
|
require 'denko'
|
19
19
|
|
20
20
|
board1 = Denko::Board.new(Denko::Connection::Serial.new)
|
21
21
|
|
22
|
-
uart
|
23
|
-
board2 = Denko::Board.new(Denko::Connection::BoardUART.new(uart, baud:
|
22
|
+
uart = Denko::UART::Hardware.new(board: board1, index: 1)
|
23
|
+
board2 = Denko::Board.new(Denko::Connection::BoardUART.new(uart, baud: 115200))
|
24
24
|
|
25
25
|
led1 = Denko::LED.new(board: board1, pin: 13)
|
26
|
-
led1.blink(0.
|
26
|
+
led1.blink(0.5)
|
27
27
|
|
28
28
|
led2 = Denko::LED.new(board: board2, pin: 13)
|
29
|
-
led2.blink(0.
|
29
|
+
led2.blink(0.5)
|
30
30
|
|
31
|
-
|
32
|
-
|
31
|
+
input = Denko::AnalogIO::Input.new(board: board2, pin: :A0)
|
32
|
+
input.smoothing = true
|
33
|
+
input.smoothing_size = 10
|
34
|
+
# Show input value only if it differs from previous state.
|
35
|
+
input.add_callback do |value|
|
36
|
+
puts "A0 value: #{value}" if value != input.state
|
37
|
+
end
|
38
|
+
input.listen(16)
|
33
39
|
|
34
40
|
sleep
|
@@ -0,0 +1,127 @@
|
|
1
|
+
module Denko
|
2
|
+
module AnalogIO
|
3
|
+
class ADS1100
|
4
|
+
include Behaviors::Lifecycle
|
5
|
+
include I2C::Peripheral
|
6
|
+
include Behaviors::Poller
|
7
|
+
include InputHelper
|
8
|
+
|
9
|
+
I2C_ADDRESS = 0x48
|
10
|
+
I2C_FREQUENCY = 400_000
|
11
|
+
|
12
|
+
# Convert sample rates in samples-per-seconds to their bit representation.
|
13
|
+
SAMPLE_RATES = [ # Bitmask
|
14
|
+
128, # 0b00
|
15
|
+
32, # 0b01
|
16
|
+
16, # 0b10
|
17
|
+
8 # 0b11 (default)
|
18
|
+
]
|
19
|
+
|
20
|
+
# Faster sampling rates have lower resolution.
|
21
|
+
BIT_RANGES = [ # Bitmask Bits SPS
|
22
|
+
4_096, # 0b00 12 128
|
23
|
+
16_383, # 0b01 14 32
|
24
|
+
32_767, # 0b10 15 16
|
25
|
+
65_535, # 0b11 16 8
|
26
|
+
]
|
27
|
+
|
28
|
+
# Wait times need to be slightly longer than the actual sample times.
|
29
|
+
WAIT_TIMES = SAMPLE_RATES.map { |rate| (1 / rate.to_f) + 0.0005 }
|
30
|
+
|
31
|
+
GAINS = [ # Bitmask Full scale voltage
|
32
|
+
1, # 0b00 Vdd
|
33
|
+
2, # 0b01 Vdd / 2
|
34
|
+
4, # 0b10 Vdd / 4
|
35
|
+
8, # 0b11 Vdd / 8
|
36
|
+
]
|
37
|
+
|
38
|
+
# Default config register:
|
39
|
+
# Bit 7 : Start conversion (write 1) | Conversion in progress (read 1)
|
40
|
+
# Bit 6-5 : Reserved, must be 00
|
41
|
+
# Bit 4 : Conversion mode. 0 = continuous (datasheet default). 1 = single (our default).
|
42
|
+
# Bit 3-2 : Sample Rate (see array above)
|
43
|
+
# Bit 1-2 : PGA setting (see array above)
|
44
|
+
CONFIG_STARTUP = 0b00011100
|
45
|
+
|
46
|
+
# Masks
|
47
|
+
GAIN_CLEAR = 0b11111100
|
48
|
+
SAMPLE_RATE_CLEAR = 0b11110011
|
49
|
+
|
50
|
+
after_initialize do
|
51
|
+
# Validate user gave full scale voltage.
|
52
|
+
raise ArgumentError "full-scale voltage not a Numeric or not given for ADS1100" unless full_scale_voltage.is_a?(Numeric)
|
53
|
+
|
54
|
+
i2c_write(config_register)
|
55
|
+
sleep WAIT_TIMES[sample_rate_mask]
|
56
|
+
end
|
57
|
+
|
58
|
+
def _read
|
59
|
+
# Set bit 7 of the config register and write it to start conversion.
|
60
|
+
i2c_write(config_register | (1<<7))
|
61
|
+
|
62
|
+
# Sleep the right amount of time for conversion, based on sample rate bits.
|
63
|
+
sleep WAIT_TIMES[sample_rate_mask]
|
64
|
+
|
65
|
+
# Read the result, triggering callbacks.
|
66
|
+
i2c_read(2)
|
67
|
+
end
|
68
|
+
|
69
|
+
def listen(pin, divider=nil)
|
70
|
+
raise StandardError, "ADS1100 does not implement #listen. Use #read or #poll instead"
|
71
|
+
end
|
72
|
+
|
73
|
+
def pre_callback_filter(bytes)
|
74
|
+
# Readings are 16-bits, signed, big-endian.
|
75
|
+
value = bytes.pack("C*").unpack("s>")[0]
|
76
|
+
# Let InputHelper module handle smooothing.
|
77
|
+
super(value)
|
78
|
+
end
|
79
|
+
|
80
|
+
# Default to single conversion.
|
81
|
+
def config_register
|
82
|
+
@config_register ||= CONFIG_STARTUP
|
83
|
+
end
|
84
|
+
|
85
|
+
def sample_rate=(rate)
|
86
|
+
raise Argument Error "wrong sample_rate: #{sample_rate.inspect} given for ADS1100" unless SAMPLE_RATES.include?(rate)
|
87
|
+
@sample_rate_mask = SAMPLE_RATES.index(rate)
|
88
|
+
config_register = (config_register & SAMPLE_RATE_CLEAR) | (sample_rate_mask << 2)
|
89
|
+
@sample_rate = rate
|
90
|
+
end
|
91
|
+
|
92
|
+
def sample_rate_mask
|
93
|
+
@sample_rate_mask ||= SAMPLE_RATES.index(sample_rate)
|
94
|
+
end
|
95
|
+
|
96
|
+
def sample_rate
|
97
|
+
@sample_rate ||= params[:sample_rate] || 8
|
98
|
+
end
|
99
|
+
|
100
|
+
attr_writer :sample_rate_mask
|
101
|
+
|
102
|
+
def gain=(gain)
|
103
|
+
raise ArgumentError "wrong gain: #{gain.inspect} given for ADS1100" unless GAINS.include?(gain)
|
104
|
+
@gain_mask = GAINS.index(gain)
|
105
|
+
config_register = (config_register & GAIN_CLEAR) | gain_mask
|
106
|
+
@gain = gain
|
107
|
+
end
|
108
|
+
|
109
|
+
def gain_mask
|
110
|
+
@gain_mask ||= GAINS.index(gain)
|
111
|
+
end
|
112
|
+
|
113
|
+
def gain
|
114
|
+
@gain ||= params[:gain] || 1
|
115
|
+
end
|
116
|
+
|
117
|
+
# Unlike some ADS parts, full-scale voltage depends on supply (Vdd). User must specify.
|
118
|
+
def full_scale_voltage
|
119
|
+
@full_scale_voltage ||= params[:full_scale_voltage]
|
120
|
+
end
|
121
|
+
|
122
|
+
def volts_per_bit
|
123
|
+
full_scale_voltage / (GAINS[gain_mask] * BIT_RANGES[sample_rate_mask]).to_f
|
124
|
+
end
|
125
|
+
end
|
126
|
+
end
|
127
|
+
end
|
@@ -1,9 +1,13 @@
|
|
1
1
|
module Denko
|
2
2
|
module AnalogIO
|
3
3
|
class ADS1115
|
4
|
+
include Behaviors::Lifecycle
|
4
5
|
include I2C::Peripheral
|
5
6
|
include ADS111X
|
6
7
|
|
8
|
+
I2C_ADDRESS = 0x48
|
9
|
+
I2C_FREQUENCY = 400_000
|
10
|
+
|
7
11
|
# Config register values on startup. MSB-first.
|
8
12
|
# Matches datasheet, except MSB bit 7 unset to avoid conversion start.
|
9
13
|
# Same as: [0x05, 0x83] or [5, 131]
|
@@ -19,42 +23,21 @@ module Denko
|
|
19
23
|
CONFIG_ADDRESS = 0b01
|
20
24
|
CONVERSION_ADDRESS = 0b00
|
21
25
|
|
22
|
-
|
23
|
-
@i2c_address = 0x48
|
24
|
-
@i2c_frequency = 400_000
|
25
|
-
super(options)
|
26
|
-
end
|
27
|
-
|
28
|
-
def after_initialize(options={})
|
29
|
-
super(options)
|
30
|
-
|
31
|
-
# Mutex and variables for BoardProxy behavior.
|
32
|
-
@mutex = Mutex.new
|
33
|
-
@active_pin = nil
|
34
|
-
@active_gain = nil
|
35
|
-
|
26
|
+
after_initialize do
|
36
27
|
# Set register bytes to default and write to device.
|
37
|
-
|
38
|
-
i2c_write [CONFIG_ADDRESS] + @config_register
|
39
|
-
|
40
|
-
# Enable BoardProxy callbacks.
|
28
|
+
i2c_write [CONFIG_ADDRESS] + config_register
|
41
29
|
enable_proxy
|
42
30
|
end
|
43
31
|
|
44
32
|
def _read(config)
|
45
33
|
# Write config register to start reading.
|
46
34
|
i2c_write [CONFIG_ADDRESS] + config
|
47
|
-
|
35
|
+
|
48
36
|
# Sleep the right amount of time for conversion, based on sample rate bits.
|
49
37
|
sleep WAIT_TIMES[config[1] >> 5]
|
50
38
|
|
51
39
|
# Read the result, triggering callbacks.
|
52
|
-
i2c_read(
|
53
|
-
end
|
54
|
-
|
55
|
-
# Readings are 2 bytes big-endian.
|
56
|
-
def pre_callback_filter(bytes)
|
57
|
-
bytes.pack("C*").unpack("s>")[0]
|
40
|
+
i2c_read(2, register: CONVERSION_ADDRESS)
|
58
41
|
end
|
59
42
|
end
|
60
43
|
end
|
@@ -1,7 +1,8 @@
|
|
1
1
|
module Denko
|
2
2
|
module AnalogIO
|
3
3
|
class ADS1118
|
4
|
-
include SPI::Peripheral
|
4
|
+
include SPI::Peripheral::SinglePin
|
5
|
+
include Behaviors::Lifecycle
|
5
6
|
include ADS111X
|
6
7
|
|
7
8
|
# Config register values on startup. MSB-first.
|
@@ -15,29 +16,19 @@ module Denko
|
|
15
16
|
BASE_MSB = 0b10000001
|
16
17
|
BASE_LSB = 0b00001010
|
17
18
|
|
18
|
-
def
|
19
|
-
|
20
|
-
|
21
|
-
# SPI mode 1 recommended.
|
22
|
-
@spi_mode = options[:spi_mode] || 1
|
23
|
-
|
24
|
-
# Mutex and variables for BoardProxy behavior.
|
25
|
-
@mutex = Mutex.new
|
26
|
-
@active_pin = nil
|
27
|
-
@active_gain = nil
|
28
|
-
|
29
|
-
# Set register bytes to default and write to device.
|
30
|
-
@config_register = CONFIG_STARTUP.dup
|
31
|
-
spi_write(@config_register)
|
19
|
+
def spi_mode
|
20
|
+
@spi_mode ||= params[:spi_mode] || 1
|
21
|
+
end
|
32
22
|
|
33
|
-
|
23
|
+
after_initialize do
|
24
|
+
spi_write(config_register)
|
34
25
|
enable_proxy
|
35
26
|
end
|
36
27
|
|
37
28
|
def _read(config)
|
38
29
|
# Write config register to start reading.
|
39
30
|
spi_write(config)
|
40
|
-
|
31
|
+
|
41
32
|
# Sleep the right amount of time for conversion, based on sample rate bits.
|
42
33
|
sleep WAIT_TIMES[config[1] >> 5]
|
43
34
|
|
@@ -45,22 +36,16 @@ module Denko
|
|
45
36
|
spi_read(2)
|
46
37
|
end
|
47
38
|
|
48
|
-
# Pack the 2 bytes back into a string, then unpack as big-endian signed int16.
|
49
|
-
def pre_callback_filter(message)
|
50
|
-
bytes = message.split(",").map { |b| b.to_i }
|
51
|
-
bytes.pack("C*").unpack("s>")[0]
|
52
|
-
end
|
53
|
-
|
54
39
|
def _temperature_read
|
55
40
|
# Wrap in mutex to not interfere with other reads.
|
56
|
-
|
41
|
+
mutex.synchronize do
|
57
42
|
_read([0b10000001, 0b10011011])
|
58
43
|
end
|
59
44
|
end
|
60
45
|
|
61
46
|
def temperature_read(&block)
|
62
47
|
reading = read_using -> { _temperature_read }
|
63
|
-
|
48
|
+
|
64
49
|
# Temperature is shifted 2 bits left, and is 0.03125 degrees C per bit.
|
65
50
|
temperature = (reading / 4) * 0.03125
|
66
51
|
|
@@ -5,6 +5,7 @@ module Denko
|
|
5
5
|
# Functionality shared among the ADS111X class of ADC converters.
|
6
6
|
#
|
7
7
|
include Behaviors::Reader
|
8
|
+
attr_accessor :config_register, :active_pin, :active_gain
|
8
9
|
|
9
10
|
PGA_SETTINGS = [ # Bitmask Full scale voltage
|
10
11
|
0.0001875, # 0b000 6.144 V
|
@@ -55,38 +56,43 @@ module Denko
|
|
55
56
|
def enable_proxy
|
56
57
|
self.add_callback(:board_proxy) do |value|
|
57
58
|
components.each do |component|
|
58
|
-
if
|
59
|
-
component.volts_per_bit = PGA_SETTINGS[
|
60
|
-
component.update(value)
|
59
|
+
if active_pin == component.pin
|
60
|
+
component.volts_per_bit = PGA_SETTINGS[active_gain]
|
61
|
+
component.update(value)
|
61
62
|
end
|
62
63
|
end
|
63
64
|
end
|
64
65
|
end
|
65
66
|
|
67
|
+
def pre_callback_filter(bytes)
|
68
|
+
# Pack the 2 bytes into a string, then unpack as big-endian int16.
|
69
|
+
value = bytes.pack("C*").unpack("s>")[0]
|
70
|
+
end
|
71
|
+
|
66
72
|
def analog_read(pin, negative_pin=nil, gain=nil, sample_rate=nil)
|
67
73
|
# Wrap in mutex so calls and callbacks are atomic.
|
68
|
-
|
74
|
+
mutex.synchronize do
|
69
75
|
# Default gain and sample rate.
|
70
76
|
gain ||= 0b010
|
71
77
|
sample_rate ||= 0b100
|
72
78
|
|
73
79
|
# Set these for callbacks.
|
74
|
-
|
75
|
-
|
80
|
+
self.active_pin = pin
|
81
|
+
self.active_gain = gain
|
76
82
|
|
77
83
|
# Set gain in upper config register.
|
78
84
|
raise ArgumentError "wrong gain: #{gain.inspect} given for ADS111X" unless PGA_RANGE.include?(gain)
|
79
|
-
|
85
|
+
config_register[0] = self.class::BASE_MSB | (gain << 1)
|
80
86
|
|
81
87
|
# Set mux bits in upper config register.
|
82
88
|
mux_bits = pins_to_mux_bits(pin, negative_pin)
|
83
|
-
|
89
|
+
config_register[0] = config_register[0] | (mux_bits << 4)
|
84
90
|
|
85
91
|
# Set sample rate in lower config_register.
|
86
|
-
raise ArgumentError "wrong sample_rate: #{sample_rate.inspect} given for ADS111X" unless SAMPLE_RATE_RANGE.include?(
|
87
|
-
|
92
|
+
raise ArgumentError "wrong sample_rate: #{sample_rate.inspect} given for ADS111X" unless SAMPLE_RATE_RANGE.include?(sample_rate)
|
93
|
+
config_register[1] = self.class::BASE_LSB | (sample_rate << 5)
|
88
94
|
|
89
|
-
read(
|
95
|
+
read(config_register)
|
90
96
|
end
|
91
97
|
end
|
92
98
|
|
@@ -118,6 +124,14 @@ module Denko
|
|
118
124
|
|
119
125
|
def stop_listener(pin)
|
120
126
|
end
|
127
|
+
|
128
|
+
def mutex
|
129
|
+
@mutex ||= Mutex.new
|
130
|
+
end
|
131
|
+
|
132
|
+
def config_register
|
133
|
+
@config_register ||= self.class::CONFIG_STARTUP.dup
|
134
|
+
end
|
121
135
|
end
|
122
136
|
end
|
123
137
|
end
|
@@ -2,77 +2,51 @@ module Denko
|
|
2
2
|
module AnalogIO
|
3
3
|
class Input
|
4
4
|
include Behaviors::InputPin
|
5
|
-
include Behaviors::Reader
|
6
5
|
include Behaviors::Poller
|
7
6
|
include Behaviors::Listener
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
7
|
+
include InputHelper
|
8
|
+
include Behaviors::Lifecycle
|
9
|
+
|
10
|
+
before_initialize do
|
11
|
+
# Allow giving ADC unit with multiple pins as a board proxy.
|
12
|
+
if params[:adc]
|
13
|
+
params[:board] = params[:adc]
|
14
|
+
params.delete(:adc)
|
15
|
+
end
|
13
16
|
end
|
14
17
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
@divider = 16
|
20
|
-
|
21
|
-
# If using a negative input on a supported ADC, store the pin.
|
22
|
-
@negative_pin = options[:negative_pin]
|
18
|
+
# Default 16ms listener for analog inputs connected to a Board.
|
19
|
+
def divider
|
20
|
+
@divider ||= params[:divider] || 16
|
21
|
+
end
|
23
22
|
|
24
|
-
|
25
|
-
|
23
|
+
# Negative input on ADCs that support it.
|
24
|
+
def negative_pin
|
25
|
+
@negative_pin ||= params[:negative_pin]
|
26
|
+
end
|
26
27
|
|
27
|
-
|
28
|
-
|
28
|
+
# PGA gain for ADCs that support it
|
29
|
+
def gain
|
30
|
+
@gain ||= params[:gain]
|
31
|
+
end
|
29
32
|
|
30
|
-
|
31
|
-
|
32
|
-
@
|
33
|
+
# Sample rates for ADCs that support it.
|
34
|
+
def sample_rate
|
35
|
+
@sample_rate ||= params[:sample_rate]
|
33
36
|
end
|
34
37
|
|
35
|
-
|
38
|
+
attr_writer :divider, :negative_pin, :gain, :sample_rate
|
36
39
|
|
37
|
-
# ADCs
|
40
|
+
# Allow ADCs to set this, so exact voltages can be calculated.
|
38
41
|
attr_accessor :volts_per_bit
|
39
42
|
|
40
43
|
def _read
|
41
44
|
board.analog_read(pin, negative_pin, gain, sample_rate)
|
42
45
|
end
|
43
46
|
|
44
|
-
def _listen(
|
45
|
-
|
46
|
-
board.analog_listen(pin,
|
47
|
-
end
|
48
|
-
|
49
|
-
# Attach a callback that only fires when state changes.
|
50
|
-
def on_change(&block)
|
51
|
-
add_callback(:on_change) do |new_state|
|
52
|
-
block.call(new_state) if new_state != self.state
|
53
|
-
end
|
54
|
-
end
|
55
|
-
|
56
|
-
#
|
57
|
-
# Smoothing features.
|
58
|
-
# Does a moving average of the last 8 readings.
|
59
|
-
#
|
60
|
-
attr_accessor :smoothing
|
61
|
-
|
62
|
-
def smooth_input(value)
|
63
|
-
# Add new value, but limit to the 8 latest values.
|
64
|
-
@smoothing_set << value
|
65
|
-
@smoothing_set.shift if @smoothing_set.length > 8
|
66
|
-
|
67
|
-
average = @smoothing_set.reduce(:+) / @smoothing_set.length.to_f
|
68
|
-
|
69
|
-
# Round up or down based on previous state to reduce fluctuations.
|
70
|
-
state && (state > average) ? average.ceil : average.floor
|
71
|
-
end
|
72
|
-
|
73
|
-
# Convert data to integer, or pass it through smoothing if enabled.
|
74
|
-
def pre_callback_filter(value)
|
75
|
-
smoothing ? smooth_input(value.to_i) : value.to_i
|
47
|
+
def _listen(div=nil)
|
48
|
+
self.divider = div if div
|
49
|
+
board.analog_listen(pin, divider)
|
76
50
|
end
|
77
51
|
end
|
78
52
|
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
module Denko
|
2
|
+
module AnalogIO
|
3
|
+
module InputHelper
|
4
|
+
#
|
5
|
+
# Smoothing features.
|
6
|
+
# Does a moving average of the last smoothing_size readings.
|
7
|
+
#
|
8
|
+
attr_accessor :smoothing, :smoothing_size
|
9
|
+
|
10
|
+
def smoothing_size
|
11
|
+
@smoothing_size ||= 8
|
12
|
+
end
|
13
|
+
|
14
|
+
def smoothing_set
|
15
|
+
@smoothing_set ||= []
|
16
|
+
end
|
17
|
+
|
18
|
+
def smooth_input(value)
|
19
|
+
# Add new value, but limit to the 8 latest values.
|
20
|
+
smoothing_set << value
|
21
|
+
smoothing_set.shift while (smoothing_set.length > smoothing_size)
|
22
|
+
|
23
|
+
average = smoothing_set.reduce(:+) / smoothing_set.length.to_f
|
24
|
+
|
25
|
+
# Round up or down based on previous state to reduce fluctuations.
|
26
|
+
state && (state > average) ? average.ceil : average.floor
|
27
|
+
end
|
28
|
+
|
29
|
+
# Handle smoothing if enabled. Call super(value) after conversion in subclasses.
|
30
|
+
def pre_callback_filter(value)
|
31
|
+
smoothing ? smooth_input(value.to_i) : value.to_i
|
32
|
+
end
|
33
|
+
|
34
|
+
# Attach a callback that only fires when state changes.
|
35
|
+
def on_change(&block)
|
36
|
+
add_callback(:on_change) do |new_state|
|
37
|
+
block.call(new_state) if new_state != self.state
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -4,12 +4,12 @@ module Denko
|
|
4
4
|
include Behaviors::OutputPin
|
5
5
|
include Behaviors::Callbacks
|
6
6
|
include Behaviors::Threaded
|
7
|
-
|
7
|
+
include Behaviors::Lifecycle
|
8
|
+
|
8
9
|
interrupt_with :write
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
self.mode = :output_dac
|
10
|
+
|
11
|
+
before_initialize do
|
12
|
+
params[:mode] = :output_dac
|
13
13
|
end
|
14
14
|
|
15
15
|
def write(value)
|
@@ -1,14 +1,12 @@
|
|
1
1
|
module Denko
|
2
2
|
module AnalogIO
|
3
|
-
class Potentiometer < Input
|
4
|
-
|
5
|
-
super(options)
|
6
|
-
|
7
|
-
# Enable smoothing.
|
8
|
-
self.smoothing = true
|
3
|
+
class Potentiometer < Input
|
4
|
+
include Behaviors::Lifecycle
|
9
5
|
|
10
|
-
|
11
|
-
|
6
|
+
after_initialize do
|
7
|
+
# Enable smoothing and start listening immediately at ~125 Hz.
|
8
|
+
self.smoothing = true
|
9
|
+
listen(8)
|
12
10
|
end
|
13
11
|
end
|
14
12
|
end
|
data/lib/denko/analog_io.rb
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
module Denko
|
2
2
|
module AnalogIO
|
3
|
+
autoload :InputHelper, "#{__dir__}/analog_io/input_helper"
|
3
4
|
autoload :Input, "#{__dir__}/analog_io/input"
|
4
5
|
autoload :Output, "#{__dir__}/analog_io/output"
|
5
6
|
autoload :Potentiometer, "#{__dir__}/analog_io/potentiometer"
|
6
|
-
autoload :Sensor, "#{__dir__}/analog_io/sensor"
|
7
7
|
autoload :ADS111X, "#{__dir__}/analog_io/ads111x"
|
8
|
+
autoload :ADS1100, "#{__dir__}/analog_io/ads1100"
|
8
9
|
autoload :ADS1115, "#{__dir__}/analog_io/ads1115"
|
9
10
|
autoload :ADS1118, "#{__dir__}/analog_io/ads1118"
|
10
11
|
end
|
@@ -11,11 +11,23 @@ module Denko
|
|
11
11
|
0
|
12
12
|
end
|
13
13
|
|
14
|
+
def analog_read_high
|
15
|
+
nil
|
16
|
+
end
|
17
|
+
|
18
|
+
def analog_write_high
|
19
|
+
nil
|
20
|
+
end
|
21
|
+
|
22
|
+
alias :pwm_high :analog_write_high
|
23
|
+
alias :dac_high :analog_write_high
|
24
|
+
alias :adc_high :analog_read_high
|
25
|
+
|
14
26
|
def convert_pin(pin)
|
15
27
|
pin.to_i
|
16
28
|
end
|
17
29
|
|
18
|
-
def set_pin_mode(pin, mode,
|
30
|
+
def set_pin_mode(pin, mode, options={}); end
|
19
31
|
|
20
32
|
def start_read; end
|
21
33
|
end
|
@@ -2,13 +2,12 @@ module Denko
|
|
2
2
|
module Behaviors
|
3
3
|
module BusPeripheral
|
4
4
|
include Component
|
5
|
+
include Lifecycle
|
5
6
|
|
6
|
-
attr_reader :address
|
7
7
|
alias :bus :board
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
super(options)
|
9
|
+
before_initialize do
|
10
|
+
params[:board] ||= params[:bus]
|
12
11
|
end
|
13
12
|
|
14
13
|
def atomically(&block)
|