Appiko
Functions
Light sensing with a LED

Light sensing based on sensing the charge accumulated due to the incident light on a reverse biased LED. More...

Functions

void led_sense_init (uint32_t led_out_pin, uint32_t led_sense_analog_pin, uint32_t led_off_val)
 Initialize the LED light sensing module. More...
 
uint32_t led_sense_get (void)
 Get the light value by measuring the voltage a LED's anode. More...
 
void led_sense_cfg_input (bool is_input_on)
 Configure the LED as either an light sensing input device or as an light emitting actuation device. More...
 

Detailed Description

Function Documentation

◆ led_sense_cfg_input()

void led_sense_cfg_input ( bool  is_input_on)
Parameters
is_input_onIs input if true and output if false

Definition at line 38 of file led_sense.c.

◆ led_sense_get()

uint32_t led_sense_get ( void  )
Returns
The ADC output of the light sensing by the LED. The value x 3.6/4096 is the actual voltage.

Definition at line 55 of file led_sense.c.

References SIMPLE_ADC_GAIN1_6, and simple_adc_get_value().

◆ led_sense_init()

void led_sense_init ( uint32_t  led_out_pin,
uint32_t  led_sense_analog_pin,
uint32_t  led_off_val 
)
Parameters
led_out_pinThe pin driving the LED
led_sense_analog_pinThe pin at LED's anode to sense light
led_off_valThe digital value at led_out_pin to switch off the LED.

Definition at line 27 of file led_sense.c.

References ASSERT.