TI公司,CC2530的收发程序
void main (void)
{
uint8 appMode;
uint8 i=0;
appState = IDLE;
appStarted = FALSE;
// Config basicRF
basicRfConfig.panId = PAN_ID;
basicRfConfig.ackRequest = FALSE;
// Initialise board peripherals
halBoardInit();
// Initalise hal_rf
if(halRfInit()==FAILED) {
HAL_ASSERT(FALSE);
}
// Indicate that device is powered
for (i=0; i<2; i++)
{
halLedSet(1);
halMcuWaitMs(500);
halLedClear(1);
halLedSet(2);
halMcuWaitMs(500);
halLedClear(2);
}
// Print Logo and splash screen on LCD
//utilPrintLogo("PER Tester");
// Wait for user to press S1 to enter menu
// while (halButtonPushed()!=HAL_BUTTON_1);
halMcuWaitMs(350);
// halLcdClear();
// Set channel
//basicRfConfig.channel = appSelectChannel();
basicRfConfig.channel = 0x0B; //Channel 11, 2405MHz
// Set mode
//appMode = appSelectMode();
appMode = MODE_RX;
// Transmitter application
if(appMode == MODE_TX) {
// No return from here
appTransmitter();
}
// Receiver application
else if(appMode == MODE_RX) {
// No return from here
appReceiver();
}
// Role is undefined. This code should not be reached
HAL_ASSERT(FALSE);
}
评论30
最新资源