CCAux  2.15.2.0
CCAux API reference
Lightsensor.h
Go to the documentation of this file.
1 /************************************************
2  *
3  * CROSSCONTROL AUX API
4  *
5  * Lightsensor.h
6  *
7  * Version 2.15.2.0, 2020-07-08
8  *
9  * (c) CrossControl 2010-2020
10  *
11 
12  * File description:
13  * Light Sensor access.
14  * The lightsensor suported by this implementation is a TAOS TSL2550 for
15  * platforms other than VC.
16  * On the VC platform, the sensor is the Intersil ISL29035.
17  *
18  * Note that reading the light sensor using average calculation at the
19  * same time as running the automatic backlight control is not supported.
20  * Also note that Lux values mentioned below (and in the Backlight class)
21  * are not necessarily true lux values. The values received are lower than
22  * true lux values, due to the light guide in the front panel, where some
23  * light is lost. It is still a measurement of the illuminance (in Lux).
24  *
25  * Use the function GetLightsensor() to get a handle to pass on to the other functions.
26  * Use the method Lightsensor_release(LIGHTSENSORHANDLE) to return the handle.
27  *
28  * Example Usage:
29  * @include lightsensor_example.cpp
30  *
31  ************************************************/
32 #ifndef CC_LIGHTSENSOR_H
33 #define CC_LIGHTSENSOR_H
34 
35 #include "CCAuxErrors.h"
36 #include "CCAuxTypes.h"
37 #include "CCPlatform.h"
38 
39 #ifdef __cplusplus
40 namespace CrossControl {
41 #endif
42 
43  typedef void* LIGHTSENSORHANDLE;
44 
58  EXTERN_C
59  CCAUXDLL_API
61  CCAUXDLL_CALLING_CONV
62  GetLightsensor(void);
63 
74  EXTERN_C
75  CCAUXDLL_API
76  void
77  CCAUXDLL_CALLING_CONV
79 
92  EXTERN_C
93  CCAUXDLL_API
94  eErr
95  CCAUXDLL_CALLING_CONV
97 
110  EXTERN_C
111  CCAUXDLL_API
112  eErr
113  CCAUXDLL_CALLING_CONV
115 
128  EXTERN_C
129  CCAUXDLL_API
130  eErr
131  CCAUXDLL_CALLING_CONV
133 
152  EXTERN_C
153  CCAUXDLL_API
154  eErr
155  CCAUXDLL_CALLING_CONV
157  uint32_t averageWndSize,
158  uint32_t rejectWndSize,
159  uint32_t rejectDeltaInLux,
161 
172  EXTERN_C
173  CCAUXDLL_API
174  eErr
175  CCAUXDLL_CALLING_CONV
177 
189  EXTERN_C
190  CCAUXDLL_API
191  eErr
192  CCAUXDLL_CALLING_CONV
194 
206  EXTERN_C
207  CCAUXDLL_API
208  eErr
209  CCAUXDLL_CALLING_CONV
211 
212 #ifdef __cplusplus
213 } /* namespace CrossControl */
214 #endif
215 
216 #endif /* CC_LIGHTSENSOR_H */
217 
eErr
Definition: CCAuxTypes.h:159
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_setOperatingRange(LIGHTSENSORHANDLE, LightSensorOperationRange range)
LightSensorSamplingMode
Definition: CCAuxTypes.h:139
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Lightsensor_getIlluminance(LIGHTSENSORHANDLE, uint16_t *value)
Definition: About.h:30
LightSensorOperationRange
Definition: CCAuxTypes.h:132
unsigned short uint16_t
Definition: CCAuxTypes.h:48
unsigned int uint32_t
Definition: CCAuxTypes.h:49
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Lightsensor_getOperatingRange(LIGHTSENSORHANDLE, LightSensorOperationRange *range)
unsigned char uint8_t
Definition: CCAuxTypes.h:47
EXTERN_C CCAUXDLL_API void CCAUXDLL_CALLING_CONV Lightsensor_release(LIGHTSENSORHANDLE)
EXTERN_C CCAUXDLL_API LIGHTSENSORHANDLE CCAUXDLL_CALLING_CONV GetLightsensor(void)
void * LIGHTSENSORHANDLE
Definition: Lightsensor.h:43
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Lightsensor_getAverageIlluminance(LIGHTSENSORHANDLE, uint16_t *value)
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Lightsensor_getIlluminance2(LIGHTSENSORHANDLE, uint16_t *value, uint8_t *ch0, uint8_t *ch1)
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Lightsensor_stopAverageCalc(LIGHTSENSORHANDLE)