Home

Defines | Functions

dwengoI2C.h File Reference

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.

Detailed Description

I2C routines.

Library to communicate over an I2C bus.


Function Documentation

void initI2C ( void  )

Initialize I2C hardware.

Initialize I2C hardware

int read1I2C ( BYTE  addr)

Read and return single byte to address.

Parameters:
addr
int read2I2C ( BYTE  addr)

Read two bytes from address and return as 16-bit value.

Parameters:
addr
unsigned char readI2C ( char  ack)

Read a single byte, optionally send ACK.

Parameters:
ack
void startI2C ( BYTE  addr,
char  rw 
)

Send I2C start condition and address.

Parameters:
addr,rw
void stopI2C ( void  )

Send I2C stop condition.

Send I2C stop condition

void write1I2C ( BYTE  addr,
BYTE  val 
)

Write single byte to address.

Parameters:
addr,val
void write2I2C ( BYTE  addr,
BYTE  val1,
BYTE  val2 
)

Write two bytes to address.

Parameters:
addr,val1,val2
void writeI2C ( BYTE  val)

Write a single byte.

Parameters:
val
 All Data Structures Files Functions Variables Defines

Generated on Wed Dec 25 2013 23:03:08 for Dwengo library by doxygen 1.7.3