目标芯片
NANO120 应用
本范例代码使用NuMicro® NANO120与LoRa模块建立具Lo
#include <stdio.h>
#include <stdint.h>
#include "platform.h"
#include "Nano100Series.h"
#include "Operation.h"
#include "led.h"
extern uint8_t F_RxStart;
extern uint8_t F_TxStart;
/*---------------------------------------------------------------------------------------------------------*/
/* Init System Clock */
/*---------------------------------------------------------------------------------------------------------*/
void SYS_Init(void)
{
/* Enable external HIRC ans LIRC */
CLK_EnableXtalRC(CLK_PWRCTL_HIRC_EN_Msk);
/* Waiting for clock ready */
CLK_WaitClockReady(CLK_CLKSTATUS_HIRC_STB_Msk);
CLK_SetCoreClock(12000000);
}
/*---------------------------------------------------------------------------------------------------------*/
/* Main application entry point. */
/*---------------------------------------------------------------------------------------------------------*/
int main( void )
{
SYS_UnlockReg();
SYS_Init();
NodeGetAddr();
ButtonInit();
BoardInit( );
SYS_LockReg();
setLedGPIO();
Radio_Init();
Timer2_Init();
ledInit();
while (1)
{
lightLED();
if(F_RxStart)
{
F_RxStart = FALSE;
RX_Done();
RX_Done_Action();
}
if(F_TxStart)
{
F_TxStart = FALSE;
TX_Done();
TX_Done_Action();
}
}
}
Ra传输功能的LED胸章
|