8#define ADC_CH5 (1 << 5)
9#define ADC_GLOBAL_INTEN (1 << 8)
17 SET_BITS(LPC_PINCON->PINSEL3, 0x3, 30);
18 LPC_ADC->ADCR = (1 << 21) | (clock_divider << 8) |
ADC_CH5;
21 NVIC_EnableIRQ(ADC_IRQn);
24 NVIC_SetPriority(ADC_IRQn, int_priority);
49 NVIC_DisableIRQ(ADC_IRQn);
void ADC_PMSDisableSampling(void)
void ADC_PMGetSample(void)
Retrieves a single sample from the PM, and triggers the interrupt.
bool ADC_PMIsInitialized(void)
_PRIVATE bool initialized
ADC_PMError ADC_PMInit(u8 options, u8 clock_divider, u8 int_priority)
Initializes the 12bit ADC peripheral, which on this board is wired to the Potentiometer (PM)....
@ ADC_PM_ERR_OK
No error occurred.
@ ADC_PM_RIT_UNINIT
The ADC was initialized with the SAMPLE_WITH_RIT option, but the RIT peripheral was not initialized.
void POWER_TurnOffPeripheral(u8 bit)
Turns off a peripheral.
void POWER_TurnOnPeripheral(u8 bit)
Turns on a peripheral.
RIT_Error RIT_EnableJob(RIT_Job job)
Include this job in the RIT handler queue.
RIT_Error RIT_RemoveJob(RIT_Job job)
Removes a job from the RIT interrupt handler job queue.
RIT_Error RIT_AddJob(RIT_Job job, u8 multiplier_factor)
bool RIT_IsEnabled(void)
Returns whether the RIT is counting or not.
#define RIT_NO_DIVIDER
Tells the RIT that the specified job needs to be executed at exactly the interval of interrupts chose...
#define CLR_BIT(reg, bit)
#define SET_BIT(reg, bit)
#define IS_DEF_PRIORITY(prio)
#define IS_BETWEEN_EQ(value, low, hi)
#define SET_BITS(reg, value, bit)