# csl_tmr.h File Reference

This is the main header file for the TIMER Module which defines all the data structures and exported API. More...

`#include <ti/csl/soc.h>`
`#include <ti/csl/csl.h>`
`#include <ti/csl/cslr_tmr.h>`

## Data Structures

struct | CSL_TmrHwSetup
| Hardware setup structure. More...
struct | CSL_TmrConfig
| Config-structure Used to configure the GP timer using CSL_tmrHwSetupRaw(). More...
struct | CSL_TmrContext
| Module specific context information. Present implementation of GP timer CSL doesn't have any context information. More...
struct | CSL_TmrParam
| Module specific parameters. Present implementation of GP timer CSL doesn't have any module specific parameters. More...
struct | CSL_TmrBaseAddress
| This structure contains the base-address information for the peripheral instance. More...
struct | CSL_TmrObj
| Watchdog timer object structure. More...

## Defines

#define | CSL_TMR_HWSETUP_DEFAULTS
| Default hardware setup parameters.
#define | CSL_TMR_CONFIG_DEFAULTS
| Default values for config structure.

## Typedefs

typedef CSL_TmrObj * | CSL_TmrHandle
| This data type is used to return the handle to the CSL of the GP timer.

## Enumerations

enum | CSL_TmrHwControlCmd { CSL_TMR_CMD_LOAD_PRDLO = 0, CSL_TMR_CMD_LOAD_PRDHI = 1, CSL_TMR_CMD_LOAD_PSCHI = 2, CSL_TMR_CMD_START_TIMLO = 3, CSL_TMR_CMD_START_TIMHI = 4, CSL_TMR_CMD_STOP_TIMLO = 5, CSL_TMR_CMD_STOP_TIMHI = 6, CSL_TMR_CMD_RESET_TIMLO = 7, CSL_TMR_CMD_RESET_TIMHI = 8, CSL_TMR_CMD_START64 = 9, CSL_TMR_CMD_STOP64 = 10, CSL_TMR_CMD_RESET64 = 11,
CSL_TMR_CMD_START_WDT = 12, CSL_TMR_CMD_LOAD_WDKEY = 13
}
| This enum describes the commands used to control the GP timer through CSL_tmrHwControl(). More...
enum | CSL_TmrHwStatusQuery { CSL_TMR_QUERY_COUNT_LO = 0, CSL_TMR_QUERY_COUNT_HI = 1, CSL_TMR_QUERY_TSTAT_LO = 2, CSL_TMR_QUERY_TSTAT_HI = 3, CSL_TMR_QUERY_WDFLAG_STATUS = 4 }
| This enum describes the commands used to get status of various parameters of the GP timer. These values are used in CSL_tmrGetHwStatus(). More...
enum | CSL_TmrIpGate { CSL_TMR_CLOCK_INP_NOGATE = 0, CSL_TMR_CLOCK_INP_GATE = 1 }
| This enum describes whether the Timer Clock input is gated or not gated. More...
enum | CSL_TmrClksrc { CSL_TMR_CLKSRC_INTERNAL = 0, CSL_TMR_CLKSRC_TMRINP = 1 }
| This enum describes the Timer Clock source selection. More...
enum | CSL_TmrEnamode { CSL_TMR_ENAMODE_DISABLE = 0, CSL_TMR_ENAMODE_ENABLE = 1, CSL_TMR_ENAMODE_CONT = 2 }
| This enum describes the enabling/disabling of Timer. More...
enum | CSL_TmrPulseWidth { CSL_TMR_PWID_ONECLK = 0, CSL_TMR_PWID_TWOCLKS = 1, CSL_TMR_PWID_THREECLKS = 2, CSL_TMR_PWID_FOURCLKS = 3 }
| This enum describes the Timer Clock cycles (1/2/3/4). More...
enum | CSL_TmrClockPulse { CSL_TMR_CP_PULSE = 0, CSL_TMR_CP_CLOCK = 1 }
| This enum describes the mode of Timer Clock (Pulse/Clock). More...
enum | CSL_TmrInvInp { CSL_TMR_INVINP_UNINVERTED = 0, CSL_TMR_INVINP_INVERTED = 1 }
| This enum describes the Timer input inverter control. More...
enum | CSL_TmrInvOutp { CSL_TMR_INVOUTP_UNINVERTED = 0, CSL_TMR_INVOUTP_INVERTED = 1 }
| This enum describes the Timer output inverter control. More...
enum | CSL_TmrMode { CSL_TMR_TIMMODE_GPT = 0, CSL_TMR_TIMMODE_DUAL_UNCHAINED = 1, CSL_TMR_TIMMODE_WDT = 2, CSL_TMR_TIMMODE_DUAL_CHAINED = 3 }
| This enum describes the mode of Timer (GPT/WDT/Chained/Unchained). More...
enum | CSL_TmrState { CSL_TMR_TIMxxRS_RESET_ON = 0, CSL_TMR_TIMxxRS_RESET_OFF = 1 }
| This enum describes the reset condition of Timer (ON/OFF). More...
enum | CSL_TmrTstat { CSL_TMR_TSTAT_HIGH = 1, CSL_TMR_TSTAT_LOW = 0 }
| This enum describes the status of Timer. More...
enum | CSL_TmrWdflagBitStatus { CSL_TMR_WDFLAG_NOTIMEOUT = 0, CSL_TMR_WDFLAG_TIMEOUT = 1 }
| This enumeration describes the flag bit status of the timer in watchdog mode. More...

## Functions

CSL_Status | CSL_tmrInit (CSL_TmrContext *pContext)
CSL_TmrHandle | CSL_tmrOpen (CSL_TmrObj *tmrObj, CSL_InstNum tmrNum, CSL_TmrParam *pTmrParam, CSL_Status *status)
CSL_Status | CSL_tmrGetBaseAddress (CSL_InstNum tmrNum, CSL_TmrParam *pTmrParam, CSL_TmrBaseAddress *pBaseAddress)
CSL_Status | CSL_tmrClose (CSL_TmrHandle hTmr)
CSL_Status | CSL_tmrHwSetup (CSL_TmrHandle hTmr, CSL_TmrHwSetup *hwSetup)
CSL_Status | CSL_tmrHwControl (CSL_TmrHandle hTmr, CSL_TmrHwControlCmd cmd, void *cmdArg)
CSL_Status | CSL_tmrGetHwStatus (CSL_TmrHandle hTmr, CSL_TmrHwStatusQuery query, void *response)
CSL_Status | CSL_tmrHwSetupRaw (CSL_TmrHandle hTmr, CSL_TmrConfig *config)
CSL_Status | CSL_tmrGetHwSetup (CSL_TmrHandle hTmr, CSL_TmrHwSetup *hwSetup)

## Detailed Description

This is the main header file for the TIMER Module which defines all the data structures and exported API.

  ============================================================================
  (C) Copyright 2002, 2003, 2004, 2005, 2008, 2009, Texas Instruments, Inc.

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.

Copyright 2012, Texas Instruments Incorporated