Definition in file i2c.c.
#include <avr/io.h>
#include <avr/interrupt.h>
#include "i2c.h"
#include "rprintf.h"
#include "uart2.h"
Go to the source code of this file.
Functions | |
| void | i2cInit (void) |
| Initialize I2C (TWI) interface. | |
| void | i2cSetBitrate (u16 bitrateKHz) |
| Set the I2C transaction bitrate (in KHz). | |
| void | i2cSetLocalDeviceAddr (u08 deviceAddr, u08 genCallEn) |
| Set the local (AVR processor's) I2C device address. | |
| void | i2cSetSlaveReceiveHandler (void(*i2cSlaveRx_func)(u08 receiveDataLength, u08 *recieveData)) |
| Set the user function which handles receiving (incoming) data as a slave. | |
| void | i2cSetSlaveTransmitHandler (u08(*i2cSlaveTx_func)(u08 transmitDataLengthMax, u08 *transmitData)) |
| Set the user function which handles transmitting (outgoing) data as a slave. | |
| void | i2cSendStart (void) |
| Send an I2C start condition in Master mode. | |
| void | i2cSendStop (void) |
| Send an I2C stop condition in Master mode. | |
| void | i2cWaitForComplete (void) |
| Wait for current I2C operation to complete. | |
| void | i2cSendByte (u08 data) |
| Send an (address|R/W) combination or a data byte over I2C. | |
| void | i2cReceiveByte (u08 ackFlag) |
| Receive a data byte over I2C. | |
| u08 | i2cGetReceivedByte (void) |
| Pick up the data that was received with i2cReceiveByte(). | |
| u08 | i2cGetStatus (void) |
| Get current I2c bus status from TWSR. | |
| void | i2cMasterSend (u08 deviceAddr, u08 length, u08 *data) |
| send I2C data to a device on the bus | |
| void | i2cMasterReceive (u08 deviceAddr, u08 length, u08 *data) |
| receive I2C data from a device on the bus | |
| u08 | i2cMasterSendNI (u08 deviceAddr, u08 length, u08 *data) |
| send I2C data to a device on the bus (non-interrupt based) | |
| u08 | i2cMasterReceiveNI (u08 deviceAddr, u08 length, u08 *data) |
| receive I2C data from a device on the bus (non-interrupt based) | |
| SIGNAL (SIG_2WIRE_SERIAL) | |
| I2C (TWI) interrupt service routine. | |
| eI2cStateType | i2cGetState (void) |
| Get the current high-level state of the I2C interface. | |
1.4.2