24c02.h
来自「MSP430开发的使用PID算法温度控制程序 本程序通过485总线与上位机通信」· C头文件 代码 · 共 36 行
H
36 行
/***********************************************************
header file for operation at24c02
***********************************************************/
#ifndef _24C02_H_
#define _24C02_H_
#define DEVICE_W 0xA0
#define DEVICE_R 0xA1
#define MAX_AT2402 0x08
/***********************************************************
* write one byte
* input parameter: 1r:address 2 :pointer of data
* output parameter: 0:failed 1:success
***********************************************************/
unsigned char WriteByte(unsigned int addr,unsigned char *pbuf);
/***********************************************************
* write byte more than one
* input parameter: 1:address 2:buffer pointer of data 3: size by writing
* output parameter: 0:failed 1:success
* attention the num must be less than device max writen num
***********************************************************/
unsigned char WritePage(unsigned int addr,unsigned char *pbuf,unsigned int num);
/***********************************************************
* Read one byte
* input parameter: 1r:address 2 :pointer of data
* output parameter: 0:failed 1:success
***********************************************************/
unsigned char ReadByte(unsigned int addr,unsigned char *pbuf);
/***********************************************************
* Read byte more than one
* input parameter: 1r:address 2 :pointer of data 3:size by reading
* output parameter: 0:failed 1:success
***********************************************************/
unsigned char ReadSeq(unsigned int addr,unsigned char *pbuf,unsigned int num);
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?