123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- #ifndef __I2CM_H__
- #define __I2CM_H__
- #include <config.h>
- #define _I2CPARAM_SPEC __data
- #define I2C_SLAVE10B_INT 0x0f
- #define I2C_SLAVE7B_INT 0x0e
- #define I2C_SLAVE_IDLE 0x0b
- #define I2C_MASTER 0x08
- #define I2C_SLAVE10B 0x07
- #define I2C_SLAVE7B 0x06
- #define I2C_SLEW_OFF 0x80
- #define I2C_SLEW_ON 0x00
- void i2cm_stop(void);
- void i2cm_start(void);
- void i2cm_restart(void);
- void i2cm_nack(void);
- void i2cm_ack(void);
- void i2cm_idle(void);
- unsigned char i2cm_drdy(void);
- unsigned char i2cm_readchar(void);
- char i2cm_readstr(_I2CPARAM_SPEC unsigned char *ptr, unsigned char len);
- char i2cm_writechar(unsigned char dat);
- char i2cm_writestr(unsigned char *ptr);
- void i2cm_begin(unsigned char address, unsigned char doread);
- void i2cm_init(unsigned char mode, unsigned char slew, unsigned char addr_brd);
- void i2cm_close(void);
- #endif
|