24 LPC_RIT->RICOMPVAL = (
rit_clk_mhz * ival_ms * 1000);
26 LPC_RIT->RICOUNTER = 0;
34 NVIC_EnableIRQ(RIT_IRQn);
39 NVIC_SetPriority(RIT_IRQn, int_priority);
46 NVIC_DisableIRQ(RIT_IRQn);
62 return LPC_RIT->RICTRL & (1 << 3);
void POWER_TurnOffPeripheral(u8 bit)
Turns off a peripheral.
void POWER_TurnOnPeripheral(u8 bit)
Turns on a peripheral.
_DECL_EXTERNALLY void free_jobs_list(void)
_USED_EXTERNALLY u32 base_ival
_DECL_EXTERNALLY u32 counter_reset_value
void RIT_Deinit(void)
De-initializes the RIT, by removing every job and disconnecting power.
void RIT_Disable(void)
Disables the RIT entirely (stops counting).
bool RIT_IsEnabled(void)
Returns whether the RIT is counting or not.
_PRIVATE const u32 rit_clk_mhz
RIT_CLK frequency in MHz. Can be checked in the RIT GUI in Keil.
void RIT_Enable(void)
Enables the RIT counting.
RIT_Error RIT_Init(MEM_Allocator *const alloc, u32 ival_ms, u16 int_priority)
Initialize the RIT.
_DECL_EXTERNALLY void allocate_jobs_list(MEM_Allocator *const)
u32 RIT_GetIntervalMs(void)
Returns the interval in millis that RIT uses for its interrupts.
@ RIT_ERR_INT_PRIO_INVALID
An invalid priority was specified (must be 0 <= prio <= 15). This is not necessarily an error,...
#define CLR_BITS(reg, value, bit)
#define CLR_BIT(reg, bit)
#define SET_BIT(reg, bit)
#define IS_DEF_PRIORITY(prio)
#define IS_BETWEEN_EQ(value, low, hi)