uint_32 _mcf5441_int_init
   (
      // [IN} Interrupt number
      PSP_INTERRUPT_TABLE_INDEX irq,

      // [IN} Interrupt priority level
      _int_level                level,

      // [IN} Unmask the interrupt now?
      boolean                   unmask
   )
{
    _mqx_int idx;
    uint_32 temp;

    if (irq >= PSP_INT_FIRST_EXTERNAL) {
        idx = irq - PSP_INT_FIRST_EXTERNAL;
   
        temp = _psp_get_sr();
        _psp_set_sr(temp | 0x0700);
        
        if (idx < 64) {
            PSP_GET_ICTRL0_BASE()->ICR[idx] = level & 7;
            
            if (unmask)
                PSP_GET_ICTRL0_BASE()->CIMR = MCF54XX_ICTRL_IMR_N(idx);
            else
                PSP_GET_ICTRL0_BASE()->SIMR = MCF54XX_ICTRL_IMR_N(idx);
        }
        else if (idx < 128) {
            idx -= 64;
            PSP_GET_ICTRL1_BASE()->ICR[idx] = level & 7;
            
            if (unmask)
                PSP_GET_ICTRL1_BASE()->CIMR = MCF54XX_ICTRL_IMR_N(idx);
            else
                PSP_GET_ICTRL1_BASE()->SIMR = MCF54XX_ICTRL_IMR_N(idx);
        }
        else {
            idx -= 128;
            PSP_GET_ICTRL2_BASE()->ICR[idx] = level & 7;
            
            if (unmask)
                PSP_GET_ICTRL2_BASE()->CIMR = MCF54XX_ICTRL_IMR_N(idx);
            else
                PSP_GET_ICTRL2_BASE()->SIMR = MCF54XX_ICTRL_IMR_N(idx);
        }
        
        _psp_set_sr(temp);
    
        return MQX_OK;
    }
    
    return MQX_INVALID_PARAMETER;
}
uint_32 _mcf5441_int_mask
   (
      // [IN} Interrupt number
      PSP_INTERRUPT_TABLE_INDEX irq
   )
{
    _mqx_int idx;

    if (irq >= PSP_INT_FIRST_EXTERNAL) {
        idx = irq - PSP_INT_FIRST_EXTERNAL;
   
        if (idx < 64) {
            PSP_GET_ICTRL0_BASE()->SIMR = MCF54XX_ICTRL_IMR_N(idx);
        }
        else if (idx < 128) {
            PSP_GET_ICTRL1_BASE()->SIMR = MCF54XX_ICTRL_IMR_N(idx - 64);
        }
        else {
            PSP_GET_ICTRL2_BASE()->SIMR = MCF54XX_ICTRL_IMR_N(idx - 128);
        }
    
        return MQX_OK;
    }
    
    return MQX_INVALID_PARAMETER;
}
示例#3
0
void  _mcf5329_int_mask_all
   (
      void
   )
{ /* Body */

   PSP_GET_ICTRL0_BASE()->SIMR = MCF53XX_ICTRL_IMR_ALL;
   PSP_GET_ICTRL1_BASE()->SIMR = MCF53XX_ICTRL_IMR_ALL;

} /* Endbody */
示例#4
0
uint_32 _mcf5329_int_unmask
   (
      /* [IN} Interrupt number */
      PSP_INTERRUPT_TABLE_INDEX irq
   )
{ /* Body */
    _mqx_int idx;

    if (irq >= PSP_INT_FIRST_EXTERNAL) {
        idx = irq - PSP_INT_FIRST_EXTERNAL;
   
        if (idx < 64) {
            PSP_GET_ICTRL0_BASE()->CIMR = MCF53XX_ICTRL_IMR_N(idx);
        }
        else {
            PSP_GET_ICTRL1_BASE()->CIMR = MCF53XX_ICTRL_IMR_N(idx - 64);
        }
    
        return MQX_OK;
    }
    
    return MQX_INVALID_PARAMETER;
} /* Endbody */