Main Page Data Structures File List Data Fields Globals Related Pages

# clib/i2c_api.h File Reference

Go to the source code of this file.

## Defines
#define | I2CINT 0xAA
#define | I2C_INIT 0x80
#define | I2C_SCAN 0x81
#define | I2C_TRANS_RECV_CHAR 0x82
#define | I2C_TRANS_RECV_BLOCK 0x83
#define | I2C_RELEASE 0x84
#define | I2C_RESTART 0x8B
#define | I2C_SELECT_CLK_PIN 0x8E
#define | I2C_SELECT_DATA_PIN 0x8F
## Functions
void | I2C_init (void)
void | I2C_release (void)
void | I2C_restart (void)
unsigned char | I2C_scan (unsigned char start_addr, unsigned char end_addr)
int | I2C_transmit_block (unsigned char slave, char far *buffer, int length)
int | I2C_receive_block (unsigned char slave, char far *buffer, int length)
int | I2C_transmit_char (unsigned char slave, char c)
int | I2C_receive_char (unsigned char slave, char *c, unsigned char lastchar)
void | I2C_select_clock_pin (unsigned char pio_no)
void | I2C_select_data_pin (unsigned char pio_no)

## Define Documentation

#define I2C_INIT 0x80

| Definition at line 55 of file i2c_api.h. Referenced by I2C_init().

#define I2C_RELEASE 0x84

| Definition at line 59 of file i2c_api.h. Referenced by I2C_release().

#define I2C_RESTART 0x8B

| Definition at line 60 of file i2c_api.h. Referenced by I2C_restart().

#define I2C_SCAN 0x81

| Definition at line 56 of file i2c_api.h. Referenced by I2C_scan().

#define I2C_SELECT_CLK_PIN 0x8E

| Definition at line 61 of file i2c_api.h. Referenced by I2C_select_clock_pin().

#define I2C_SELECT_DATA_PIN 0x8F

| Definition at line 62 of file i2c_api.h. Referenced by I2C_select_data_pin().

#define I2C_TRANS_RECV_BLOCK 0x83

| Definition at line 58 of file i2c_api.h. Referenced by I2C_receive_block(), and I2C_transmit_block().

#define I2C_TRANS_RECV_CHAR 0x82

| Definition at line 57 of file i2c_api.h. Referenced by I2C_receive_char(), and I2C_transmit_char().

#define I2CINT 0xAA

| Definition at line 50 of file i2c_api.h. Referenced by I2C_init(), I2C_receive_block(), I2C_receive_char(), I2C_release(), I2C_restart(), I2C_scan(), I2C_select_clock_pin(), I2C_select_data_pin(), I2C_transmit_block(), and I2C_transmit_char().

## Function Documentation

void I2C_init | ( | void |  | ) |

| Definition at line 63 of file i2c_api.c. References I2C_INIT, and I2CINT.

int I2C_receive_block | ( | unsigned char | slave,
|  | char far * | buffer,
|  | int | length
| ) |

| Definition at line 151 of file i2c_api.c. References I2C_TRANS_RECV_BLOCK, and I2CINT.

int I2C_receive_char | ( | unsigned char | slave,
|  | char * | c,
|  | unsigned char | lastchar
| ) |

| Definition at line 198 of file i2c_api.c. References I2C_TRANS_RECV_CHAR, and I2CINT.

void I2C_release | ( | void |  | ) |

| Definition at line 78 of file i2c_api.c. References I2C_RELEASE, and I2CINT.

void I2C_restart | ( | void |  | ) |

| Definition at line 93 of file i2c_api.c. References I2C_RESTART, and I2CINT.

unsigned char I2C_scan | ( | unsigned char | start_addr,
|  | unsigned char | end_addr
| ) |

| Definition at line 108 of file i2c_api.c. References I2C_SCAN, and I2CINT.

void I2C_select_clock_pin | ( | unsigned char | pio_no | ) |

| Definition at line 228 of file i2c_api.c. References I2C_SELECT_CLK_PIN, and I2CINT.

void I2C_select_data_pin | ( | unsigned char | pio_no | ) |

| Definition at line 241 of file i2c_api.c. References I2C_SELECT_DATA_PIN, and I2CINT.

int I2C_transmit_block | ( | unsigned char | slave,
|  | char far * | buffer,
|  | int | length
| ) |

| Definition at line 126 of file i2c_api.c. References I2C_TRANS_RECV_BLOCK, and I2CINT.

int I2C_transmit_char | ( | unsigned char | slave,
|  | char | c
| ) |

| Definition at line 177 of file i2c_api.c. References I2C_TRANS_RECV_CHAR, and I2CINT.