257#if IS_USED(MODULE_SAUL_GPIO) || DOXYGEN
261#if IS_USED(MODULE_PCF857X_IRQ) || DOXYGEN
273#ifndef PCF8575_BASE_ADDR
274#define PCF8575_BASE_ADDR (0x20)
278#ifndef PCF8574_BASE_ADDR
279#define PCF8574_BASE_ADDR (0x20)
283#ifndef PCF8574A_BASE_ADDR
284#define PCF8574A_BASE_ADDR (0x38)
294#define PCF8575_GPIO_PIN_NUM (16)
295#define PCF8574_GPIO_PIN_NUM (8)
296#define PCF8574A_GPIO_PIN_NUM (8)
300#define PCF857X_GPIO_PIN(x,y) (y)
306#if IS_USED(MODULE_PCF8575) || DOXYGEN
314#define PCF857X_GPIO_PIN_NUM (16)
325#define PCF857X_GPIO_PIN_NUM (8)
355#if IS_USED(MODULE_PCF8574) || DOXYGEN
358#if IS_USED(MODULE_PCF8574A) || DOXYGEN
361#if IS_USED(MODULE_PCF8575) || DOXYGEN
378#if IS_USED(MODULE_PCF857X_IRQ) || DOXYGEN
388#if IS_USED(MODULE_PCF857X_IRQ) || DOXYGEN
423#if IS_USED(MODULE_PCF857X_IRQ) || DOXYGEN
432#if IS_USED(MODULE_SAUL_GPIO) || DOXYGEN
489#if IS_USED(MODULE_PCF857X_IRQ) || DOXYGEN
576#if IS_USED(MODULE_PCF857X_IRQ) || DOXYGEN
Low-level GPIO peripheral driver interface definitions.
#define ENXIO
No such device or address.
#define EINVAL
Invalid argument.
#define ENOSYS
Function not supported.
#define ENOTSUP
Not supported (may be the same value as [EOPNOTSUPP]).
int pcf857x_init(pcf857x_t *dev, const pcf857x_params_t *params)
Initialize the PCF857X I/O expander.
pcf857x_exp_t
Definition of PCF857X expander variants.
void pcf857x_gpio_irq_disable(pcf857x_t *dev, uint8_t pin)
Disable pin interrupt.
uint16_t pcf857x_data_t
Data type that can mask all expander pins.
void pcf857x_gpio_write(pcf857x_t *dev, uint8_t pin, int value)
Write the value to PCF857X input pin.
#define PCF857X_GPIO_PIN_NUM
Maximum number of GPIO pins.
int pcf857x_gpio_init(pcf857x_t *dev, uint8_t pin, gpio_mode_t mode)
Initialize a PCF857X pin.
void pcf857x_gpio_irq_enable(pcf857x_t *dev, uint8_t pin)
Enable pin interrupt.
void pcf857x_gpio_clear(pcf857x_t *dev, uint8_t pin)
Clear the PCF857X output pin.
pcf857x_error_codes_t
Definition of PCF857X driver error codes.
int pcf857x_gpio_init_int(pcf857x_t *dev, uint8_t pin, gpio_mode_t mode, gpio_flank_t flank, gpio_cb_t isr, void *arg)
Initialize a PCF857X pin for external interrupt usage.
void pcf857x_gpio_set(pcf857x_t *dev, uint8_t pin)
Set the PCF857X output pin.
int pcf857x_gpio_read(pcf857x_t *dev, uint8_t pin)
Get the value from PCF857X input pin.
void pcf857x_gpio_toggle(pcf857x_t *dev, uint8_t pin)
Toggle the value of the PCF857X output pin.
@ PCF857X_EXP_PCF8574
PCF8574 8 bit I/O expander used.
@ PCF857X_EXP_PCF8575
PCF8575 16 bit I/O expander.
@ PCF857X_EXP_PCF8574A
PCF8574A 8 bit I/O expander.
@ PCF857X_ERROR_INT_PIN
interrupt pin initialization failed
@ PCF857X_ERROR_INV_FLANK
invalid interrupt flank
@ PCF857X_ERROR_INV_EXP
invalid expander variant
@ PCF857X_ERROR_I2C
I2C communication error.
@ PCF857X_ERROR_INV_MODE
invalid pin mode
void(* gpio_cb_t)(void *arg)
Signature of event callback functions triggered from interrupts.
uint_fast8_t i2c_t
Default i2c_t type definition.
Low-level I2C peripheral driver interface definition.
Common macros and compiler attributes/pragmas configuration.
gpio_mode_t
Available pin modes.
Parameter definitions for mapping peripherals directly to SAUL.
Default interrupt context for GPIO pins.
event_t event
inherited event data structure
void * dev
PCF857X device reference.
PCF857X device initialization parameters.
pcf857x_exp_t exp
PCF857X expander variant used by the device (default depends on used pseudomodules.
gpio_t int_pin
MCU GPIO pin or GPIO_UNDEF if not used (default).
i2c_t dev
I2C device (default I2C_DEV(0))
uint16_t addr
I2C slave address offset to the PCF7857X base address (default 0)
PCF857X configuration structure for mapping expander pins to SAUL.
unsigned int dev
PCF857X device index.
saul_gpio_params_t gpio
GPIO configuration for mapping to SAUL.
PCF857X device data structure type.
pcf857x_params_t params
device initialization parameters
pcf857x_data_t modes
expander pin modes
pcf857x_irq_event_t irq_event
IRQ event object used for the device.
uint8_t pin_num
number of I/O pins, depends on used expander variant
pcf857x_data_t in
expander input pin values
pcf857x_data_t out
expander output pin values
Direct mapped GPIO configuration values.