📄 i2c_master.h
字号:
//------------------------------------------------------------------------------
// I2C_Master.h - Header file for I2C_Master.s43
//------------------------------------------------------------------------------
#ifndef I2CMASTER_H
#define I2CMASTER_H
//------------------------------------------------------------------------------
#define PI2C_DIR P2DIR // Define the port where the
#define PI2C_OUT P2OUT // I2C lines are connected to
#define PI2C_IN P2IN
#define SDA (0x01) // Px.0 controls SDA line (pull-up)
#define SCL (0x02) // Px.1 controls SCL line (pull-up)
//------------------------------------------------------------------------------
// Exported functions (for use with C)
//------------------------------------------------------------------------------
#ifdef __STDC__
extern void I2CSetup(void);
extern unsigned int I2CRead16(unsigned char Addr);
extern void I2CWrite8(unsigned char Addr, unsigned char Data);
#endif
//------------------------------------------------------------------------------
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -