文件名称:smbus
- 所属分类:
- 微处理器(ARM/PowerPC等)
- 资源属性:
- [C/C++] [源码]
- 上传时间:
- 2013-01-19
- 文件大小:
- 1kb
- 下载次数:
- 0次
- 提 供 者:
- k*
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
c8051f340的SMBUS(iic)总线的驱动代码,使用任务方式,只支持主器件,不支持从器件方式,调用smbtskcx查询可以再添加几条任务,#define MAXTSKCOUNT 10 中的(10)为最大任务设定,可以自己更改,smbaddtask为添加任务的函数,其它的过程用户可以不关心,
写过程为先写8位器件地址,再写数据指针指向的数据(内容用户自己设定,如要包含子地址等),读时如果有子地址,要分成两个任务,一个是要写入子地址任务,一个是读取任务,
如smbaddtask(0xa0,2,p) ambddtask(0xa1,10,s) -c8051f340 the SMBUS (iic), the bus driver code, use the task the way, only support the master device from the device does not support call smbtskcx query can then add a few tasks in# define MAXTSKCOUNT 10 (10), the largest task set can change smbaddtask added function of the task, the other process users do not care about the writing process to first write the 8-bit device address, write data pointer to the data (the contents of the user' s own settings, such as to include a sub-address ), read if there are sub-address, to be divided into two tasks, and a task is to be written to the sub-address, a read task, such as smbaddtask (0xa0, 2, p) ambddtask (0xa1, 10, s)
写过程为先写8位器件地址,再写数据指针指向的数据(内容用户自己设定,如要包含子地址等),读时如果有子地址,要分成两个任务,一个是要写入子地址任务,一个是读取任务,
如smbaddtask(0xa0,2,p) ambddtask(0xa1,10,s) -c8051f340 the SMBUS (iic), the bus driver code, use the task the way, only support the master device from the device does not support call smbtskcx query can then add a few tasks in# define MAXTSKCOUNT 10 (10), the largest task set can change smbaddtask added function of the task, the other process users do not care about the writing process to first write the 8-bit device address, write data pointer to the data (the contents of the user' s own settings, such as to include a sub-address ), read if there are sub-address, to be divided into two tasks, and a task is to be written to the sub-address, a read task, such as smbaddtask (0xa0, 2, p) ambddtask (0xa1, 10, s)
(系统自动生成,下载前可以参看下载内容)
下载文件列表
smbus.c
smbus.h