关闭

关闭

关闭

封号提示

内容

首页 FM31256驱动,测试通过(FM31256 driver, test passed).doc

FM31256驱动,测试通过(FM31256 driver, test passed).doc

FM31256驱动,测试通过(FM31256 driver, …

上传者: Hedda凡凡 2017-10-13 评分 0 0 0 0 0 0 暂无简介 简介 举报

简介:本文档为《FM31256驱动,测试通过(FM31256 driver, test passed)doc》,可适用于领域,主题内容包含FM驱动,测试通过(FMdriver,testpassed)FM驱动,测试通过(FMdriver,testpassed)==============符等。

FM驱动,测试通过(FMdriver,testpassed)FM驱动,测试通过(FMdriver,testpassed)=============================================功能:FM测试程序时间:=============================================#包括<<reg。”#unsignedint定义单元#定义unsignedchar函数#iicwritexA定义#定义iicreadxA#定义regreadxd登记读#定义regwritexd登记写#定义writeprotectxb#定义年x#定义月x#定义天x#定义日期x#小时寄存器定义#定义分钟x#定义二x#定义控制语句#定义标志x#定义wdtflagx#定义wdttimexa函数的时间函数反=一个公司^SDA=P普通SCL=P^普通SDA=P^SDA位保护位普通SCLP^=SCL位保护位公司^CNT=P事件计数器的输出P^了CNT=事件计数器输出普通卡=P^加州输出普通RST=P^看门狗输出位数据检bbyte函数公司bbyte^D=公司bbyte^D=公司bbyte^D=公司bbyte^D=公司bbyte^D=公司bbyte^D=公司bbyte^D=公司bbyte^D=无效(){TMOD=xxfdTh=xfdTL=TR=任正非,=SM=EA=ES,}================================无效start(){SDA,症状自评量表=SDA,}=================================无效stop(){SDA,症状自评量表=SDA,}=================================无效writebyte(ucharWdata){bbyte=数据症状自评量表=SDA=DSCL=SCL=SDA=DSCL=SCL=SDA=DSCL=SCL=SDA=DSCL=SCL=SDA=DSCL=SCL=SDA=DSCL=SCL=SDA=DSCL=SCL=SDA=D=SCLSCL=}==================================readbyte()函数{ucharRetValue症状自评量表=SCL=D=SDASCL=SCL=D=SDASCL=SCL=D=SDASCL=SCL=D=SDASCL=SCL=D=SDASCL=SCL=D=SDASCL=SCL=D=SDASCL=SCL=D=SDASCL=retvalue=bbyte返回retvalue}====================================无效ack(){我的函数症状自评量表=我=同时((i)和SDA)症状自评量表=}====================================ucharReadFRAM(单位地址){ucharRetValuestart()writebyte(iicwrite)ack()WriteByte((函数)(地址>>))ack()WriteByte((函数)(地址))ack()start()writebyte(iicread)ack()retvalue=readbyte()scl=sda=scl=stop()returnretvalue}=====================================voidwritereg(ucharregadd,ucharwdata){start()writebyte(regwrite)ack()regadd=regaddxfwritebyte(regadd)ack()writebyte(wdata)ack()stop()}=====================================ucharreadreg(ucharregadd){ucharretvaluestart()writebyte(regwrite)ack()writebyte(regadd)ack()start()writebyte(regread)ack()retvalue=readbyte()scl=sda=scl=stop()returnretvalue}=====================================voidwritefram(uintaddress,ucharwdata){start()writebyte(iicwrite)ack()writebyte((uchar)(address>>)ack()writebyte((uchar)(address))ack()writebyte(wdata)ack()stop()}======================================initiationvoid(void)initialforbaudrate,uset{tmod=xth=xfdtoillustratethe=xfdtr=pure=sm=sm=ea=es=}=======================================voidsenddata(ucharsdata){sbuf=sdatawhile(!)ti=}=======================================voidmain(void){uintadducharreaddatawritereg(control,x)停止时钟initiation()tr=senddata(x)*(add=add<xffadd){writefram(add,x)}(add=xadd<xffadd){writefram(add,x)}(add=add<xffadd){readdata=readfram(add)senddata(readdata)>*软件写保护功能不能实现writereg(writeprotect,x)软件写保护writereg(writeprotect,x)软件写保护writereg(writeprotect,x)软件写保护全部*(add=add<xffadd){writefram(add,x)}(add=add<xffadd){readdata=readfram(add)senddata(readdata)}*writereg(control,x)启动时钟writereg(flags,x)清除标志位writereg(flags,x)允许写操作writereg(year,x)写时间writereg(mounth,x)writereg(day,x)writereg(date,x)writereg(hour,x)writereg(minute,x)writereg(second,x)writereg(flags,x)停止写操作writereg(flags,x)允许读操作tr=启动定时器while(){{if(counter==){es=writereg(flags,x)允许读操作hour=readreg(year)senddata(hour)hour=readreg(mounth)senddata(hour)hour=readreg(day)senddata(hour)hour=readreg(date)senddata(hour)hour=readreg(hour)senddata(hour)hour=readreg(minute)senddata(hour)hour=readreg(second)senddata(hour)writereg(flags,x)es=counter=*(add=add<xffadd){readdata=readfram(add)senddata(readdata)}*}}}}=========================================定时中断,读取时钟=========================================*voidtimer()interrupt{th=xdctl=xif(counter==){counter=writereg(flags,x)允许读操作hour=readreg(year)senddata(hour)hour=readreg(mounth)senddata(hour)hour=readreg(day)senddata(hour)hour=readreg(date)senddata(hour)hour=readreg(hour)senddata(hour)hour=readreg(minute)senddata(hour)hour=readreg(second)senddata(hour)writereg(flags,x)}else{counter}}*=========================================串口通讯中断,读取时钟=========================================voidinterrupt(){ri=a=sbufif(a==x)counter=}

用户评论(0)

0/200

精彩专题

上传我的资料

每篇奖励 +2积分

资料评价:

/14
0下载券 下载 加入VIP, 送下载券

意见
反馈

立即扫码关注

爱问共享资料微信公众号

返回
顶部