CCAux 2.19.0.0
CCAux API reference
Lightsensor.h
Go to the documentation of this file.
1
2/*
3 * Copyright (C) 2010-2022 CrossControl AB - All rights reserved
4 *
5 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
6 *
7 * This source code is licensed under the proprietary CrossControl software
8 * license v 1.0.Please refer to the software license text for details or
9 * contact info@crosscontrol.com for more info.
10 *
11 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
12 */
13/*
14 * File description:
15 * Light Sensor access.
16 * The lightsensor suported by this implementation is a TAOS TSL2550 for
17 * platforms other than VC.
18 * On the VC platform, the sensor is the Intersil ISL29035.
19 *
20 * Note that reading the light sensor using average calculation at the
21 * same time as running the automatic backlight control is not supported.
22 * Also note that Lux values mentioned below (and in the Backlight class)
23 * are not necessarily true lux values. The values received are lower than
24 * true lux values, due to the light guide in the front panel, where some
25 * light is lost. It is still a measurement of the illuminance (in Lux).
26 *
27 * Use the function GetLightsensor() to get a handle to pass on to the other functions.
28 * Use the method Lightsensor_release(LIGHTSENSORHANDLE) to return the handle.
29 *
30 * Example Usage:
31 * @include lightsensor_example.cpp
32 *
33 ************************************************/
34#ifndef CC_LIGHTSENSOR_H
35#define CC_LIGHTSENSOR_H
36
37#include "CCAuxErrors.h"
38#include "CCAuxTypes.h"
39#include "CCPlatform.h"
40
41#ifdef __cplusplus
42namespace CrossControl
43{
44#endif
45
46typedef void *LIGHTSENSORHANDLE;
47
67EXTERN_C
68CCAUXDLL_API
70CCAUXDLL_CALLING_CONV
72
83EXTERN_C
84CCAUXDLL_API
85void CCAUXDLL_CALLING_CONV Lightsensor_release(LIGHTSENSORHANDLE);
86
99EXTERN_C
100CCAUXDLL_API
102
115EXTERN_C
116CCAUXDLL_API
118
131EXTERN_C
132CCAUXDLL_API
134
154EXTERN_C
155CCAUXDLL_API
156eErr CCAUXDLL_CALLING_CONV Lightsensor_startAverageCalc(LIGHTSENSORHANDLE, uint32_t averageWndSize,
157 uint32_t rejectWndSize, uint32_t rejectDeltaInLux,
159
170EXTERN_C
171CCAUXDLL_API
173
185EXTERN_C
186CCAUXDLL_API
188
200EXTERN_C
201CCAUXDLL_API
203
213EXTERN_C
214CCAUXDLL_API
216
226EXTERN_C
227CCAUXDLL_API
229
231#ifdef __cplusplus
232} /* namespace CrossControl */
233#endif
234
235#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:33
LightSensorOperationRange
Definition: CCAuxTypes.h:132
void * LIGHTSENSORHANDLE
Definition: Lightsensor.h:46
LightSensorSamplingMode
Definition: CCAuxTypes.h:142
ComponentLocation
Definition: CCAuxTypes.h:569
eErr
Definition: CCAuxTypes.h:162