CCAux  2.20.0.0
CCAux API reference
Functions
Backlight functions

Functions

EXTERN_C CCAUXDLL_API BACKLIGHTHANDLE CCAUXDLL_CALLING_CONV GetBacklight (void)
 
EXTERN_C CCAUXDLL_API void CCAUXDLL_CALLING_CONV Backlight_release (BACKLIGHTHANDLE)
 
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Backlight_getIntensity (BACKLIGHTHANDLE, uint8_t *intensity)
 
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Backlight_setIntensity (BACKLIGHTHANDLE, uint8_t intensity)
 
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Backlight_getStatus (BACKLIGHTHANDLE, uint8_t *status)
 
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Backlight_getHWStatus (BACKLIGHTHANDLE, bool *status)
 
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Backlight_startAutomaticBL (BACKLIGHTHANDLE)
 
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Backlight_stopAutomaticBL (BACKLIGHTHANDLE)
 
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Backlight_getAutomaticBLStatus (BACKLIGHTHANDLE, uint8_t *status)
 
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Backlight_setAutomaticBLParams (BACKLIGHTHANDLE, bool bSoftTransitions)
 
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Backlight_getAutomaticBLParams (BACKLIGHTHANDLE, bool *bSoftTransitions, float64_t *k)
 
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Backlight_setAutomaticBLFilter (BACKLIGHTHANDLE, uint32_t averageWndSize, uint32_t rejectWndSize, uint32_t rejectDeltaInLux, LightSensorSamplingMode mode)
 
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Backlight_getAutomaticBLFilter (BACKLIGHTHANDLE, uint32_t *averageWndSize, uint32_t *rejectWndSize, uint32_t *rejectDeltaInLux, LightSensorSamplingMode *mode)
 
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Backlight_getLedDimming (BACKLIGHTHANDLE, CCStatus *status)
 
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Backlight_setLedDimming (BACKLIGHTHANDLE, CCStatus status)
 
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Backlight_setActive (BACKLIGHTHANDLE, ComponentLocation location)
 
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Backlight_getActive (BACKLIGHTHANDLE, ComponentLocation *location)
 

Detailed Description

Functions in the Backlight class

Function Documentation

◆ Backlight_getActive()

EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV CrossControl::Backlight_getActive ( BACKLIGHTHANDLE  ,
ComponentLocation location 
)

Get active backlight.

Supported Platform(s): Yukon, V510, V710, V1000, V1200

Parameters
LocationLocation of the active Backlight.
Returns
error status. 0 = ERR_SUCCESS, otherwise error code. See the enum eErr for details.

◆ Backlight_getAutomaticBLFilter()

EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV CrossControl::Backlight_getAutomaticBLFilter ( BACKLIGHTHANDLE  ,
uint32_t averageWndSize,
uint32_t rejectWndSize,
uint32_t rejectDeltaInLux,
LightSensorSamplingMode mode 
)

Get light sensor filter parameters for automatic backlight control.

Supported Platform(s): XL, XL5, XM, XM9, XS, XA, VC, VA, VS, V700, Yukon, V510, V710, V1000, V1200, X1200

Parameters
averageWndSizeThe average window size in nr of samples.
rejectWndSizeThe reject window size in nr of samples.
rejectDeltaInLuxThe reject delta in lux.
modeThe configured sampling mode.
Returns
error status. 0 = ERR_SUCCESS, otherwise error code. See the enum eErr for details.

◆ Backlight_getAutomaticBLParams()

EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV CrossControl::Backlight_getAutomaticBLParams ( BACKLIGHTHANDLE  ,
bool *  bSoftTransitions,
float64_t k 
)

Get parameters for automatic backlight control.

Supported Platform(s): XL, XL5, XM, XM9, XS, XA, VC, VA, VS, V700, Yukon, V510, V710, V1000, V1200, X1200

