Skip to content
Snippets Groups Projects
Commit 86afbc7a authored by Adrian Schneider's avatar Adrian Schneider
Browse files

chore(light_sensor) add api docs for light sensor

parent 5098717c
No related branches found
No related tags found
No related merge requests found
...@@ -168,8 +168,41 @@ API(API_INTERRUPT_ENABLE, int epic_interrupt_enable(api_int_id_t int_id)); ...@@ -168,8 +168,41 @@ API(API_INTERRUPT_ENABLE, int epic_interrupt_enable(api_int_id_t int_id));
*/ */
API(API_INTERRUPT_DISABLE, int epic_interrupt_disable(api_int_id_t int_id)); API(API_INTERRUPT_DISABLE, int epic_interrupt_disable(api_int_id_t int_id));
/**
* Start continuous readout of the light sensor. Will read light level
* at preconfigured interval and make it available via `epic_light_sensor_get()`
*
* :return: `0` if the start was successful or a negative error value
* if an error occured. Possible errors:
*
* - ``-EBUSY``: The timer could not be scheduled.
* - ``-EALREADY``: The continuous readout is already running. You can ignore
* this error and safely use `epic_light_sensor_get()` anyways.
*/
API(API_LIGHT_SENSOR_RUN, int epic_light_sensor_run()); API(API_LIGHT_SENSOR_RUN, int epic_light_sensor_run());
/**
* Get the last light level measured by the continuous readout.
*
* :param uint16_t* value: where the last light level should be written.
* :return: `0` if the readout was successful or a negative error
* value. Possible errors:
*
* - ``-ENODATA``: Continuous readout not currently running.
*/
API(API_LIGHT_SENSOR_GET, int epic_light_sensor_get(uint16_t* value)); API(API_LIGHT_SENSOR_GET, int epic_light_sensor_get(uint16_t* value));
/**
* Stop continuous readout of the light sensor.
*
* :return: `0` if the stop was sucessful or a negative error value
* if an error occured. Possible errors:
*
* - ``-EBUSY``: The timer stop could not be scheduled.
* - ``-EINVAL``: The continuous readout was not running. The continuous
* readout can be safely restarted.
*/
API(API_LIGHT_SENSOR_STOP, int epic_light_sensor_stop()); API(API_LIGHT_SENSOR_STOP, int epic_light_sensor_stop());
#endif /* _EPICARDIUM_H */ #endif /* _EPICARDIUM_H */
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment