コード例 #1
0
ファイル: demoTimer.c プロジェクト: OS-Project/Divers
/*
** Timer 6 Interrupt Service Routine
*/
static void Timer6Isr(void)
{
    /* Stop the timer */
    DMTimerDisable(SOC_DMTIMER_6_REGS);

    /* Clear the status of the interrupt flags */
    DMTimerIntStatusClear(SOC_DMTIMER_6_REGS, DMTIMER_INT_OVF_EN_FLAG);
}
コード例 #2
0
ファイル: demoTimer.c プロジェクト: OS-Project/Divers
/*
** Timer 4 Interrupt Service Routine
*/
static void Timer4Isr(void)
{
    /* Clear the status of the interrupt flags */
    DMTimerIntStatusClear(SOC_DMTIMER_4_REGS, DMTIMER_INT_OVF_EN_FLAG);
    
    tmr4Flag = TRUE;
	
}
コード例 #3
0
ファイル: sysdelay.c プロジェクト: DanielCollins/BeagleDrone
static void DMTimerIsr(void)
{
    /* Clear the status of the interrupt flags */
    DMTimerIntStatusClear(SOC_DMTIMER_7_REGS, DMTIMER_INT_OVF_EN_FLAG);

    DMTimerDisable(SOC_DMTIMER_7_REGS);

    flagIsr = TRUE;
}
コード例 #4
0
ファイル: grlibDemoTouch.c プロジェクト: OS-Project/Divers
/*
** Timer 3 ISR
*/
static void Timer3Isr(void)
{
    /* Clear the status of the interrupt flags */
    DMTimerIntStatusClear(SOC_DMTIMER_3_REGS, DMTIMER_INT_MAT_EN_FLAG);

    DMTimerDisable(SOC_DMTIMER_3_REGS);
    DMTimerCounterSet(SOC_DMTIMER_3_REGS, 0);
   
    touchRelease = 1;
}
コード例 #5
0
void TMR_3_ISR(void)
{
	unsigned char status;

	status = DMTimerIntStatusGet(SOC_DMTIMER_3_REGS);

	if(status == DMTIMER_INT_OVF_IT_FLAG)
	{
		DMTimerDisable(SOC_DMTIMER_3_REGS); // start the timer
		TMR_SetMISCTimerFlag();
		DMTimerIntStatusClear(SOC_DMTIMER_3_REGS, DMTIMER_INT_OVF_IT_FLAG);
	}
}
コード例 #6
0
ファイル: dmtimerCounter.c プロジェクト: OS-Project/Divers
/*
** DMTimer interrupt service routine. This will send a character to serial 
** console.
*/    
static void DMTimerIsr(void)
{
    /* Disable the DMTimer interrupts */
    DMTimerIntDisable(SOC_DMTIMER_2_REGS, DMTIMER_INT_OVF_EN_FLAG);

    /* Clear the status of the interrupt flags */
    DMTimerIntStatusClear(SOC_DMTIMER_2_REGS, DMTIMER_INT_OVF_IT_FLAG);

    flagIsr = 1;

    /* Enable the DMTimer interrupts */
    DMTimerIntEnable(SOC_DMTIMER_2_REGS, DMTIMER_INT_OVF_EN_FLAG);
}
コード例 #7
0
ファイル: irqPreemption.c プロジェクト: OS-Project/Divers
/*
** DMTimer interrupt service routine.
*/
static void DMTimerIsr(void)
{
    UARTPuts("                Timer ISR Entry.\r\n", -1);

    /* Clear the status of the interrupt flags */
    DMTimerIntStatusClear(TIMER_INST_BASE, DMTIMER_INT_OVF_EN_FLAG);

    /* Stop the DMTimer */
    DMTimerDisable(TIMER_INST_BASE);

    preemptFlag = PREEMPT_FLAG_TIMER_ISR;

    UARTPuts("                Timer ISR Exit.\r\n", -1);
}
コード例 #8
0
ファイル: demoTimer.c プロジェクト: OS-Project/Divers
/*
** Timer 2 Interrupt Service Routine
*/
static void Timer2Isr(void)
{
	static unsigned int index = 0;
	
    /* Clear the status of the interrupt flags */
    DMTimerIntStatusClear(SOC_DMTIMER_2_REGS, DMTIMER_INT_OVF_EN_FLAG);
    
    tmr2Flag = TRUE;
	
	DMTimerCounterSet(SOC_DMTIMER_2_REGS, timerCount[index++%10]);
	
	DMTimerEnable(SOC_DMTIMER_2_REGS);	
	
}
コード例 #9
0
ファイル: irqPreemption.c プロジェクト: OS-Project/Divers
/*
** DMTimer interrupt service routine.
*/
static void DMTimerIsr(void)
{
    UARTPuts("                Timer ISR Entry.\r\n", -1);

    /* Clear the status of the interrupt flags */
    DMTimerIntStatusClear(SOC_DMTIMER_2_REGS, DMTIMER_INT_OVF_EN_FLAG);

    /* Stop the DMTimer */
    DMTimerDisable(SOC_DMTIMER_2_REGS);

    preemptFlag = 4;

    UARTPuts("                Timer ISR Exit.\r\n", -1);
}
コード例 #10
0
void TMR_2_ISR(void)
{
	unsigned char status;

	status = DMTimerIntStatusGet(SOC_DMTIMER_2_REGS);

	if(status == DMTIMER_INT_OVF_IT_FLAG)
	{
		TEST_Togglepoint1();

		/* GUI  New Screen Tag Timer */
		if(TMR_GetNewScreenTagTimerEnabled())
		{
			TMR_NewScreenTagTimer++;
			if(TMR_NewScreenTagTimer >= GUI_NEW_SCREEN_TAG_TIMER)
			{
				TMR_SetNewScreenTagTimerEnabled(FALSE);
				TMR_ResetNewScreenTagTimer();
				GUI_SetTagTimoutFlag();
			}
		}

		/* Audio Playback Timer */
		if(AUD_GetPlayingFlag())
		{
			TMR_AudioPlaybackTimer++;
			if(TMR_AudioPlaybackTimer >= AUD_AudioTimeoutCount)
			{
				TMR_ResetAudioPlaybackTimer();
				AUD_SetTimoutFlag();
			}
		}

		/* LCD Backlight Timer */
		if(TMR_BacklightTimer < GUI_BACKLIGHT_TIMER)
		{
			TMR_BacklightTimer++;
			if(TMR_BacklightTimer == GUI_BACKLIGHT_TIMER)
			{
				GUI_SetBacklightTimeout();
			}
		}

	    /* Clear the status of the interrupt flags */
	    DMTimerIntStatusClear(SOC_DMTIMER_2_REGS, DMTIMER_INT_OVF_IT_FLAG);
	}
}
コード例 #11
0
ファイル: demoPwrMgmnt.c プロジェクト: OS-Project/Divers
/*
** This function will disable interrupts of wake sources corresponding
** to Standby mode
*/
void disableStandbyWakeSrc(unsigned int wakeSource)
{
    switch(wakeSource)
    {
        case WAKE_SOURCE_TSC:

            /* Include Touchscreen for Enable/Disable Module  */
            ModuleListConfig(TRUE, CLK_ADC_TSC);
            break;

        case WAKE_SOURCE_UART:

            /* Include GPIO for Enable/Disable Module  */
            ModuleListConfig(TRUE, CLK_GPIO1);
            break;

        case WAKE_SOURCE_TMR:

            /* Include Timer for Enable/Disable Module  */
            ModuleListConfig(TRUE, CLK_TIMER6);

            /* Clear the status of the interrupt flags */
            DMTimerIntStatusClear(DMTIMER6_BASE_ADDR, DMTIMER_INT_OVF_EN_FLAG);
            break;

        case WAKE_SOURCE_GPIO:

            /* Include GPIO for Enable/Disable Module  */
            ModuleListConfig(TRUE, CLK_GPIO0);
            break;

        case WAKE_SOURCE_RTC:

            /* Include GPIO for Enable/Disable Module  */
            ModuleListConfig(TRUE, CLK_RTC);

            disableRTCIntr();
            break;

        default:
            break;
       }
}
コード例 #12
0
ファイル: grlibDemoTouch.c プロジェクト: OS-Project/Divers
/*
** Initializes the touch screen 
*/
void InitTouchScreen(void)
{
    unsigned int i;  
	
	/*	TSC clock config	*/
	TSCADCModuleClkConfig();
	/*	TSC pin mux	*/
	TSCADCPinMuxSetUp();
	
	/*	Timer3 Clock config	*/
	DMTimer3ModuleClkConfig();

    /* configures ADC to 3Mhz */
    TSCADCConfigureAFEClock(SOC_ADC_TSC_0_REGS, 24000000, 3000000);

    /* Enable Transistor bias */
    TSCADCTSTransistorConfig(SOC_ADC_TSC_0_REGS, TSCADC_TRANSISTOR_ENABLE);

    /* Map hardware event to Pen Touch IRQ */
    TSCADCHWEventMapSet(SOC_ADC_TSC_0_REGS, TSCADC_PEN_TOUCH);

    /* Set 4 Wire or 5 wire touch screen  mode */
    TSCADCTSModeConfig(SOC_ADC_TSC_0_REGS, TSCADC_FOUR_WIRE_MODE);

    TSCADCStepIDTagConfig(SOC_ADC_TSC_0_REGS, 1);

    /* Disable Write Protection of Step Configuration regs*/
    TSCADCStepConfigProtectionDisable(SOC_ADC_TSC_0_REGS);

    /* Configure ADC to Single ended operation mode */
    TSCADCIdleStepOperationModeControl(SOC_ADC_TSC_0_REGS,
                                    TSCADC_SINGLE_ENDED_OPER_MODE);

    /* Configure reference volatage and input to idlestep */
    TSCADCIdleStepConfig(SOC_ADC_TSC_0_REGS, TSCADC_NEGATIVE_REF_VSSA,
                         TSCADC_POSITIVE_INP_CHANNEL1, TSCADC_NEGATIVE_INP_ADCREFM,
                         TSCADC_POSITIVE_REF_VDDA);

    /* Configure the Analog Supply to Touch screen */
    TSCADCIdleStepAnalogSupplyConfig(SOC_ADC_TSC_0_REGS, TSCADC_XPPSW_PIN_OFF,
                                     TSCADC_XNPSW_PIN_OFF, TSCADC_YPPSW_PIN_OFF);

    /*
    **Configure the Analong Ground of Touch screen.
    */
    TSCADCIdleStepAnalogGroundConfig(SOC_ADC_TSC_0_REGS, TSCADC_XNNSW_PIN_OFF,
                                     TSCADC_YPNSW_PIN_ON, TSCADC_YNNSW_PIN_ON,
                                     TSCADC_WPNSW_PIN_OFF);


    /* Configure ADC to Single ended operation mode */
    TSCADCChargeStepOperationModeControl(SOC_ADC_TSC_0_REGS,
                                         TSCADC_SINGLE_ENDED_OPER_MODE);

    /* Configure reference volatage and input to charge step*/
    TSCADCChargeStepConfig(SOC_ADC_TSC_0_REGS, TSCADC_NEGATIVE_REF_XNUR,
                           TSCADC_POSITIVE_INP_CHANNEL2, TSCADC_NEGATIVE_INP_CHANNEL2,
                           TSCADC_POSITIVE_REF_XPUL);

    /* Configure the Analog Supply to Touch screen */
    TSCADCChargeStepAnalogSupplyConfig(SOC_ADC_TSC_0_REGS, TSCADC_XPPSW_PIN_ON,
                                       TSCADC_XNPSW_PIN_OFF, TSCADC_XPPSW_PIN_OFF);

    /* Configure the Analong Ground to Touch screen */
    TSCADCChargeStepAnalogGroundConfig(SOC_ADC_TSC_0_REGS, TSCADC_XNNSW_PIN_OFF,
                                       TSCADC_YPNSW_PIN_OFF, TSCADC_YNNSW_PIN_ON,
                                       TSCADC_WPNSW_PIN_OFF);

    TSCADCTSChargeStepOpenDelayConfig(SOC_ADC_TSC_0_REGS, 0x200);
	
    for(i = 0; i < SAMPLES; i++)
    {
         StepConfigX(i);

         TSCADCTSStepOpenDelayConfig(SOC_ADC_TSC_0_REGS, i, 0x98);
    }

    for(i = SAMPLES; i < (2 * SAMPLES); i++)
    {
         StepConfigY(i);

         TSCADCTSStepOpenDelayConfig(SOC_ADC_TSC_0_REGS, i, 0x98);
    }

    /* Configure FIFO1 threshold value */
    TSCADCFIFOIRQThresholdLevelConfig(SOC_ADC_TSC_0_REGS, TSCADC_FIFO_1, 5);

    IsTSPress = 0;
    touchRelease = 0;

	/* timer setup for touch screen */
	IntPrioritySet(SYS_INT_TINT3, 0, AINTC_HOSTINT_ROUTE_IRQ);
    IntSystemEnable(SYS_INT_TINT3);
    IntRegister(SYS_INT_TINT3, Timer3Isr);

    DMTimerModeConfigure(SOC_DMTIMER_3_REGS, DMTIMER_ONESHOT_CMP_ENABLE);
    DMTimerReloadSet(SOC_DMTIMER_3_REGS, 0xffffffff);
    DMTimerCompareSet(SOC_DMTIMER_3_REGS, 0xfffff); 

    DMTimerIntStatusClear(SOC_DMTIMER_3_REGS, DMTIMER_INT_MAT_EN_FLAG);

    /* Enable the DMTimer interrupts */
    DMTimerIntEnable(SOC_DMTIMER_3_REGS, DMTIMER_INT_MAT_EN_FLAG);
	
	/*	Interrupt register	*/
	TouchIntEnable();
	/*	enable touch	*/
	TouchEnable();
}
コード例 #13
0
ファイル: rmpi.c プロジェクト: vastsoun/bbmc
static inline void
rmpi_timer_interrupt_off (void)
{
    DMTimerIntDisable(SOC_DMTIMER_4_REGS, DMTIMER_INT_OVF_EN_FLAG);
    DMTimerIntStatusClear(SOC_DMTIMER_4_REGS, DMTIMER_INT_OVF_IT_FLAG);
}