Parameters
bSoftTransitionsSoft transitions used?
kK value.
Returns
error status. 0 = ERR_SUCCESS, otherwise error code. See the enum eErr for details.

◆ Backlight_getAutomaticBLStatus()

EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV CrossControl::Backlight_getAutomaticBLStatus ( BACKLIGHTHANDLE  ,
uint8_t status 
)

Get status from automatic backlight control.

Supported Platform(s): XL, XL5, XM, XM9, XS, XA, VC, VA, VS, V700, Yukon, V510, V710, V1000, V1200, X1200

Parameters
status1=running, 0=stopped.
Returns
error status. 0 = ERR_SUCCESS, otherwise error code. See the enum eErr for details.

◆ Backlight_getHWStatus()

EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV CrossControl::Backlight_getHWStatus ( BACKLIGHTHANDLE  ,
bool *  status 
)

Get backlight hardware status.

Parameters
statusBacklight controller status. true: All backlight drivers works ok, false: one or more backlight drivers are faulty.

Supported Platform(s): XL, XM, XS, XA

Returns
error status. 0 = ERR_SUCCESS, otherwise error code. See the enum eErr for details.

Example Usage:

bool backlightStatus = false;
err = Backlight_getHWStatus(pBacklight, &backlightStatus);
if (err == ERR_SUCCESS)
{
if (backlightStatus)
printf("Backlight hardware status: OK\n");
else
printf("Backlight hardware status: not OK, one or more backlight drivers are faulty\n");
}
else if (err == ERR_NOT_SUPPORTED)
{
printf("Backlight_getHWStatus: Not supported!\n");
}
else
{
printf("Error(%d) in function Backlight_getHWStatus: %s\n", err, GetErrorStringA(err));
}
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Backlight_getHWStatus(BACKLIGHTHANDLE, bool *status)
EXTERN_C CCAUXDLL_API char_t const *CCAUXDLL_CALLING_CONV GetErrorStringA(eErr errCode)
@ ERR_SUCCESS
Definition: CCAuxTypes.h:163
@ ERR_NOT_SUPPORTED
Definition: CCAuxTypes.h:165

◆ Backlight_getIntensity()

EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV CrossControl::Backlight_getIntensity ( BACKLIGHTHANDLE  ,
uint8_t intensity 
)

Get backlight intensity. Note that there might be hardware limitations, limiting the minimum and/or maximum value to other than (1..255).

Supported Platform(s): XL, XL5, XM, XM9, XS, XA, VC, VA, VS, VI2, V700, Yukon, V510, V710, V1000, V1200, X1200

Parameters
intensityThe current backlight intensity (1..255).
Returns
error status. 0 = ERR_SUCCESS, otherwise error code. See the enum eErr for details.

Example Usage:

err = Backlight_getIntensity(pBacklight, &value);
if (err == ERR_SUCCESS)
{
printf("Current backlight intensity (0-255): %d\n", value);
}
else
{
printf("Error(%d) in function Backlight_getIntensity: %s\n", err, GetErrorStringA(err));
}
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Backlight_getIntensity(BACKLIGHTHANDLE, uint8_t *intensity)

◆ Backlight_getLedDimming()

EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV CrossControl::Backlight_getLedDimming ( BACKLIGHTHANDLE  ,
CCStatus status 
)

Get the current setting for Led dimming. If enabled, the function automatically dimms the LED according to the current backlight setting; Low backlight gives less bright LED. This works with manual backlight setting and automatic backlight, but only if the led is set to pure red, green or blue color. If another color is being used, this functionality must be implemented separately.

Supported Platform(s): XL, XL5, XM, XM9, XS, XA, VC, VA, VS, VI2, V700, Yukon, V510, V710, V1000, V1200, X1200

Parameters
statusEnabled/Disabled
Returns
error status. 0 = ERR_SUCCESS, otherwise error code. See the enum eErr for details.

◆ Backlight_getStatus()

EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV CrossControl::Backlight_getStatus ( BACKLIGHTHANDLE  ,
uint8_t status 
)

Get backlight controller status. Deprecated, use Backlight_getHWStatus instead.

Supported Platform(s): XL, XM

Parameters
statusBacklight controller status. Bit 0: status controller 1. Bit 1: status controller 2. Bit 2: status controller 3. Bit 3: status controller 4. 1=normal, 0=fault.
Returns
error status. 0 = ERR_SUCCESS, otherwise error code. See the enum eErr for details.

Example Usage:

err = Backlight_getStatus(pBacklight, &value);
if (err == ERR_SUCCESS)
{
printf("Backlight status: \nBL1:%s\nBL2:%s\nBL3:%s\nBL4:%s\n", (value & 0x01) ? "OK" : "NOT OK or missing",
(value & 0x02) ? "OK" : "NOT OK or missing", (value & 0x04) ? "OK" : "NOT OK or missing",
(value & 0x08) ? "OK" : "NOT OK or missing");
}
else if (err == ERR_NOT_SUPPORTED)
{
printf("Backlight_getStatus: Not supported!\n");
}
else
{
printf("Error(%d) in function Backlight_getStatus: %s\n", err, GetErrorStringA(err));
}
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Backlight_getStatus(BACKLIGHTHANDLE, uint8_t *status)

◆ Backlight_release()

EXTERN_C CCAUXDLL_API void CCAUXDLL_CALLING_CONV CrossControl::Backlight_release ( BACKLIGHTHANDLE  )

Delete the backlight object.

Supported Platform(s): XL, XL5, XM, XM9, XS, XA, VC, VA, VS, VI2, V700, Yukon, V510, V710, V1000, V1200, X1200

Returns
-

Example Usage:

assert(pBacklight);
if (argc == 2)
{
change_backlight(pBacklight, (unsigned char)atoi(argv[1]));
}
else
{
change_backlight(pBacklight, -1);
}
Backlight_release(pBacklight);
EXTERN_C CCAUXDLL_API BACKLIGHTHANDLE CCAUXDLL_CALLING_CONV GetBacklight(void)
EXTERN_C CCAUXDLL_API void CCAUXDLL_CALLING_CONV Backlight_release(BACKLIGHTHANDLE)
void * BACKLIGHTHANDLE
Definition: Backlight.h:34

◆ Backlight_setActive()

EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV CrossControl::Backlight_setActive ( BACKLIGHTHANDLE  ,
ComponentLocation  location 
)

Set active backlight.

Supported Platform(s): Yukon, V510, V710, V1000, V1200

Parameters
locationLocation of the Backlight to set Active. Max number depends from platform.
Returns
error status. 0 = ERR_SUCCESS, otherwise error code. See the enum eErr for details.

◆ Backlight_setAutomaticBLFilter()

EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV CrossControl::Backlight_setAutomaticBLFilter ( BACKLIGHTHANDLE  ,
uint32_t  averageWndSize,
uint32_t  rejectWndSize,
uint32_t  rejectDeltaInLux,
LightSensorSamplingMode  mode 
)

Set light sensor filter parameters for automatic backlight control.

Supported Platform(s): XL, XL5, XM, XM9, XS, XA, VC, VA, VS, V700, Yukon, V510, V710, V1000, V1200, X1200

Parameters
averageWndSizeThe average window size in nr of samples.
rejectWndSizeThe reject window size in nr of samples.
rejectDeltaInLuxThe reject delta in lux.
modeThe configured sampling mode.
Returns
error status. 0 = ERR_SUCCESS, otherwise error code. See the enum eErr for details.

◆ Backlight_setAutomaticBLParams()

EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV CrossControl::Backlight_setAutomaticBLParams ( BACKLIGHTHANDLE  ,
bool  bSoftTransitions 
)

Set parameters for automatic backlight control.

