Ejemplo n.º 1
0
/***********************************************************************************
* @fn      halRfDisableRxInterrupt
*
* @brief   Clear and disable RX interrupt.
*
* @param   none
*
* @return  none
*/
void halRfDisableRxInterrupt(void)
{
    // Clear the exception and the IRQ
    CLEAR_EXC_RX_FRM_DONE();
    halDigioIntClear(&pinRadio_GPIO0);
    halDigioIntDisable(&pinRadio_GPIO0);
}
Ejemplo n.º 2
0
/***********************************************************************************
* @fn      halRfInit
*
* @brief   Power up, sets default tuning settings, enables autoack and configures
*          chip IO
*
* @param   none
*
* @return  HAL_RF_SUCCESS if the radio has started, FAILURE otherwise
*/
uint8 halRfInit(void)
{
    regVal_t* p;

    DEBUG_MSG_FUNC_START;

    // Avoid GPIO0 interrupts during reset
#if 0 // POOH
    halDigioIntDisable(&pinRadio_GPIO0);
#else
    CC2520_GPIO_0_Interrupt_Setting(DISABLE);
#endif

    // Make sure to pull the CC2520 RESETn and VREG_EN pins low
    CC2520_RESET_OPIN(0);
    CC2520_SPI_END();
    CC2520_VREG_EN_OPIN(0);
#if 0 // POOH
    halMcuWaitUs(1100);
#else
    Delay(110);
#endif

    // Make sure MISO is configured as output.
#if 0 // POOH
    CC2520_MISO_DIR_OUT();
#endif

    // Enable the voltage regulator and wait for it (CC2520 power-up)
    CC2520_VREG_EN_OPIN(1);
#if 0 // POOH
    halMcuWaitUs(CC2520_VREG_MAX_STARTUP_TIME);
#else
    Delay(200);
#endif

    // Release reset
    CC2520_RESET_OPIN(1);

#if 0 // POOH
    // Wait for XOSC stable to be announced on the MISO pin
    if (halRfWaitRadioReady()==HAL_RF_FAILED)
        return HAL_RF_FAILED;
#else
    Delay(200);
#endif

    // Write non-default register values
    p= regval;
    while (p->reg!=0) {
        CC2520_MEMWR8(p->reg,p->val);
        p++;
    }

    return HAL_RF_SUCCESS;
}
Ejemplo n.º 3
0
/***********************************************************************************
* @fn      halRfDisableRxInterrupt
*
* @brief   Clear and disable RX interrupt.
*
* @param   none
*
* @return  none
*/
void halRfDisableRxInterrupt(void)
{
    // Clear the exception and the IRQ
    CLEAR_EXC_RX_FRM_DONE();
#if 0 // POOH
    halDigioIntClear(&pinRadio_GPIO0);
    halDigioIntDisable(&pinRadio_GPIO0);
#else
    EXTI_ClearITPendingBit(GPIO_EXTI_Line_RF_GPIO0);
    CC2520_GPIO_0_Interrupt_Setting(DISABLE);
#endif
}
Ejemplo n.º 4
0
/***********************************************************************************
* @fn      halRfInit
*
* @brief   Power up, sets default tuning settings, enables autoack and configures
*          chip IO
*
* @param   none
*
* @return  SUCCESS if the radio has started, FAILURE otherwise
*/
uint8 halRfInit(void)
{
    regVal_t* p;
    uint8 val;

    // Avoid GPIO0 interrupts during reset
    halDigioIntDisable(&pinRadio_GPIO0);

    // Make sure to pull the CC2520 RESETn and VREG_EN pins low
    CC2520_RESET_OPIN(0);
    CC2520_SPI_END();
    CC2520_VREG_EN_OPIN(0);
    halMcuWaitUs(1100);

    // Make sure MISO is configured as output.
    CC2520_MISO_DIR_OUT();
	
    // Enable the voltage regulator and wait for it (CC2520 power-up)
    CC2520_VREG_EN_OPIN(1);
    halMcuWaitUs(CC2520_VREG_MAX_STARTUP_TIME);

    // Release reset
    CC2520_RESET_OPIN(1);

    // Wait for XOSC stable to be announced on the MISO pin
    if (halRfWaitRadioReady()==FAILED)
        return FAILED;

    // Write non-default register values
    p= regval;
    while (p->reg!=0) {
        CC2520_MEMWR8(p->reg,p->val);
        p++;
    }

    // Verify a register
    val= CC2520_MEMRD8(CC2520_MDMCTRL0);

    return val==0x85? SUCCESS : FAILED;
}
Ejemplo n.º 5
0
/**************************************************************************************************
 * @fn      HalKeyIntDisable
 *
 * @brief   
 *
 * @param   none
 *
 * @return  None
 **************************************************************************************************/
void HalKeyIntDisable(void)
{
	halDigioIntDisable(&pinKey);
}
Ejemplo n.º 6
0
/***********************************************************************************
* @fn      halJoystickIntDisable
*
* @brief   Disable joystick move interrupt
*
* @param   none
*
* @return  none
*/
void halJoystickIntDisable(void)
{
   halDigioIntDisable(&pinJoystickMove);
}