40 #include "lib/sensors.h" 46 #include "driverlib/aux_adc.h" 52 static uint8_t channel = ADC_COMPB_IN_AUXIO0;
53 static bool is_active =
false;
56 .clocks = AUX_WUC_ADI_CLOCK | AUX_WUC_ANAIF_CLOCK | AUX_WUC_SMPH_CLOCK
70 ti_lib_aux_adc_select_input(channel);
76 case ADC_SENSOR_SET_CHANNEL:
79 ti_lib_aux_adc_select_input(channel);
108 if(type == ADC_SENSOR_VALUE) {
109 int val, adj_val, adj_mv;
112 puts(
"ADC not active");
116 ti_lib_aux_adc_enable_sync(AUXADC_REF_FIXED, AUXADC_SAMPLE_TIME_2P7_US,
117 AUXADC_TRIGGER_MANUAL);
119 ti_lib_aux_adc_gen_manual_trigger();
120 val = ti_lib_aux_adc_read_fifo();
121 adj_val = ti_lib_aux_adc_adjust_value_for_gain_and_offset(
123 ti_lib_aux_adc_get_adjustment_gain(AUXADC_REF_FIXED),
124 ti_lib_aux_adc_get_adjustment_offset(AUXADC_REF_FIXED));
125 adj_mv = ti_lib_aux_adc_value_to_microvolts(AUXADC_FIXED_REF_VOLTAGE_NORMAL, adj_val);
126 ti_lib_aux_adc_disable();
134 SENSORS_SENSOR(adc_sensor, ADC_SENSOR, value,
config, status);
void aux_ctrl_unregister_consumer(aux_consumer_module_t *consumer)
Deregister a module that no longer requires access to the AUX power domain.
Header file with macros which rename TI CC26xxware functions.
Timer library header file.
Header file for the CC13xx/CC26xx ADC driver.
Header file for the management of the CC13xx/CC26xx AUX domain.
void aux_ctrl_register_consumer(aux_consumer_module_t *consumer)
Register a module that no longer requires access to the AUX power domain.
The data structure to be used for modules that require access to AUX.