Contiki-NG
|
Files | |
file | adc-zoul.c |
Generic driver for the Zoul ADC interface. | |
file | adc-zoul.h |
Header file for the Zoul ADC interface. | |
Functions | |
static int | configure (int type, int value) |
Generic ADC sensors | |
#define | ZOUL_SENSORS_ADC_MIN 2 |
PA1 pin mask. | |
Driver for the Zoul ADC interface
This driver supports analogue sensors connected to ADC1, ADC2, ADC3, ADC4, ADC5 and ADC6 inputs. ADC6 is shared with the user button, so disable user button if ADC6 is needed. This is controlled by the type argument of the value() function. Possible choices are:
To initialize the ADC sensors use the configure() function, using as first argument SENSORS_HW_INIT, and choose which ADC channels to enable passing as second argument any single or combined (sum) values as below:
Using an invalid combination will return ZOUL_SENSORS_ERROR.
The decimation rate can be set by passing ZOUL_SENSORS_CONFIGURE_TYPE_DECIMATION_RATE as the type argument to the configure() function and then specifying the rate through the value argument. Valid values are:
|
static |
< PA1 pin mask
Definition at line 131 of file adc-zoul.c.
References adc_init(), ADC_SENSORS_ADC1_PIN, ADC_SENSORS_ADC2_PIN, ADC_SENSORS_ADC3_PIN, ADC_SENSORS_ADC4_PIN, ADC_SENSORS_ADC5_PIN, ADC_SENSORS_ADC6_PIN, configure(), GPIO_A_BASE, GPIO_A_NUM, GPIO_SET_INPUT, GPIO_SOFTWARE_CONTROL, IOC_OVERRIDE_ANA, ioc_set_over(), SOC_ADC_ADCCON_DIV_512, and ZOUL_SENSORS_ADC_MIN.
Referenced by configure().