/******************************************************************************************************** * @fn ZMacInit * * @brief Initialize MAC. * * @param none. * * @return status. ********************************************************************************************************/ uint8 ZMacInit( void ) { uint8 stat; #if defined( ZCL_KEY_ESTABLISH ) /* Set the callback function for 16 byte random seed */ MAC_SetRandomSeedCB( SSP_StoreRandomSeedNV); #endif MAC_Init(); MAC_InitDevice(); #if !defined NONWK if ( ZG_BUILD_RTR_TYPE ) { MAC_InitCoord(); } #endif // If OK, initialize the MAC stat = ZMacReset( TRUE ); // Turn off interrupts osal_int_disable( INTS_ALL ); return ( stat ); }
/********************************************************************* * @fn InitBoard() * @brief Initialize the CC2420DB Board Peripherals * @param level: COLD,WARM,READY * @return None */ void InitBoard( uint8 level ) { if ( level == OB_COLD ) { // IAR does not zero-out this byte below the XSTACK. *(uint8 *)0x0 = 0; // Interrupts off osal_int_disable( INTS_ALL ); // Check for Brown-Out reset ChkReset(); #if defined CC2531ZNP znpCfg1 = ZNP_CFG1_UART; #elif defined CC2530_MK znpCfg1 = ZNP_CFG1_SPI; znpCfg0 = ZNP_CFG0_32K_OSC; #else znpCfg1 = P2_0; znpCfg0 = P1_2; // Tri-state the 2 CFG inputs after being read (see hal_board_cfg_xxx.h for CFG0.) P1INP |= BV(2); P2INP |= BV(0); #endif } else // !OB_COLD { /* Initialize Key stuff */ HalKeyConfig(HAL_KEY_INTERRUPT_DISABLE, OnBoard_KeyCallback); } }
/****************************************************************************** * @fn InitBoard() * @brief Initialize the CC22538DB Board Peripherals * @param level: COLD,WARM,READY * @return None */ void InitBoard( uint8 level ) { if ( level == OB_COLD ) { /* Interrupts off */ osal_int_disable( INTS_ALL ); HalKeyConfig( FALSE, NULL); //Config GPIO as input #if (defined OTA_CLIENT) && (OTA_CLIENT == TRUE) HalOTAInit(); #endif #ifdef HAL_UART_USB znpCfg1 = ZNP_CFG1_UART; znpCfg0 = ZNP_CFG0_32K_XTAL; #elif HAL_SPI znpCfg1 = ZNP_CFG1_SPI; znpCfg0 = ZNP_CFG0_32K_XTAL; #else znpCfg1 = ZNP_CFG1_UART; znpCfg0 = ZNP_CFG0_32K_XTAL; #endif } else /* !OB_COLD */ { /* Initialize Key stuff */ OnboardKeyIntEnable = HAL_KEY_INTERRUPT_DISABLE; HalKeyConfig( OnboardKeyIntEnable, OnBoard_KeyCallback); } }
/********************************************************************* * @fn InitBoard() * @brief Initialize the CC2420DB Board Peripherals * @param level: COLD,WARM,READY * @return None */ void InitBoard( uint8 level ) { if ( level == OB_COLD ) { // Interrupts off osal_int_disable( INTS_ALL ); } else // !OB_COLD { /* Initialize Key stuff */ HalKeyConfig(HAL_KEY_INTERRUPT_DISABLE, OnBoard_KeyCallback); } }
/********************************************************************* * @fn InitBoard() * @brief Initialize the CC2420DB Board Peripherals * @param level: COLD,WARM,READY * @return None */ void InitBoard( uint8 level ) { if ( level == OB_COLD ) { // IAR does not zero-out this byte below the XSTACK. *(uint8 *)0x0 = 0; // Interrupts off osal_int_disable( INTS_ALL ); // Check for Brown-Out reset ChkReset(); } else // !OB_COLD { /* Initialize Key stuff */ HalKeyConfig(HAL_KEY_INTERRUPT_ENABLE, OnBoard_KeyCallback); } }
/********************************************************************* * @fn InitBoard() * @brief Initialize the CC2540DB Board Peripherals * @param level: COLD,WARM,READY * @return None */ void InitBoard( uint8 level ) { if ( level == OB_COLD ) { // Interrupts off osal_int_disable( INTS_ALL ); // Turn all LEDs off HalLedSet( HAL_LED_ALL, HAL_LED_MODE_OFF ); // Check for Brown-Out reset // ChkReset(); } else // !OB_COLD { /* Initialize Key stuff */ OnboardKeyIntEnable = HAL_KEY_INTERRUPT_ENABLE; HalKeyConfig( OnboardKeyIntEnable, OnBoard_KeyCallback); } }
/****************************************************************************** * @fn InitBoard() * @brief Initialize the CC22538DB Board Peripherals * @param level: COLD,WARM,READY * @return None */ void InitBoard( uint8 level ) { if ( level == OB_COLD ) { // Interrupts off osal_int_disable( INTS_ALL ); HalKeyConfig( FALSE, NULL); //Config GPIO as input #if (defined OTA_CLIENT) && (OTA_CLIENT == TRUE) HalOTAInit(); #endif } else // !OB_COLD { /* Initialize Key stuff */ OnboardKeyIntEnable = HAL_KEY_INTERRUPT_DISABLE; HalKeyConfig( OnboardKeyIntEnable, OnBoard_KeyCallback); } }
/******************************************************************************************************** * @fn ZMacInit * * @brief Initialize MAC. * * @param none. * * @return status. ********************************************************************************************************/ ROOT uint8 ZMacInit( void ) { uint8 stat; MAC_Init(); MAC_InitDevice(); #if defined ( RTR_NWK ) MAC_InitCoord(); #endif // If OK, initialize the MAC stat = ZMacReset( TRUE ); // Turn off interrupts osal_int_disable( INTS_ALL ); return ( stat ); }