ESPHome
2024.11.0
|
Here you'll find the Arduino code used to interface with the SX1509 I2C 16 I/O expander. More...
Data Structures | |
class | SX1509BinarySensor |
class | SX1509Component |
class | SX1509FloatOutputChannel |
class | SX1509GPIOPin |
class | SX1509Processor |
Variables | |
const uint8_t | INTERNAL_CLOCK_2MHZ = 2 |
const uint8_t | EXTERNAL_CLOCK = 1 |
const uint8_t | SOFTWARE_RESET = 0 |
const uint8_t | HARDWARE_RESET = 1 |
const uint8_t | REG_I_ON [16] |
const uint8_t | REG_INPUT_DISABLE_B |
const uint8_t | REG_INPUT_DISABLE_A |
const uint8_t | REG_LONG_SLEW_B |
const uint8_t | REG_LONG_SLEW_A = 0x03 |
const uint8_t | REG_LOW_DRIVE_B |
const uint8_t | REG_LOW_DRIVE_A = 0x05 |
const uint8_t | REG_PULL_UP_B = 0x06 |
const uint8_t | REG_PULL_UP_A = 0x07 |
const uint8_t | REG_PULL_DOWN_B = 0x08 |
const uint8_t | REG_PULL_DOWN_A = 0x09 |
const uint8_t | REG_OPEN_DRAIN_B = 0x0A |
const uint8_t | REG_OPEN_DRAIN_A = 0x0B |
const uint8_t | REG_POLARITY_B = 0x0C |
const uint8_t | REG_POLARITY_A = 0x0D |
const uint8_t | REG_DIR_B = 0x0E |
const uint8_t | REG_DIR_A = 0x0F |
const uint8_t | REG_DATA_B = 0x10 |
const uint8_t | REG_DATA_A = 0x11 |
const uint8_t | REG_INTERRUPT_MASK_B |
const uint8_t | REG_INTERRUPT_MASK_A |
const uint8_t | REG_SENSE_HIGH_B = 0x14 |
const uint8_t | REG_SENSE_LOW_B = 0x15 |
const uint8_t | REG_SENSE_HIGH_A = 0x16 |
const uint8_t | REG_SENSE_LOW_A = 0x17 |
const uint8_t | REG_INTERRUPT_SOURCE_B |
const uint8_t | REG_INTERRUPT_SOURCE_A |
const uint8_t | REG_EVENT_STATUS_B = 0x1A |
const uint8_t | REG_EVENT_STATUS_A = 0x1B |
const uint8_t | REG_LEVEL_SHIFTER_1 = 0x1C |
const uint8_t | REG_LEVEL_SHIFTER_2 = 0x1D |
const uint8_t | REG_CLOCK = 0x1E |
const uint8_t | REG_MISC = 0x1F |
const uint8_t | REG_LED_DRIVER_ENABLE_B |
const uint8_t | REG_LED_DRIVER_ENABLE_A |
const uint8_t | REG_DEBOUNCE_CONFIG = 0x22 |
const uint8_t | REG_DEBOUNCE_ENABLE_B |
const uint8_t | REG_DEBOUNCE_ENABLE_A |
const uint8_t | REG_KEY_CONFIG_1 = 0x25 |
const uint8_t | REG_KEY_CONFIG_2 = 0x26 |
const uint8_t | REG_KEY_DATA_1 = 0x27 |
const uint8_t | REG_KEY_DATA_2 = 0x28 |
const uint8_t | REG_I_ON_0 = 0x2A |
const uint8_t | REG_I_ON_1 = 0x2D |
const uint8_t | REG_I_ON_2 = 0x30 |
const uint8_t | REG_I_ON_3 = 0x33 |
const uint8_t | REG_I_ON_4 = 0x36 |
const uint8_t | REG_I_ON_5 = 0x3B |
const uint8_t | REG_I_ON_6 = 0x40 |
const uint8_t | REG_I_ON_7 = 0x45 |
const uint8_t | REG_I_ON_8 = 0x4A |
const uint8_t | REG_I_ON_9 = 0x4D |
const uint8_t | REG_I_ON_10 = 0x50 |
const uint8_t | REG_I_ON_11 = 0x53 |
const uint8_t | REG_I_ON_12 = 0x56 |
const uint8_t | REG_I_ON_13 = 0x5B |
const uint8_t | REG_I_ON_14 = 0x60 |
const uint8_t | REG_I_ON_15 = 0x65 |
const uint8_t | REG_HIGH_INPUT_B = 0x69 |
const uint8_t | REG_HIGH_INPUT_A = 0x6A |
const uint8_t | REG_RESET = 0x7D |
const uint8_t | REG_TEST_1 = 0x7E |
const uint8_t | REG_TEST_2 = 0x7F |
Here you'll find the Arduino code used to interface with the SX1509 I2C 16 I/O expander.
There are functions to take advantage of everything the SX1509 provides - input/output setting, writing pins high/low, reading the input value of pins, LED driver utilities (blink, breath, pwm), and keypad engine utilities.
Development environment specifics: IDE: Arduino 1.6.5 Hardware Platform: Arduino Uno SX1509 Breakout Version: v2.0
This code is beerware; if you see me (or any other SparkFun employee) at the local, and you've found our code helpful, please buy us a round!
Distributed as-is; no warranty is given.
const uint8_t esphome::sx1509::REG_CLOCK = 0x1E |
Definition at line 68 of file sx1509_registers.h.
const uint8_t esphome::sx1509::REG_DATA_A = 0x11 |
Definition at line 51 of file sx1509_registers.h.
const uint8_t esphome::sx1509::REG_DATA_B = 0x10 |
Definition at line 50 of file sx1509_registers.h.
const uint8_t esphome::sx1509::REG_DEBOUNCE_CONFIG = 0x22 |
Definition at line 75 of file sx1509_registers.h.
const uint8_t esphome::sx1509::REG_DEBOUNCE_ENABLE_A |
Definition at line 78 of file sx1509_registers.h.
const uint8_t esphome::sx1509::REG_DEBOUNCE_ENABLE_B |
Definition at line 76 of file sx1509_registers.h.
const uint8_t esphome::sx1509::REG_DIR_A = 0x0F |
Definition at line 49 of file sx1509_registers.h.
const uint8_t esphome::sx1509::REG_DIR_B = 0x0E |
Definition at line 48 of file sx1509_registers.h.
const uint8_t esphome::sx1509::REG_EVENT_STATUS_A = 0x1B |
Definition at line 65 of file sx1509_registers.h.
const uint8_t esphome::sx1509::REG_EVENT_STATUS_B = 0x1A |
Definition at line 64 of file sx1509_registers.h.
const uint8_t esphome::sx1509::REG_HIGH_INPUT_A = 0x6A |
Definition at line 103 of file sx1509_registers.h.
const uint8_t esphome::sx1509::REG_HIGH_INPUT_B = 0x69 |
Definition at line 102 of file sx1509_registers.h.
const uint8_t esphome::sx1509::REG_I_ON[16] |
const uint8_t esphome::sx1509::REG_I_ON_0 = 0x2A |
Definition at line 85 of file sx1509_registers.h.
const uint8_t esphome::sx1509::REG_I_ON_1 = 0x2D |
Definition at line 86 of file sx1509_registers.h.
const uint8_t esphome::sx1509::REG_I_ON_10 = 0x50 |
Definition at line 95 of file sx1509_registers.h.
const uint8_t esphome::sx1509::REG_I_ON_11 = 0x53 |
Definition at line 96 of file sx1509_registers.h.
const uint8_t esphome::sx1509::REG_I_ON_12 = 0x56 |
Definition at line 97 of file sx1509_registers.h.
const uint8_t esphome::sx1509::REG_I_ON_13 = 0x5B |
Definition at line 98 of file sx1509_registers.h.
const uint8_t esphome::sx1509::REG_I_ON_14 = 0x60 |
Definition at line 99 of file sx1509_registers.h.
const uint8_t esphome::sx1509::REG_I_ON_15 = 0x65 |
Definition at line 100 of file sx1509_registers.h.
const uint8_t esphome::sx1509::REG_I_ON_2 = 0x30 |
Definition at line 87 of file sx1509_registers.h.
const uint8_t esphome::sx1509::REG_I_ON_3 = 0x33 |
Definition at line 88 of file sx1509_registers.h.
const uint8_t esphome::sx1509::REG_I_ON_4 = 0x36 |
Definition at line 89 of file sx1509_registers.h.
const uint8_t esphome::sx1509::REG_I_ON_5 = 0x3B |
Definition at line 90 of file sx1509_registers.h.
const uint8_t esphome::sx1509::REG_I_ON_6 = 0x40 |
Definition at line 91 of file sx1509_registers.h.
const uint8_t esphome::sx1509::REG_I_ON_7 = 0x45 |
Definition at line 92 of file sx1509_registers.h.
const uint8_t esphome::sx1509::REG_I_ON_8 = 0x4A |
Definition at line 93 of file sx1509_registers.h.
const uint8_t esphome::sx1509::REG_I_ON_9 = 0x4D |
Definition at line 94 of file sx1509_registers.h.
const uint8_t esphome::sx1509::REG_INPUT_DISABLE_A |
Definition at line 32 of file sx1509_registers.h.
const uint8_t esphome::sx1509::REG_INPUT_DISABLE_B |
Definition at line 30 of file sx1509_registers.h.
const uint8_t esphome::sx1509::REG_INTERRUPT_MASK_A |
Definition at line 54 of file sx1509_registers.h.
const uint8_t esphome::sx1509::REG_INTERRUPT_MASK_B |
Definition at line 52 of file sx1509_registers.h.
const uint8_t esphome::sx1509::REG_INTERRUPT_SOURCE_A |
Definition at line 62 of file sx1509_registers.h.
const uint8_t esphome::sx1509::REG_INTERRUPT_SOURCE_B |
Definition at line 60 of file sx1509_registers.h.
const uint8_t esphome::sx1509::REG_KEY_CONFIG_1 = 0x25 |
Definition at line 80 of file sx1509_registers.h.
const uint8_t esphome::sx1509::REG_KEY_CONFIG_2 = 0x26 |
Definition at line 81 of file sx1509_registers.h.
const uint8_t esphome::sx1509::REG_KEY_DATA_1 = 0x27 |
Definition at line 82 of file sx1509_registers.h.
const uint8_t esphome::sx1509::REG_KEY_DATA_2 = 0x28 |
Definition at line 83 of file sx1509_registers.h.
const uint8_t esphome::sx1509::REG_LED_DRIVER_ENABLE_A |
Definition at line 72 of file sx1509_registers.h.
const uint8_t esphome::sx1509::REG_LED_DRIVER_ENABLE_B |
Definition at line 70 of file sx1509_registers.h.
const uint8_t esphome::sx1509::REG_LEVEL_SHIFTER_1 = 0x1C |
Definition at line 66 of file sx1509_registers.h.
const uint8_t esphome::sx1509::REG_LEVEL_SHIFTER_2 = 0x1D |
Definition at line 67 of file sx1509_registers.h.
const uint8_t esphome::sx1509::REG_LONG_SLEW_A = 0x03 |
Definition at line 36 of file sx1509_registers.h.
const uint8_t esphome::sx1509::REG_LONG_SLEW_B |
Definition at line 34 of file sx1509_registers.h.
const uint8_t esphome::sx1509::REG_LOW_DRIVE_A = 0x05 |
Definition at line 39 of file sx1509_registers.h.
const uint8_t esphome::sx1509::REG_LOW_DRIVE_B |
Definition at line 37 of file sx1509_registers.h.
const uint8_t esphome::sx1509::REG_MISC = 0x1F |
Definition at line 69 of file sx1509_registers.h.
const uint8_t esphome::sx1509::REG_OPEN_DRAIN_A = 0x0B |
Definition at line 45 of file sx1509_registers.h.
const uint8_t esphome::sx1509::REG_OPEN_DRAIN_B = 0x0A |
Definition at line 44 of file sx1509_registers.h.
const uint8_t esphome::sx1509::REG_POLARITY_A = 0x0D |
Definition at line 47 of file sx1509_registers.h.
const uint8_t esphome::sx1509::REG_POLARITY_B = 0x0C |
Definition at line 46 of file sx1509_registers.h.
const uint8_t esphome::sx1509::REG_PULL_DOWN_A = 0x09 |
Definition at line 43 of file sx1509_registers.h.
const uint8_t esphome::sx1509::REG_PULL_DOWN_B = 0x08 |
Definition at line 42 of file sx1509_registers.h.
const uint8_t esphome::sx1509::REG_PULL_UP_A = 0x07 |
Definition at line 41 of file sx1509_registers.h.
const uint8_t esphome::sx1509::REG_PULL_UP_B = 0x06 |
Definition at line 40 of file sx1509_registers.h.
const uint8_t esphome::sx1509::REG_RESET = 0x7D |
Definition at line 105 of file sx1509_registers.h.
const uint8_t esphome::sx1509::REG_SENSE_HIGH_A = 0x16 |
Definition at line 58 of file sx1509_registers.h.
const uint8_t esphome::sx1509::REG_SENSE_HIGH_B = 0x14 |
Definition at line 56 of file sx1509_registers.h.
const uint8_t esphome::sx1509::REG_SENSE_LOW_A = 0x17 |
Definition at line 59 of file sx1509_registers.h.
const uint8_t esphome::sx1509::REG_SENSE_LOW_B = 0x15 |
Definition at line 57 of file sx1509_registers.h.
const uint8_t esphome::sx1509::REG_TEST_1 = 0x7E |
Definition at line 106 of file sx1509_registers.h.
const uint8_t esphome::sx1509::REG_TEST_2 = 0x7F |
Definition at line 107 of file sx1509_registers.h.