Beispiel #1
0
//*****************************************************************************
//
//! \InterruptTestTerm
//! Performs termination processing.
//! This function is called once the test completes to tidy up as required.
//!
//! \param None.
//!
//! \return None.
//
//*****************************************************************************
static void
InterruptTestTerm(void)
{

    //
    // Unhook our interrupt handlers if they are still hooked.
    //
    TimerIntUnregister(TIMERA0_BASE, TIMER_A);
    TimerIntUnregister(TIMERA1_BASE, TIMER_A);
    TimerIntUnregister(TIMERA2_BASE, TIMER_A);

    //
    // Restore the original timer interrupt priorities and priority group
    // settings.
    //
    MAP_IntPriorityGroupingSet(g_lPriorityGrouping);
    MAP_IntPrioritySet(INT_TIMERA0A, (unsigned char)g_ulTimer0APriority);
    MAP_IntPrioritySet(INT_TIMERA1A, (unsigned char)g_ulTimer1APriority);

    //
    // Reset and Disable the timer blocks
    //
    MAP_PRCMPeripheralReset(PRCM_TIMERA0);
    MAP_PRCMPeripheralReset(PRCM_TIMERA1);
    MAP_PRCMPeripheralReset(PRCM_TIMERA2);

    MAP_PRCMPeripheralClkDisable(PRCM_TIMERA0, PRCM_RUN_MODE_CLK);
    MAP_PRCMPeripheralClkDisable(PRCM_TIMERA1, PRCM_RUN_MODE_CLK);
    MAP_PRCMPeripheralClkDisable(PRCM_TIMERA2, PRCM_RUN_MODE_CLK);

}
Beispiel #2
0
/**
 * @brief Initialize the CPU, set IRQ priorities
 */
void cpu_init(void) {

    /* initializes the Cortex-M core */
    cortexm_init();

    PRCMCC3200MCUInit();

    /* 1 priority group */
    MAP_IntPriorityGroupingSet(0);

}
Beispiel #3
0
//*****************************************************************************
//
//! \PerformIntTest
//!
//! Performs the repeated steps in running each test scenario.
//!
//! \param ucPriorityA0 is the interrupt priority to be used for Timer A0
//! \param ucPriorityA1 is the interrupt priority to be used for Timer A1
//! \param ucPriorityA2 is the interrupt priority to be used for Timer A2
//!
//! This function performs all the steps which are common to each test scenario
//! inside function InterruptTest.
//!
//! \return None.
//
//*****************************************************************************
tBoolean
PerformIntTest(unsigned long ulPriBits, unsigned char ucPriorityA0,
       unsigned char ucPriorityA1,unsigned char ucPriorityA2)
{
    tBoolean bRetcode;
    unsigned long ulStatus;
    
    //
    // Set the appropriate interrupt priorities.
    //
    MAP_IntPriorityGroupingSet(ulPriBits);
    MAP_IntPrioritySet(INT_TIMERA0A, ucPriorityA0);
    MAP_IntPrioritySet(INT_TIMERA1A, ucPriorityA1);
    MAP_IntPrioritySet(INT_TIMERA2A, ucPriorityA2);
    
    //
    // Clear any pending timer interrupts
    //
    ulStatus = MAP_TimerIntStatus(TIMERA0_BASE, false);
    MAP_TimerIntClear(TIMERA0_BASE, ulStatus);
    ulStatus = MAP_TimerIntStatus(TIMERA1_BASE, false);
    MAP_TimerIntClear(TIMERA1_BASE, ulStatus);
    ulStatus = MAP_TimerIntStatus(TIMERA2_BASE, false);
    MAP_TimerIntClear(TIMERA2_BASE, ulStatus);
    
    //
    // Clear all the counters and flags used by the interrupt handlers.
    //
    g_ulA0IntCount = 0;
    g_ulA1IntCount = 0;
    g_ulA2IntCount=0;
    g_bA1CountChanged = false;
    
    //
    // Enable three timer interrupts
    //
    MAP_TimerIntEnable(TIMERA0_BASE, TIMER_TIMA_TIMEOUT);
    MAP_TimerIntEnable(TIMERA1_BASE, TIMER_TIMA_TIMEOUT);
    MAP_TimerIntEnable(TIMERA2_BASE, TIMER_TIMA_TIMEOUT);
    
    //
    // Enable Timer A0
    //
    MAP_TimerEnable(TIMERA0_BASE, TIMER_A);
    
    //
    // Wait for Timer 0/A to fire.
    //
    bRetcode = UTUtilsWaitForCount(&g_ulA0IntCount, 1,
                                       ((SLOW_TIMER_DELAY_uS*3)/1000));
       
  
    //
    // Stop All timers and disable their interrupts
    //
    MAP_TimerDisable(TIMERA2_BASE, TIMER_A);
    MAP_TimerDisable(TIMERA1_BASE, TIMER_A);
    MAP_TimerDisable(TIMERA0_BASE, TIMER_A);
    MAP_TimerIntDisable(TIMERA2_BASE, TIMER_TIMA_TIMEOUT);
    MAP_TimerIntDisable(TIMERA1_BASE, TIMER_TIMA_TIMEOUT);
    MAP_TimerIntDisable(TIMERA0_BASE, TIMER_TIMA_TIMEOUT);

    return(bRetcode);
}