此软件包包含了模拟I2C C51程序软件包和ZLG7290的C51程序然后包。 软件包的接口界面: (1) bit ISendByte(uchar sla,uchar c) (无子地址)写单字节数据 (现行地址写) (2) bit IRcvByte(uchar sla,uchar *c) (无子地址)读单字节数据 (现行地址读) (3) bit ISendStr(uchar sla,uchar suba,uchar *s,uchar no)(有子地址)读N字节数据 (4) bit IRcvStr(uchar sla,uchar suba,uchar *s,uchar no) (有子地址)写N字节数据 (5) bit ISendStr(uchar sla,uchar *s,uchar no) (无子地址)写多字节数据 (6) bit IRcvStr(uchar sla,uchar *s,uchar no) (无子地址)读单字节数据 (7) unsigned char ZLG7290_SendData(unsigned char SubAdd,unsigned char Data) (8) void ZLG7290_SendBuf(unsigned char * disp_buf,unsigned char num) (9) unsigned char ZLG7290_SendCmd(unsigned char Data1,unsigned char Data2) (10)unsigned char ZLG7290_GetKey()
上传时间: 2013-12-05
上传用户:hongmo
c8051f020 实时时钟模块程序 内含IIC模块程序/********************** SYSTEM CLOCK 8M********************************/ extern unsigned char xdata currenttime[16]={0} extern unsigned char xdata settime[16]={ 0x00, // control regesiter 1 0x00, // control regesiter 2 0x01, //current second 0x19, //current minute 0x20, //current hour 0x29, //current data 0x04, //current week 0x07, //current month 0x05, //current year 0x00, // alarm value reset 0x00, // alarm value reset 0x00, // alarm value reset 0x00, // alarm value reset 0x00, // clk out disable 0x00, // close timer 0x00, } /*********************************************************************/ extern void Current_Time ( void ) extern void Set_Time ( void )
标签: c8051f020 SYSTEM CLOCK IIC
上传时间: 2015-06-30
上传用户:edisonfather
C51的一些误区和注意事项(ZT) 1)C忌讳绝对定位。 常看见初学者要求使用_at_,这是一种谬误,把C当作ASM看待了。在C中变量 的定位是编译器的事情,初学者只要定义变量和变量的作 用域,编译器就把一个固定地址给这个 变量。怎么取得这个变量的地址?要用指针。比如unsigned char data x 后,x的地址就是...
上传时间: 2014-12-05
上传用户:xiaoxiang
函数模板T max(T a, T b, T c),使之实现对任何类型数,能从三个数中求出最大数返回。设计各种类型数据(char,short,long,float,double)调用此函数模板。
上传时间: 2015-07-07
上传用户:时代电子小智
#include "define.h" #include <stdio.h> #include <string.h> #include <ctype.h> #include <malloc.h> FILE *fp /*////////////////////////////////////////////////////////////////////////////// This is a pretreatment. /////////////////////////////////////////////////////////////////////////////*/ void readIntoBuffer(char buffer[256]) { char ch1 char temp int i for(i=0 i<256&&!feof(fp) i++) { ch1=fgetc(fp) if(ch1== )
上传时间: 2015-07-16
上传用户:ynsnjs
24C01的读写程序,C51源代码 调用方式:write_8bit(unsigned char ch) ﹫2001/03/23 函数说明:内函数,私有,用户不直接调用。
上传时间: 2015-08-07
上传用户:cc1015285075
本驱动程序在linux2.6.17中测试通过。yangxing msn:lelma_yx@hotmail.com 希望对SPI操作的朋友有所帮助。 一、工作方式: 从设备:SPI为MASTER模式 S3C2410:SPI为SLAVE模式+DMA 二、工作流程 1.S3C2410从接收:当从设备发送数据时,S3C2410利用DMA方式收数,收到指定长度的数据,则进入DMA中断,将接收的数据拷出。 2.S3C2410从发送:当S3C2410需要发送,首先由RTS请求发送,然后等待从设备应答CTS,当从设备应答CTS时,进入外部中断,启动DMA发送,发送完成,再次进入从接收状态。 三、文件位置 spi_dma_slave.c spi_dma_slave.h circular_buf.c circular_buf.h 等文件存放入driver/char/目录 dma.c存放于arch/arm/mach-s3c2410/目录 dma.h存放于include/arm-asm/mach-s3c2410/目录 四、使用环境 1.arm-linux-gcc-3.4.1
标签: SPI lelma_yx yangxing hotmail
上传时间: 2015-08-11
上传用户:徐孺
avr应用有关使用注意事项如下 1 在使用例子程序之前将库文件libslavr.a 拷贝到ICCAVR 安装目录下的库文件目录中 即...\LIB\目录将头文件slavr.h 拷贝到头文件目录即...\include\目录 2 如果想使用库文件中的函数那么设置如下 1) 在文件中应使用 "#include <slavr.h>"包含slavr.h 头文件 2) 在工程选项中的Additional LIB 一栏中填入"slavr" 使用附加的libslavr.a 库文件(注意引号不需要输入) 3 libslavr.a 库中包含的函数清单如下 1) void write_lcd(unsigned char data,unsigned
上传时间: 2013-12-29
上传用户:dongqiangqiang
Linux 2.4内核字符设备驱动开发实例。 是Linux下驱动开发人员再好不过的参考源码。编译之后加载驱动,附有测试程序进行驱动的测试! Linux kernel 2.4 char device driver example.
上传时间: 2015-08-22
上传用户:liglechongchong
其中的usb端口通信已经作为一个模块来使用,用户只需用以下函数就可以对usb端口进行方便的读写: unsigned char D12_WriteEndpoint(unsigned char endp, unsigned char len, unsigned char * buf) 此为usb端点输出函数,endp是要进行通信的端点,取值为3(普通端点,最大可一次传输16byte)或5(主端点,最大可一次传输64byte);len为一次输出数据长度;*buf为数据所在位置。 usb端点数据的读操作是由底层函数自动完成的(相关函数为unsigned char D12_ReadEndpoint(unsigned char endp, unsigned char len, unsigned char * buf); 相应端点为2和4),所读到的数据存于GenEpBuf[](普通端点)、MainEpBuf[]或EpBuf[](主端点)中,用户可以直接读取使用。
上传时间: 2014-01-12
上传用户:yuanyuan123