Beispiel #1
0
void tick_stop(void)
{
    avic_disable_int(INT_EPIT1);            /* Disable insterrupt */
    EPITCR1 &= ~(EPITCR_OCIEN | EPITCR_EN); /* Disable counter */
    EPITSR1 = EPITSR_OCIF;                  /* Clear pending */
    ccm_module_clock_gating(CG_EPIT1, CGM_OFF); /* Turn off module clock */
}
Beispiel #2
0
void usb_drv_int_enable(bool enable)
{
    if (enable)
    {
        avic_enable_int(INT_USB_OTG, INT_TYPE_IRQ, INT_PRIO_DEFAULT,
                        USB_OTG_HANDLER);
    }
    else
    {
        avic_disable_int(INT_USB_OTG);
    }
}
static void stop_timer(bool clock_off)
{
    /* Ensure clock gating on (before touching any module registers) */
    ccm_module_clock_gating(CG_EPIT2, CGM_ON_RUN_WAIT);
    /* Disable insterrupt */
    avic_disable_int(INT_EPIT2);
    /* Clear wakeup mask */
    CCM_WIMR0 &= ~CCM_WIMR0_IPI_INT_EPIT2;
    /* Disable counter */
    EPITCR2 &= ~(EPITCR_OCIEN | EPITCR_EN);
    /* Clear pending */
    EPITSR2 = EPITSR_OCIF;

    if (clock_off)
    {
        /* Final stop, not reset; don't clock module any longer */
        ccm_module_clock_gating(CG_EPIT2, CGM_OFF);
    }
}