i2cmsu.h

来自「* Use 10 MHz crystal frequency. * Use 」· C头文件 代码 · 共 53 行

H
53
字号
#ifndef I2CMSU_H#define I2CMSU_H/* I2C  Functions  i2c_idle();      -- waits for idle condition on i2c interface  i2c_start();     -- sends start and waits for finish of start  i2c_rstart();     -- sends repeated start and waits for finish of repeated start  extern i2c_stop(); -- sends stop and waits for finish of stop  i2c_ack(unsigned char ackbit); -- do acknowledge  i2c_putbyte(unsigned char byte);  -- sends byte on i2c bus, check idle first  i2c_put(unsigned char byte); -- same as previous, do not check idle  i2c_put_noerr(unsigned char byte); -- do not reset on ack error  unsigned char i2c_getbyte(unsigned char ackbit); -- read byte from i2c bus, do ack   char i2c_ackerr; -- variable that tracks current operation void i2c_print_err();  -- print error message based on i2c_ackerr valueThese functions assume the WatchDogTimer is in operation, and that thei2c_ackerr variable can be used to identify which function was beingexecuted if the WDT timer timeout within one of these functions.*/void i2c_idle(void);void i2c_start(void);void i2c_rstart(void);void i2c_stop(void);void i2c_ack(unsigned char ackbit);unsigned char i2c_putbyte(unsigned char byte);unsigned char i2c_put(unsigned char byte);unsigned char i2c_put_noerr(unsigned char byte);unsigned char i2c_get(unsigned char ackbit);unsigned char i2c_getbyte(unsigned char ackbit);void i2c_print_err(void);extern char i2c_ackerr;#endif

⌨️ 快捷键说明

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