This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

OMAPL138: Timer Event to trigger EDMA transfer

Other Parts Discussed in Thread: OMAPL138

Hi,

I will use the TM64P3_Out12 Event to enable a AB-synchronized EDMA transfer. CCNT is 3.
Is the TEVT12 always set when an interrupt is set or do I have to enable more than only the PRDINTEN12?

I know that I have to clear the Interrupt flag when one occured, do I have to do the same with the EDMA3 event flag if this is accessable from "outside" or is it automatically reseted after the event is submitted to the EDMA3 CC?

I have the TM64P3_Out12 also available on a GPIO to trigger a AD conversion on the EMIFA connected ADCs. At the same time, the EDMA3 system shall transfer the last ADC values from the ADCs to an other  memory section. Thus, the EDMA3 CC shall react also on this EVANT. I see on a connected Oszilloscope that the puls of the timer occurs as expected, but no change in the EDMACC1 IPR can observed. The CCNT is 4, I hope that means that 4 transfers must be triggerd before the bit in the IPR is set? The bit is never set... The corresponding EVENT is 26, am I right? I configured the the EDMACC and PaRAM-sets (Set26 links to Set 127. Set127 links back to 26) as followed:

/*
* Setup the EDMA3 CC1
*/
/*Enable Event 26 in EDMA3CC1. Event 26 comes from TM64P3_Out12*/
CSL_FINST(Edma31cc0Regs->EESR, EDMA3CC_EESR_E26, SET);
/*Map Event 26 on EDMACC1 to Queue Q0 - should be by default but only to be safe*/
CSL_FINST(Edma31cc0Regs->DMAQNUM[3], EDMA3CC_DMAQNUM_E2, Q0);
/* Enable EDMA3CC1 Interrupt 0 - Ping Buffer - This interrupt needs to be served by the TCC in PaRAM.OPT */
CSL_FINST(Edma31cc0Regs->IESR, EDMA3CC_IESR_I0, SET);
/* Enable EDMA3CC1 Interrupt 1 - Pong Buffer - This interrupt needs to be served by the TCC in PaRAM.OPT */
CSL_FINST(Edma31cc0Regs->IESR, EDMA3CC_IESR_I1, SET);
/*
* relative Memory-Addresses of PaRAM sets
* PaRAM set 26:  0x4340 (responsible for EVENT26 (Timer64P3 Out12))
* PaRAM set 127: 0x4FE0
*/
/*
* PaRAM set 26 for PING buffer - 16 bit
*/
/* Intermediate transfer completion chaining disable */
CSL_FINST(Edma31cc0Regs->PARAMSET[26].OPT, EDMA3CC_OPT_ITCCHEN, DISABLE);
/* Transfer complete chaining disable */
CSL_FINST(Edma31cc0Regs->PARAMSET[26].OPT, EDMA3CC_OPT_TCCHEN, DISABLE);
/* Intermediate transfer completion interrupt disable */
CSL_FINST(Edma31cc0Regs->PARAMSET[26].OPT, EDMA3CC_OPT_ITCINTEN, DISABLE);
/* Transfer complete interrupt enable */
CSL_FINST(Edma31cc0Regs->PARAMSET[26].OPT, EDMA3CC_OPT_TCINTEN, ENABLE);
/* TCC is 0 to set after transfer completion the bit 0 in IPR  */
CSL_FINS(Edma31cc0Regs->PARAMSET[26].OPT, EDMA3CC_OPT_TCC, 0);
/* Transfer completion mode */
CSL_FINST(Edma31cc0Regs->PARAMSET[26].OPT, EDMA3CC_OPT_TCCMOD, NORMAL);
/* FIFO width */
/* Applies if either SAM or DAM is set to constant addressing mode.
* SAM or DAM isn't supported at any controller on OMAPL138, therefore dosen't matter which size is choosen */
CSL_FINST(Edma31cc0Regs->PARAMSET[26].OPT, EDMA3CC_OPT_FWID, 256BIT);
/* Updating PaRAM-set after TR submitted  */
CSL_FINST(Edma31cc0Regs->PARAMSET[26].OPT, EDMA3CC_OPT_STATIC, NORMAL);
/* AB-synchronized transfer ACNT and BCNT  */
CSL_FINST(Edma31cc0Regs->PARAMSET[26].OPT, EDMA3CC_OPT_SYNCDIM, ABSYNC);
/* Increment Destination Adress  */
CSL_FINST(Edma31cc0Regs->PARAMSET[26].OPT, EDMA3CC_OPT_DAM, INCR);
/* Increment Source Adress - Constant would be the better choice in this case but isn't supported by L138 */
CSL_FINST(Edma31cc0Regs->PARAMSET[26].OPT, EDMA3CC_OPT_SAM, INCR);
/* Source Address of the Ping buffer -> Start Address of EMIFA connected ADCs  */
CSL_FINS(Edma31cc0Regs->PARAMSET[26].SRC, EDMA3CC_SRC_SRC, 0x66000001);
/* Number of bytes in an Array  */
CSL_FINS(Edma31cc0Regs->PARAMSET[26].A_B_CNT, EDMA3CC_A_B_CNT_ACNT, 0x0002);
/* Number of Arrays per transfer (Frame)  */
CSL_FINS(Edma31cc0Regs->PARAMSET[26].A_B_CNT, EDMA3CC_A_B_CNT_BCNT, 0x0002);
/*Start address of destination  */
CSL_FINS(Edma31cc0Regs->PARAMSET[26].DST, EDMA3CC_DST_DST, BuffAddressPing);
/*modification of destination address after transfer one array  */
CSL_FINS(Edma31cc0Regs->PARAMSET[26].SRC_DST_BIDX, EDMA3CC_SRC_DST_BIDX_DSTBIDX, 0x0003);
/*modification of source address after transfer one array. must be zero, the ADCs are always connected to the same address  */
CSL_FINS(Edma31cc0Regs->PARAMSET[26].SRC_DST_BIDX, EDMA3CC_SRC_DST_BIDX_SRCBIDX, 0x0000);
/*Link to PaRAM-set 127 at Address 0x4FE0  */
CSL_FINS(Edma31cc0Regs->PARAMSET[26].LINK_BCNTRLD, EDMA3CC_LINK_BCNTRLD_LINK, 0x4FE0);
/*Modification of destination address in 3rd dimension (CCNT...)  */
CSL_FINS(Edma31cc0Regs->PARAMSET[26].SRC_DST_CIDX, EDMA3CC_SRC_DST_CIDX_DSTCIDX, 0x0000);
/*Modification of source address in 3rd dimension (CCNT...)  */
CSL_FINS(Edma31cc0Regs->PARAMSET[26].SRC_DST_CIDX, EDMA3CC_SRC_DST_CIDX_SRCCIDX, 0x0000);
/*CCNT  */
CSL_FINS(Edma31cc0Regs->PARAMSET[26].CCNT, EDMA3CC_CCNT_CCNT, 0x0004);
/*
* PaRAM set 127 for PONG buffer - 16 bit
*/
/* Intermediate transfer completion chaining disable */
CSL_FINST(Edma31cc0Regs->PARAMSET[127].OPT, EDMA3CC_OPT_ITCCHEN, DISABLE);
/* Transfer complete chaining disable */
CSL_FINST(Edma31cc0Regs->PARAMSET[127].OPT, EDMA3CC_OPT_TCCHEN, DISABLE);
/* Intermediate transfer completion interrupt disable */
CSL_FINST(Edma31cc0Regs->PARAMSET[127].OPT, EDMA3CC_OPT_ITCINTEN, DISABLE);
/* Transfer complete interrupt enable */
CSL_FINST(Edma31cc0Regs->PARAMSET[127].OPT, EDMA3CC_OPT_TCINTEN, ENABLE);
/* TCC is 1 to set after transfer completion the bit 1 in IPR  */
CSL_FINS(Edma31cc0Regs->PARAMSET[127].OPT, EDMA3CC_OPT_TCC, 1);
/* Transfer completion mode */
CSL_FINST(Edma31cc0Regs->PARAMSET[127].OPT, EDMA3CC_OPT_TCCMOD, NORMAL);
/* FIFO width */
/* Applies if either SAM or DAM is set to constant addressing mode.
* SAM or DAM isn't supported at any controller on OMAPL138, therefore dosen't matter which size is choosen */
CSL_FINST(Edma31cc0Regs->PARAMSET[127].OPT, EDMA3CC_OPT_FWID, 256BIT);
/* Updating PaRAM-set after TR submitted  */
CSL_FINST(Edma31cc0Regs->PARAMSET[127].OPT, EDMA3CC_OPT_STATIC, NORMAL);
/* AB-synchronized transfer ACNT and BCNT  */
CSL_FINST(Edma31cc0Regs->PARAMSET[127].OPT, EDMA3CC_OPT_SYNCDIM, ABSYNC);
/* Increment Destination Adress  */
CSL_FINST(Edma31cc0Regs->PARAMSET[127].OPT, EDMA3CC_OPT_DAM, INCR);
/* Increment Source Adress - Constant would be the better choice in this case but isn't supported by L138 */
CSL_FINST(Edma31cc0Regs->PARAMSET[127].OPT, EDMA3CC_OPT_SAM, INCR);
/* Source Address of the Ping buffer -> Start Address of EMIFA connected ADCs  */
CSL_FINS(Edma31cc0Regs->PARAMSET[127].SRC, EDMA3CC_SRC_SRC, 0x66000001);
/* Number of bytes in an Array  */
CSL_FINS(Edma31cc0Regs->PARAMSET[127].A_B_CNT, EDMA3CC_A_B_CNT_ACNT, 0x0002);
/* Number of Arrays per transfer (Frame)  */
CSL_FINS(Edma31cc0Regs->PARAMSET[127].A_B_CNT, EDMA3CC_A_B_CNT_BCNT, 0x0002);
/*Start address of destination  */
CSL_FINS(Edma31cc0Regs->PARAMSET[127].DST, EDMA3CC_DST_DST, BuffAddressPong);
/*modification of destination address after transfer one array  */
CSL_FINS(Edma31cc0Regs->PARAMSET[127].SRC_DST_BIDX, EDMA3CC_SRC_DST_BIDX_DSTBIDX, 0x0003);
/*modification of source address after transfer one array. must be zero, the ADCs are always connected to the same address  */
CSL_FINS(Edma31cc0Regs->PARAMSET[127].SRC_DST_BIDX, EDMA3CC_SRC_DST_BIDX_SRCBIDX, 0x0000);
/*Link to PaRAM-set 26 at Address 0x4340  */
CSL_FINS(Edma31cc0Regs->PARAMSET[127].LINK_BCNTRLD, EDMA3CC_LINK_BCNTRLD_LINK, 0x4340);
/*Modification of destination address in 3rd dimension (CCNT...)  */
CSL_FINS(Edma31cc0Regs->PARAMSET[127].SRC_DST_CIDX, EDMA3CC_SRC_DST_CIDX_DSTCIDX, 0x0000);
/*Modification of source address in 3rd dimension (CCNT...)  */
CSL_FINS(Edma31cc0Regs->PARAMSET[127].SRC_DST_CIDX, EDMA3CC_SRC_DST_CIDX_SRCCIDX, 0x0000);
/*CCNT  */
CSL_FINS(Edma31cc0Regs->PARAMSET[127].CCNT, EDMA3CC_CCNT_CCNT, 0x0004);

