Contiki-NG
|
Driver for the Zoul ADC interface. More...
Files | |
file | adc-zoul.c |
Generic driver for the Zoul ADC interface. | |
file | adc-zoul.h |
Header file for the Zoul ADC interface. | |
Generic ADC sensors | |
#define | ADC_ZOUL "ADC sensor interface" |
#define | ADC_SENSORS_PORT_BASE GPIO_PORT_TO_BASE(ADC_SENSORS_PORT) |
#define | ADC_SENSORS_REFERENCE SOC_ADC_ADCCON_REF_AVDD5 |
#define | ZOUL_SENSORS_ADC_MIN 2 |
PA1 pin mask. | |
#define | ZOUL_SENSORS_ADC1 0 |
#define | ZOUL_SENSORS_ADC2 0 |
#define | ZOUL_SENSORS_ADC3 0 |
#define | ZOUL_SENSORS_ADC4 0 |
#define | ZOUL_SENSORS_ADC5 0 |
#define | ZOUL_SENSORS_ADC6 0 |
#define | ZOUL_SENSORS_ADC_ALL |
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: