Tested with AT91R40008 only. Other ARMs or AVR may not work.
* * $Log: twbbif.c,v $ * Revision 1.1 2005/10/24 10:21:57 haraldkipp * Initial check in. * * *
Defines | |
#define | TWI_DELAY 8 |
Functions | |
int | TwMasterTransact (u_char sla, CONST void *txdata, u_short txlen, void *rxdata, u_short rxsiz, u_long tmo) |
Transmit and/or receive data as a master. | |
int | TwMasterError (void) |
Get last master mode error. | |
int | TwSlaveListen (u_char *sla, void *rxdata, u_short rxsiz, u_long tmo) |
Listen for incoming data from a master. | |
int | TwSlaveRespond (void *txdata, u_short txlen, u_long tmo) |
Send response to a master. | |
int | TwSlaveError (void) |
Get last slave mode error. | |
int | TwIOCtl (int req, void *conf) |
Perform TWI control functions. | |
int | TwInit (u_char sla) |
Initialize TWI interface. |
|
Transmit and/or receive data as a master. The two-wire serial interface must have been initialized by calling TwInit() before this function can be used.
|
|
Get last master mode error. You may call this function to determine the specific cause of an error after TwMasterTransact() failed.
|
|
Listen for incoming data from a master. If this function returns without error, the bus is blocked. The caller must immediately process the request and return a response by calling TwSlaveRespond().
|
|
Send response to a master. This function must be called as soon as possible after TwSlaveListen() returned successfully, even if no data needs to be returned. Not doing so will completely block the bus.
|
|
Get last slave mode error. You may call this function to determine the specific cause of an error after TwSlaveListen() or TwSlaveRespond() failed.
|
|
Perform TWI control functions. Not implemented in the bit banging version.
|
|
Initialize TWI interface. The specified slave address is used only, if the local system is running as a slave. Anyway, care must be taken that it doesn't conflict with another connected device.
|