CCAux 3.0.0.0
CCAux API reference
Lightsensor.h
Go to the documentation of this file.
1
2/*
3 * Copyright (C) 2023 CrossControl AB
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; with
8 * version 2.1 of the License.
9 */
10/*
11 * File description:
12 * Light Sensor access.
13 * The lightsensor suported by this implementation is a TAOS TSL2550 for
14 * platforms other than VC.
15 * On the VC platform, the sensor is the Intersil ISL29035.
16 *
17 * Note that reading the light sensor using average calculation at the
18 * same time as running the automatic backlight control is not supported.
19 * Also note that Lux values mentioned below (and in the Backlight class)
20 * are not necessarily true lux values. The values received are lower than
21 * true lux values, due to the light guide in the front panel, where some
22 * light is lost. It is still a measurement of the illuminance (in Lux).
23 *
24 * Use the function GetLightsensor() to get a handle to pass on to the other functions.
25 * Use the method Lightsensor_release(LIGHTSENSORHANDLE) to return the handle.
26 *
27 * Example Usage:
28 * @include lightsensor_example.cpp
29 *
30 ************************************************/
31#ifndef CC_LIGHTSENSOR_H
32#define CC_LIGHTSENSOR_H
33
34#include "CCAuxErrors.h"
35#include "CCAuxTypes.h"
36#include "CCPlatform.h"
37
38#ifdef __cplusplus
39namespace CrossControl
40{
41#endif
42
43typedef void *LIGHTSENSORHANDLE;
44
64EXTERN_C
65CCAUXDLL_API
67CCAUXDLL_CALLING_CONV
69
80EXTERN_C
81CCAUXDLL_API
82void CCAUXDLL_CALLING_CONV Lightsensor_release(LIGHTSENSORHANDLE);
83
96EXTERN_C
97CCAUXDLL_API
99
112EXTERN_C
113CCAUXDLL_API
115
128EXTERN_C
129CCAUXDLL_API
131
151EXTERN_C
152CCAUXDLL_API
153eErr CCAUXDLL_CALLING_CONV Lightsensor_startAverageCalc(LIGHTSENSORHANDLE, uint32_t averageWndSize,
154 uint32_t rejectWndSize, uint32_t rejectDeltaInLux,
156
167EXTERN_C
168CCAUXDLL_API
170
182EXTERN_C
183CCAUXDLL_API
185
197EXTERN_C
198CCAUXDLL_API
200
210EXTERN_C
211CCAUXDLL_API
213
223EXTERN_C
224CCAUXDLL_API
226
228#ifdef __cplusplus
229} /* namespace CrossControl */
230#endif
231
232#endif /* CC_LIGHTSENSOR_H */
unsigned short uint16_t
Definition: CCAuxTypes.h:38
unsigned int uint32_t
Definition: CCAuxTypes.h:39
unsigned char uint8_t
Definition: CCAuxTypes.h:37
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Lightsensor_setActive(LIGHTSENSORHANDLE, ComponentLocation location)
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Lightsensor_stopAverageCalc(LIGHTSENSORHANDLE)
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Lightsensor_getAverageIlluminance(LIGHTSENSORHANDLE, uint16_t *value)
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Lightsensor_getOperatingRange(LIGHTSENSORHANDLE, LightSensorOperationRange *range)
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Lightsensor_getIlluminance(LIGHTSENSORHANDLE, uint16_t *value)
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Lightsensor_startAverageCalc(LIGHTSENSORHANDLE, uint32_t averageWndSize, uint32_t rejectWndSize, uint32_t rejectDeltaInLux, LightSensorSamplingMode mode)
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Lightsensor_getIlluminance2(LIGHTSENSORHANDLE, uint16_t *value, uint8_t *ch0, uint8_t *ch1)
EXTERN_C CCAUXDLL_API void CCAUXDLL_CALLING_CONV Lightsensor_release(LIGHTSENSORHANDLE)
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Lightsensor_setOperatingRange(LIGHTSENSORHANDLE, LightSensorOperationRange range)
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Lightsensor_getActive(LIGHTSENSORHANDLE, ComponentLocation *location)
EXTERN_C CCAUXDLL_API LIGHTSENSORHANDLE CCAUXDLL_CALLING_CONV GetLightsensor(void)
Definition: About.h:30
LightSensorOperationRange
Definition: CCAuxTypes.h:132
void * LIGHTSENSORHANDLE
Definition: Lightsensor.h:43
LightSensorSamplingMode
Definition: CCAuxTypes.h:142
ComponentLocation
Definition: CCAuxTypes.h:569
eErr
Definition: CCAuxTypes.h:162