40 #include "sys/clock.h" 48 #define ADC_ALS_PWR_PORT_BASE GPIO_PORT_TO_BASE(ADC_ALS_PWR_PORT) 49 #define ADC_ALS_PWR_PIN_MASK GPIO_PIN_MASK(ADC_ALS_PWR_PIN) 50 #define ADC_ALS_OUT_PIN_MASK GPIO_PIN_MASK(ADC_ALS_OUT_PIN) 58 GPIO_SET_PIN(ADC_ALS_PWR_PORT_BASE, ADC_ALS_PWR_PIN_MASK);
63 GPIO_CLR_PIN(ADC_ALS_PWR_PORT_BASE, ADC_ALS_PWR_PIN_MASK);
69 configure(
int type,
int value)
75 GPIO_CLR_PIN(ADC_ALS_PWR_PORT_BASE, ADC_ALS_PWR_PIN_MASK);
93 SENSORS_SENSOR(
als_sensor, ALS_SENSOR, value, configure, status);
#define GPIO_SET_PIN(PORT_BASE, PIN_MASK)
Set pins with PIN_MASK of port with PORT_BASE high.
#define SOC_ADC_ADCCON_DIV_512
512 decimation rate (12 bits ENOB)
Header file with register and macro declarations for the cc2538 GPIO module.
#define GPIO_CLR_PIN(PORT_BASE, PIN_MASK)
Set pins with PIN_MASK of port with PORT_BASE low.
Header file with declarations for the I/O Control module.
void clock_delay_usec(uint16_t dt)
Delay a given number of microseconds.
#define IOC_OVERRIDE_ANA
Analog Enable.
#define IOC_OVERRIDE_DIS
Override Disabled.
Header file for the cc2538 ADC driver.
#define GPIO_SOFTWARE_CONTROL(PORT_BASE, PIN_MASK)
Configure the pin to be software controlled with PIN_MASK of port with PORT_BASE. ...
#define ADC_ALS_PWR_PIN
ALS power GPIO control pin.
#define GPIO_A_NUM
GPIO_A: 0.
#define SOC_ADC_ADCCON_REF_INT
Internal reference.
Header file for the cc2538dk ALS Driver.
void ioc_set_over(uint8_t port, uint8_t pin, uint8_t over)
Set Port:Pin override function.
#define GPIO_SET_INPUT(PORT_BASE, PIN_MASK)
Set pins with PIN_MASK of port with PORT_BASE to input.
#define SOC_ADC_ADCCON_CH_AIN0
AIN0.
#define GPIO_SET_OUTPUT(PORT_BASE, PIN_MASK)
Set pins with PIN_MASK of port with PORT_BASE to output.
#define GPIO_A_BASE
GPIO_A.
int16_t adc_get(uint8_t channel, uint8_t ref, uint8_t div)
Performs a single conversion on a given ADC channel.
#define ADC_ALS_PWR_PORT
ALS power GPIO control port.
#define ADC_ALS_OUT_PIN
ALS output ADC input pin on port A.
const struct sensors_sensor als_sensor
Exports a global symbol to be used by the sensor API.