Supported Platform(s): XL, XL5, XM, XM9, XS, XA, VC, VA, VS, V700, Yukon, V510, V710, V1000, V1200, X1200

Parameters
bSoftTransitionsUse soft transitions?
Returns
error status. 0 = ERR_SUCCESS, otherwise error code. See the enum eErr for details.

◆ Backlight_setIntensity()

EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV CrossControl::Backlight_setIntensity ( BACKLIGHTHANDLE  ,
uint8_t  intensity 
)

Set backlight intensity. Note that there might be hardware limitations, limiting the minimum and/or maximum value to other than (1..255).

Supported Platform(s): XL, XL5, XM, XM9, XS, XA, VC, VA, VS, VI2, V700, Yukon, V510, V710, V1000, V1200, X1200

Parameters
intensityThe backlight intensity to set (1..255).
Returns
error status. 0 = ERR_SUCCESS, otherwise error code. See the enum eErr for details.

Example Usage:

err = Backlight_setIntensity(pBacklight, value);
if (err == ERR_SUCCESS)
{
printf("Setting backlight intensity: %d\n", value);
}
else
{
printf("Error(%d) in function Backlight_setIntensity: %s\n", err, GetErrorStringA(err));
}
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Backlight_setIntensity(BACKLIGHTHANDLE, uint8_t intensity)

◆ Backlight_setLedDimming()

EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV CrossControl::Backlight_setLedDimming ( BACKLIGHTHANDLE  ,
CCStatus  status 
)

Enable/disable Led dimming. If enabled, the function automatically dimms the LED according to the current backlight setting; Low backlight gives less bright LED. This works with manual backlight setting and automatic backlight, but only if the led is set to pure red, green or blue color. If another color is being used, this functionality must be implemented separately.

Supported Platform(s): XL, XL5, XM, XM9, XS, XA, VC, VA, VS, VI2, V700, Yukon, V510, V710, V1000, V1200, X1200

Parameters
statusEnabled/Disabled
Returns
error status. 0 = ERR_SUCCESS, otherwise error code. See the enum eErr for details.

◆ Backlight_startAutomaticBL()

EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV CrossControl::Backlight_startAutomaticBL ( BACKLIGHTHANDLE  )

Start automatic backlight control. Note that reading the light sensor at the same time as running the automatic backlight control is not supported.

Supported Platform(s): XL, XL5, XM, XM9, XS, XA, VC, VA, VS, V700, Yukon, V510, V710, V1000, V1200, X1200

Returns
error status. 0 = ERR_SUCCESS, otherwise error code. See the enum eErr for details.

◆ Backlight_stopAutomaticBL()

EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV CrossControl::Backlight_stopAutomaticBL ( BACKLIGHTHANDLE  )

Stop automatic backlight control.

Supported Platform(s): XL, XL5, XM, XM9, XS, XA, VC, VA, VS, V700, Yukon, V510, V710, V1000, V1200, X1200

Returns
error status. 0 = ERR_SUCCESS, otherwise error code. See the enum eErr for details.

◆ GetBacklight()

EXTERN_C CCAUXDLL_API BACKLIGHTHANDLE CCAUXDLL_CALLING_CONV CrossControl::GetBacklight ( void  )

Factory function that creates instances of the Backlight object.

Supported Platform(s): XL, XL5, XM, XM9, XS, XA, VC, VA, VS, VI2, V700, Yukon, V510, V710, V1000, V1200, X1200

Returns
BACKLIGHTHANDLE to an allocated Backlight object. The returned handle needs to be deallocated using the Backlight_release(BACKLIGHTHANDLE) method when it's no longer needed. Returns NULL if it fails to allocate memory.

Example Usage:

assert(pBacklight);
if (argc == 2)
{
change_backlight(pBacklight, (unsigned char)atoi(argv[1]));
}
else
{
change_backlight(pBacklight, -1);
}
Backlight_release(pBacklight);