wrtrf02.c

来自「keil C51编写的的RFM01和RFM02应用程序」· C语言 代码 · 共 30 行

C
30
字号
//-变量声明---------------------------------------------------------------------------------
#include <reg52.h>
#include "WRT_CMD.h"
#include "UART_init.h"
#include "GET_CMD.h"
sbit nSEL1=P1^3;
sbit nSEL2=P1^2;
//sbit SEND_flag=P0^0;

//------------------------------------------------------------------------------------------
// name:wrtRF02
//description:designed for Wireless RS232 adapter.setting the "A" board RFM02 frequence command
//input:NON
//output:NON
//designed by KongRui,Version 1.0,2007/05/13
//-------------------------------------------------------------------------------------------
void wrtRF02(unsigned int RF02CSC,RF02FSC,RF02DRC){
 // bit SDI,SCK;
  nSEL2=0;
  nSEL1=1;
//  SEND_flag=0;
//  SDI=P1^0;
//  SCK=P1^1;
  WRT_CMD(RF02CSC);	//configuration setting command,get the command from the computer
  WRT_CMD(RF02FSC);	//frequency setting command,get the command from the computer
  WRT_CMD(RF02DRC);	//data rate command,get the command from the computer
  WRT_CMD(0xc038);  //send data
//  SEND_flag=1;
}  

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?