I2C routines. More...
#include "dwengoBoard.h"
Defines | |
#define | I2C_READ 1 |
#define | I2C_WRITE 0 |
Functions | |
void | startI2C (BYTE addr, char rw) |
Send I2C start condition and address. | |
void | writeI2C (BYTE val) |
Write a single byte. | |
unsigned char | readI2C (char ack) |
Read a single byte, optionally send ACK. | |
void | stopI2C (void) |
Send I2C stop condition. | |
void | initI2C (void) |
Initialize I2C hardware. | |
void | write1I2C (BYTE addr, BYTE val) |
Write single byte to address. | |
void | write2I2C (BYTE addr, BYTE val1, BYTE val2) |
Write two bytes to address. | |
int | read1I2C (BYTE addr) |
Read and return single byte to address. | |
int | read2I2C (BYTE addr) |
Read two bytes from address and return as 16-bit value. |
I2C routines.
Library to communicate over an I2C bus.
void initI2C | ( | void | ) |
Initialize I2C hardware.
Initialize I2C hardware
int read1I2C | ( | BYTE | addr | ) |
Read and return single byte to address.
addr |
int read2I2C | ( | BYTE | addr | ) |
Read two bytes from address and return as 16-bit value.
addr |
unsigned char readI2C | ( | char | ack | ) |
Read a single byte, optionally send ACK.
ack |
void startI2C | ( | BYTE | addr, |
char | rw | ||
) |
Send I2C start condition and address.
addr,rw |
void stopI2C | ( | void | ) |
Send I2C stop condition.
Send I2C stop condition
void write1I2C | ( | BYTE | addr, |
BYTE | val | ||
) |
Write single byte to address.
addr,val |
void write2I2C | ( | BYTE | addr, |
BYTE | val1, | ||
BYTE | val2 | ||
) |
Write two bytes to address.
addr,val1,val2 |
void writeI2C | ( | BYTE | val | ) |
Write a single byte.
val |