CCAux  2.20.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
39 namespace CrossControl
40 {
41 #endif
42 
43 typedef void *LIGHTSENSORHANDLE;
44 
64 EXTERN_C
65 CCAUXDLL_API
67 CCAUXDLL_CALLING_CONV
69 
80 EXTERN_C
81 CCAUXDLL_API
82 void CCAUXDLL_CALLING_CONV Lightsensor_release(LIGHTSENSORHANDLE);
83 
96 EXTERN_C
97 CCAUXDLL_API
99 
112 EXTERN_C
113 CCAUXDLL_API
114 eErr CCAUXDLL_CALLING_CONV Lightsensor_getIlluminance2(LIGHTSENSORHANDLE, uint16_t *value, uint8_t *ch0, uint8_t *ch1);
115 
128 EXTERN_C
129 CCAUXDLL_API
131 
151 EXTERN_C
152 CCAUXDLL_API
153 eErr CCAUXDLL_CALLING_CONV Lightsensor_startAverageCalc(LIGHTSENSORHANDLE, uint32_t averageWndSize,
154  uint32_t rejectWndSize, uint32_t rejectDeltaInLux,
156 
167 EXTERN_C
168 CCAUXDLL_API
170 
182 EXTERN_C
183 CCAUXDLL_API
185 
197 EXTERN_C
198 CCAUXDLL_API
200 
210 EXTERN_C
211 CCAUXDLL_API
213 
223 EXTERN_C
224 CCAUXDLL_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