www.pudn.com > PPI.rar > I2C.h
//#include#include //------------------------------------------------------------------------------ // 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 //--------------------------------------------------------------------------// // 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 void SetSDATA(bool state); // Set SDATA to 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();