Go to the documentation of this file.
32 #ifndef __TIMER_11XX_H_
33 #define __TIMER_11XX_H_
64 #define TIMER_IR_CLR(n) _BIT(n)
67 #define TIMER_MATCH_INT(n) (_BIT((n) & 0x0F))
69 #define TIMER_CAP_INT(n) (_BIT((((n) & 0x0F) + 4)))
72 #define TIMER_ENABLE ((uint32_t) (1 << 0))
74 #define TIMER_RESET ((uint32_t) (1 << 1))
77 #define TIMER_INT_ON_MATCH(n) (_BIT(((n) * 3)))
79 #define TIMER_RESET_ON_MATCH(n) (_BIT((((n) * 3) + 1)))
81 #define TIMER_STOP_ON_MATCH(n) (_BIT((((n) * 3) + 2)))
84 #define TIMER_CAP_RISING(n) (_BIT(((n) * 3)))
86 #define TIMER_CAP_FALLING(n) (_BIT((((n) * 3) + 1)))
88 #define TIMER_INT_ON_CAP(n) (_BIT((((n) * 3) + 2)))
151 pTMR->
IR = (0x10 << capnum);
220 pTMR->
MR[matchnum] = matchval;
232 return pTMR->
CR[capnum];
IP_TIMER_CAP_SRC_STATE
Standard timer clock and edge for count source.
@ TIMER_EXTMATCH_DO_NOTHING
STATIC INLINE void Chip_TIMER_StopOnMatchDisable(LPC_TIMER_T *pTMR, int8_t matchnum)
Disable stop on match for a match timer. Disables a match timer to stop the terminal count when a mat...
STATIC INLINE void Chip_TIMER_StopOnMatchEnable(LPC_TIMER_T *pTMR, int8_t matchnum)
Enable a match timer to stop the terminal count when a match count equals the terminal count.
@ TIMER_CAPSRC_RISING_CAPN
#define TIMER_INT_ON_MATCH(n)
#define TIMER_CAP_FALLING(n)
void Chip_TIMER_Init(LPC_TIMER_T *pTMR)
Initialize a timer.
#define TIMER_CAP_RISING(n)
STATIC INLINE void Chip_TIMER_CaptureRisingEdgeDisable(LPC_TIMER_T *pTMR, int8_t capnum)
Disables capture on on rising edge of selected CAP signal. For the selected capture register,...
IP_TIMER_PIN_MATCH_STATE
Standard timer initial match pin state and change state.
#define TIMER_RESET_ON_MATCH(n)
STATIC INLINE void Chip_TIMER_PrescaleSet(LPC_TIMER_T *pTMR, uint32_t prescale)
Sets the prescaler value.
enum IP_TIMER_PIN_MATCH_STATE TIMER_PIN_MATCH_STATE_T
Standard timer initial match pin state and change state.
STATIC INLINE uint32_t Chip_TIMER_ReadCount(LPC_TIMER_T *pTMR)
Returns the current timer count.
STATIC INLINE void Chip_TIMER_CaptureEnableInt(LPC_TIMER_T *pTMR, int8_t capnum)
Enables interrupt on capture of selected CAP signal. For the selected capture register,...
#define TIMER_MATCH_INT(n)
STATIC INLINE bool Chip_TIMER_MatchPending(LPC_TIMER_T *pTMR, int8_t matchnum)
Determine if a match interrupt is pending.
STATIC INLINE void Chip_TIMER_ClearCapture(LPC_TIMER_T *pTMR, int8_t capnum)
Clears a (pending) capture interrupt.
STATIC INLINE void Chip_TIMER_ClearMatch(LPC_TIMER_T *pTMR, int8_t matchnum)
Clears a (pending) match interrupt.
STATIC INLINE void Chip_TIMER_TIMER_SetCountClockSrc(LPC_TIMER_T *pTMR, TIMER_CAP_SRC_STATE_T capSrc, int8_t capnum)
Sets timer count source and edge with the selected passed from CapSrc. If CapSrc selected a CAPn pin,...
void Chip_TIMER_DeInit(LPC_TIMER_T *pTMR)
Shutdown a timer.
#define TIMER_INT_ON_CAP(n)
32-bit Standard timer register block structure
STATIC INLINE void Chip_TIMER_ResetOnMatchEnable(LPC_TIMER_T *pTMR, int8_t matchnum)
For the specific match counter, enables reset of the terminal count register when a match occurs.
@ TIMER_CAPSRC_FALLING_CAPN
STATIC INLINE void Chip_TIMER_ResetOnMatchDisable(LPC_TIMER_T *pTMR, int8_t matchnum)
For the specific match counter, disables reset of the terminal count register when a match occurs.
STATIC INLINE void Chip_TIMER_Enable(LPC_TIMER_T *pTMR)
Enables the timer (starts count)
enum IP_TIMER_CAP_SRC_STATE TIMER_CAP_SRC_STATE_T
Standard timer clock and edge for count source.
#define TIMER_STOP_ON_MATCH(n)
STATIC INLINE void Chip_TIMER_SetMatch(LPC_TIMER_T *pTMR, int8_t matchnum, uint32_t matchval)
Sets a timer match value.
STATIC INLINE bool Chip_TIMER_CapturePending(LPC_TIMER_T *pTMR, int8_t capnum)
Determine if a capture interrupt is pending.
STATIC INLINE uint32_t Chip_TIMER_ReadPrescale(LPC_TIMER_T *pTMR)
Returns the current prescale count.
STATIC INLINE void Chip_TIMER_Disable(LPC_TIMER_T *pTMR)
Disables the timer (stops count)
void Chip_TIMER_ExtMatchControlSet(LPC_TIMER_T *pTMR, int8_t initial_state, TIMER_PIN_MATCH_STATE_T matchState, int8_t matchnum)
Sets external match control (MATn.matchnum) pin control. For the pin selected with matchnum,...
void Chip_TIMER_Reset(LPC_TIMER_T *pTMR)
Resets the timer terminal and prescale counts to 0.
STATIC INLINE void Chip_TIMER_CaptureFallingEdgeEnable(LPC_TIMER_T *pTMR, int8_t capnum)
Enables capture on on falling edge of selected CAP signal. For the selected capture register,...
STATIC INLINE void Chip_TIMER_CaptureFallingEdgeDisable(LPC_TIMER_T *pTMR, int8_t capnum)
Disables capture on on falling edge of selected CAP signal. For the selected capture register,...
STATIC INLINE void Chip_TIMER_CaptureRisingEdgeEnable(LPC_TIMER_T *pTMR, int8_t capnum)
Enables capture on on rising edge of selected CAP signal for the selected capture register,...
STATIC INLINE void Chip_TIMER_MatchEnableInt(LPC_TIMER_T *pTMR, int8_t matchnum)
Enables a match interrupt that fires when the terminal count matches the match counter value.
STATIC INLINE uint32_t Chip_TIMER_ReadCapture(LPC_TIMER_T *pTMR, int8_t capnum)
Reads a capture register.
@ TIMER_CAPSRC_RISING_PCLK
STATIC INLINE void Chip_TIMER_CaptureDisableInt(LPC_TIMER_T *pTMR, int8_t capnum)
Disables interrupt on capture of selected CAP signal.
STATIC INLINE void Chip_TIMER_MatchDisableInt(LPC_TIMER_T *pTMR, int8_t matchnum)
Disables a match interrupt for a match counter.