Contain SAADC module with related functions. More...
Macros | |
#define | ANALOG_BATTERY (2UL) |
ADC Channel 0 - Battery measurement. More... | |
#define | ANALOG_PRESSURE (3UL) |
ADC Channel 1 - PX3 Pressure measurement. More... | |
#define | SAADC_CALIBRATION_INTERVAL 10 |
Determines how often the SAADC should be calibrated relative to NRF_DRV_SAADC_EVT_DONE event. More... | |
#define | SAADC_SAMPLES_IN_BUFFER 2 |
Number of SAADC samples in RAM before returning a SAADC event. More... | |
Functions | |
void | pwm_init (void) |
Initialize PWM module. More... | |
void | updateLED (uint16_t REDduty, uint16_t GREENduty, uint16_t BLUEduty) |
More... | |
void | stopLED (void) |
More... | |
void | startLED (void) |
More... | |
void | testLED () |
More... | |
nrfx_saadc_event_handler_t | saadc_handler (nrfx_saadc_evt_t const *p_event) |
SAADC event handler. More... | |
void | saadc_init (void) |
Initialize SAADC. More... | |
Variables | |
int16_t | REDseq_buf [] = {(1 << 15) | 0} |
Channel 0: Inverse polarity (bit 15), 500us duty cycle. More... | |
int16_t | GREENseq_buf [] = {(1 << 15) | 0} |
Channel 1: Inverse polarity (bit 15), 500us duty cycle. More... | |
int16_t | BLUEseq_buf [] = {(1 << 15) | 1} |
Channel 2: Inverse polarity (bit 15), 500us duty cycle. More... | |
bool | SAADCdataReady |
Flag to signal SAADC is ready to be read. More... | |
Contain SAADC module with related functions.
#define ANALOG_BATTERY (2UL) |
ADC Channel 0 - Battery measurement.
#define ANALOG_PRESSURE (3UL) |
ADC Channel 1 - PX3 Pressure measurement.
#define SAADC_CALIBRATION_INTERVAL 10 |
Determines how often the SAADC should be calibrated relative to NRF_DRV_SAADC_EVT_DONE event.
E.g. value 10 will make the SAADC calibrate every 10th time the NRF_DRV_SAADC_EVT_DONE is triggered.
#define SAADC_SAMPLES_IN_BUFFER 2 |
Number of SAADC samples in RAM before returning a SAADC event.
For low power SAADC set this constant to 1. Otherwise the EasyDMA will be enabled for an extended time which consumes high current.
void pwm_init | ( | void | ) |
Initialize PWM module.
nrfx_saadc_event_handler_t saadc_handler | ( | nrfx_saadc_evt_t const * | p_event | ) |
SAADC event handler.
[in] | p_event | saadc event. |
void saadc_init | ( | ) |
Initialize SAADC.
void startLED | ( | void | ) |
Start PWM module.
void stopLED | ( | void | ) |
Stop PWM module.
void testLED | ( | void | ) |
PWM module test sequence.
Set new RGB brightness and/or color.
int16_t BLUEseq_buf[] = {(1 << 15) | 1} |
Channel 2: Inverse polarity (bit 15), 500us duty cycle.
int16_t GREENseq_buf[] = {(1 << 15) | 0} |
Channel 1: Inverse polarity (bit 15), 500us duty cycle.
int16_t REDseq_buf[] = {(1 << 15) | 0} |
Channel 0: Inverse polarity (bit 15), 500us duty cycle.
bool SAADCdataReady |
Flag to signal SAADC is ready to be read.
Flag to signal SAADC is ready to be read.