资源描述:
《无线905基于凌阳程序 调试成功 1602显示》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、无线905基于凌阳程序调试成功1602显示#include"SPCE061A.h"#include"1602.h"#defineTxRxBuf_Len4unsignedintTxBuf[TxRxBuf_Len]={0x00,0x00,0x00,0x00};unsignedintRxBuf[TxRxBuf_Len]={0x00,0x00,0x00,0x00};//////////////////////////////////////////////////////////////////#defineBYTE_BIT70x0080//------------------
2、----------------------------------------------------------------------------------------------unsignedintDATA_BUF;#defineDATA7((DATA_BUF&BYTE_BIT7)!=0)//----------------------------------------------NRF905控制IO------------------------------------------------------#defineTXENIOB0#defineTRX
3、_CEIOB1#definePWRIOB2//----------------------------------------------NRF905SPI接口---------------------------------------------------#defineMISOIOB12#defineMOSIIOB4#defineSCKIOB5#defineCSNIOB6//数码管控制灯位定义#defineLED1IOB8#defineLED2IOB9#defineLED3IOB10#defineLED4IOB11#defineKEY1IOA11#defineKE
4、Y2IOA10#defineKEY3IOA9#defineKEY4IOA8//----------------------------------------nrf905状态标志---------------------------------------------------------#defineAMIOB13#defineDRIOB14#defineCDIOB15//--------------------------------------------------------------------------------------------------
5、-------------unsignedinttf;//-------------------------------------------------------nrf905控制指令-------------------------------------------#defineWC0x00#defineRC0x10#defineWTP0x20#defineRTP0x21#defineWTA0x22#defineRTA0x23#defineRRP0x24//------------------------------------------------NRF90
6、5寄存器配置------------------------------------------------unsignedintRFConf[11]={0x00,//配置命令//0x4c,//CH_NO,配置频段在430MHZ0x0c,//输出功率为10db,不重发,节电为正常模式0x44,//地址宽度设置,为4字节0x04,0x04,//接收发送有效数据长度为32字节0xCC,0xCC,0xCC,0xCC,//接收地址0x58//CRC充许,8位CRC校验,外部时钟信号不使能,16M晶振};unsignedintSeg[20]={0xff3f,0xff06,0xff
7、5b,0xff4f,0xff6e,0xff79,0xff6d,0xffb9,0xff39,0xff76,0xff79,0xff38,0xff73};//0123yESc.cHELPunsignedintTxAddress[4]={0xcc,0xcc,0xcc,0xcc};//------------------------------------------------延时------------------------------------------------------------Delay(intn){inti;while(n