- 论坛徽章:
- 0
|
测试iic的代码(from 设备驱动开发详解)
#include
#include
#include
#include
#include
//#include
#define I2C_RETRIES 0x0701
#define I2C_TIMEOUT 0x0702
#define I2C_SLAVE 0x0703
#define BUF_SIZE 1024
void percentage(int given,int total){
static int first = 0;
int i;
int tmp;
total--;
tmp = (given*100)/total;
if(first != 0){ //第一次调用此显示进度的函数不应该退格
for(i=0;i>1 = 0x50,驱动里面会把最地位补全的(读或者写)
ioctl(fd,I2C_TIMEOUT,1);
ioctl(fd,I2C_RETRIES,1);
int block;
for(block=0;block
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u3/93291/showart_2090259.html |
|