denko 0.13.1 → 0.13.3
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 +2 -4
- data/.github/workflows/build_esp32.yml +2 -3
- data/.github/workflows/build_esp8266.yml +2 -3
- data/.github/workflows/build_megaavr.yml +3 -5
- data/.github/workflows/build_ra4m1.yml +57 -0
- data/.github/workflows/build_rp2040.yml +2 -4
- data/.github/workflows/build_sam3x.yml +1 -3
- data/.github/workflows/build_samd.yml +2 -4
- data/CHANGELOG.md +100 -0
- data/DEPS_CLI.md +13 -6
- data/DEPS_IDE.md +14 -7
- data/HARDWARE.md +104 -80
- data/README.md +19 -28
- data/benchmarks/i2c_ssd1306_refresh.rb +79 -0
- data/examples/analog_io/ads1115.rb +57 -0
- data/examples/analog_io/ads1118.rb +8 -9
- data/examples/analog_io/dac_loopback.rb +6 -4
- data/examples/analog_io/input.rb +39 -36
- data/examples/connection/tcp.rb +1 -1
- data/examples/display/hd44780.rb +3 -3
- data/examples/display/ssd1306.rb +1 -1
- data/lib/denko/analog_io/ads1115.rb +61 -0
- data/lib/denko/analog_io/ads1118.rb +10 -120
- data/lib/denko/analog_io/ads111x.rb +123 -0
- data/lib/denko/analog_io/output.rb +2 -1
- data/lib/denko/analog_io.rb +2 -0
- data/lib/denko/behaviors/reader.rb +14 -13
- data/lib/denko/behaviors/subcomponents.rb +2 -2
- data/lib/denko/board/core.rb +1 -1
- data/lib/denko/board/i2c.rb +1 -4
- data/lib/denko/board/led_array.rb +3 -6
- data/lib/denko/board/map.rb +9 -0
- data/lib/denko/board/servo.rb +2 -6
- data/lib/denko/board.rb +32 -20
- data/lib/denko/connection/board_uart.rb +3 -3
- data/lib/denko/connection/flow_control.rb +10 -2
- data/lib/denko/digital_io/output.rb +1 -1
- data/lib/denko/display/hd44780.rb +18 -18
- data/lib/denko/led/seven_segment.rb +18 -19
- data/lib/denko/message.rb +7 -15
- data/lib/denko/pulse_io/ir_transmitter.rb +1 -2
- data/lib/denko/version.rb +1 -1
- data/lib/denko_cli/packages.rb +7 -1
- data/lib/denko_cli/targets.rb +8 -5
- data/lib/denko_cli/usage.txt +8 -4
- data/src/denko_ethernet.ino +15 -23
- data/src/denko_serial.ino +3 -14
- data/src/denko_wifi.ino +72 -52
- data/src/lib/Denko.cpp +14 -6
- data/src/lib/Denko.h +6 -17
- data/src/lib/DenkoCoreIO.cpp +3 -3
- data/src/lib/DenkoDefines.h +73 -19
- data/src/lib/DenkoEEPROM.cpp +9 -1
- data/src/lib/DenkoI2C.cpp +11 -9
- data/src/lib/DenkoLEDArray.cpp +5 -11
- data/test/analog_io/input_test.rb +3 -3
- data/test/analog_io/output_test.rb +1 -1
- data/test/analog_io/potentiometer_test.rb +2 -2
- data/test/behaviors/bus_peripheral_addressed.rb +1 -1
- data/test/behaviors/bus_peripheral_test.rb +1 -1
- data/test/behaviors/callbacks_test.rb +4 -4
- data/test/behaviors/component_test.rb +2 -2
- data/test/behaviors/listener_test.rb +3 -3
- data/test/behaviors/poller_test.rb +3 -3
- data/test/behaviors/reader_test.rb +11 -4
- data/test/behaviors/subcomponents_test.rb +1 -1
- data/test/behaviors/threaded_test.rb +7 -7
- data/test/board/board_test.rb +8 -8
- data/test/board/core_test.rb +12 -12
- data/test/board/eeprom_test.rb +2 -2
- data/test/board/helper_test.rb +0 -4
- data/test/board/i2c_test.rb +5 -5
- data/test/board/infrared_test.rb +1 -1
- data/test/board/message_test.rb +1 -1
- data/test/board/one_wire_test.rb +4 -4
- data/test/board/pulse_test.rb +2 -2
- data/test/board/servo_test.rb +3 -3
- data/test/board/spi_test.rb +3 -3
- data/test/board/tone_test.rb +2 -2
- data/test/connection/serial_test.rb +13 -13
- data/test/digital_io/input_test.rb +7 -7
- data/test/digital_io/output_test.rb +5 -5
- data/test/digital_io/rotary_encoder_test.rb +4 -4
- data/test/display/hd44780_test.rb +11 -1
- data/test/eeprom/built_in_test.rb +1 -1
- data/test/i2c/bus_test.rb +5 -5
- data/test/i2c/peripheral_test.rb +4 -4
- data/test/led/base_test.rb +2 -2
- data/test/led/rgb_test.rb +6 -6
- data/test/led/seven_segment_test.rb +36 -14
- data/test/motor/servo_test.rb +6 -6
- data/test/motor/stepper_test.rb +5 -5
- data/test/one_wire/bus_test.rb +9 -9
- data/test/one_wire/peripheral_test.rb +17 -17
- data/test/pulse_io/buzzer_test.rb +4 -4
- data/test/pulse_io/ir_transmitter_test.rb +2 -2
- data/test/pulse_io/pwm_output_test.rb +4 -4
- data/test/rtc/ds3231_test.rb +4 -4
- data/test/sensor/dht_test.rb +3 -3
- data/test/sensor/ds18b20_test.rb +9 -9
- data/test/spi/bus_test.rb +4 -4
- data/test/spi/input_register_test.rb +8 -8
- data/test/spi/output_register_test.rb +4 -4
- data/test/test_helper.rb +17 -2
- data/test/uart/bitbang_test.rb +3 -3
- metadata +7 -350
- data/vendor/board-maps/.gitignore +0 -56
- data/vendor/board-maps/.gitmodules +0 -21
- data/vendor/board-maps/BoardMap.h +0 -1364
- data/vendor/board-maps/README.md +0 -51
- data/vendor/board-maps/lib/boards_parser.rb +0 -66
- data/vendor/board-maps/lib/header_parser.rb +0 -164
- data/vendor/board-maps/run.rb +0 -47
- data/vendor/board-maps/yaml/0XCB_HELIOS.yml +0 -48
- data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_ESP32S2.yml +0 -25
- data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_ESP32S2_REVTFT.yml +0 -25
- data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_ESP32S2_TFT.yml +0 -27
- data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_ESP32S3.yml +0 -29
- data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_ESP32S3_NOPSRAM.yml +0 -29
- data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_ESP32S3_REVTFT.yml +0 -25
- data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_ESP32S3_TFT.yml +0 -27
- data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_ESP32_V2.yml +0 -30
- data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_RP2040.yml +0 -48
- data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_RP2040_CAN.yml +0 -48
- data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_RP2040_DVI.yml +0 -48
- data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_RP2040_PROP_MAKER.yml +0 -48
- data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_RP2040_RFM.yml +0 -48
- data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_RP2040_SCORPIO.yml +0 -48
- data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_RP2040_THINKINK.yml +0 -48
- data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_RP2040_USB_HOST.yml +0 -48
- data/vendor/board-maps/yaml/ADAFRUIT_ITSYBITSY_ESP32.yml +0 -24
- data/vendor/board-maps/yaml/ADAFRUIT_ITSYBITSY_RP2040.yml +0 -48
- data/vendor/board-maps/yaml/ADAFRUIT_KB2040_RP2040.yml +0 -48
- data/vendor/board-maps/yaml/ADAFRUIT_MACROPAD_RP2040.yml +0 -48
- data/vendor/board-maps/yaml/ADAFRUIT_MATRIXPORTAL_ESP32S3.yml +0 -16
- data/vendor/board-maps/yaml/ADAFRUIT_QTPY_ESP32C3.yml +0 -12
- data/vendor/board-maps/yaml/ADAFRUIT_QTPY_ESP32S2.yml +0 -22
- data/vendor/board-maps/yaml/ADAFRUIT_QTPY_ESP32S3_NOPSRAM.yml +0 -20
- data/vendor/board-maps/yaml/ADAFRUIT_QTPY_ESP32_PICO.yml +0 -27
- data/vendor/board-maps/yaml/ADAFRUIT_QTPY_RP2040.yml +0 -48
- data/vendor/board-maps/yaml/ADAFRUIT_STEMMAFRIEND_RP2040.yml +0 -48
- data/vendor/board-maps/yaml/ADAFRUIT_TRINKEYQT_RP2040.yml +0 -48
- data/vendor/board-maps/yaml/ALKS.yml +0 -34
- data/vendor/board-maps/yaml/AMPERKA_WIFI_SLOT.yml +0 -16
- data/vendor/board-maps/yaml/AVR_ADK.yml +0 -24
- data/vendor/board-maps/yaml/AVR_BT.yml +0 -16
- data/vendor/board-maps/yaml/AVR_CIRCUITPLAY.yml +0 -14
- data/vendor/board-maps/yaml/AVR_DUEMILANOVE.yml +0 -16
- data/vendor/board-maps/yaml/AVR_ESPLORA.yml +0 -20
- data/vendor/board-maps/yaml/AVR_ETHERNET.yml +0 -16
- data/vendor/board-maps/yaml/AVR_FIO.yml +0 -16
- data/vendor/board-maps/yaml/AVR_GEMMA.yml +0 -6
- data/vendor/board-maps/yaml/AVR_INDUSTRIAL101.yml +0 -20
- data/vendor/board-maps/yaml/AVR_LEONARDO.yml +0 -20
- data/vendor/board-maps/yaml/AVR_LEONARDO_ETH.yml +0 -20
- data/vendor/board-maps/yaml/AVR_LILYPAD.yml +0 -16
- data/vendor/board-maps/yaml/AVR_LILYPAD_USB.yml +0 -20
- data/vendor/board-maps/yaml/AVR_LININO_ONE.yml +0 -20
- data/vendor/board-maps/yaml/AVR_MEGA.yml +0 -24
- data/vendor/board-maps/yaml/AVR_MEGA2560.yml +0 -24
- data/vendor/board-maps/yaml/AVR_MICRO.yml +0 -20
- data/vendor/board-maps/yaml/AVR_MINI.yml +0 -16
- data/vendor/board-maps/yaml/AVR_NANO.yml +0 -16
- data/vendor/board-maps/yaml/AVR_NANO_EVERY.yml +0 -22
- data/vendor/board-maps/yaml/AVR_NG.yml +0 -16
- data/vendor/board-maps/yaml/AVR_PRO.yml +0 -16
- data/vendor/board-maps/yaml/AVR_ROBOT_CONTROL.yml +0 -22
- data/vendor/board-maps/yaml/AVR_ROBOT_MOTOR.yml +0 -19
- data/vendor/board-maps/yaml/AVR_UNO.yml +0 -16
- data/vendor/board-maps/yaml/AVR_UNO_WIFI_DEV_ED.yml +0 -16
- data/vendor/board-maps/yaml/AVR_UNO_WIFI_REV2.yml +0 -22
- data/vendor/board-maps/yaml/AVR_YUN.yml +0 -20
- data/vendor/board-maps/yaml/AVR_YUNMINI.yml +0 -20
- data/vendor/board-maps/yaml/AirM2M_CORE_ESP32C3.yml +0 -14
- data/vendor/board-maps/yaml/BEE_DATA_LOGGER.yml +0 -39
- data/vendor/board-maps/yaml/BPI_BIT.yml +0 -9
- data/vendor/board-maps/yaml/BPI_LEAF_S3.yml +0 -31
- data/vendor/board-maps/yaml/BRIDGETEK_IDM2040-7A.yml +0 -48
- data/vendor/board-maps/yaml/BeeMotionS3.yml +0 -40
- data/vendor/board-maps/yaml/Bee_Motion.yml +0 -27
- data/vendor/board-maps/yaml/Bee_Motion_Mini.yml +0 -1
- data/vendor/board-maps/yaml/Bee_S3.yml +0 -38
- data/vendor/board-maps/yaml/CHALLENGER_2040_LORA_RP2040.yml +0 -39
- data/vendor/board-maps/yaml/CHALLENGER_2040_LTE_RP2040.yml +0 -38
- data/vendor/board-maps/yaml/CHALLENGER_2040_NFC_RP2040.yml +0 -32
- data/vendor/board-maps/yaml/CHALLENGER_2040_SDRTC_RP2040.yml +0 -36
- data/vendor/board-maps/yaml/CHALLENGER_2040_SUBGHZ_RP2040.yml +0 -39
- data/vendor/board-maps/yaml/CHALLENGER_2040_UWB_RP2040.yml +0 -39
- data/vendor/board-maps/yaml/CHALLENGER_2040_WIFI_BLE_RP2040.yml +0 -42
- data/vendor/board-maps/yaml/CHALLENGER_2040_WIFI_RP2040.yml +0 -38
- data/vendor/board-maps/yaml/CHALLENGER_NB_2040_WIFI_RP2040.yml +0 -38
- data/vendor/board-maps/yaml/CRABIK_SLOT_ESP32_S3.yml +0 -19
- data/vendor/board-maps/yaml/CYTRON_MAKER_FEATHER_AIOT_S3.yml +0 -26
- data/vendor/board-maps/yaml/CYTRON_MAKER_NANO_RP2040.yml +0 -48
- data/vendor/board-maps/yaml/CYTRON_MAKER_PI_RP2040.yml +0 -48
- data/vendor/board-maps/yaml/CoreESP32.yml +0 -49
- data/vendor/board-maps/yaml/D1_MINI32.yml +0 -36
- data/vendor/board-maps/yaml/D1_UNO32.yml +0 -28
- data/vendor/board-maps/yaml/DATANOISETV_PICOADK.yml +0 -48
- data/vendor/board-maps/yaml/DENKY.yml +0 -26
- data/vendor/board-maps/yaml/DENKY_PICOV3.yml +0 -26
- data/vendor/board-maps/yaml/DENKY_WROOM32.yml +0 -26
- data/vendor/board-maps/yaml/DEPARTMENT_OF_ALCHEMY_MINIMAIN_ESP32S2.yml +0 -26
- data/vendor/board-maps/yaml/DFROBOT_BEETLE_ESP32_C3.yml +0 -14
- data/vendor/board-maps/yaml/DFROBOT_BEETLE_RP2040.yml +0 -48
- data/vendor/board-maps/yaml/DFROBOT_FIREBEETLE_2_ESP32E.yml +0 -44
- data/vendor/board-maps/yaml/DFROBOT_FIREBEETLE_2_ESP32S3.yml +0 -38
- data/vendor/board-maps/yaml/DFROBOT_ROMEO_ESP32S3.yml +0 -7
- data/vendor/board-maps/yaml/DPU_ESP32.yml +0 -26
- data/vendor/board-maps/yaml/DYDK.yml +0 -38
- data/vendor/board-maps/yaml/DYDK1A.yml +0 -37
- data/vendor/board-maps/yaml/DYDK1Av2.yml +0 -45
- data/vendor/board-maps/yaml/DYG.yml +0 -20
- data/vendor/board-maps/yaml/DYM.yml +0 -40
- data/vendor/board-maps/yaml/DYMv2.yml +0 -39
- data/vendor/board-maps/yaml/D_Duino_32.yml +0 -29
- data/vendor/board-maps/yaml/ELECTRONICCATS_HUNTERCAT_NFC.yml +0 -44
- data/vendor/board-maps/yaml/ESP320.yml +0 -8
- data/vendor/board-maps/yaml/ESP32C3_DEV.yml +0 -14
- data/vendor/board-maps/yaml/ESP32C3_M1_I_KIT.yml +0 -13
- data/vendor/board-maps/yaml/ESP32S2_DEV.yml +0 -33
- data/vendor/board-maps/yaml/ESP32S2_THING_PLUS.yml +0 -34
- data/vendor/board-maps/yaml/ESP32S2_USB.yml +0 -33
- data/vendor/board-maps/yaml/ESP32S3_CAM_LCD.yml +0 -7
- data/vendor/board-maps/yaml/ESP32S3_DEV.yml +0 -38
- data/vendor/board-maps/yaml/ESP32_DEV.yml +0 -26
- data/vendor/board-maps/yaml/ESP32_DEVKIT_LIPO.yml +0 -26
- data/vendor/board-maps/yaml/ESP32_EVB.yml +0 -7
- data/vendor/board-maps/yaml/ESP32_GATEWAY.yml +0 -13
- data/vendor/board-maps/yaml/ESP32_GATEWAY_C.yml +0 -13
- data/vendor/board-maps/yaml/ESP32_GATEWAY_E.yml +0 -13
- data/vendor/board-maps/yaml/ESP32_GATEWAY_F.yml +0 -13
- data/vendor/board-maps/yaml/ESP32_IOT_REDBOARD.yml +0 -27
- data/vendor/board-maps/yaml/ESP32_MICROMOD.yml +0 -24
- data/vendor/board-maps/yaml/ESP32_PICO.yml +0 -26
- data/vendor/board-maps/yaml/ESP32_POE.yml +0 -7
- data/vendor/board-maps/yaml/ESP32_POE_ISO.yml +0 -7
- data/vendor/board-maps/yaml/ESP32_S3_BOX.yml +0 -16
- data/vendor/board-maps/yaml/ESP32_S3_USB_OTG.yml +0 -11
- data/vendor/board-maps/yaml/ESP32_THING.yml +0 -27
- data/vendor/board-maps/yaml/ESP32_THING_PLUS.yml +0 -30
- data/vendor/board-maps/yaml/ESP32_THING_PLUS_C.yml +0 -30
- data/vendor/board-maps/yaml/ESP32_WROOM_DA.yml +0 -26
- data/vendor/board-maps/yaml/ESP32_WROVER_KIT.yml +0 -26
- data/vendor/board-maps/yaml/ESP8266_ADAFRUIT_HUZZAH.yml +0 -9
- data/vendor/board-maps/yaml/ESP8266_AGRUMINO_LEMON_V4.yml +0 -8
- data/vendor/board-maps/yaml/ESP8266_ARDUINO_PRIMO.yml +0 -7
- data/vendor/board-maps/yaml/ESP8266_ARDUINO_STAR_OTTO.yml +0 -7
- data/vendor/board-maps/yaml/ESP8266_ARDUINO_UNOWIFI.yml +0 -9
- data/vendor/board-maps/yaml/ESP8266_ESP01.yml +0 -9
- data/vendor/board-maps/yaml/ESP8266_ESP07.yml +0 -20
- data/vendor/board-maps/yaml/ESP8266_ESP12.yml +0 -20
- data/vendor/board-maps/yaml/ESP8266_ESP13.yml +0 -17
- data/vendor/board-maps/yaml/ESP8266_ESP210.yml +0 -9
- data/vendor/board-maps/yaml/ESP8266_ESPECTRO_CORE.yml +0 -9
- data/vendor/board-maps/yaml/ESP8266_ESPINO_ESP12.yml +0 -9
- data/vendor/board-maps/yaml/ESP8266_ESPINO_ESP13.yml +0 -9
- data/vendor/board-maps/yaml/ESP8266_ESPRESSO_LITE_V1.yml +0 -9
- data/vendor/board-maps/yaml/ESP8266_ESPRESSO_LITE_V2.yml +0 -9
- data/vendor/board-maps/yaml/ESP8266_GENERIC.yml +0 -9
- data/vendor/board-maps/yaml/ESP8266_INVENT_ONE.yml +0 -22
- data/vendor/board-maps/yaml/ESP8266_NODEMCU_ESP12.yml +0 -20
- data/vendor/board-maps/yaml/ESP8266_NODEMCU_ESP12E.yml +0 -20
- data/vendor/board-maps/yaml/ESP8266_OAK.yml +0 -9
- data/vendor/board-maps/yaml/ESP8266_PHOENIX_V1.yml +0 -9
- data/vendor/board-maps/yaml/ESP8266_PHOENIX_V2.yml +0 -9
- data/vendor/board-maps/yaml/ESP8266_SCHIRMILABS_EDUINO_WIFI.yml +0 -25
- data/vendor/board-maps/yaml/ESP8266_SONOFF_BASIC.yml +0 -9
- data/vendor/board-maps/yaml/ESP8266_SONOFF_S20.yml +0 -9
- data/vendor/board-maps/yaml/ESP8266_SONOFF_SV.yml +0 -9
- data/vendor/board-maps/yaml/ESP8266_SONOFF_TH.yml +0 -9
- data/vendor/board-maps/yaml/ESP8266_THING.yml +0 -9
- data/vendor/board-maps/yaml/ESP8266_THING_DEV.yml +0 -9
- data/vendor/board-maps/yaml/ESP8266_WEMOS_D1MINI.yml +0 -18
- data/vendor/board-maps/yaml/ESP8266_WEMOS_D1MINILITE.yml +0 -18
- data/vendor/board-maps/yaml/ESP8266_WEMOS_D1MINIPRO.yml +0 -18
- data/vendor/board-maps/yaml/ESP8266_WEMOS_D1R1.yml +0 -25
- data/vendor/board-maps/yaml/ESP8266_WEMOS_D1WROOM02.yml +0 -18
- data/vendor/board-maps/yaml/ESP8266_WIO_LINK.yml +0 -9
- data/vendor/board-maps/yaml/ESP8266_XINABOX_CW01.yml +0 -9
- data/vendor/board-maps/yaml/ESPECTRO32.yml +0 -27
- data/vendor/board-maps/yaml/ESPea32.yml +0 -27
- data/vendor/board-maps/yaml/ESPino32.yml +0 -27
- data/vendor/board-maps/yaml/ET-Board.yml +0 -26
- data/vendor/board-maps/yaml/EXTREMEELEXTRONICS_RC2040.yml +0 -46
- data/vendor/board-maps/yaml/Edgebox-ESP-100.yml +0 -7
- data/vendor/board-maps/yaml/FEATHERS2.yml +0 -33
- data/vendor/board-maps/yaml/FEATHERS2NEO.yml +0 -30
- data/vendor/board-maps/yaml/FEATHERS3.yml +0 -29
- data/vendor/board-maps/yaml/FEATHER_ESP32.yml +0 -28
- data/vendor/board-maps/yaml/FLYBOARD2040_CORE.yml +0 -48
- data/vendor/board-maps/yaml/FRANZININHO_WIFI.yml +0 -33
- data/vendor/board-maps/yaml/FRANZININHO_WIFI_MSC.yml +0 -33
- data/vendor/board-maps/yaml/FROG_ESP32.yml +0 -26
- data/vendor/board-maps/yaml/FUNHOUSE_ESP32S2.yml +0 -22
- data/vendor/board-maps/yaml/GEN4_IOD.yml +0 -9
- data/vendor/board-maps/yaml/GENERIC_RP2040.yml +0 -48
- data/vendor/board-maps/yaml/HEALTHYPI_4.yml +0 -27
- data/vendor/board-maps/yaml/HONEYLEMON.yml +0 -27
- data/vendor/board-maps/yaml/HORNBILL_ESP32_DEV.yml +0 -27
- data/vendor/board-maps/yaml/HORNBILL_ESP32_MINIMA.yml +0 -16
- data/vendor/board-maps/yaml/ILABS_2040_RPICO32_RP2040.yml +0 -47
- data/vendor/board-maps/yaml/IMBRIOS_LOGSENS_V1P1.yml +0 -19
- data/vendor/board-maps/yaml/INTOROBOT_ESP32_DEV.yml +0 -34
- data/vendor/board-maps/yaml/LILYGO_T_DISPLAY_S3.yml +0 -26
- data/vendor/board-maps/yaml/LOLIN32.yml +0 -27
- data/vendor/board-maps/yaml/LOLIN32_LITE.yml +0 -27
- data/vendor/board-maps/yaml/LOLIN_C3_MINI.yml +0 -14
- data/vendor/board-maps/yaml/LOLIN_D32.yml +0 -27
- data/vendor/board-maps/yaml/LOLIN_D32_PRO.yml +0 -27
- data/vendor/board-maps/yaml/LOLIN_S2_MINI.yml +0 -34
- data/vendor/board-maps/yaml/LOLIN_S2_PICO.yml +0 -34
- data/vendor/board-maps/yaml/LOLIN_S3.yml +0 -32
- data/vendor/board-maps/yaml/LOLIN_S3_MINI.yml +0 -32
- data/vendor/board-maps/yaml/LOLIN_S3_PRO.yml +0 -32
- data/vendor/board-maps/yaml/Lion_Bit_Dev_Board.yml +0 -18
- data/vendor/board-maps/yaml/LoPy.yml +0 -27
- data/vendor/board-maps/yaml/LoPy4.yml +0 -27
- data/vendor/board-maps/yaml/M5STACK_CORES3.yml +0 -8
- data/vendor/board-maps/yaml/M5STACK_Core2.yml +0 -9
- data/vendor/board-maps/yaml/M5STACK_FIRE.yml +0 -10
- data/vendor/board-maps/yaml/M5Stack-Timer-CAM.yml +0 -10
- data/vendor/board-maps/yaml/M5Stack_ATOM.yml +0 -10
- data/vendor/board-maps/yaml/M5Stack_ATOMS3.yml +0 -7
- data/vendor/board-maps/yaml/M5Stack_CoreInk.yml +0 -9
- data/vendor/board-maps/yaml/M5Stack_Core_ESP32.yml +0 -10
- data/vendor/board-maps/yaml/M5Stack_Station.yml +0 -10
- data/vendor/board-maps/yaml/M5Stick_C.yml +0 -10
- data/vendor/board-maps/yaml/MAGTAG29_ESP32S2.yml +0 -21
- data/vendor/board-maps/yaml/MELOPERO_COOKIE_RP2040.yml +0 -48
- data/vendor/board-maps/yaml/MELOPERO_SHAKE_RP2040.yml +0 -48
- data/vendor/board-maps/yaml/METRO_ESP32S2.yml +0 -34
- data/vendor/board-maps/yaml/MGBOT_IOTIK32A.yml +0 -27
- data/vendor/board-maps/yaml/MGBOT_IOTIK32B.yml +0 -27
- data/vendor/board-maps/yaml/MH_ET_LIVE_ESP32DEVKIT.yml +0 -27
- data/vendor/board-maps/yaml/MH_ET_LIVE_ESP32MINIKIT.yml +0 -27
- data/vendor/board-maps/yaml/MICROS2.yml +0 -34
- data/vendor/board-maps/yaml/MOD_WIFI_ESP8266.yml +0 -9
- data/vendor/board-maps/yaml/Metro.yml +0 -8
- data/vendor/board-maps/yaml/NANO32.yml +0 -27
- data/vendor/board-maps/yaml/NANO_RP2040_CONNECT.yml +0 -35
- data/vendor/board-maps/yaml/NEBULAS3.yml +0 -33
- data/vendor/board-maps/yaml/NEKOSYSTEMS_BL2040_MINI.yml +0 -48
- data/vendor/board-maps/yaml/NULLBITS_BIT_C_PRO.yml +0 -48
- data/vendor/board-maps/yaml/Node32s.yml +0 -27
- data/vendor/board-maps/yaml/NodeMCU_32S.yml +0 -27
- data/vendor/board-maps/yaml/ODROID_ESP32.yml +0 -10
- data/vendor/board-maps/yaml/ONEHORSE_ESP32_DEV.yml +0 -24
- data/vendor/board-maps/yaml/OROCA_EDUBOT.yml +0 -33
- data/vendor/board-maps/yaml/PIMORONI_PGA2040.yml +0 -48
- data/vendor/board-maps/yaml/PROS3.yml +0 -28
- data/vendor/board-maps/yaml/PYCOM_GPY.yml +0 -27
- data/vendor/board-maps/yaml/Piranha.yml +0 -16
- data/vendor/board-maps/yaml/Pocket32.yml +0 -27
- data/vendor/board-maps/yaml/QUANTUM.yml +0 -26
- data/vendor/board-maps/yaml/RASPBERRY_PI_PICO.yml +0 -48
- data/vendor/board-maps/yaml/RASPBERRY_PI_PICO_W.yml +0 -48
- data/vendor/board-maps/yaml/REDPILL_ESP32S3.yml +0 -32
- data/vendor/board-maps/yaml/RMP.yml +0 -33
- data/vendor/board-maps/yaml/SAMD_CIRCUITPLAYGROUND_EXPRESS.yml +0 -12
- data/vendor/board-maps/yaml/SAMD_MKR1000.yml +0 -20
- data/vendor/board-maps/yaml/SAMD_MKRFox1200.yml +0 -19
- data/vendor/board-maps/yaml/SAMD_MKRGSM1400.yml +0 -15
- data/vendor/board-maps/yaml/SAMD_MKRNB1500.yml +0 -15
- data/vendor/board-maps/yaml/SAMD_MKRVIDOR4000.yml +0 -19
- data/vendor/board-maps/yaml/SAMD_MKRWAN1300.yml +0 -18
- data/vendor/board-maps/yaml/SAMD_MKRWAN1310.yml +0 -18
- data/vendor/board-maps/yaml/SAMD_MKRWIFI1010.yml +0 -19
- data/vendor/board-maps/yaml/SAMD_MKRZERO.yml +0 -19
- data/vendor/board-maps/yaml/SAMD_NANO_33_IOT.yml +0 -13
- data/vendor/board-maps/yaml/SAMD_TIAN.yml +0 -15
- data/vendor/board-maps/yaml/SAMD_ZERO.yml +0 -14
- data/vendor/board-maps/yaml/SAM_DUE.yml +0 -26
- data/vendor/board-maps/yaml/SAM_ZERO.yml +0 -15
- data/vendor/board-maps/yaml/SEEED_INDICATOR_RP2040.yml +0 -47
- data/vendor/board-maps/yaml/SEEED_XIAO_RP2040.yml +0 -29
- data/vendor/board-maps/yaml/SOLDERPARTY_RP2040_STAMP.yml +0 -48
- data/vendor/board-maps/yaml/SONOFF_DUALR3.yml +0 -26
- data/vendor/board-maps/yaml/SPARKFUN_PROMICRO_RP2040.yml +0 -48
- data/vendor/board-maps/yaml/SPARKFUN_THINGPLUS_RP2040.yml +0 -48
- data/vendor/board-maps/yaml/STAMP_S3.yml +0 -4
- data/vendor/board-maps/yaml/TAMC_TERMOD_S3.yml +0 -31
- data/vendor/board-maps/yaml/TBEAM_USE_RADIO_SX1262.yml +0 -23
- data/vendor/board-maps/yaml/TBEAM_USE_RADIO_SX1268.yml +0 -23
- data/vendor/board-maps/yaml/TBEAM_USE_RADIO_SX1276.yml +0 -23
- data/vendor/board-maps/yaml/TBEAM_USE_RADIO_SX1278.yml +0 -23
- data/vendor/board-maps/yaml/TBEAM_USE_RADIO_SX1280.yml +0 -23
- data/vendor/board-maps/yaml/TBeam.yml +0 -23
- data/vendor/board-maps/yaml/TINYPICO.yml +0 -26
- data/vendor/board-maps/yaml/TINYS2.yml +0 -33
- data/vendor/board-maps/yaml/TINYS3.yml +0 -25
- data/vendor/board-maps/yaml/TTGO-T-OI-PLUS_DEV.yml +0 -11
- data/vendor/board-maps/yaml/TTGO_LoRa32_V1.yml +0 -28
- data/vendor/board-maps/yaml/TTGO_LoRa32_V2.yml +0 -28
- data/vendor/board-maps/yaml/TTGO_LoRa32_v21new.yml +0 -28
- data/vendor/board-maps/yaml/TTGO_T1.yml +0 -27
- data/vendor/board-maps/yaml/TTGO_T7_V13_Mini32.yml +0 -27
- data/vendor/board-maps/yaml/TTGO_T7_V14_Mini32.yml +0 -27
- data/vendor/board-maps/yaml/TWATCH_2020_V1.yml +0 -10
- data/vendor/board-maps/yaml/TWATCH_2020_V2.yml +0 -10
- data/vendor/board-maps/yaml/TWATCH_2020_V3.yml +0 -10
- data/vendor/board-maps/yaml/TWATCH_BASE.yml +0 -10
- data/vendor/board-maps/yaml/TWatch.yml +0 -10
- data/vendor/board-maps/yaml/Trueverit_ESP32_Universal_IoT_Driver.yml +0 -18
- data/vendor/board-maps/yaml/Trueverit_ESP32_Universal_IoT_Driver_MK_II.yml +0 -18
- data/vendor/board-maps/yaml/UBLOX_NINA_W10.yml +0 -48
- data/vendor/board-maps/yaml/UBLOX_NORA_W10.yml +0 -43
- data/vendor/board-maps/yaml/UPESY_RP2040_DEVKIT.yml +0 -48
- data/vendor/board-maps/yaml/VALTRACK_V4_MFW_ESP32_C3.yml +0 -23
- data/vendor/board-maps/yaml/VALTRACK_V4_VTS_ESP32_C3.yml +0 -23
- data/vendor/board-maps/yaml/VIYALAB_MIZU_RP2040.yml +0 -48
- data/vendor/board-maps/yaml/WATCHY.yml +0 -7
- data/vendor/board-maps/yaml/WATCHY_V10.yml +0 -7
- data/vendor/board-maps/yaml/WATCHY_V15.yml +0 -7
- data/vendor/board-maps/yaml/WATCHY_V20.yml +0 -7
- data/vendor/board-maps/yaml/WAVESHARE_RP2040_LCD_0_96.yml +0 -47
- data/vendor/board-maps/yaml/WAVESHARE_RP2040_LCD_1_28.yml +0 -47
- data/vendor/board-maps/yaml/WAVESHARE_RP2040_ONE.yml +0 -47
- data/vendor/board-maps/yaml/WAVESHARE_RP2040_PLUS.yml +0 -48
- data/vendor/board-maps/yaml/WAVESHARE_RP2040_ZERO.yml +0 -47
- data/vendor/board-maps/yaml/WESP32.yml +0 -17
- data/vendor/board-maps/yaml/WIDORA_AIR.yml +0 -34
- data/vendor/board-maps/yaml/WIFIDUINO_ESP8266.yml +0 -23
- data/vendor/board-maps/yaml/WIFINFO.yml +0 -20
- data/vendor/board-maps/yaml/WIPY3.yml +0 -27
- data/vendor/board-maps/yaml/WIZNET_5100S_EVB_PICO.yml +0 -48
- data/vendor/board-maps/yaml/WIZNET_5500_EVB_PICO.yml +0 -48
- data/vendor/board-maps/yaml/WIZNET_WIZFI360_EVB_PICO.yml +0 -48
- data/vendor/board-maps/yaml/WT32_ETH01.yml +0 -8
- data/vendor/board-maps/yaml/WiFiduino32S3.yml +0 -27
- data/vendor/board-maps/yaml/WiFiduinoV2.yml +0 -27
- data/vendor/board-maps/yaml/Wifiduino32.yml +0 -40
- data/vendor/board-maps/yaml/XIAO_ESP32C3.yml +0 -22
- data/vendor/board-maps/yaml/XIAO_ESP32S3.yml +0 -36
- data/vendor/board-maps/yaml/YD_RP2040.yml +0 -48
- data/vendor/board-maps/yaml/atmegazero_esp32s2.yml +0 -30
- data/vendor/board-maps/yaml/connaxio_espoir.yml +0 -18
- data/vendor/board-maps/yaml/esp32vn_iot_uno.yml +0 -22
- data/vendor/board-maps/yaml/fm_devkit.yml +0 -15
- data/vendor/board-maps/yaml/heltec_wifi_32_lora_V3.yml +0 -31
- data/vendor/board-maps/yaml/heltec_wifi_kit_32.yml +0 -28
- data/vendor/board-maps/yaml/heltec_wifi_kit_32_V3.yml +0 -32
- data/vendor/board-maps/yaml/heltec_wifi_lora_32.yml +0 -27
- data/vendor/board-maps/yaml/heltec_wifi_lora_32_V2.yml +0 -27
- data/vendor/board-maps/yaml/heltec_wireless_stick.yml +0 -27
- data/vendor/board-maps/yaml/heltec_wireless_stick_LITE.yml +0 -27
- data/vendor/board-maps/yaml/openkb.yml +0 -27
- data/vendor/board-maps/yaml/roboheart_hercules.yml +0 -17
- data/vendor/board-maps/yaml/sensesiot_weizen.yml +0 -26
- data/vendor/board-maps/yaml/uPesy_WROOM.yml +0 -27
- data/vendor/board-maps/yaml/uPesy_WROVER.yml +0 -27
- data/vendor/board-maps/yaml/unphone8.yml +0 -32
- data/vendor/board-maps/yaml/unphone9.yml +0 -32
- data/vendor/board-maps/yaml/wifi_kit_8.yml +0 -15
@@ -1,6 +1,6 @@
|
|
1
1
|
require_relative '../test_helper'
|
2
2
|
|
3
|
-
class OneWirePeripheralTest <
|
3
|
+
class OneWirePeripheralTest < Minitest::Test
|
4
4
|
def board
|
5
5
|
@board ||= BoardMock.new
|
6
6
|
end
|
@@ -21,7 +21,7 @@ class OneWirePeripheralTest < MiniTest::Test
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def test_atomically_locks_the_bus_mutex
|
24
|
-
mock =
|
24
|
+
mock = Minitest::Mock.new.expect(:synchronize, nil)
|
25
25
|
bus.stub(:mutex, mock) do
|
26
26
|
part.atomically {}
|
27
27
|
end
|
@@ -29,13 +29,13 @@ class OneWirePeripheralTest < MiniTest::Test
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def test_atomically_calls_the_block_once
|
32
|
-
mock =
|
32
|
+
mock = Minitest::Mock.new.expect(:call, nil)
|
33
33
|
part.atomically { mock.call }
|
34
34
|
mock.verify
|
35
35
|
end
|
36
36
|
|
37
37
|
def test_match_calls_reset
|
38
|
-
mock =
|
38
|
+
mock = Minitest::Mock.new.expect(:call, nil)
|
39
39
|
bus.stub(:reset, mock) do
|
40
40
|
part.match
|
41
41
|
end
|
@@ -43,7 +43,7 @@ class OneWirePeripheralTest < MiniTest::Test
|
|
43
43
|
end
|
44
44
|
|
45
45
|
def test_match_skips_rom_if_alone
|
46
|
-
mock =
|
46
|
+
mock = Minitest::Mock.new.expect(:call, nil, [0xCC])
|
47
47
|
bus.stub(:write, mock) do
|
48
48
|
part.match
|
49
49
|
end
|
@@ -51,7 +51,7 @@ class OneWirePeripheralTest < MiniTest::Test
|
|
51
51
|
end
|
52
52
|
|
53
53
|
def test_match_matches_rom_if_not_alone
|
54
|
-
mock =
|
54
|
+
mock = Minitest::Mock.new
|
55
55
|
mock.expect(:call, nil, [0x55])
|
56
56
|
mock.expect(:call, nil, [[255,255,255,255,255,255,255,255]])
|
57
57
|
bus.instance_variable_set(:@found_devices, [1,2])
|
@@ -62,19 +62,19 @@ class OneWirePeripheralTest < MiniTest::Test
|
|
62
62
|
end
|
63
63
|
|
64
64
|
def test_copy_scratch_is_atomic
|
65
|
-
mock =
|
65
|
+
mock = Minitest::Mock.new.expect(:call, nil)
|
66
66
|
part.stub(:atomically, mock) { part.copy_scratch }
|
67
67
|
mock.verify
|
68
68
|
end
|
69
69
|
|
70
70
|
def test_copy_scratch_matches_first
|
71
|
-
mock =
|
71
|
+
mock = Minitest::Mock.new.expect(:call, nil)
|
72
72
|
part.stub(:match, mock) { part.copy_scratch }
|
73
73
|
mock.verify
|
74
74
|
end
|
75
75
|
|
76
76
|
def test_copy_scratch_sends_the_command
|
77
|
-
mock =
|
77
|
+
mock = Minitest::Mock.new
|
78
78
|
mock.expect(:call, nil, [0xCC])
|
79
79
|
mock.expect(:call, nil, [0x48])
|
80
80
|
bus.stub(:write, mock) { part.copy_scratch }
|
@@ -82,7 +82,7 @@ class OneWirePeripheralTest < MiniTest::Test
|
|
82
82
|
end
|
83
83
|
|
84
84
|
def test_copy_scratch_resets_after_command_if_parasite_power
|
85
|
-
mock =
|
85
|
+
mock = Minitest::Mock.new.expect(:call, nil).expect(:call, nil)
|
86
86
|
bus.stub(:parasite_power, true) do
|
87
87
|
bus.stub(:reset, mock) { part.copy_scratch }
|
88
88
|
end
|
@@ -95,7 +95,7 @@ class OneWirePeripheralTest < MiniTest::Test
|
|
95
95
|
# Will read 9 bytes.
|
96
96
|
board.inject_read_for_component(bus, 1, "255,255,255,255,255,255,255,255")
|
97
97
|
|
98
|
-
mock =
|
98
|
+
mock = Minitest::Mock.new.expect(:call, nil)
|
99
99
|
part.stub(:atomically, mock) { part.read_scratch(9) }
|
100
100
|
mock.verify
|
101
101
|
end
|
@@ -106,7 +106,7 @@ class OneWirePeripheralTest < MiniTest::Test
|
|
106
106
|
# Will read 9 bytes.
|
107
107
|
board.inject_read_for_component(bus, 1, "255,255,255,255,255,255,255,255")
|
108
108
|
|
109
|
-
mock =
|
109
|
+
mock = Minitest::Mock.new.expect(:call, nil)
|
110
110
|
part.stub(:match, mock) { part.read_scratch(9) }
|
111
111
|
mock.verify
|
112
112
|
end
|
@@ -117,7 +117,7 @@ class OneWirePeripheralTest < MiniTest::Test
|
|
117
117
|
# Will read 9 bytes.
|
118
118
|
board.inject_read_for_component(bus, 1, "255,255,255,255,255,255,255,255")
|
119
119
|
|
120
|
-
mock =
|
120
|
+
mock = Minitest::Mock.new
|
121
121
|
mock.expect(:call, nil, [0xCC])
|
122
122
|
mock.expect(:call, nil, [0xBE])
|
123
123
|
bus.stub(:write, mock) { part.read_scratch(9) }
|
@@ -130,25 +130,25 @@ class OneWirePeripheralTest < MiniTest::Test
|
|
130
130
|
# Will read 9 bytes.
|
131
131
|
board.inject_read_for_component(bus, 1, "255,255,255,255,255,255,255,255")
|
132
132
|
|
133
|
-
mock =
|
133
|
+
mock = Minitest::Mock.new.expect(:call, nil, [9])
|
134
134
|
bus.stub(:read, mock) { part.read_scratch(9) }
|
135
135
|
mock.verify
|
136
136
|
end
|
137
137
|
|
138
138
|
def test_write_scratch_is_atomic
|
139
|
-
mock =
|
139
|
+
mock = Minitest::Mock.new.expect(:call, nil)
|
140
140
|
part.stub(:atomically, mock) { part.write_scratch(1) }
|
141
141
|
mock.verify
|
142
142
|
end
|
143
143
|
|
144
144
|
def test_write_scratch_matches_first
|
145
|
-
mock =
|
145
|
+
mock = Minitest::Mock.new.expect(:call, nil)
|
146
146
|
part.stub(:match, mock) { part.write_scratch(1) }
|
147
147
|
mock.verify
|
148
148
|
end
|
149
149
|
|
150
150
|
def test_write_scratch_sends_the_command_and_data
|
151
|
-
mock =
|
151
|
+
mock = Minitest::Mock.new
|
152
152
|
mock.expect(:call, nil, [0xCC])
|
153
153
|
mock.expect(:call, nil, [0x4E])
|
154
154
|
mock.expect(:call, nil, [1,2,3])
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require_relative '../test_helper'
|
2
2
|
|
3
|
-
class BuzzerTest <
|
3
|
+
class BuzzerTest < Minitest::Test
|
4
4
|
def board
|
5
5
|
@board ||= BoardMock.new
|
6
6
|
end
|
@@ -14,7 +14,7 @@ class BuzzerTest < MiniTest::Test
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def test_tone
|
17
|
-
mock =
|
17
|
+
mock = Minitest::Mock.new
|
18
18
|
mock.expect :call, nil, [part.pin, 60, nil]
|
19
19
|
mock.expect :call, nil, [part.pin, 120, 2000]
|
20
20
|
board.stub(:tone, mock) do
|
@@ -26,7 +26,7 @@ class BuzzerTest < MiniTest::Test
|
|
26
26
|
|
27
27
|
def test_no_tone
|
28
28
|
part
|
29
|
-
mock =
|
29
|
+
mock = Minitest::Mock.new
|
30
30
|
mock.expect :call, nil, [part.pin]
|
31
31
|
board.stub(:no_tone, mock) do
|
32
32
|
part.no_tone
|
@@ -35,7 +35,7 @@ class BuzzerTest < MiniTest::Test
|
|
35
35
|
end
|
36
36
|
|
37
37
|
def stop
|
38
|
-
mock =
|
38
|
+
mock = Minitest::Mock.new
|
39
39
|
mock.expect :call, nil
|
40
40
|
mock.expect :call, nil
|
41
41
|
part.stub(:kill_thread, mock) do
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require_relative '../test_helper'
|
2
2
|
|
3
|
-
class IRTransmitterTest <
|
3
|
+
class IRTransmitterTest < Minitest::Test
|
4
4
|
def board
|
5
5
|
@board ||= BoardMock.new
|
6
6
|
end
|
@@ -29,7 +29,7 @@ class IRTransmitterTest < MiniTest::Test
|
|
29
29
|
|
30
30
|
def test_emits
|
31
31
|
part
|
32
|
-
mock =
|
32
|
+
mock = Minitest::Mock.new.expect(:call, nil, [1, 38, [127,0]])
|
33
33
|
board.stub(:infrared_emit, mock) do
|
34
34
|
part.emit([127,0])
|
35
35
|
end
|
@@ -10,8 +10,8 @@ class PWMOutTest < Minitest::Test
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def test_pwm_write
|
13
|
-
enable_mock =
|
14
|
-
write_mock =
|
13
|
+
enable_mock = Minitest::Mock.new.expect :call, nil
|
14
|
+
write_mock = Minitest::Mock.new
|
15
15
|
write_mock.expect :call, nil, [14, 128]
|
16
16
|
|
17
17
|
board.stub(:pwm_write, write_mock) do
|
@@ -31,7 +31,7 @@ class PWMOutTest < Minitest::Test
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def test_write_uses_digital_write_at_limits
|
34
|
-
mock =
|
34
|
+
mock = Minitest::Mock.new
|
35
35
|
mock.expect :call, nil, [board.high]
|
36
36
|
mock.expect :call, nil, [board.low]
|
37
37
|
part.stub(:digital_write, mock) do
|
@@ -42,7 +42,7 @@ class PWMOutTest < Minitest::Test
|
|
42
42
|
end
|
43
43
|
|
44
44
|
def test_write_uses_analog_write_between_limits
|
45
|
-
mock =
|
45
|
+
mock = Minitest::Mock.new.expect :call, nil, [128]
|
46
46
|
part.stub(:pwm_write, mock) do
|
47
47
|
part.write(128)
|
48
48
|
end
|
data/test/rtc/ds3231_test.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
require_relative '../test_helper'
|
2
2
|
|
3
|
-
class DS3231Test <
|
3
|
+
class DS3231Test < Minitest::Test
|
4
4
|
def board
|
5
5
|
@board ||= BoardMock.new
|
6
6
|
end
|
@@ -28,7 +28,7 @@ class DS3231Test < MiniTest::Test
|
|
28
28
|
end
|
29
29
|
|
30
30
|
def test_time=
|
31
|
-
mock =
|
31
|
+
mock = Minitest::Mock.new.expect :call, nil, [[0, [0, 0, 0, 6, 1, 1, 48]]]
|
32
32
|
part.stub(:i2c_write, mock) do
|
33
33
|
part.time = Time.new(2000, 1, 1, 0, 0, 0.0)
|
34
34
|
end
|
@@ -38,7 +38,7 @@ class DS3231Test < MiniTest::Test
|
|
38
38
|
def test_read
|
39
39
|
board.inject_read_for_component(part, 5, "104-0,0,0,6,1,1,48")
|
40
40
|
|
41
|
-
mock =
|
41
|
+
mock = Minitest::Mock.new.expect :call, nil, [part.address, 0x00, 7, 100000, false]
|
42
42
|
bus.stub(:_read, mock) do
|
43
43
|
part.time
|
44
44
|
end
|
@@ -46,7 +46,7 @@ class DS3231Test < MiniTest::Test
|
|
46
46
|
end
|
47
47
|
|
48
48
|
def test_pre_callback_filter
|
49
|
-
mock =
|
49
|
+
mock = Minitest::Mock.new.expect :call, nil, [Time.new(2000, 1, 1, 0, 0, 0.0)]
|
50
50
|
part.stub(:update_state, mock) do
|
51
51
|
bus.send(:update, "104-0,0,0,6,1,1,48")
|
52
52
|
end
|
data/test/sensor/dht_test.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
require_relative '../test_helper'
|
2
2
|
|
3
|
-
class DHTTest <
|
3
|
+
class DHTTest < Minitest::Test
|
4
4
|
PIN = 1
|
5
5
|
|
6
6
|
# Actual raw data from a sensor
|
@@ -26,7 +26,7 @@ class DHTTest < MiniTest::Test
|
|
26
26
|
# It should tell the board to do a #pulse_read
|
27
27
|
def test__read
|
28
28
|
part
|
29
|
-
mock =
|
29
|
+
mock = Minitest::Mock.new.expect(:call, nil, [PIN], reset: board.low, reset_time: 20000, pulse_limit: 84, timeout: 100)
|
30
30
|
board.stub(:pulse_read, mock) do
|
31
31
|
part._read
|
32
32
|
end
|
@@ -36,7 +36,7 @@ class DHTTest < MiniTest::Test
|
|
36
36
|
# Callback pre filter should convert string of bytes to array and call #decode with it.
|
37
37
|
def test_pre_callback_filter
|
38
38
|
part
|
39
|
-
mock =
|
39
|
+
mock = Minitest::Mock.new.expect(:call, nil, [GOOD_ARRAY])
|
40
40
|
part.stub(:decode, mock) do
|
41
41
|
part.update(GOOD_STRING)
|
42
42
|
end
|
data/test/sensor/ds18b20_test.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
require_relative '../test_helper'
|
2
2
|
|
3
|
-
class DS18B20Test <
|
3
|
+
class DS18B20Test < Minitest::Test
|
4
4
|
def board
|
5
5
|
@board ||= BoardMock.new
|
6
6
|
end
|
@@ -45,7 +45,7 @@ class DS18B20Test < MiniTest::Test
|
|
45
45
|
|
46
46
|
def test_pre_callback_filter_does_crc_and_returns_error_on_fail
|
47
47
|
raw_bytes = [239, 1, 75, 70, 127, 255, 1, 16, 245]
|
48
|
-
mock =
|
48
|
+
mock = Minitest::Mock.new.expect(:call, false, [raw_bytes])
|
49
49
|
|
50
50
|
Denko::OneWire::Helper.stub(:crc, mock) do
|
51
51
|
assert_equal({crc_error: true}, part.pre_callback_filter(raw_bytes))
|
@@ -56,7 +56,7 @@ class DS18B20Test < MiniTest::Test
|
|
56
56
|
# test resolution=
|
57
57
|
|
58
58
|
def test_convert_is_atomic
|
59
|
-
mock =
|
59
|
+
mock = Minitest::Mock.new.expect(:call, nil)
|
60
60
|
part.stub(:atomically, mock) do
|
61
61
|
part.convert
|
62
62
|
end
|
@@ -64,8 +64,8 @@ class DS18B20Test < MiniTest::Test
|
|
64
64
|
end
|
65
65
|
|
66
66
|
def test_convert_matches_first
|
67
|
-
match_mock =
|
68
|
-
sleep_mock =
|
67
|
+
match_mock = Minitest::Mock.new.expect(:call, nil)
|
68
|
+
sleep_mock = Minitest::Mock.new.expect(:call, nil, [0.75])
|
69
69
|
|
70
70
|
part.stub(:match, match_mock) do
|
71
71
|
part.stub(:sleep, sleep_mock) do
|
@@ -76,10 +76,10 @@ class DS18B20Test < MiniTest::Test
|
|
76
76
|
end
|
77
77
|
|
78
78
|
def test_convert_sends_the_command
|
79
|
-
write_mock =
|
79
|
+
write_mock = Minitest::Mock.new
|
80
80
|
write_mock.expect(:call, nil, [0xCC])
|
81
81
|
write_mock.expect(:call, nil, [0x44])
|
82
|
-
sleep_mock =
|
82
|
+
sleep_mock = Minitest::Mock.new.expect(:call, nil, [0.75])
|
83
83
|
|
84
84
|
bus.stub(:write, write_mock) do
|
85
85
|
part.stub(:sleep, sleep_mock) do
|
@@ -90,7 +90,7 @@ class DS18B20Test < MiniTest::Test
|
|
90
90
|
end
|
91
91
|
|
92
92
|
def test_convert_sets_max_convert_time_first
|
93
|
-
sleep_mock =
|
93
|
+
sleep_mock = Minitest::Mock.new.expect(:call, nil, [0.75])
|
94
94
|
part.stub(:sleep, sleep_mock) do
|
95
95
|
part.convert
|
96
96
|
end
|
@@ -99,7 +99,7 @@ class DS18B20Test < MiniTest::Test
|
|
99
99
|
end
|
100
100
|
|
101
101
|
def test_convert_sleeps_for_convert_time
|
102
|
-
mock =
|
102
|
+
mock = Minitest::Mock.new.expect(:call, nil, [0.75])
|
103
103
|
part.stub(:sleep, mock) do
|
104
104
|
part.convert
|
105
105
|
end
|
data/test/spi/bus_test.rb
CHANGED
@@ -21,7 +21,7 @@ class SPIBusTest < Minitest::Test
|
|
21
21
|
OPTIONS = { read: 2, frequency: 800000, mode: 2, bit_order: :lsbfirst }
|
22
22
|
|
23
23
|
def test_transfer
|
24
|
-
mock =
|
24
|
+
mock = Minitest::Mock.new.expect :call, nil, [PIN], **OPTIONS
|
25
25
|
board.stub(:spi_transfer, mock) do
|
26
26
|
part.transfer(PIN, **OPTIONS)
|
27
27
|
end
|
@@ -29,7 +29,7 @@ class SPIBusTest < Minitest::Test
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def test_listen
|
32
|
-
mock =
|
32
|
+
mock = Minitest::Mock.new.expect :call, nil, [PIN], **OPTIONS
|
33
33
|
board.stub(:spi_listen, mock) do
|
34
34
|
part.listen(PIN, **OPTIONS)
|
35
35
|
end
|
@@ -37,7 +37,7 @@ class SPIBusTest < Minitest::Test
|
|
37
37
|
end
|
38
38
|
|
39
39
|
def test_stop
|
40
|
-
mock =
|
40
|
+
mock = Minitest::Mock.new.expect :call, nil, [PIN]
|
41
41
|
board.stub(:spi_stop, mock) do
|
42
42
|
part.stop(PIN)
|
43
43
|
end
|
@@ -54,7 +54,7 @@ class SPIBusTest < Minitest::Test
|
|
54
54
|
end
|
55
55
|
|
56
56
|
def test_set_pin_mode
|
57
|
-
mock =
|
57
|
+
mock = Minitest::Mock.new.expect :call, nil, [9, :output]
|
58
58
|
board.stub(:set_pin_mode, mock) do
|
59
59
|
part.set_pin_mode(9, :output)
|
60
60
|
end
|
@@ -28,7 +28,7 @@ class InputRegisterTest < Minitest::Test
|
|
28
28
|
end
|
29
29
|
|
30
30
|
def test_read
|
31
|
-
mock =
|
31
|
+
mock = Minitest::Mock.new.expect :call, nil, [9], read: 2, frequency: 800000, mode: 2, bit_order: :lsbfirst
|
32
32
|
bus.stub(:transfer, mock) do
|
33
33
|
part.read
|
34
34
|
end
|
@@ -36,7 +36,7 @@ class InputRegisterTest < Minitest::Test
|
|
36
36
|
end
|
37
37
|
|
38
38
|
def test_listen
|
39
|
-
mock =
|
39
|
+
mock = Minitest::Mock.new.expect :call, nil, [9], read: 2, frequency: 800000, mode: 2, bit_order: :lsbfirst
|
40
40
|
bus.stub(:listen, mock) do
|
41
41
|
part.listen
|
42
42
|
end
|
@@ -44,7 +44,7 @@ class InputRegisterTest < Minitest::Test
|
|
44
44
|
end
|
45
45
|
|
46
46
|
def test_stop
|
47
|
-
mock =
|
47
|
+
mock = Minitest::Mock.new.expect :call, nil, [9]
|
48
48
|
bus.stub(:stop, mock) do
|
49
49
|
part.stop
|
50
50
|
end
|
@@ -69,7 +69,7 @@ class InputRegisterTest < Minitest::Test
|
|
69
69
|
end
|
70
70
|
|
71
71
|
def test_callbacks_get_bit_array
|
72
|
-
mock =
|
72
|
+
mock = Minitest::Mock.new.expect :call, nil, [[1,1,1,1,1,1,1,0]]
|
73
73
|
part.add_callback do |data|
|
74
74
|
mock.call(data)
|
75
75
|
end
|
@@ -87,7 +87,7 @@ class InputRegisterTest < Minitest::Test
|
|
87
87
|
part.update("255")
|
88
88
|
end
|
89
89
|
|
90
|
-
mock =
|
90
|
+
mock = Minitest::Mock.new
|
91
91
|
mock.expect :call, nil
|
92
92
|
part.stub(:read, mock) do
|
93
93
|
button.read
|
@@ -96,7 +96,7 @@ class InputRegisterTest < Minitest::Test
|
|
96
96
|
end
|
97
97
|
|
98
98
|
def test_listener_proxy
|
99
|
-
mock =
|
99
|
+
mock = Minitest::Mock.new
|
100
100
|
mock.expect :call, nil
|
101
101
|
part.stub(:listen, mock) do
|
102
102
|
# Tells the register to start listening when it initializees.
|
@@ -119,7 +119,7 @@ class InputRegisterTest < Minitest::Test
|
|
119
119
|
button
|
120
120
|
|
121
121
|
# Calling stop on a child part, when only it is listening, should call stop on the register too.
|
122
|
-
mock =
|
122
|
+
mock = Minitest::Mock.new.expect :call, nil
|
123
123
|
part.stub(:stop, mock) do
|
124
124
|
button.stop
|
125
125
|
end
|
@@ -131,7 +131,7 @@ class InputRegisterTest < Minitest::Test
|
|
131
131
|
end
|
132
132
|
|
133
133
|
def test_gets_reads_through_pin
|
134
|
-
mock =
|
134
|
+
mock = Minitest::Mock.new.expect :call, nil, ["127,255"]
|
135
135
|
part.stub(:update, mock) do
|
136
136
|
board.update("#{part.pin}:127,255")
|
137
137
|
end
|
@@ -23,7 +23,7 @@ class OutputRegisterTest < Minitest::Test
|
|
23
23
|
|
24
24
|
def test_write
|
25
25
|
part
|
26
|
-
mock =
|
26
|
+
mock = Minitest::Mock.new.expect :call, nil, [9], write: [255,127], frequency: 800000, mode: 2, bit_order: :lsbfirst
|
27
27
|
bus.stub(:transfer, mock) do
|
28
28
|
arr = Array.new(16) { 1 }; arr[7] = 0
|
29
29
|
part.instance_variable_set(:@state, arr)
|
@@ -46,7 +46,7 @@ class OutputRegisterTest < Minitest::Test
|
|
46
46
|
def test_updates_and_writes_state_for_children
|
47
47
|
led
|
48
48
|
|
49
|
-
mock =
|
49
|
+
mock = Minitest::Mock.new.expect :call, nil, [9], write: [0, 1], frequency: 800000, mode: 2, bit_order: :lsbfirst
|
50
50
|
bus.stub(:transfer, mock) do
|
51
51
|
led.on
|
52
52
|
sleep 0.050
|
@@ -62,7 +62,7 @@ class OutputRegisterTest < Minitest::Test
|
|
62
62
|
def test_implements_digital_read_for_children
|
63
63
|
led
|
64
64
|
|
65
|
-
mock =
|
65
|
+
mock = Minitest::Mock.new.expect :call, nil, [0]
|
66
66
|
part.stub(:digital_read, mock) do
|
67
67
|
led.board.digital_read(led.pin)
|
68
68
|
end
|
@@ -73,7 +73,7 @@ class OutputRegisterTest < Minitest::Test
|
|
73
73
|
part.instance_variable_set(:@bytes, 2)
|
74
74
|
bit_array = "0101010100001111".split("")
|
75
75
|
|
76
|
-
mock =
|
76
|
+
mock = Minitest::Mock.new.expect :call, nil, [9], write: [0b11110000, 0b10101010], frequency: 800000, mode: 2, bit_order: :lsbfirst
|
77
77
|
bus.stub(:transfer, mock) do
|
78
78
|
part.instance_variable_set(:@state, bit_array)
|
79
79
|
part.write
|
data/test/test_helper.rb
CHANGED
@@ -100,7 +100,12 @@ module Constants
|
|
100
100
|
opts[:on].send(:remove_const, const) if self.class.const_defined?(const)
|
101
101
|
opts[:on].const_set(const, value)
|
102
102
|
end
|
103
|
-
|
103
|
+
# Imaginary handshake ack from the board. Not a real SAMD_ZERO device.
|
104
|
+
# Serial buffer = 256
|
105
|
+
# Aux size = 528
|
106
|
+
# EEPROM size = 1024
|
107
|
+
# I2C buffer = 32
|
108
|
+
ACK = "SAMD_ZERO,0.13.0,256,528,1024,32"
|
104
109
|
|
105
110
|
# Some test redefine RUBY_PLATFORM. Save the original to reset it.
|
106
111
|
ORIGINAL_RUBY_PLATFORM = RUBY_PLATFORM
|
@@ -137,6 +142,9 @@ class ConnectionMock
|
|
137
142
|
def handshake
|
138
143
|
Constants::ACK
|
139
144
|
end
|
145
|
+
def remote_buffer_size=(size)
|
146
|
+
@remote_buffer_size = size
|
147
|
+
end
|
140
148
|
end
|
141
149
|
|
142
150
|
class BoardMock < Denko::Board
|
@@ -211,7 +219,7 @@ module TestPacker
|
|
211
219
|
end
|
212
220
|
end
|
213
221
|
|
214
|
-
# Speed up
|
222
|
+
# Speed up tests which use long delays.
|
215
223
|
module Denko
|
216
224
|
module OneWire
|
217
225
|
class Bus
|
@@ -220,4 +228,11 @@ module Denko
|
|
220
228
|
end
|
221
229
|
end
|
222
230
|
end
|
231
|
+
module LED
|
232
|
+
class SevenSegment
|
233
|
+
def sleep(time)
|
234
|
+
super(0.001)
|
235
|
+
end
|
236
|
+
end
|
237
|
+
end
|
223
238
|
end
|
data/test/uart/bitbang_test.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
require_relative '../test_helper'
|
2
2
|
|
3
|
-
class UARTBitBangTest <
|
3
|
+
class UARTBitBangTest < Minitest::Test
|
4
4
|
include TestPacker
|
5
5
|
|
6
6
|
def board
|
@@ -12,7 +12,7 @@ class UARTBitBangTest < MiniTest::Test
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def test_initialize
|
15
|
-
mock =
|
15
|
+
mock = Minitest::Mock.new
|
16
16
|
# Set RX to input
|
17
17
|
mock.expect :call, nil, ["0.10.1\n"]
|
18
18
|
# Start BB UART
|
@@ -27,7 +27,7 @@ class UARTBitBangTest < MiniTest::Test
|
|
27
27
|
|
28
28
|
def test_write
|
29
29
|
part
|
30
|
-
mock =
|
30
|
+
mock = Minitest::Mock.new
|
31
31
|
mock.expect :call, nil, ["13..8.Testing\\\n\n"]
|
32
32
|
board.stub(:write, mock) do
|
33
33
|
part.write("Testing\n")
|