Is there anything wrong configured in the program above?
Is there a special configuration on the Timer registers needed to submitt the event to EDMA3 CC? 

thanks,
Christian 

  • I forgot to insert my configuration of the Timer... sorry and thanks for all your help!

    //Disable Timer 1:2, if running
    CSL_FINST(TmrRegs->TCR, TMR_TCR_ENAMODE12, DISABLE);
    //Reset Timer 1:2
    CSL_FINST(TmrRegs->TGCR, TMR_TGCR_TIM12RS, RESET);
    TMRRSTWaitcycle(10000);
    //Enable PLUS-funxtions like Reload, etc
    CSL_FINST(TmrRegs->TGCR, TMR_TGCR_PLUSEN, ENABLE);
    //Select 32-bit unchained mode
    CSL_FINST(TmrRegs->TGCR, TMR_TGCR_TIMMODE, 32BIT_UNCHAIN);
    //Remove the timer 1:2 from reset
    CSL_FINST(TmrRegs->TGCR, TMR_TGCR_TIM12RS, NO_RESET);
    //Select the desired timer period for timer 1:2
    CSL_FINS(TmrRegs->PRD12, TMR_PRD12_PRD12, TMRPeriod);
    //Select the desired clock source for timer 1:2
    CSL_FINST(TmrRegs->TCR, TMR_TCR_CLKSRC12, INTERNAL);
    //Select how the external  pin TM64_OUT12 shall operate: Pulse-Mode
    CSL_FINST(TmrRegs->TCR, TMR_TCR_CP12, PULSE);
    //Select pulsewidth of the external pin TM64_OUT12 in Pulse-Mode
    // Source clock is 150 MHZ not 456 MHZ
    CSL_FINST(TmrRegs->TCR, TMR_TCR_PWID12, FOUR_CLK);
    // Invert polarity of output pin
    CSL_FINST(TmrRegs->TCR, TMR_TCR_INVOUTP12, INVERTED);
    //Fill Reloadregister
    CSL_FINS(TmrRegs->REL12, TMR_REL12_REL12, 0xFFFF);
    //Enable interrupt generation when timer is enabled in 64-bit/32-bit chained/unchained/watchdog modes.
    CSL_FINST(TmrRegs->INTCTLSTAT, TMR_INTCTLSTAT_PRDINTEN12, ENABLE);
    //Clear pending flag by setting 1 to the field
    CSL_FINST(TmrRegs->INTCTLSTAT, TMR_INTCTLSTAT_PRDINTSTAT12, PEND);
    Thanks,
    Christian
  • Hi Christian,

    Thanks for your post.

    PRDINTEN12 field of Timer Interrupt Control and Status Register (INTCTLSTAT) is set, to generate interrupt when timer is enabled in 64-bit/32-bit chained/unchained/watchdog modes. This generates the timer interrupt (TINT12) to CPU interrupt controller and TEVT12 is a timer DMA event to DMA controller.

    Basically, When the timer is enabled, the timer counter starts incrementing by 1 at every timer input clock cycle. When the timer counter matches the timer period, a maskable timer interrupt (TINT12) and a timer EDMA (TEVT12) are generated. So, both timer events (TEVTn) to DMA enginer and timer interrupts (TINTn) to CPU shall be sent independantly depending on the operating mode of the timer.

    I also understand that, TM64P3_Out12 output event triggers EDMA transfer as well AD conversion on the EMIFA connected ADCs at the same time. The timer can generate an output pulse on the TM64P_OUT12 pin. The output signal is generated when the count value in the counter registers reaches the value specified in the period registers.

    I don't think, there is special configuration needed on the Timer registers to submit the event to EDMA3 CC but the timer supports additional features for control and status of interrupt and DMA event generation if the PLUSEN bit in the timer global control register (TGCR) is set.

    Please refer the below Sections for the timer configuration in the TRM:

     31.2.1.4.1.3 (64-Bit Timer Configuration Procedure)

    31.2.1.4.2.1.2 (32-Bit Timer Chained Mode Configuration Procedure)

    31.2.1.4.2.2.4 (32-Bit Timer Unchained Mode Configuration Procedure)

    http://www.ti.com/lit/spruh77

     Thanks & regards,

    Sivaraj K

    ---------------------------------------------------------------------------------
    Please click the
    Verify Answer button on this post if it answers your question.
    ---------------------------------------------------------------------------------
     

     

  • Thanks for you answer, but unfortunately one thing isn't clear for me. When the TM64P3_OUT12 pin is triggering a new AD conversion and the same signal is also triggering an DMA-event to transfer the available datas from the ADCs to another memory location, do I have always to reset the timer interruptflag after it is occured by the CPU to trigger a new event to the DMA-controller?

     

    For me it looks like it is exactly what needs to be done. Can you confirm this or is there any other way to trigger an DMA AB-synchronized transfer after the timer reached the PRD whithout any intervention of the CPU?

     

    Thanks,
    Christian

  • Hi Christian,

    First, timer needs to be enabled for continuous operation (ENAMODEn = 1), the timer counter counts up until it reaches the period values, then resets itself to zero and begins counting again, instead, if it is enabled for one time operation, (ENAMODEn = 1), timer stops once the counter reaches the period value.

    To address your question, it all depends how to reload the period registers (PRD12 or PRD34) with the value in the period reload registers (REL12 or REL34) and timer begins counting again for the period value after it resets. I recommend you to choose a low period value in the reload registers, sothat, timer counter counts up fast to reach its period value and it reset the counting. So, for every fast reset, timer will generate a timer interrupt (TINT12), a timer DMA event (TEVT12) and a timer output event on TM64P_OUT12

    Yes, to trigger a new DMA event to the controller, you don't need to reset the timer interrupt flag but for sure, timer counter should reach its period value faster and resets itself to generate new interrupt as well new DMA event. So, inorder to use the same signal on TM64P3_OUT12 pin of the timer module for triggering both AD conversion as well DMA event to transfer available data from ADC, you need to trigger a new DMA event to the DMA controller to transfer data from ADC by choosing low period value, sothat, timer resets very fast and generates a new DMA event as well timer interrupt to CPU controller to transfer available data from ADC. There is no other way to trigger DMA transfer unless the CPU gets interrupted.

    Hope, it clarifies your query.

    Thanks & regards,

    Sivaraj K

    ---------------------------------------------------------------------------------
    Please click the
    Verify Answer button on this post if it answers your question.
    ---------------------------------------------------------------------------------

  • Hi Sivaraj K,

    sorry but it isn't still not clear for me....
    I have the timer configured for continuous operation but not with Reload of the REL register. I'm using this operation mode:

    Continuous operation (timer automatically resets to zero after each period and continues to operate)

    Makes this any difference to use the period reload register or not in case of DMA event gerneration? The PRD register is filled with 0x00000096 what isn't a long period.

    At the moment I'm not able to let the timer trigger new DMA events by itselfs. It is only possible if the CPU reacts on each timer interrupt and reset PRDINTSTAT12 bit in the INTCTLSTAT register. After this bit was resetted, a new dma event is submitted by the timer.

    Or is my understanding of your answer not correct. You said, it is possible that the timer generate DMA events everytime the PRD is reached without any intervention of the CPU. The only thing is, I have to use low period values?

    Thanks again for your explanations.
    BR,
    Christian

     

  • Hi Christian,

    I apologise for the misunderstanding.

    Agreed, It is possible only if CPU reacts on each timer interrupt and reset PRDINTSTAT12 bit in the INTCTLSTAT regsiter. Only after this bit gets reset, a new dma event can be submitted by the timer. This is the same statement, I have told in my previous post that, "There is no other way to trigger DMA transfer unless the CPU gets interrupted". In other words, without CPU intervention, it is not possible for the timer to generate DMA events to trigger any data transfer and it can be done only after each timer interrupt to the CPU controller.

    If you use low period values, timer resets very fast and generates a new DMA event  to the controller to transfer data from ADC in addition to AD conversion. Yes, this is my suggestion.

    Thanks & regards,

    Sivaraj K

    ---------------------------------------------------------------------------------
    Please click the
    Verify Answer button on this post if it answers your question.
    ---------------------------------------------------------------------------------

     

  • Thanks for clarifing that!

    Do you have maybe another recommodation for me to find a solution for my challenge?

    Here some background information about my project and what I want to do:
    I have on the EMIFA 3 18 bit ADC's with an 16 bit parallelinterface connected. To activate the correct interface of the ADC's I have some  Ultra High Speed logic gates between the EMIFA address lines and each ADC. The specification is for an 16 bit application, to have at least 1MSPS at each ADC and transfer the datas after conversion complete through the EMIFA controlled by the EDMA3 controller to a Buffersection in memory. This transfer shall happen 4 times. The transfer model is AB-Synchronized. An event should occur every 1 us, to get the 1 MSPS. This is, why i thought i can also use the same timer for gernerating these event. The other method would be to trigger an DMA event by the ADC's conversion finish signal which is connected on an GPIO, but I think there is the same problem/behaviour of the interrupt flags as at the timer.

    Do you see there any other chance to transfer more ADC datas, than one, without any intervention of the CPU for resetting any interrupt bits?

    For the moment I'm using an CSL makro for resetting the PRDINTSTAT12 flag in INTCTLSTAT register of TIMER64P3DSP.

    CSL_FINST(TmrRegs->INTCTLSTAT, TMR_INTCTLSTAT_PRDINTSTAT12, PEND);

    I think this makro costs some performance... I'm not really experienced in writing assembly code but is there an easy way to reset this bit while using assembler code? Could you advise me there also?

    thanks
    BR,
    Christian

  • Hi Christian,

    I understand your concern.

    There are timer API's availabe which clears the status of specified timer interrupts. Please refer the API "TimerIntStatusClear" in the attached code snippet.

    The attached file which gives you idea of device abstraction layer API's for the timer module.

    /**
     *  \file   timer.c
     *
     *  \brief  TIMER APIs.
     *
     *   This file contains the device abstraction layer APIs for Timer Plus.
     */
    
    /*
    * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
    */
    /*
    *  Redistribution and use in source and binary forms, with or without
    *  modification, are permitted provided that the following conditions
    *  are met:
    *
    *    Redistributions of source code must retain the above copyright
    *    notice, this list of conditions and the following disclaimer.
    *
    *    Redistributions in binary form must reproduce the above copyright
    *    notice, this list of conditions and the following disclaimer in the
    *    documentation and/or other materials provided with the
    *    distribution.
    *
    *    Neither the name of Texas Instruments Incorporated nor the names of
    *    its contributors may be used to endorse or promote products derived
    *    from this software without specific prior written permission.
    *
    *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
    *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    *
    */
    
    /* HW Macros and Peripheral Defines */
    #include "hw_types.h"
    #include "hw_tmr.h"
    
    /* Driver APIs */
    #include "timer.h"
    
    /*******************************************************************************
    *                       INTERNAL MACRO DEFINITIONS
    *******************************************************************************/
    #define WDT_KEY_PRE_ACTIVE                    (0xA5C6u)
    #define WDT_KEY_ACTIVE                        (0xDA7Eu)
    #define CMP_IDX_MASK                          (0x07)
    #define PRESCALE_MASK                         (0x0F)
    #define TDDR_MASK                             (0x0F)
    
    /*******************************************************************************
    *                        API FUNCTION DEFINITIONS
    *******************************************************************************/
    
    /**
     * \brief   Enables the timer in the specified mode. The timer must be 
     *          configured before it is enabled. The timer starts running when this
     *          API is called
     *
     * \param   baseAddr      Base Address of the Timer Module Registers.
     * \param   timer         The timer to be enabled.
     * \param   enaMode       Mode of enabling the timer.
     *
     * timer can take the values \n
     *     TMR_TIMER34 - Timer34 only \n
     *     TMR_TIMER12 - Timer 12 only \n
     *     TMR_TIMER_BOTH - Both timers \n
     *
     * enaMode can take the values \n
     *     TMR_ENABLE_ONCE - Enable the timer to run once \n
     *     TMR_ENABLR_CONT - Enable to run continuous \n
     *     TMR_ENABLE_CONTRELOAD - Enable to run continuous with period reload
     *
     * \return  None.
     *
     **/
    void TimerEnable(unsigned int baseAddr, unsigned int timer, 
                     unsigned int enaMode)
    {
        /* Clear the enable bits of both timers; the timers stops couting */
        HWREG(baseAddr + TMR_TCR) &= ~((timer & (TMR_TCR_ENAMODE12 |
                                                 TMR_TCR_ENAMODE34)));
    
        /* Enable the timer */
        HWREG(baseAddr + TMR_TCR) |= (enaMode & timer);
    }
    
    /**
     * \brief   Disables the timer. The timer stops running when this API is called
     *
     * \param   baseAddr      Base Address of the Timer Module Registers.
     * \param   timer         Timer to be disabled.
     *
     * timer can take the values \n
     *     TMR_TIMER34 - Timer34 only \n
     *     TMR_TIMER12 - Timer12 only \n
     *     TMR_TIMER_BOTH - Both timers \n
     *
     * \return  None.
     *
     **/
    void TimerDisable(unsigned int baseAddr, unsigned int timer)
    {
        /* Disable the timer; the Timer stops couting */
        HWREG(baseAddr + TMR_TCR) &= ~((timer & (TMR_TCR_ENAMODE12 |
                                                 TMR_TCR_ENAMODE34)));
    }
    
    /**
     * \brief   Configures the timer. The timer can be configured in 64 bit mode
     *          32 bit chained/unchained mode, or as a watchdog timer. The timer
     *          can be given external clock input or internal clock input. When
     *          this API is called,\n  
     *          > The Timer counters are cleared \n
     *          > Both the timers are disabled from Reset. Hence, both the timers
     *            will start counting when enabled. \n
     *
     * \param   baseAddr      Base Address of the Timer Module Registers.
     * \param   config        Configuration of the Timer Module.
     *
     * config can take the values \n 
     *     TMR_CFG_64BIT_CLK_INT - 64 bit mode with internal clock \n
     *     TMR_CFG_64BIT_CLK_EXT - 64 bit mode with external clock \n
     *     TMR_CFG_64BIT_WATCHDOG - 64 bit watchdog timer mode \n
     *     TMR_CFG_32BIT_CH_CLK_INT - 32 bit chained mode with internal clock \n
     *     TMR_CFG_32BIT_CH_CLK_EXT - 32 bit chained mode with external clock \n
     *     TMR_CFG_32BIT_UNCH_CLK_BOTH_INT - 32 bit unchained mode; Both timers 
     *                                       clock sources are internal \n
     *     TMR_CFG_32BIT_UNCH_CLK_12INT_34EXT - 32 bit unchained mode; Clock source
     *                       for Timer12 is internal and for Timer34 is external \n 
     *     TMR_CFG_32BIT_UNCH_CLK_12EXT_34INT - 32 bit unchained mode; Clock source
     *                       for Timer12 is external and for Timer34 is internal \n
     *     TMR_CFG_32BIT_UNCH_CLK_BOTH_EXT - 32 bit unchained  mode; Both timers 
     *                                       clock sources are external
     *
     * \return  None.
     *
     **/
    void TimerConfigure(unsigned int baseAddr, unsigned int config)
    {
    
        /*
        ** Set the timer control register. This will only affect the clock
        ** selection bits. All other fields will be reset and the timer counting
        ** will be disabled.
        */
        HWREG(baseAddr + TMR_TCR) = (config & (TMR_TCR_CLKSRC12 | TMR_TCR_CLKSRC34));
    
        /* Clear the Timer Counters */
        HWREG(baseAddr + TMR_TIM12) = 0x0;
        HWREG(baseAddr + TMR_TIM34) = 0x0;
    
        /* Clear the TIMMODE bits and Reset bits */
        HWREG(baseAddr + TMR_TGCR) &= ~( TMR_TGCR_TIMMODE | TMR_TGCR_TIM34RS |
                                         TMR_TGCR_TIM12RS);
    
        /*
        ** Select the timer mode and disable the timer module from Reset
        ** Timer Plus features are enabled.
        */
        HWREG(baseAddr + TMR_TGCR) |= (config & 
                                       (TMR_TGCR_TIMMODE | TMR_TGCR_TIM34RS |
                                        TMR_TGCR_TIM12RS | TMR_TGCR_PLUSEN));
    }
    
    /**
     * \brief   Activate the Watchdog timer. The timer shall be configured as
     *          watchdog timer before this API is called.  This API writes two keys
     *          into the WDTCR in the order to activate the WDT. The user shall call
     *          TimerWatchdogReactivate API before the WDT expires, to avoid a reset.
     *
     * \param   baseAddr      Base Address of the Timer Module Registers.
     *
     * \return  None.
     *
     **/
    void TimerWatchdogActivate(unsigned int baseAddr)
    {
        /* Enable the watchdog timer. Write the keys in the order */
        HWREG(baseAddr + TMR_WDTCR) = ((TMR_WDTCR_WDEN | TMR_WDTCR_WDFLAG) |
                                      (WDT_KEY_PRE_ACTIVE << TMR_WDTCR_WDKEY_SHIFT));
        HWREG(baseAddr + TMR_WDTCR) = ((HWREG(baseAddr + TMR_WDTCR) &
                                        (~TMR_WDTCR_WDKEY)) |
                                       (WDT_KEY_ACTIVE << TMR_WDTCR_WDKEY_SHIFT));
                                            
    }
    
    /**
     * \brief   Re-activate the Watchdog timer. The WDT shall be enabled before
     *          this API is called. The user shall call this API before the WDT
     *          expires, to avoid a reset.
     *
     * \param   baseAddr      Base Address of the Timer Module Registers.
     *
     * \return  None.
     *
     **/
    void TimerWatchdogReactivate(unsigned int baseAddr)
    {
        /* Write the first keys in the order. This order shall not change */
        HWREG(baseAddr + TMR_WDTCR) = ((HWREG(baseAddr + TMR_WDTCR) &
                                        (~TMR_WDTCR_WDKEY)) |
                                       (WDT_KEY_PRE_ACTIVE << TMR_WDTCR_WDKEY_SHIFT));
        HWREG(baseAddr + TMR_WDTCR) = ((HWREG(baseAddr + TMR_WDTCR) &
                                        (~TMR_WDTCR_WDKEY)) |
                                       (WDT_KEY_ACTIVE << TMR_WDTCR_WDKEY_SHIFT));
     
    }
    
    /**
     * \brief   Set the Period register(s) of the specified timer(s).
     *
     * \param   baseAddr      Base Address of the Timer Module Registers.
     * \param   timer         The timer, of which period to be set.
     * \param   period        The period value of the timer.
     *
     * timer can take the values \n
     *     TMR_TIMER34 - Timer34 only \n
     *     TMR_TIMER12 - Timer12 only \n
     *     TMR_TIMER_BOTH - Both timers 
     *
     * \return  None.
     *
     **/
    void TimerPeriodSet(unsigned int baseAddr, unsigned int timer, 
                        unsigned int period)
    {
        if(TMR_TIMER12 & timer)
        {
            /* Write the period for Timer12 */
            HWREG(baseAddr + TMR_PRD12) = period;
        }
    
        if(TMR_TIMER34 & timer)
        {
            /* Write the period for Timer34 */
            HWREG(baseAddr + TMR_PRD34) = period;
        }
    }
    
    /**
     * \brief   Returns the Period register contents of the specified timer.
     *
     * \param   baseAddr      Base Address of the Timer Module Registers.
     * \param   timer         The timer, of which period to be read.
     *
     * timer can take the values \n
     *     TMR_TIMER34 - Timer34 \n
     *     TMR_TIMER12 - Timer12 
     *
     * \return  Period Value
     *
     **/
    unsigned int TimerPeriodGet(unsigned int baseAddr, unsigned int timer)
    {
        /* Return the appropriate period */
        return((timer == TMR_TIMER12) ? HWREG(baseAddr + TMR_PRD12) :
                                        HWREG(baseAddr + TMR_PRD34));
    }
    
    /**
     * \brief   Set the Counter register of the specified timer.
     *
     * \param   baseAddr      Base Address of the Timer Module Registers.
     * \param   timer         The timer, of which counter to be set.
     * \param   counter       The counter value of the timer.
     *
     * timer can take the values \n
     *     TMR_TIMER34 - Timer34 only \n
     *     TMR_TIMER12 - Timer12 only \n
     *     TMR_TIMER_BOTH - Both timers \n
     *
     * \return  None.
     *
     **/
    void TimerCounterSet(unsigned int baseAddr, unsigned int timer, 
                         unsigned int counter)
    {
        if(TMR_TIMER12 & timer)
        {
            /* Write the counter for Timer12 */
            HWREG(baseAddr + TMR_TIM12) = counter;
        }
    
        if(TMR_TIMER34 & timer)
        {
            /* Write the counter for Timer34 */
            HWREG(baseAddr + TMR_TIM34) = counter;
        }
    }
    
    /**
     * \brief   Returns the Counter register contents of the specified timer.
     *
     * \param   baseAddr      Base Address of the Timer Module Registers.
     * \param   timer         The timer, of which counter to be read.
     *
     * timer can take the values \n
     *     TMR_TIMER34 - Timer34 \n
     *     TMR_TIMER12 - Timer12 \n
     *
     * \return  Counter Value.
     *
     **/
    unsigned int TimerCounterGet(unsigned int baseAddr, unsigned int timer)
    {
        /* Return the appropriate period */
        return((timer == TMR_TIMER12) ? HWREG(baseAddr + TMR_TIM12) :
                                        HWREG(baseAddr + TMR_TIM34));
    }
    
    
    /**
     * \brief   Set the Reload period of the specified timer.
     *
     * \param   baseAddr      Base Address of the Timer Module Registers.
     * \param   timer         The timer, of which reload period to be set.
     * \param   reload        The reload period value of the timer.
     *
     * timer can take the values \n
     *     TMR_TIMER34 - Timer34 only \n
     *     TMR_TIMER12 - Timer12 only \n
     *     TMR_TIMER_BOTH - Both timers
     *
     * \return  None.
     *
     **/
    void TimerReloadSet(unsigned int baseAddr, unsigned int timer, 
                        unsigned int reload)
    {
        if(TMR_TIMER12 & timer)
        {
            /* Write the reload value for Timer12 */
            HWREG(baseAddr + TMR_REL12) = reload;
        }
    
        if(TMR_TIMER34 & timer)
        {
            /* Write the reload value for Timer34 */
            HWREG(baseAddr + TMR_REL34) = reload;
        }
    }
    
    /**
     * \brief   Returns the Reload Period of the specified timer.
     *
     * \param   baseAddr      Base Address of the Timer Module Registers.
     * \param   timer         The timer, of which Reload value to be read.
     *
     * timer can take the values \n
     *     TMR_TIMER34 - Timer34 \n
     *     TMR_TIMER12 - Timer12 \n
     *
     * \return  Reload Value
     *
     **/
    unsigned int TimerReloadGet(unsigned int baseAddr, unsigned int timer)
    {
        /* Return the appropriate reload value */
        return((TMR_TIMER12 == timer) ? HWREG(baseAddr + TMR_REL12) :
                                        HWREG(baseAddr + TMR_REL34));
    }
    
    /**
     * \brief   Returns the capture value of the specified timer.
     *
     * \param   baseAddr      Base Address of the Timer Module Registers.
     * \param   timer         The timer, of which capture value to be read.
     *
     * timer can take the values \n
     *     TMR_TIMER34 - Timer34 \n
     *     TMR_TIMER12 - Timer12 \n
     *
     * \return  Capture Value
     *
     **/
    unsigned int TimerCaptureGet(unsigned int baseAddr, unsigned int timer)
    {
        /* Return the appropriate value */
        return((TMR_TIMER12 == timer) ? HWREG(baseAddr + TMR_CAP12) :
                                        HWREG(baseAddr + TMR_CAP34));
    }
    
    /**
     * \brief   Set the Compare value of the specified CMP register.
     *
     * \param   baseAddr      Base Address of the Timer Module Registers.
     * \param   regIndex      Index of the CMP Register
     * \param   compare       The value to be written
     *
     * regIndex can take any value from 0 to 7.
     *                   If regIndex = n, CMPn will be set with the value compare.
     *
     * \return  None.
     *
     **/
    void TimerCompareSet(unsigned int baseAddr, unsigned int regIndex, 
                         unsigned int compare)
    {
        /* Write only to the desired Compare register according to the index */
        HWREG(baseAddr + TMR_CMP(regIndex)) = compare;
    }
    
    
    /**
     * \brief   Returns the Compare value of the specified CMP register.
     *
     * \param   baseAddr      Base Address of the Timer Module Registers.
     * \param   regIndex      Index of the CMP Register
     *
     * regIndex can take any value from 0 to 7.
     *                         If regIndex = n, contents of CMPn will be returned.
     *
     * \return  Compare Value.
     *
     **/
    unsigned int TimerCompareGet(unsigned int baseAddr, unsigned int regIndex)
    {
        /* Return the counter value according to the index requested */
        return(HWREG(baseAddr + TMR_CMP(regIndex)));
    }
    
    /**
     * \brief   Enables the specified timer interrupts. The timer interrupts which
     *          are to be enabled can be passed as parameter to this function.
     *
     * \param   baseAddr      Base Address of the Timer Module Registers.
     * \param   intFlags      Timer Interrupts to be enabled
     *
     * intFlags can take any, or a combination of the following values \n
     *    TMR_INT_TMR12_CAPT_MODE - Enable Timer12 interrupt in Capture Mode \n
     *    TMR_INT_TMR12_NON_CAPT_MODE - Enable Timer12 interrupt in normal mode \n
     *    TMR_INT_TMR34_CAPT_MODE - Enable Timer34 interrupt in Capture mode \n
     *    TMR_INT_TMR34_NON_CAPT_MODE - Enable Timer34 interrupt in normal mode \n
     *
     * \return  None.
     *
     **/
    void TimerIntEnable(unsigned int baseAddr, unsigned int intFlags)
    {
        /* Enable the mentioned interrupts. One or more interrupts are enabled */
        HWREG(baseAddr + TMR_INTCTLSTAT) |= intFlags;
    }
    
    /**
     * \brief   Disables the specified timer interrupts.
     *
     * \param   baseAddr      Base Address of the Timer Module Registers.
     * \param   intFlags      Timer Interrupts to be disabled
     *
     * intFlags can take any, or a combination of the following values \n
     *    TMR_INT_TMR12_CAPT_MODE - Disable Timer12 interrupt in Capture Mode \n
     *    TMR_INT_TMR12_NON_CAPT_MODE - Disable Timer12 interrupt in normal mode \n
     *    TMR_INT_TMR34_CAPT_MODE - Disable Timer34 interrupt in Capture mode \n
     *    TMR_INT_TMR34_NON_CAPT_MODE - Disable Timer34 interrupt in normal mode \n
     *
     * \return  None.
     *
     **/
    void TimerIntDisable(unsigned int baseAddr, unsigned int intFlags)
    {
        /* Disable the mentioned interrupts */
        HWREG(baseAddr + TMR_INTCTLSTAT) &= ~(intFlags);
    }
    
    /**
     * \brief   Returns the status of specified timer interrupts.
     *
     * \param   baseAddr      Base Address of the Timer Module Registers.
     * \param   statFlag      Status flags to be read.
     *
     * intFlags can take any or combination of the following values \n
     *    TMR_INTSTAT12_TIMER_NON_CAPT - Timer12 interrupt status in normal mode \n
     *    TMR_INTSTAT12_TIMER_CAPT - Timer12 interrupt status in capture mode \n
     *    TMR_INTSTAT34_TIMER_NON_CAPT - Timer34 interrupt status in normal mode \n
     *    TMR_INTSTAT34_TIMER_CAPT - Timer34 interrupt status in capture mode \n
     *
     * \return  Status of Interrupt. Returns all the fields of which status is set
     *
     * Note : This API will return the same fields which is passed as parameter, if
     * all the specified interrupt status is set. The return value will be 0 if 
     * none of the interrupt status in the parameter passed is set. 
     *     
     **/
    unsigned int TimerIntStatusGet(unsigned int baseAddr, unsigned int statFlag)
    {
        /* Return statuses of the interrupts. There is no shifting applied here */
        return((HWREG(baseAddr + TMR_INTCTLSTAT)) & statFlag);
    
    }
    
    /**
     * \brief   Clears the status of specified timer interrupts.
     *
     * \param   baseAddr      Base Address of the Timer Module Registers.
     * \param   statFlag      Status flags to be cleared.
     *
     * intFlags can take any or combination of the following values \n
     *    TMR_INTSTAT12_TIMER_NON_CAPT - Timer12 interrupt status in normal mode \n
     *    TMR_INTSTAT12_TIMER_CAPT - Timer12 interrupt status in capture mode \n
     *    TMR_INTSTAT34_TIMER_NON_CAPT - Timer34 interrupt status in normal mode \n
     *    TMR_INTSTAT34_TIMER_CAPT - Timer34 interrupt status in capture mode \n
     *
     * \return  None
     *     
     **/
    unsigned int TimerIntStatusClear(unsigned int baseAddr, unsigned int statFlag)
    {
        volatile unsigned status = HWREG(baseAddr + TMR_INTCTLSTAT) & statFlag;
    
        /* Return statuses of the interrupts. There is no shifting applied here */
        HWREG(baseAddr + TMR_INTCTLSTAT) |= status;
        return status;
    
    }
    
    /**
     * \brief   Sets the Prescalar Counter of Timer34.
     *
     * \param   baseAddr      Base Address of the Timer Module Registers.
     * \param   psc34         4 bit prescalar value
     *
     * \return  None.
     *
     **/
    void TimerPreScalarCount34Set(unsigned int baseAddr, unsigned int psc34)
    {
        HWREG(baseAddr + TMR_TGCR) &= ~(PRESCALE_MASK << TMR_TGCR_PSC34_SHIFT); 
    
        /* Set the Prescalar value. This is applicable only for Timer34 */
        HWREG(baseAddr + TMR_TGCR) |= ((psc34 & PRESCALE_MASK) << 
                                       TMR_TGCR_PSC34_SHIFT);
    }
    
    
    /**
     * \brief   Returns the Prescalar Counter of Timer34.
     *
     * \param   baseAddr      Base Address of the Timer Module Registers.
     *
     * \return  Prescalar Value.
     *
     **/
    unsigned int TimerPreScalarCount34Get(unsigned int baseAddr)
    {
        /* 
        ** Return the prescalar value. This is only for Timer34 in 32 bit 
        ** unchained mode.
        */ 
        return((HWREG(baseAddr + TMR_TGCR) & TMR_TGCR_PSC34) >> 
               TMR_TGCR_PSC34_SHIFT);
    }
    
    
    /**
     * \brief   Sets the Timer Divide Down Ratio of Timer34.
     *
     * \param   baseAddr      Base Address of the Timer Module Registers.
     * \param   tddr34        TDDR34, Timer Divide Down Ratio
     *
     * \return  None.
     *
     **/
    void TimerDivDwnRatio34Set(unsigned int baseAddr, unsigned int tddr34)
    {
        HWREG(baseAddr + TMR_TGCR) &= ~(TDDR_MASK << TMR_TGCR_TDDR34_SHIFT);
    
        /* Set the TDDR. This is only for Timer34  in unchained mode */
        HWREG(baseAddr + TMR_TGCR) |= ((tddr34 & TDDR_MASK) << 
                                       TMR_TGCR_TDDR34_SHIFT);
    }
    
    /**
     * \brief   returns the Timer Divide Down Ratio of Timer34.
     *
     * \param   baseAddr      Base Address of the Timer Module Registers.
     *
     * \return  TDDR34 value.
     *
     **/
    unsigned int TimerDivDwnRatio34Get(unsigned int baseAddr)
    {
        /* Return the TDDR value. Only applicable in unchained mode for Timer34 */
        return((HWREG(baseAddr + TMR_TGCR) & TMR_TGCR_TDDR34) >> 
                TMR_TGCR_TDDR34_SHIFT);
    }
    
    /**
     * \brief   Configures the Timer for Capture Mode. The Timer Module Shall be
     *          Configured in 32 bit unchained mode before this API is called.
     *
     * \param   baseAddr      Base Address of the Timer Module Registers.
     * \param   timer         The timer, of which capture to be configured.
     * \param   cfgCap        Configuration of Capture Mode.
     *
     * timer can take the values \n
     *     TMR_TIMER34 - Timer34 only \n
     *     TMR_TIMER12 - Timer12 only \n
     *     TMR_TIMER_BOTH - Both timers \n
     *
     * cfgCap can take the values \n
     *     TMR_CAPT_DISABLE - Capture Mode disable \n
     *     TMR_CAPT_ENABLE_RIS_EDGE - Capture enable at rising edge \n
     *     TMR_CAPT_ENABLE_FALL_EDGE - Capture enable at falling edge \n
     *     TMR_CAPT_ENABLE_BOTH_EDGE - Capture enable at both edges 
     *
     * \return  None.
     *
     **/
    void TimerCaptureConfigure(unsigned int baseAddr, unsigned int timer, 
                               unsigned int cfgCap)
    {
        /* Clear the bits CAPTEN and edge selection bits */
        HWREG(baseAddr + TMR_TCR) &= ~(timer & (TMR_TCR_CAPEVTMODE12 |
                                                TMR_TCR_CAPMODE12 |
                                                TMR_TCR_CAPEVTMODE34 |
                                                TMR_TCR_CAPMODE34) );
    
        /* Write the capture configuration along with the edge selection */
        HWREG(baseAddr + TMR_TCR) |= (cfgCap & timer);
    }
    
    
    /**
     * \brief   Enables the timer(s) for read reset mode. The timer shall be
     *          Configured in 32 bit unchained mode before this API is called.
     *          Read reset determines the effect of timer counter read on TIMn. 
     *          If Read reset is enabled, the timer counter will be reset when
     *          the timer counter register TIMn is read.
     *
     * \param   baseAddr      Base Address of the Timer Module Registers.
     * \param   timer         The timer, of which Read Reset to be enabled.
     *
     * timer can take the values \n
     *     TMR_TIMER34 - Timer34 only \n
     *     TMR_TIMER12 - Timer12 only \n
     *     TMR_TIMER_BOTH - Both timers
     *
     * \return  None.
     *
     **/
    void TimerReadResetEnable(unsigned int baseAddr, unsigned int timer)
    {
        /* 
        ** Enable the read reset mode for the specified timers; The timer counter
        ** for the corresponding timer will be reset for further TIMn reads
        */
        HWREG(baseAddr + TMR_TCR) |= (timer & (TMR_TCR_READRSTMODE12 |
                                               TMR_TCR_READRSTMODE34));
    }
    
    
    /**
     * \brief   Disables the timer for read reset mode.
     *
     * \param   baseAddr      Base Address of the Timer Module Registers.
     * \param   timer         The timer, of which Read Reset to be disabled.
     *
     * timer can take the values \n
     *     TMR_TIMER34 - Timer34 only \n
     *     TMR_TIMER12 - Timer12 only \n
     *     TMR_TIMER_BOTH - Both timers
     *
     * \return  None.
     *
     **/
    void TimerReadResetDisable(unsigned int baseAddr, unsigned int timer)
    {
        /* Disable the Read Reset mode */
        HWREG(baseAddr + TMR_TCR) &= ~(timer & (TMR_TCR_READRSTMODE12 |
                                                TMR_TCR_READRSTMODE34));
    }
    
    /**
     * \brief   Sets the Input Gate Enable. Allows the timer to gate the internal
     *          timer clock source. The timer starts counting when the input pin
     *          goes from Low to High and stops counting when transition happens
     *          from high to low.
     *
     * \param   baseAddr      Base Address of the Timer Module Registers.
     * \param   timer         The timer, of which input gate to be enabled.
     *
     * timer can take the values \n
     *     TMR_TIMER34 - Timer34 only \n
     *     TMR_TIMER12 - Timer12 only \n
     *     TMR_TIMER_BOTH - Both timers
     *
     * \return  None.
     *
     **/
    void TimerInputGateEnable(unsigned int baseAddr, unsigned int timer)
    {
        /* Set the input gate enable for the timers requested */
        HWREG(baseAddr + TMR_TCR) |= (timer & (TMR_TCR_TIEN12 |
                                               TMR_TCR_TIEN34));
    }
    
    /**
     * \brief   Disable the Input Gate. Timer clock will not be gated by input pin.
     *
     * \param   baseAddr      Base Address of the Timer Module Registers.
     * \param   timer         The timer, of which input gate to be disabled.
     *
     * timer can take the values \n
     *     TMR_TIMER34 - Timer34 only \n
     *     TMR_TIMER12 - Timer12 only \n
     *     TMR_TIMER_BOTH - Both timers
     *
     * \return  None.
     *
     **/
    void TimerInputGateDisable(unsigned int baseAddr, unsigned int timer)
    {
        /* Disable the input gating for the requested timers */
        HWREG(baseAddr + TMR_TCR) &= ~(timer & (TMR_TCR_TIEN12 |
                                                TMR_TCR_TIEN34));
    }
    
    /**
     * \brief   Sets the pulse width for the specified timer. Determines the pulse.
     *          width in the TSTATn bit and the OUT pin in pulse mode.
     *
     * \param   baseAddr      Base Address of the Timer Module Registers.
     * \param   timer         The timer, of which pulse width to be set.
     * \param   pulseWidth    Pulse width to be set.
     *
     * timer can take the values \n
     *     TMR_TIMER34 - Timer34 only \n
     *     TMR_TIMER12 - Timer12 only \n
     *     TMR_TIMER_BOTH - Both timers \n
     *
     * pulseWidth can take the following values \n
     *     TMR_PULSE_WIDTH_1_CLK - 1 clock cycle  \n
     *     TMR_PULSE_WIDTH_2_CLK - 2 clock cycles \n
     *     TMR_PULSE_WIDTH_3_CLK - 3 clock cycles \n
     *     TMR_PULSE_WIDTH_4_CLK - 4 clock cycles
     *
     * \return  None.
     *
     **/
    void TimerPulseWidthSet(unsigned int baseAddr, unsigned int timer, 
                            unsigned int pulseWidth)
    {
        /* Clear the bits for Pulse width selection */
        HWREG(baseAddr + TMR_TCR) &= ~(timer & (TMR_TCR_PWID34 |
                                                TMR_TCR_PWID12));
    
        /* Set the pulse width for the appropriate timer */
        HWREG(baseAddr + TMR_TCR) |= (timer & (TMR_TCR_PWID34 |
                                               TMR_TCR_PWID12));
    }
    
    
    /**
     * \brief   Sets the clock mode. Once the clock mode is set, the outpin behaves
     *          as 50% duty cycle signal.
     *
     * \param   baseAddr      Base Address of the Timer Module Registers.
     * \param   timer         The timer, of which clock mode to be set.
     *
     * timer can take the values \n
     *     TMR_TIMER34 - Timer34 only \n
     *     TMR_TIMER12 - Timer12 only \n
     *     TMR_TIMER_BOTH - Both timers
     *
     * \return  None.
     *
     **/
    void TimerClockModeSet(unsigned int baseAddr, unsigned int timer)
    {
        /* Set the clock mode for the appropriate timer */
        HWREG(baseAddr + TMR_TCR) |= (timer & (TMR_TCR_CP12 |
                                               TMR_TCR_CP34));
    }
    
    /**
     * \brief   Sets the pulse mode. The outpin goes active when the timer count
     *          reaches the period.
     *
     * \param   baseAddr      Base Address of the Timer Module Registers.
     * \param   timer         The timer, of which pulse mode to be set.
     *
     * timer can take the values \n
     *     TMR_TIMER34 - Timer34 only \n
     *     TMR_TIMER12 - Timer12 only \n
     *     TMR_TIMER_BOTH - Both timers
     *
     * \return  None.
     *
     **/
    void TimerPulseModeSet(unsigned int baseAddr, unsigned int timer)
    {
        /*
        ** Clear the clock mode for the appropriate timer
        ** This will enable the pulse mode
        */
        HWREG(baseAddr + TMR_TCR) &= ~(timer & (TMR_TCR_CP12 |
                                                TMR_TCR_CP34));
    }
    
    /**
     * \brief   Returns the timer status. The timer status Drives the value of the
     *          timer output TM64P_OUTn when configured.
     *
     * \param   baseAddr      Base Address of the Timer Module Registers.
     * \param   timer         The timer, of which status to be read
     *
     * timer can take the values \n
     *     TMR_TIMER34 - Timer34  \n
     *     TMR_TIMER12 - Timer12 \n
     *     TMR_TIMER_BOTH - Both timers \n
     *
     * Note : This API returns 0 if none of the status bits is set.
     *
     * \return  Status of the timer. Returns the following values or the
     *          combination of both. \n
     *          TMR_OUT12_ASSERTED - TMR64P_OUT12 is asserted \n
     *          TMR_OUT34_ASSERTED - TMR64P_OUT34 is asserted 
     *
     **/
    unsigned int TimerOUTStatusGet(unsigned int baseAddr, unsigned int timer)
    {
        /* Return the status */
        return(HWREG(baseAddr + TMR_TCR) & (timer & (TMR_TCR_TSTAT12 |
                                                     TMR_TCR_TSTAT34)));
    }
    
    /**
     * \brief   Inverts the TMR64P_INn signal
     *
     * \param   baseAddr      Base Address of the Timer Module Registers.
     * \param   timer         The timer, of which inversion to be enabled.
     *
     * timer can take the following values. \n
     *     TMR_TIMER34 - Inverts TMR64P_IN34 signal \n
     *     TMR_TIMER12 - Inverts TMR64P_IN12 signal \n
     *     TMR_TIMER_BOTH - Inverts both TMR64P_IN12 and TMR64P_IN34 signals
     *
     * \return  None.
     *
     **/
    void TimerInvertINEnable(unsigned int baseAddr, unsigned int timer)
    {
        /* Enable the invert for IN pin for the timers requested */
        HWREG(baseAddr + TMR_TCR) |= (timer & (TMR_TCR_INVINP12 |
                                               TMR_TCR_INVINP34));
    }
    
    /**
     * \brief   Disables the Inversion of the TMR64P_INn signal
     *
     * \param   baseAddr      Base Address of the Timer Module Registers.
     * \param   timer         The timer, of which inversion to be disabled.
     * 
     *  timer can take the values \n
     *     TMR_TIMER34 - TMR64P_INT34 inversion will be disabled \n
     *     TMR_TIMER12 - TMR64P_IN12 inversion will be disabled \n
     *     TMR_TIMER_BOTH - Both TMR64P_IN12 and TMR64P_IN34 inversion disabled
     *
     * \return  None.
     *
     **/
    void TimerInvertINDisable(unsigned int baseAddr, unsigned int timer)
    {
        /* Disable the invert for IN pin for timers requested */
        HWREG(baseAddr + TMR_TCR) &= ~(timer & (TMR_TCR_INVINP12 |
                                                TMR_TCR_INVINP34));
    }
    
    /**
     * \brief   Inverts the TMR64P_OUTn signal
     *
     * \param   baseAddr      Base Address of the Timer Module Registers.
     * \param   timer         The timer, of which inversion to be enabled.
     *
     * timer can take the values \n
     *     TMR_TIMER34 - Inverts TMR64P_OUT34 signal \n
     *     TMR_TIMER12 - Inverts TMR64P_OUT12 signal \n
     *     TMR_TIMER_BOTH - Inverts both TMR64P_OUT12 and TMR64P_OUT34 signals
     *
     * \return  None.
     *
     **/
    void TimerInvertOUTEnable(unsigned int baseAddr, unsigned int timer)
    {
        /* Enable the invert for OUT pin for the timers requested */
        HWREG(baseAddr + TMR_TCR) |= (timer & (TMR_TCR_INVOUTP12 |
                                               TMR_TCR_INVOUTP34));
    }
    
    /**
     * \brief   Disables the inversion the TMR64P_OUTn signal
     *
     * \param   baseAddr      Base Address of the Timer Module Registers.
     * \param   timer         The timer, of which inversion to be disabled.
     *
     * timer can take the values \n
     *     TMR_TIMER34 - TMR64P_OUT34 inversion will be disabled \n
     *     TMR_TIMER12 - TMR64P_OUT12 inversion will be disabled \n
     *     TMR_TIMER_BOTH - Both TMR64P_OUT12 and TMR64P_OUT34 inversion disabled
     *
     * \return  None.
     *
     **/
    void TimerInvertOUTDisable(unsigned int baseAddr, unsigned int timer)
    {
        /* Disable the invert for OUT pin for the timers requested */
        HWREG(baseAddr + TMR_TCR) &= ~(timer & (TMR_TCR_INVOUTP12 |
                                                TMR_TCR_INVOUTP34));
    }
    
    /***************************** End Of File ***********************************/
    

    Also, there are starter ware examples for C6748 in the specified path below:

    ~\pdk_C6748_2_0_0_0\C6748_StarterWare_1_20_03_03\examples\evmC6748\timer

    ~\pdk_C6748_2_0_0_0\C6748_StarterWare_1_20_03_03\platform\evmC6748\timertick.c

    You shall use the above resources to do timer specific operations.

    Thanks & regards,

    Sivaraj K

    ---------------------------------------------------------------------------------
    Please click the
    Verify Answer button on this post if it answers your question.
    ---------------------------------------------------------------------------------