|
const iface_config_type & | iface_config () const |
| Access the interface configuration for the device.
|
|
const gpio_regs_type & | gpio_cache () const noexcept |
| Access the internal cache of GPIO registers.
|
|
uint16_t | led_driver_cache () const |
| Access the internal cache of LEDDriverEnable.
|
|
uint8_t | clock_cache () const |
| Access the internal cache of Clock.
|
|
uint8_t | misc_cache () const |
| Access the internal cache of Misc.
|
|
int | reload_cache () noexcept |
| Read all locally cached registers from the device. More...
|
|
unsigned int | configuration (unsigned int psel) const noexcept |
| Return the GPIO pin configuration for the given IOX pin. More...
|
|
int | configure (unsigned int psel, unsigned int pin_cnf, int initial=-1) noexcept |
| Change the GPIO pin configuration for the given IOX pin. More...
|
|
int | multiconfigure (uint16_t out_set, uint16_t out_clear, uint16_t pull_down, uint16_t pull_up=0) noexcept |
| Configure multiple pins at once. More...
|
|
| sx1509b (iface_config_type &ifc, unsigned int addr=0) noexcept |
| Instantiate the device. More...
|
|
int | hw_reset () noexcept |
| Reset the device to its power-on state via RESETn. More...
|
|
int | sw_reset () noexcept |
| Reset the device to its power-on state via software command. More...
|
|
int | clock () const noexcept |
| Read the Clock register from the SX1509B. More...
|
|
int | clock (uint8_t value) noexcept |
| Set the Clock register in the SX1509B. More...
|
|
int | misc () const noexcept |
| Read the Misc register from the SX1509B. More...
|
|
int | misc (uint8_t value) noexcept |
| Set the Misc register in the SX1509B. More...
|
|
int | configure_as_leds (uint16_t leds, bool source_current=false) noexcept |
| Configure a set of pins for LED operations. More...
|
|
int | led_configuration (unsigned int psel, led_type &cfg) const noexcept |
| Read the LED configuration for the given pin. More...
|
|
int | led_configuration (unsigned int psel, led_pwm_type &cfg) const noexcept |
| Set the LED configuration for the given pin. More...
|
|
int | led_configure (unsigned int psel, const led_type &cfg) const noexcept |
| Set the LED configuration for the given pin. More...
|
|
int | led_configure (unsigned int psel, const led_pwm_type &cfg) const noexcept |
| Set the LED configuration for the given pin. More...
|
|
int | output_sct (uint16_t set, uint16_t clear) noexcept |
| Multi-signal set, clear, and toggle API. More...
|
|
|
static constexpr auto | RegClock_FREQ_Pos = 5U |
|
static constexpr uint16_t | RegClock_FREQ_Msk = 0x03 << RegClock_FREQ_Pos |
|
static constexpr uint16_t | RegClock_FREQ_Off = 0 |
|
static constexpr uint16_t | RegClock_FREQ_External = 1 |
|
static constexpr uint16_t | RegClock_FREQ_2MHz = 2 |
|
static constexpr auto | RegClock_OSCIO_Pos = 4U |
|
static constexpr uint16_t | RegClock_OSCIO_Msk = 0x01 << RegClock_OSCIO_Pos |
|
static constexpr uint16_t | RegClock_OSCIO_Input = 0 |
|
static constexpr uint16_t | RegClock_OSCIO_Output = 1 |
|
static constexpr auto | RegClock_OUTFREQ_Pos = 0U |
|
static constexpr uint16_t | RegClock_OUTFREQ_Msk = 0x0F << RegClock_OUTFREQ_Pos |
|
static constexpr uint16_t | RegClock_OUTFREQ_Low = 0 |
|
static constexpr uint16_t | RegClock_OUTFREQ_High = 0x0F |
|
static constexpr auto | RegMisc_LEDB_Pos = 7U |
|
static constexpr uint16_t | RegMisc_LEDB_Msk = 1U << RegMisc_LEDB_Pos |
|
static constexpr uint16_t | RegMisc_LEDB_Linear = 0 |
|
static constexpr uint16_t | RegMisc_LEDB_Logarithmic = 1 |
|
static constexpr auto | RegMisc_LEDFREQ_Pos = 4U |
|
static constexpr uint16_t | RegMisc_LEDFREQ_Msk = 0x07U << RegMisc_LEDFREQ_Pos |
|
static constexpr uint16_t | RegMisc_LEDFREQ_Off = 0 |
|
static constexpr auto | RegMisc_LEDA_Pos = 3U |
|
static constexpr uint16_t | RegMisc_LEDA_Msk = 1U << RegMisc_LEDA_Pos |
|
static constexpr uint16_t | RegMisc_LEDA_Linear = 0 |
|
static constexpr uint16_t | RegMisc_LEDA_Logarithmic = 1 |
|
static constexpr auto | RegMisc_NRESET_Pos = 2U |
|
static constexpr uint16_t | RegMisc_NRESET_Msk = 1U << RegMisc_NRESET_Pos |
|
static constexpr uint16_t | RegMisc_NRESET_POR = 0 |
|
static constexpr uint16_t | RegMisc_NRESET_ResetCounters = 1 |
|
static constexpr auto | RegMisc_AUTOINC_Pos = 1U |
|
static constexpr uint16_t | RegMisc_AUTOINC_Msk = 1U << RegMisc_AUTOINC_Pos |
|
static constexpr uint16_t | RegMisc_AUTOINC_On = 0 |
|
static constexpr uint16_t | RegMisc_AUTOINC_Off = 1 |
|
static constexpr auto | RegMisc_AUTOCLR_Pos = 0U |
|
static constexpr uint16_t | RegMisc_AUTOCLR_Msk = 1U << RegMisc_AUTOCLR_Pos |
|
static constexpr uint16_t | RegMisc_AUTOCLR_On = 0 |
|
static constexpr uint16_t | RegMisc_AUTOCLR_Off = 1 |
|
static constexpr auto | RegTOnX_TOn_Pos = 0U |
|
static constexpr uint16_t | RegTOnX_TOn_Msk = 0x1F << RegTOnX_TOn_Pos |
|
static constexpr auto | RegOffX_TOff_Pos = 3U |
|
static constexpr uint16_t | RegOffX_TOff_Msk = 0x1F << RegOffX_TOff_Pos |
|
static constexpr auto | RegOffX_IOff_Pos = 0U |
|
static constexpr uint16_t | RegOffX_IOff_Msk = 0x07 << RegOffX_IOff_Pos |
|
Abstraction around the Semtex SX1509B Level-Shifting GPIO Extender.
- Note
- At this time only basic GPIO and LED driver functionality is supported.
- See also
- https://www.semtech.com/products/smart-sensing/io-expanders/sx1509b