⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 iic.h

📁 单片机实现消息队列的例子
💻 H
字号:
/*************************************************/

/***************IIC串行总线*******************/

/*************2003年1月15日********************/

/************WROTE BY WANGSW********************/

/*串口EEPROM,型号CAT24WC02,
芯片控制 码:1010,
片选脚		A2,A1,A0 可扩展8个 现为全接地,故地址为0xA0(不包括最后一位0x1010000*)
一页可读写16BYTE.
注:写后必须延迟一段时间(delay(0x200))才能执行读,否则出现错误
*/

/*
本质上SCL 上升沿时数据有效
*/

#ifndef _IIC_H
#define _IIC_H

#define CAT24WC64 	0xA0
#define CAT24WC641 	0xA2

extern bool iic_send_byte(byte SlaveAddress, byte value);							/*无内存地址写单个字节*/
 
extern bool iic_send_str(byte SlaveAddress, byte address, byte *source, byte len) ;         /*有内存地址写多个字节*/

extern bool iic_rcv_byte(byte SlaveAddress, byte value);							/*无内存地址读单个字节*/

extern bool iic_rcv_str(byte SlaveAddress, byte address, byte *source, byte len);	/*有内存地址读多个字节*/

extern bool iiv_send_long_str(byte SlaveAddress, word address, byte *source, byte len);

extern bool iic_rcv_long_str(byte SlaveAddress, word address, byte *source, byte len);

extern bool iic_24c64_write(word wAddr, byte *source, byte len);

extern bool iic_24c64_read(word wAddr, byte *source, byte len);

#endif

⌨️ 快捷键说明

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