⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 i2c.h

📁 ST7032i驱动应用实例(I2C接口)
💻 H
字号:
// ------------------- head file for i2c.c -------------------------------------
#ifndef __LCD_I2C__
#define __LCD_I2C__

// ---------------- Pins' Definition of I2C Bus --------------------------------
#ifndef I2C_SCL
	#define I2C_SCL 0	// Serial Clock
	#define I2C_SDA 1	// Serial Data
	#define I2C_DataPort PORTB	// I2C data port
	#define I2C_DataPins PINB	// I2C data pins
#endif
// -----------------------------------------------------------------------------

#define I2C_DELAY	4	// Delay in Us for I2C Bus

// ------------------------ 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(uint8 ACK);
// -----------------------------------------------------------------------------

#include "i2c.c"
#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -