iic.h
来自「采用华邦79E834+HT1380+24C04实现全自动抽水将置的源程式。如要疑」· C头文件 代码 · 共 42 行
H
42 行
/******************************************************************************
*
* Purpose: IIC.c
*
* Creator: Rob Lansbergen
*
* Version: $Revision: 2 $
*
* File Name: $Workfile: iic.h $
* Prototypes for functions in iic.c
*/
#ifndef iic_h
#define iic_h
void i2c_init(void);
unsigned char i2c_start(void);
void i2c_stop(void);
unsigned char i2c_send_ex(unsigned char addr, unsigned char count, unsigned char send_stop); /*uses fixed buffer*/
unsigned char i2c_sendbuf_ex(unsigned char addr, unsigned char *buf, unsigned char count, unsigned char send_stop);
unsigned char i2c_recv(unsigned char count);
unsigned char I2cSentByte(unsigned char dat);
unsigned char I2C_Write_Byte(unsigned char map,unsigned char dat);
unsigned char I2C_Read_Byte(unsigned char map);
unsigned char I2C_Read_Buf (unsigned char addr, unsigned char rx_count);
unsigned char I2C_Write_Buf (unsigned char addr, unsigned char *buf, unsigned char count, unsigned char flash_type);
extern unsigned char i2c_error; /* Set to last error value, see below */
extern unsigned char I2C_Data_buf[6];
extern unsigned char i2cSlaveAddress;
#define I2CERR_OK 0 /* No error */
#define I2CERR_NAK 1 /* No ACK from slave */
#define I2CERR_LOST 2 /* Arbitration lost */
#define I2CERR_BUS 3 /* Bus is stuck (not used yet) */
#define I2CERR_TIMEOUT 4 /* Timeout on bus */
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?