45 #include "sw/modules/types/src/types.h"
65 #define TIMER0_BASE_ADDR (0x00000C00)
69 #define TIMER1_BASE_ADDR (0x00000C08)
73 #define TIMER2_BASE_ADDR (0x00000C10)
78 #define TIMER_TCR_TSS_BITS (1 << 4)
82 #define TIMER_TCR_TRB_BITS (1 << 5)
86 #define TIMER_TCR_FREESOFT_BITS (3 << 10)
90 #define TIMER_TCR_TIE_BITS (1 << 14)
94 #define TIMER_TCR_TIF_BITS (1 << 15)
169 uint32_t cnt = timer->
TIM;
185 extern TIMER_Handle
TIMER_init(
void *pMemory,
const size_t numBytes);
206 const uint16_t decFactor);
225 uint32_t period = timer->
PRD;
235 const uint32_t period)
251 const uint16_t preScaler);
287 #endif // end of _TIMER_H_ definition
Denotes that the counter is zero.
static void TIMER_setPeriod(TIMER_Handle timerHandle, const uint32_t period)
Sets the timer (TIMER) period.
Defines the timer (TIMER) object.
void TIMER_clearFlag(TIMER_Handle timerHandle)
Clears the timer (TIMER) flag.
volatile uint16_t TCR
Timer Control Register.
Denotes that the timer will stop after the next decrement.
TIMER_Status_e
Enumeration to define the timer (TIMER) status.
struct _TIMER_Obj_ * TIMER_Handle
Defines the timer (TIMER) handle.
void TIMER_disableInt(TIMER_Handle timerHandle)
Disables the timer (TIMER) interrupt.
#define TIMER_TCR_TSS_BITS
Defines the location of the TSS bits in the TCR register.
void TIMER_enableInt(TIMER_Handle timerHandle)
Enables the timer (TIMER) interrupt.
Denotes that the timer will run free.
static uint32_t TIMER_getCount(TIMER_Handle timerHandle)
Gets the timer (TIMER) count.
Denotes that the timer will stop when it reaches zero.
#define TIMER_TCR_TRB_BITS
Defines the location of the TRB bits in the TCR register.
volatile uint16_t resvd_1
Reserved.
volatile uint32_t TIM
Timer Counter Register.
static void TIMER_stop(TIMER_Handle timerHandle)
Stops the timer (TIMER)
void TIMER_setDecimationFactor(TIMER_Handle timerHandle, const uint16_t decFactor)
Sets the timer (TIMER) decimation factor.
static void TIMER_reload(TIMER_Handle timerHandle)
Reloads the timer (TIMER) value.
TIMER_Status_e TIMER_getStatus(TIMER_Handle timerHandle)
Gets the timer (TIMER) status.
void TIMER_setEmulationMode(TIMER_Handle timerHandle, const TIMER_EmulationMode_e mode)
Sets the timer (TIMER) emulation mode.
static void TIMER_start(TIMER_Handle timerHandle)
Starts the timer (TIMER)
volatile uint32_t PRD
Period Register.
static uint32_t TIMER_getPeriod(TIMER_Handle timerHandle)
Gets the timer (TIMER) period.
volatile uint32_t TPR
Timer Prescaler Register.
void TIMER_setPreScaler(TIMER_Handle timerHandle, const uint16_t preScaler)
Sets the timer (TIMER) prescaler.
TIMER_EmulationMode_e
Enumeration to define the timer (TIMER) emulation mode.
Denotes that the counter is non-zero.
struct _TIMER_Obj_ TIMER_Obj
Defines the timer (TIMER) object.
TIMER_Handle TIMER_init(void *pMemory, const size_t numBytes)
Initializes the timer (TIMER) object handle.