/*********************************************************************************** * @fn halRfWaitRadioReady * * @brief Wait for the crystal oscillator to stabilise. * * @param none * * @return SUCCESS if oscillator starts, FAILED otherwise */ static uint8 halRfWaitRadioReady(void) { uint8 i; // Wait for XOSC stable to be announced on the MISO pin i= 50; CC2520_CSN_OPIN(0); while (i > 0 && !CC2520_MISO_IPIN) { chThdSleepMicroseconds(100); --i; } CC2520_CSN_OPIN(1); return i > 0 ? SUCCESS : FAILED; }
/*********************************************************************************** * @fn halRfWaitRadioReady * * @brief Wait for the crystal oscillator to stabilise. * * @param none * * @return HAL_RF_SUCCESS if oscillator starts, HAL_RF_FAILED otherwise */ static uint8 halRfWaitRadioReady(void) { uint8 i; // Wait for XOSC stable to be announced on the MISO pin i= 100; CC2520_CSN_OPIN(0); while (i>0 && !CC2520_MISO_IPIN) { halMcuWaitUs(10); --i; } CC2520_CSN_OPIN(1); return i>0 ? HAL_RF_SUCCESS : HAL_RF_FAILED; }
/*********************************************************************************** * @fn halRfWaitRadioReady * * @brief Wait for the crystal oscillator to stabilise. * * @param none * * @return SUCCESS if oscillator starts, FAILED otherwise */ static uint8 halRfWaitRadioReady(void) { uint8 i; // Wait for XOSC stable to be announced on the MISO pin i= 100; HAL_MAC_SPI_LUMINARY_SO_AS_GPIO(); CC2520_CSN_OPIN(0); while (i>0 && !CC2520_MISO_IPIN) { halMcuWaitUs(10); --i; } CC2520_CSN_OPIN(1); BSP_SSI0_Init(); return i>0 ? SUCCESS : FAILED; }