i2c.h

来自「STV0299 Minituner driver, for ST chipset」· C头文件 代码 · 共 29 行

H
29
字号
#ifndef H_I2C
	#define H_I2C

	#include "gen_types.h"

	/* exported definitions */
	typedef enum
	{
		I2C_OK = 0,		/* I2C transmission OK */
		I2C_NOSDA,		/* SDA line is stucked */
		I2C_NOSCL,		/* SCL line is stucked */
		I2C_BUSERROR,	/* SDA and SCL are stucked */
		I2C_NOACK		/* SDA and SCL lines are OK but the device does not acknowledge */
	} I2C_RESULT;
	
	typedef enum
	{
		I2C_READ,		/* Read from slave */
		I2C_WRITE,		/* Write to slave */
		I2C_WRITENOSTOP /* Write to slave without stop */   
	} I2C_MODE;
	
	/*	exported functions	*/
	void 		I2cInit(U16 BaseAddress, U32 tempo);	/* Init I2C transmission */ 
	I2C_RESULT	I2cReadWrite(I2C_MODE mode,unsigned char ChipAddress,unsigned char *Data,int NbData);	/* Read or write bytes */
	void		I2cTerm(void);	/* Terminate I2C transmission */
#endif

⌨️ 快捷键说明

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