i2c.h
来自「一个测试LCD的应用程序」· C头文件 代码 · 共 27 行
H
27 行
// ------------------- head file for i2c.c -------------------------------------
#ifndef __LCD_I2C__
#define __LCD_I2C__
// ---------------- Pins' Definition of I2C Bus --------------------------------
#ifndef I2C_SCL
#define I2C_SCL P3_1 // Serial Clock
#define I2C_SDA P3_2 // Serial Data
#endif
// -----------------------------------------------------------------------------
// ------------------------ Function Prototypes --------------------------------
// Start an I2C communication
void I2C_Start(void);
// Stop an I2C Communication
void I2C_Stop(void);
// Send a byte to I2C Bus
void I2C_SendByte(uint8 dByte);
// Read a byte from the slave device
uint8 I2C_ReadByte(void);
// Send an ACK/NACK signal to the Slave device
void I2C_SendAck(bit ACK);
// -----------------------------------------------------------------------------
#include "i2c.c"
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?