40 #include "lib/sensors.h"
41 #include "dev/adc-sensor.h"
47 #include "driverlib/aux_adc.h"
53 static uint8_t channel = ADC_COMPB_IN_AUXIO0;
54 static bool is_active =
false;
57 .clocks = AUX_WUC_ADI_CLOCK | AUX_WUC_ANAIF_CLOCK | AUX_WUC_SMPH_CLOCK
61 config(
int type,
int c)
71 ti_lib_aux_adc_select_input(channel);
77 case ADC_SENSOR_SET_CHANNEL:
80 ti_lib_aux_adc_select_input(channel);
109 if(type == ADC_SENSOR_VALUE) {
113 puts(
"ADC not active");
117 ti_lib_aux_adc_enable_sync(AUXADC_REF_FIXED, AUXADC_SAMPLE_TIME_2P7_US,
118 AUXADC_TRIGGER_MANUAL);
120 ti_lib_aux_adc_gen_manual_trigger();
121 val = ti_lib_aux_adc_read_fifo();
123 ti_lib_aux_adc_disable();
131 SENSORS_SENSOR(adc_sensor, ADC_SENSOR, value, config, status);
void aux_ctrl_register_consumer(aux_consumer_module_t *consumer)
Register a module that no longer requires access to the AUX power domain.
Header file with macros which rename TI CC26xxware functions.
Header file for the management of the CC13xx/CC26xx AUX domain.
Timer library header file.
The data structure to be used for modules that require access to AUX.
Header file for the CC13xx/CC26xx GPIO interrupt management.
void aux_ctrl_unregister_consumer(aux_consumer_module_t *consumer)
Deregister a module that no longer requires access to the AUX power domain.