Microchip® Advanced Software Framework

s_light.c File Reference
#include <string.h>
#include <stdio.h>
#include "compiler.h"
#include "s_light.h"
#include "board.h"
#include "gpio.h"
#include "adc.h"
#include "FreeRTOS.h"

Functions

bool b_light_get_value (char *buf, U32 *result)
 Get the current light sensor value. More...
 

Variables

static volatile avr32_adc_t * adc = (volatile avr32_adc_t *) &AVR32_ADC
 

bool b_light_get_value ( char *  buf,
U32 result 
)

Get the current light sensor value.

Parameters
bufchar buffer in which the light sensor value is stored.
resultreturns the light sensor value.
Returns
true upon success, false if error.

References adc, adc_disable(), adc_enable(), adc_get_value(), ADC_LIGHT_CHANNEL, ADC_MAX_VALUE, and adc_start().

Referenced by device_full_custom_task().

volatile avr32_adc_t* adc = (volatile avr32_adc_t *) &AVR32_ADC
static

ADC cell.