Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
pca95xx.c File Reference

Driver for the 8-bit I/O expander based on i2c. More...

+ Include dependency graph for pca95xx.c:

Go to the source code of this file.

Functions

void pca95xx_init (struct pca95xx *dev, struct i2c_periph *i2c_p, uint8_t addr)
 Init PCA95XX. More...
 
bool pca95xx_configure (struct pca95xx *dev, uint8_t val, bool blocking)
 Configure PCA95XX. More...
 
bool pca95xx_set_output (struct pca95xx *dev, uint8_t mask, bool blocking)
 Set output value. More...
 
bool pca95xx_get_input (struct pca95xx *dev, uint8_t mask, uint8_t *result)
 Get input value. More...
 

Detailed Description

Driver for the 8-bit I/O expander based on i2c.

Definition in file pca95xx.c.

Function Documentation

◆ pca95xx_configure()

bool pca95xx_configure ( struct pca95xx dev,
uint8_t  val,
bool  blocking 
)

Configure PCA95XX.

Parameters
[in]devaddress to pca95xx device
[in]valvalue to write to confi register
[in]blockingtrue for blocking i2c transaction
Returns
false if i2c was not ready or transaction submit fails or timeout (blocking)

Definition at line 42 of file pca95xx.c.

References blocking, dev, i2c_blocking_transmit(), i2c_transmit(), I2CTransDone, I2CTransFailed, I2CTransSuccess, PCA95XX_CONFIG_REG, and val.

Referenced by gpio_ext_pca95xx_lazy_init(), gpio_ext_pca95xx_setup_input(), gpio_ext_pca95xx_setup_output(), multi_ranger_init(), and multi_ranger_periodic().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pca95xx_get_input()

bool pca95xx_get_input ( struct pca95xx dev,
uint8_t  mask,
uint8_t result 
)

Get input value.

Parameters
[in]devaddress to pca95xx device
[in]maskinput pins
[out]inputregister with mask applied Note: always blocking
Returns
false if i2c was not ready or transaction submit fails or timeout (blocking)

Definition at line 78 of file pca95xx.c.

References dev, i2c_blocking_transceive(), I2CTransDone, I2CTransFailed, I2CTransSuccess, and PCA95XX_INPUT_REG.

Referenced by gpio_ext_pca95xx_get().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pca95xx_init()

void pca95xx_init ( struct pca95xx dev,
struct i2c_periph i2c_p,
uint8_t  addr 
)

Init PCA95XX.

Parameters
[in]devaddress to pca95xx device
[in]i2c_paddres of i2c bus
[in]addri2c address

Definition at line 30 of file pca95xx.c.

References dev, and I2CTransDone.

Referenced by gpio_ext_pca95xx_lazy_init(), and multi_ranger_init().

+ Here is the caller graph for this function:

◆ pca95xx_set_output()

bool pca95xx_set_output ( struct pca95xx dev,
uint8_t  mask,
bool  blocking 
)

Set output value.

Parameters
[in]devaddress to pca95xx device
[in]maskoutput pins to set
[in]blockingtrue for blocking i2c transaction
Returns
false if i2c was not ready or transaction submit fails or timeout (blocking)

Definition at line 60 of file pca95xx.c.

References blocking, dev, i2c_blocking_transmit(), i2c_transmit(), I2CTransDone, I2CTransFailed, I2CTransSuccess, and PCA95XX_OUTPUT_REG.

Referenced by gpio_ext_pca95xx_clear(), gpio_ext_pca95xx_set(), multi_ranger_init(), and multi_ranger_periodic().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: