mikroC

mikroC - C Compiler for Microchip PIC microcontrollers

making it simple...

I2C_Rd

Prototype

char I2C_Rd(char ack);

 

 

Returns

Returns one byte from the slave.

 

 

Description

Reads one byte from the slave, and sends not acknowledge signal if parameter ack is 0,

 

otherwise it sends acknowledge.

 

 

Requires

START signal needs to be issued in order to use this function. See I2C_Start.

 

 

Example

temp = I2C_Rd(0); // Read data and send not acknowledge signal

 

 

I2C_Wr

Prototype

char I2C_Wr(char data);

 

 

Returns

Returns 0 if there were no errors.

 

 

Description

Sends data byte (parameter data) via I²C bus.

 

 

Requires

START signal needs to be issued in order to use this function. See I2C_Start.

 

 

Example

I2C_Write(0xA3);

 

 

I2C_Stop

Prototype

void I2C_Stop(void);

Description Issues STOP signal.

Requires I²C must be configured before using this function. See I2C_Init.

page

 

190

MikroElektronika: Development tools - Books - Compilers