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

📄 iic.h

📁 自己编写的bootloader for S3c4510. 1、支持串口下载
💻 H
字号:
#ifndef   _IIC_H
#define   _IIC_H

#define IIC_DEV_0	0xa2    //IIC device's slave address
#define PAGE_SIZE   1
#define S_WRITE		0x00    //Write IIC data for slave
#define S_READ		0x01    //Read IIC data for slave


#define BF 		0x01        //Buffer flag
#define IEN		0x02        //Interrupt enable
#define LRB		0x04        //Last bit received
                            //ACK not received
#define ACK		0x08        //Acknowlege enable
                            //Generate an ACK signal at 9th SCL
#define NOACK	0x00        //No more received data is required
                            //from the slave
#define START		0x10
#define STOP		0x20
#define RESTART		0x30
#define BUSY		0x40
#define IICRESET	0x80        //Reset the IIC-BUS controller

typedef struct 
{
  int read;
  int write;
  int device;
  int address;
  int size;
  int *pdata;
}iic_struct;

void IIC_Init(void);
int DrvIicRead(int addr, int size, int *pdata);
int DrvIicWriter(int address, int size, int *pdata);
int DrvEepromWrite(int addr, int size, int * pdata);

#endif

⌨️ 快捷键说明

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