📄 wrtrf01.c
字号:
//-变量声明---------------------------------------------------------------------------------
#include <reg52.h>
#include "WRT_CMD.h"
#include "UART_init.h"
#include "GET_CMD.h"
sbit nSEL1=P1^3;
sbit nSEL2=P1^2;
//sbit REC_flag=P0^1;
//------------------------------------------------------------------------------------------
// name:wrtRF01
//description:designed for Wireless RS232 adapter.setting the "A" board RFM01 frequence command
//input:NON
//output:NON
//designed by KongRui,Version 1.0,2007/05/13
//-------------------------------------------------------------------------------------------
void wrtRF01(unsigned int RF01CSC,RF01FSC,RF01DRC){
// bit SDI,SCK;
nSEL1=0; //choose RFM01
nSEL2=1;
// REC_flag=0;
// SDI=P1^7;
// SCK=P1^5;
WRT_CMD(0xc080); //receiver setting command
WRT_CMD(0xc240); //low battery detector and microcontroller clock divider command
//CLK out=1.66MHz
WRT_CMD(0xc6db); //AFC command,digital filler,DQD=4
WRT_CMD(0xce88); //output and FIFO mode command,no use FIFO
WRT_CMD(RF01CSC); //configuration setting command,get the command from the computer
WRT_CMD(RF01FSC); //frequency setting command,get the command from the computer
WRT_CMD(RF01DRC); //data rate command,get the command from the computer
WRT_CMD(0xc081); //open RX,allow receive
// REC_flag=1;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -