xyControl
0.1
Quadrotor Flight Controller on AVR Basis
|
Using the AVR TWI/I2C Hardware. More...
Files | |
file | twi.h |
I2C API Header. | |
Macros | |
#define | TWI_READ 1 |
I2C Read Bit. More... | |
#define | TWI_WRITE 0 |
I2C Write Bit. More... | |
Functions | |
void | twiInit (void) |
Initialize the I2C Hardware. More... | |
void | twiStop (void) |
Stop the I2C Hardware. More... | |
unsigned char | twiStart (unsigned char addr) |
Start an I2C Transfer. More... | |
unsigned char | twiRepStart (unsigned char addr) |
Start a repeated I2C Transfer. More... | |
void | twiStartWait (unsigned char addr) |
Start an I2C Transfer and poll until ready. More... | |
unsigned char | twiWrite (unsigned char data) |
Write to the I2C Slave. More... | |
unsigned char | twiReadAck (void) |
Read from the I2C Slave and request more data. More... | |
unsigned char | twiReadNak (void) |
Read from the I2C Slave and deny more data. More... | |
Using the AVR TWI/I2C Hardware.
#define TWI_READ 1 |
I2C Read Bit.
Definition at line 43 of file twi.h.
Referenced by accRead(), gyroRead(), and magRead().
#define TWI_WRITE 0 |
I2C Write Bit.
Definition at line 44 of file twi.h.
Referenced by accRead(), gyroRead(), magRead(), magWriteRegister(), and motorTask().
void twiInit | ( | void | ) |
unsigned char twiReadAck | ( | void | ) |
Read from the I2C Slave and request more data.
Definition at line 179 of file twi.c.
Referenced by accRead(), gyroRead(), and magRead().
unsigned char twiReadNak | ( | void | ) |
Read from the I2C Slave and deny more data.
Definition at line 194 of file twi.c.
Referenced by accRead(), gyroRead(), and magRead().
unsigned char twiRepStart | ( | unsigned char | addr | ) |
Start a repeated I2C Transfer.
addr | Slave Address (with Read/Write bit) |
Definition at line 127 of file twi.c.
References twiStart().
Referenced by accRead(), gyroRead(), and magRead().
unsigned char twiStart | ( | unsigned char | addr | ) |
Start an I2C Transfer.
addr | Slave Address (with Read/Write bit) |
Definition at line 40 of file twi.c.
Referenced by accRead(), gyroRead(), magRead(), magWriteRegister(), motorTask(), and twiRepStart().
void twiStartWait | ( | unsigned char | addr | ) |
void twiStop | ( | void | ) |
Stop the I2C Hardware.
Definition at line 137 of file twi.c.
Referenced by magWriteRegister(), and motorTask().
unsigned char twiWrite | ( | unsigned char | data | ) |
Write to the I2C Slave.
data | Data to send |
Definition at line 155 of file twi.c.
Referenced by accRead(), gyroRead(), magRead(), magWriteRegister(), and motorTask().