Light service API.
More...
#include <core/state.h>
Go to the source code of this file.
|
|
#define | RECORD_LIGHT_SENSOR "light_sensor" |
| | Record name for light sensor.
|
| |
|
|
typedef struct LightSensor | LightSensor |
| | LightSensor opaque pointer type.
|
| |
◆ LightSensorLightWavelength
Light sensor wavelengths.
| Enumerator |
|---|
| LightSensorLightWavelength600nm | 600nm wavelength
|
| LightSensorLightWavelength840nm | 840nm wavelength
|
◆ light_sensor_get_raw_data()
Get the raw light sensor value.
- Parameters
-
| [in] | instance | pointer to the LightSensor instance. |
| [in] | wavelength | Wavelength to read. |
| [out] | raw | Raw light sensor value. |
- Returns
- True if successful, false otherwise.
◆ light_sensor_get_state()
| FuriState * light_sensor_get_state |
( |
LightSensor * | instance | ) |
|
Get the state object containing the current light levels.
The underlying data will be of LightSensorState type.
- Parameters
-
| [in] | instance | pointer to the LightSensor instance. |
- Returns
- pointer to the state object
◆ light_sensor_sleep()
| bool light_sensor_sleep |
( |
LightSensor * | instance, |
|
|
bool | sleep ) |
Enter low-power sleep mode.
- Parameters
-
| [in] | instance | pointer to the LightSensor instance. |
| [in] | sleep | true - sleep mode, false - normal operation mode. |
- Returns
- True if successful, false otherwise.