CCAux  2.7.2.0
CCAux API reference
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator
Lightsensor.h
Go to the documentation of this file.
1 /************************************************
2 *
3 * CROSSCONTROL AUX API
4 *
5 * Lightsensor.h
6 *
7 * Version 2.7.2.0, 2014-08-25
8 *
9 * (c) maximatecc 2013
10 *
11 * File description:
12 * Light Sensor access.
13 * The lightsensor suported by this implementation is a TAOS TSL2550 for platforms other than VC.
14 * On the VC platform, the sensor is the Intersil ISL29035.
15 *
16 * Note that reading the light sensor using average calculation at the same time as running the automatic backlight control is not supported.
17 * Also note that Lux values mentioned below (and in the Backlight class) are not necessarily true lux values.
18 * The values received are lower than true lux values, due to the light guide in the front panel, where some light is lost.
19 * It is still a measurement of the illuminance (in Lux).
20 *
21 * Use the function GetLightsensor() to get a handle to pass on to the other functions.
22 * Use the method Lightsensor_release(LIGHTSENSORHANDLE) to return the handle.
23 *
24 * Example Usage:
25 * @include lightsensor_example.cpp
26 *
27 ************************************************/
28 #ifndef CC_LIGHTSENSOR_H
29 #define CC_LIGHTSENSOR_H
30 
31 #include "CCAuxErrors.h"
32 #include "CCAuxTypes.h"
33 #include "CCPlatform.h"
34 
35 #ifdef __cplusplus
36 namespace CrossControl {
37 #endif
38 
39  typedef void* LIGHTSENSORHANDLE;
40 
41 
55  EXTERN_C
56  CCAUXDLL_API
58  CCAUXDLL_CALLING_CONV
59  GetLightsensor(void);
60 
71  EXTERN_C
72  CCAUXDLL_API
73  void
74  CCAUXDLL_CALLING_CONV
76 
89  EXTERN_C
90  CCAUXDLL_API
91  eErr
92  CCAUXDLL_CALLING_CONV
93  Lightsensor_getIlluminance (LIGHTSENSORHANDLE, unsigned short* value);
94 
107  EXTERN_C
108  CCAUXDLL_API
109  eErr
110  CCAUXDLL_CALLING_CONV
111  Lightsensor_getIlluminance2 (LIGHTSENSORHANDLE, unsigned short* value, unsigned char* ch0, unsigned char* ch1);
112 
125  EXTERN_C
126  CCAUXDLL_API
127  eErr
128  CCAUXDLL_CALLING_CONV
129  Lightsensor_getAverageIlluminance (LIGHTSENSORHANDLE, unsigned short* value);
130 
146  EXTERN_C
147  CCAUXDLL_API
148  eErr
149  CCAUXDLL_CALLING_CONV
151  unsigned long averageWndSize,
152  unsigned long rejectWndSize,
153  unsigned long rejectDeltaInLux,
155 
166  EXTERN_C
167  CCAUXDLL_API
168  eErr
169  CCAUXDLL_CALLING_CONV
171 
182  EXTERN_C
183  CCAUXDLL_API
184  eErr
185  CCAUXDLL_CALLING_CONV
187 
199  EXTERN_C
200  CCAUXDLL_API
201  eErr
202  CCAUXDLL_CALLING_CONV
204 
205 #ifdef __cplusplus
206 } /* namespace CrossControl */
207 #endif
208 
209 #endif /* CC_LIGHTSENSOR_H */
210