29#include "generated/airframe.h"
36#ifdef GPIO_EXT_PCA95XX_I2C_PERIPH1
37#define GPIO_EXT_PCA95XX_I2C_PERIPH1_PTR &(GPIO_EXT_PCA95XX_I2C_PERIPH1)
39#define GPIO_EXT_PCA95XX_I2C_PERIPH1_PTR NULL
41#ifdef GPIO_EXT_PCA95XX_I2C_PERIPH2
42#define GPIO_EXT_PCA95XX_I2C_PERIPH2_PTR &(GPIO_EXT_PCA95XX_I2C_PERIPH2)
44#define GPIO_EXT_PCA95XX_I2C_PERIPH2_PTR NULL
46#ifdef GPIO_EXT_PCA95XX_I2C_PERIPH3
47#define GPIO_EXT_PCA95XX_I2C_PERIPH3_PTR &(GPIO_EXT_PCA95XX_I2C_PERIPH3)
49#define GPIO_EXT_PCA95XX_I2C_PERIPH3_PTR NULL
51#ifdef GPIO_EXT_PCA95XX_I2C_PERIPH4
52#define GPIO_EXT_PCA95XX_I2C_PERIPH4_PTR &(GPIO_EXT_PCA95XX_I2C_PERIPH4)
54#define GPIO_EXT_PCA95XX_I2C_PERIPH4_PTR NULL
63#ifndef GPIO_EXT_PCA95XX_I2C_ADDRESS1
64#define GPIO_EXT_PCA95XX_I2C_ADDRESS1 0x00
66#ifndef GPIO_EXT_PCA95XX_I2C_ADDRESS2
67#define GPIO_EXT_PCA95XX_I2C_ADDRESS2 0x00
69#ifndef GPIO_EXT_PCA95XX_I2C_ADDRESS3
70#define GPIO_EXT_PCA95XX_I2C_ADDRESS3 0x00
72#ifndef GPIO_EXT_PCA95XX_I2C_ADDRESS4
73#define GPIO_EXT_PCA95XX_I2C_ADDRESS4 0x00
82#ifndef GPIO_EXT_PCA95XX_BLOCKING1
83#define GPIO_EXT_PCA95XX_BLOCKING1 TRUE
85#ifndef GPIO_EXT_PCA95XX_BLOCKING2
86#define GPIO_EXT_PCA95XX_BLOCKING2 TRUE
88#ifndef GPIO_EXT_PCA95XX_BLOCKING3
89#define GPIO_EXT_PCA95XX_BLOCKING3 TRUE
91#ifndef GPIO_EXT_PCA95XX_BLOCKING4
92#define GPIO_EXT_PCA95XX_BLOCKING4 TRUE
static void gpio_ext_pca95xx_set(uint32_t port, uint32_t gpios)
#define GPIO_EXT_PCA95XX_I2C_ADDRESS1
#define GPIO_EXT_PCA95XX_I2C_PERIPH1_PTR
#define GPIO_EXT_PCA95XX_I2C_ADDRESS3
static const uint8_t i2c_addr[]
#define GPIO_EXT_PCA95XX_I2C_PERIPH2_PTR
#define GPIO_EXT_PCA95XX_I2C_ADDRESS2
static void gpio_ext_pca95xx_toggle(uint32_t port, uint32_t gpios)
#define GPIO_EXT_PCA95XX_I2C_ADDRESS4
#define GPIO_EXT_PCA95XX_I2C_PERIPH3_PTR
static void gpio_ext_pca95xx_setup_output(uint32_t port, uint32_t gpios)
static void gpio_ext_pca95xx_clear(uint32_t port, uint32_t gpios)
static void gpio_ext_pca95xx_setup_input(uint32_t port, uint32_t gpios)
#define GPIO_EXT_PCA95XX_BLOCKING1
struct gpio_ext_functions pca95xx_functions
static uint32_t gpio_ext_pca95xx_get(uint32_t port, uint32_t gpios)
static struct gpio_ext_pca95xx_impl_t impl[GPIOEXT_NB]
static const bool blocking[]
static void gpio_ext_pca95xx_lazy_init(uint32_t port)
#define GPIO_EXT_PCA95XX_I2C_PERIPH4_PTR
enum I2CTransactionStatus status
Transaction status.
@ I2CTransSuccess
transaction successfully finished by I2C driver
Architecture independent I2C (Inter-Integrated Circuit Bus) API.
void pca95xx_init(struct pca95xx *dev, struct i2c_periph *i2c_p, uint8_t addr)
Init PCA95XX.
bool pca95xx_get_input(struct pca95xx *dev, uint8_t mask, uint8_t *result)
Get input value.
bool pca95xx_configure(struct pca95xx *dev, uint8_t val, bool blocking)
Configure PCA95XX.
bool pca95xx_set_output(struct pca95xx *dev, uint8_t mask, bool blocking)
Set output value.
Driver for the 8-bit I/O expander based on i2c.
struct i2c_transaction i2c_trans
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.