欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136
標題:
STM32+CC1101,SPI驅動,非GPIO模擬源程序
[打印本頁]
作者:
danruhai
時間:
2019-7-31 10:39
標題:
STM32+CC1101,SPI驅動,非GPIO模擬源程序
#include "delay.h"
#include "sys.h"
#include "usart.h"
#include "usart2.h"
#include "time2.h"
#include "Time3.h"
#include "string.h"
#include "stdlib.h"
#include "spi_cc1101.h"
#include "led.h"
extern u8 PaTabel[8];
u8 SWitch1Flg;
u8 SWitch2Flg;
u8 SWitch3Flg;
u8 txBuffer[4];
int main(void)
{
u8 i;
SWitch1Flg = 0;
SWitch2Flg = 0;
SWitch3Flg = 0;
delay_init(); //延時函數初始化
//LED_Init();
NVIC_Configuration(); //設置NVIC中斷分組2:2位搶占優先級,2位響應優先級
uart_init(115200); //串口初始化為9600
USART2_Config();
USAT2_NVIC_Configuration();
printf("SYS INIT OK....\r\n");
SPI_CC1101_Init();
CC1101_POWER_RESET();
halRfWriteRfSettings();
halSpiWriteBurstReg(CCxxx0_PATABLE, PaTabel, 8);//發射功率設置
while(1)
{
if (SWitch1Flg == 1)
{
SWitch1Flg = 0;
txBuffer[0] = 0xfe;
txBuffer[1] = 0x01;
txBuffer[2] = 0xf0;
txBuffer[3] = 0xf1;
halRfSendPacket(txBuffer, 4);
//printf("5\r\n");
}
if (SWitch2Flg == 1)
{
SWitch2Flg = 0;
txBuffer[0] = 0xfe;
txBuffer[1] = 0x02;
txBuffer[2] = 0xf0;
txBuffer[3] = 0xf1;
halRfSendPacket(txBuffer, 4);
// printf("6\r\n");
}
if (SWitch3Flg == 1)
{
SWitch3Flg = 0;
txBuffer[0] = 0xfe;
txBuffer[1] = 0x03;
txBuffer[2] = 0xf0;
txBuffer[3] = 0xf1;
halRfSendPacket(txBuffer, 4);
// printf("6\r\n");
}
}
}
復制代碼
STM32CC1101.7z
2019-7-31 22:29 上傳
點擊文件名下載附件
下載積分: 黑幣 -5
222.25 KB, 下載次數: 31, 下載積分: 黑幣 -5
歡迎光臨 (http://m.raoushi.com/bbs/)
Powered by Discuz! X3.1