📄 i2c.h
字号:
//#include <sys\exception.h>
#include <cdefBF533.h>
//------------------------------------------------------------------------------
// I2C Peripheral Variables
//------------------------------------------------------------------------------
//unsigned char IdentAddr;
//unsigned int Delay;
//--------------------------------------------------------------------------//
// Definations
//--------------------------------------------------------------------------//
//#define INL inline // Large Code Size/Little Stack usage
#define INL // Small Code Size/Larger Stack usage
//--------------------------------------------------------------------------//
// Symbolic constants //
//--------------------------------------------------------------------------//
#define SCLK 0x0010 // PF4
#define SDATA 0x0020 // PF5
#define KEY1 0x0800 //PF11
#define KEY2 0x0200 //PF9
//--------------------------------------------------------------------------//
// Prototypes //
//--------------------------------------------------------------------------//
//------------------------------------------------------------------------------
// I2C Peripheral Function Prototypes
//------------------------------------------------------------------------------
void Init(void); // Initialize I2C port
void Start(void); // Sends I2C Start Trasfer
void Stop(void); // Sends I2C Stop Trasfer
bool Write(unsigned char data_out); // Writes data over the I2C bus
bool Read(unsigned char *data_in, bool send_ack);// Reads data from the I2C bus
void SetSCLK(bool state); // Set SCLK to <state>
void SetSDATA(bool state); // Set SDATA to <state>
bool GetSDATA(); // Get SDATA state
// in file I2C.c
bool I2C_Init(unsigned char identaddr);
bool I2C_Write(unsigned char data_out, unsigned char address);
bool I2C_Read(unsigned char *data_in, unsigned char address);
//bool TVP5150_Reset(bool bReset);
//bool TVP5150_Cnfg(int SourceMode, int OutputMode);
//void INL DelayTVP5150();
bool ADV7179_Cnfg(void);
bool SAA7113_Cnfg(void);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -