Paparazzi UAS  v5.15_devel-230-gc96ce27
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
pca95x4.c File Reference

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

+ Include dependency graph for pca95x4.c:

Go to the source code of this file.

Functions

void pca95x4_init (struct pca95x4 *dev, struct i2c_periph *i2c_p, uint8_t addr)
 Init PCA95X4. More...
 
bool pca95x4_configure (struct pca95x4 *dev, uint8_t val, bool blocking)
 Configure PCA95X4. More...
 
bool pca95x4_set_output (struct pca95x4 *dev, uint8_t mask, bool blocking)
 Set output value. More...
 

Detailed Description

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

Definition in file pca95x4.c.

Function Documentation

bool pca95x4_configure ( struct pca95x4 dev,
uint8_t  val,
bool  blocking 
)

Configure PCA95X4.

Parameters
[in]devaddress to pca95x4 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 pca95x4.c.

References i2c_transaction::buf, i2c_blocking_transmit(), pca95x4::i2c_p, pca95x4::i2c_trans, i2c_transmit(), I2CTransDone, I2CTransFailed, I2CTransSuccess, PCA95X4_CONFIG_REG, i2c_transaction::slave_addr, i2c_transaction::status, and val.

Referenced by multi_ranger_init(), and multi_ranger_periodic().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void pca95x4_init ( struct pca95x4 dev,
struct i2c_periph i2c_p,
uint8_t  addr 
)

Init PCA95X4.

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

Definition at line 30 of file pca95x4.c.

References pca95x4::i2c_p, pca95x4::i2c_trans, I2CTransDone, i2c_transaction::slave_addr, and i2c_transaction::status.

Referenced by multi_ranger_init().

+ Here is the caller graph for this function:

bool pca95x4_set_output ( struct pca95x4 dev,
uint8_t  mask,
bool  blocking 
)

Set output value.

Parameters
[in]devaddress to pca95x4 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 pca95x4.c.

References i2c_transaction::buf, i2c_blocking_transmit(), pca95x4::i2c_p, pca95x4::i2c_trans, i2c_transmit(), I2CTransDone, I2CTransFailed, I2CTransSuccess, PCA95X4_OUTPUT_REG, i2c_transaction::slave_addr, and i2c_transaction::status.

Referenced by multi_ranger_init(), and multi_ranger_periodic().

+ Here is the call graph for this function:

+ Here is the caller graph for this function: