| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- /**
- ******************************** STM32F10x *********************************
- * @文件名 : main.c
- * @作者 : sun
- * @库版本 : V3.5.0
- * @文件版本 : V1.0.0
- * @日期 : 2016年05月09日
- * @摘要 :
- ******************************************************************************/
- /*----------------------------------------------------------------------------
- 更新日志:
- ----------------------------------------------------------------------------*/
- /* 包含的头文件 --------------------------------------------------------------*/
- #include "bsp.h"
- #include "spi.h"
- #include "timer.h"
- #include "usart.h"
- #include "radio.h"
- #include "LoraUsart.h"
- #include "systick.h"
- #include "LoraComm.h"
- #include "led.h"
- #include "sx1276-Hal.h"
- #include "rtc.h"
- #include "ch455h.h"
- /************************************************
- 函数名称 : main
- 功 能 : 主函数入口
- 参 数 : 无
- 返 回 值 : int
- 作 者 : sun
- *************************************************/
- int main(void)
- {
- uint8_t temp = 0;
- uint32_t times=0;
- uint8_t test = 0;
- uint8_t i = 0;
- uint32_t t=0;
-
- System_Initializes();
-
- LED_Init(); //初始化与LED连接的硬件接口
- Radio = RadioDriverInit( ); //无线射频模块函数定义
- temp = Radio->Init( ); //无线射频模块初始化
- printf("采集器,LoRa串口透传测试程序.\r\n");
- printf("LED0常亮:电源指示.\r\n");
- printf("LED1闪烁:系统运行中.\r\n");
- printf("LED2闪烁:串口接收到数据.\r\n");
- printf("LED3闪烁:LoRa接收到数据.\r\n");
-
- for(i=0;i<0x70;i++)
- {
- SX1276Read(i, &test);
- printf("LoRa address=0x%02x,value=0x%02x\r\n",i,test);
- }
- if(temp == 0)
- {
- SysReboot();
- }
- while(1)
- {
- UsartToLora(); //串口透传
- if(times&0x00002000)
- {
- LED1=1;
- }
- else
- {
- LED1=0;
- }
- times++;
-
- if(t!=DeviceRTC.Second)
- {
- //printf("%02d:%02d:%02d\r\n",DeviceRTC.Hour,DeviceRTC.Minute,DeviceRTC.Second);
- //RUN_LED3_TOGGLE;
- t=DeviceRTC.Second;
- CH455_Write( CH455_DIG1 | Letter_tab[t%10]);
- }
- }
- }
- /**** Copyright (C)2016 sun. All Rights Reserved **** END OF FILE ****/
|