void RF_Init( void ) {
uint8 state;
rfConfig_t rfConfig;
taskID = TMOS_ProcessEventRegister( RF_ProcessEvent );
#if defined(CH573)
rfConfig.accessAddress = 0x8E89BED6;
rfConfig.CRCInit = 0x555555;
#elif defined(CH579)
rfConfig.TxAccessAddress = 0x8E89BED6;
rfConfig.RxAccessAddress = 0x8E89BED6;
rfConfig.TxCRCInit = 0x555555;
rfConfig.RxCRCInit = 0x555555;
#else
#error "You must define CH573 or CH579 first!"
#endif
rfConfig.Channel = 37;
rfConfig.LLEMode = LLE_MODE_BASIC;
rfConfig.rfStatusCB = RF_2G4StatusCallBack;
state = RF_Config( &rfConfig );
PRINT("rf 2.4g init state for ble adv test: %x\n",state);
}
//ble adv data for RF-PHY test
static uint8_t ble_adv_test_data[] = {
0x3c,0x10,0x2D, 0xE4, 0xC2, 0x84,\\MAC ADDR
9,0x09,‘A‘,‘D‘,‘V‘,‘-‘,‘T‘,‘E‘,‘S‘,‘T‘ \\ADV data
};
uint8_t ble_adv_tx(void) {
RF_Shut( );
//tx type :0X02 for no connected adv
RF_Tx( TX_DATA,sizeof(TX_DATA), 0x02, 0xFF );
}
在CH579/CH573/CH57x 上使用RF_PHY 实现BLE广播
原文:https://www.cnblogs.com/iot-fan/p/14320405.html