16#include <zephyr/drivers/counter.h>
17#include <zephyr/device.h>
24 counter_alarm_callback_t callback;
26 uint32_t alarm_seconds;
34#define MINUTES_TO_SECONDS(minutes) (minutes * 60)
int sensor_timer_get_total_seconds(const struct device *dev)
Get the total seconds the timer has been running. This value is reset when the timer is reset.
Definition sensor_timer.c:67
int sensor_timer_cancel_alarm(const struct device *dev, uint8_t channel)
Cancel the alarm for the chosen channel of the sensor timer instance.
Definition sensor_timer.c:152
int sensor_timer_start(const struct device *dev)
Start the chosen sensor timer instance.
Definition sensor_timer.c:50
int sensor_timer_reset(const struct device *dev)
Reset the chosen sensor timer instance. This also resets the total seconds to 0.
Definition sensor_timer.c:77
int sensor_timer_stop(const struct device *dev)
Stop the chosen sensor timer instance. Timer will remain at the current value.
Definition sensor_timer.c:116
int sensor_timer_init(const struct device *dev)
Initialize the chosen sensor timer instance and create a top value callback to increment the total ov...
Definition sensor_timer.c:28
int sensor_timer_set_alarm(const struct device *dev, sensor_timer_alarm_cfg_t *sensor_timer_alarm_cfg)
Set the alarm for the chosen sensor timer instance, also setting the top value of the timer to the ch...
Definition sensor_timer.c:122
int sensor_timer_get_current_seconds(const struct device *dev)
Get the current seconds the timer was started. This value resets every time the timer is reset or top...
Definition sensor_timer.c:55
Structure to hold the sensor timer data.
Definition sensor_timer.h:22