EasyManua.ls Logo

ST VD6283 - Flicker Measure Using an External ADC

ST VD6283
27 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
A.3 Flicker measure using an external ADC
CustomerPrivate client;
void *hdl;
// sensor initialization
Error = STALS_Init("VD6283", &client, &hdl);
// First configure sensor settings
Error = STALS_SetGain(hdl, STALS_CHANNEL_6, 0x0a00, &current_gain);
Error = STALS_SetFlickerOutputType(hdl, STALS_FLICKER_OUTPUT_ANALOG);
// start Flicker sampling
Error = STALS_Start(hdl, STALS_MODE_FLICKER, STALS_CHANNEL_6);
// capture data from GPIO2 pin through an external RC filter using a platform dependent adc.
// Sampling frequency must be greater than 4Khz.
Platform_capture_adc(data);
Platform_fft(data, data_fft);
flk_frequency = Platform_flk_detect(data_fft);
printf("flicker frequency %d hz\n", flk_frequency);
// stop acquisition
Error = STALS_Stop(hdl, STALS_MODE_FLICKER);
// Release sensor
Error = STALS_Term(&hdl);
UM2878
Flicker measure using an external ADC
UM2878 - Rev 1
page 22/27

Related product manuals