pca9555.c File Reference

Go to the source code of this file.

Defines

#define I2C_SLA_IOEXP   0x23
#define PCA_PINP   0
#define PCA_POUT   2
#define PCA_PINV   4
#define PCA_CONF   6

Functions

int IOExpInit (void)
int IOExpPinConfigSet (int bank, int bit, uint32_t flags)
int IOExpRawWrite (int bank, int value)
int IOExpRawRead (int bank, int *value)
int IOExpGetBit (int bank, int bit, int *value)
int IOExpSetBitHigh (int bank, int bit)
int IOExpSetBitLow (int bank, int bit)
int IOExpSetBit (int bank, int bit, int value)

Variables

pca_regs_t * pca_ctrl = NULL


Define Documentation

#define I2C_SLA_IOEXP   0x23

#define PCA_PINP   0

PCA Input register offset

Definition at line 60 of file pca9555.c.

Referenced by IOExpGetBit(), and IOExpRawRead().

#define PCA_POUT   2

PCA Output register offset

Definition at line 61 of file pca9555.c.

Referenced by IOExpInit(), IOExpPinConfigSet(), IOExpRawWrite(), IOExpSetBitHigh(), and IOExpSetBitLow().

#define PCA_PINV   4

PCA Polarity inversion register offset

Definition at line 62 of file pca9555.c.

#define PCA_CONF   6

PCA Configuration register offset

Definition at line 63 of file pca9555.c.

Referenced by IOExpPinConfigSet().


Function Documentation

int IOExpInit ( void   ) 

Definition at line 75 of file pca9555.c.

References I2C_SLA_IOEXP, malloc, memset(), pca_ctrl, PCA_POUT, and TwMasterRegWrite().

Referenced by main().

int IOExpPinConfigSet ( int  bank,
int  bit,
uint32_t  flags 
)

Definition at line 97 of file pca9555.c.

References GPIO_CFG_OUTPUT, GPIO_CFG_PULLUP, I2C_SLA_IOEXP, PCA_CONF, pca_ctrl, PCA_POUT, and TwMasterRegWrite().

Referenced by InitKEY(), and InitLED().

int IOExpRawWrite ( int  bank,
int  value 
)

Definition at line 119 of file pca9555.c.

References I2C_SLA_IOEXP, pca_ctrl, PCA_POUT, and TwMasterRegWrite().

int IOExpRawRead ( int  bank,
int *  value 
)

Definition at line 133 of file pca9555.c.

References I2C_SLA_IOEXP, PCA_PINP, and TwMasterRegRead().

Referenced by sys_key(), and Thread2().

int IOExpGetBit ( int  bank,
int  bit,
int *  value 
)

Definition at line 146 of file pca9555.c.

References I2C_SLA_IOEXP, PCA_PINP, and TwMasterRegRead().

int IOExpSetBitHigh ( int  bank,
int  bit 
)

Definition at line 163 of file pca9555.c.

References I2C_SLA_IOEXP, pca_ctrl, PCA_POUT, and TwMasterRegWrite().

Referenced by InitLED(), and IOExpSetBit().

int IOExpSetBitLow ( int  bank,
int  bit 
)

Definition at line 177 of file pca9555.c.

References I2C_SLA_IOEXP, pca_ctrl, PCA_POUT, and TwMasterRegWrite().

Referenced by IOExpSetBit().

int IOExpSetBit ( int  bank,
int  bit,
int  value 
)

Definition at line 191 of file pca9555.c.

References IOExpSetBitHigh(), and IOExpSetBitLow().

Referenced by NutSetLed().


Variable Documentation

pca_regs_t* pca_ctrl = NULL


© 2000-2007 by egnite Software GmbH - visit http://www.ethernut.de/