LoRa-BLE-Sensor
Loading...
Searching...
No Matches
Classes | Enumerations | Functions
sensor_scheduling.h File Reference

This is a library to schedule sensor readings and radio transmissions. More...

#include "sensor_timer.h"
#include <stdint.h>
#include <zephyr/kernel.h>
#include <zephyr/device.h>
Include dependency graph for sensor_scheduling.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  sensor_scheduling_cfg_t
 Structure for the sensor scheduling configuration, each sensor and radio will have a schedule. More...
 

Enumerations

enum  sensor_scheduling_id { SENSOR_SCHEDULING_ID_SENSOR1 , SENSOR_SCHEDULING_ID_SENSOR2 , SENSOR_SCHEDULING_ID_RADIO , SENSOR_SCHEDULING_ID_LIMIT }
 Enum for the sensor scheduling id. This is used to identify the sensor or radio to schedule.
 

Functions

int sensor_scheduling_init (const struct device *timer)
 Initialize the sensor scheduling module.
 
int sensor_scheduling_add_schedule (sensor_scheduling_cfg_t *schedule)
 Add a schedule to the sensor scheduling module.
 
int sensor_scheduling_remove_schedule (sensor_scheduling_cfg_t *schedule)
 Remove a schedule from the sensor scheduling module.
 
int sensor_scheduling_reset_schedule (sensor_scheduling_cfg_t *schedule)
 Reset a schedule in the sensor scheduling module. This will set the alarm to trigger at the given frequency from the last event time. Triggering the next event based on the last event time keeps the schedule from drifting.
 
int sensor_scheduling_get_seconds (void)
 Get the current time in seconds since the scheduling module was initialized.
 

Detailed Description

This is a library to schedule sensor readings and radio transmissions.

Author
Tyler Garcia
Version
0.1
Date
2025-05-12

Function Documentation

◆ sensor_scheduling_add_schedule()

int sensor_scheduling_add_schedule ( sensor_scheduling_cfg_t schedule)

Add a schedule to the sensor scheduling module.

Parameters
scheduleThe schedule to add
Returns
int 0 on success, negative error code on failure

◆ sensor_scheduling_get_seconds()

int sensor_scheduling_get_seconds ( void  )

Get the current time in seconds since the scheduling module was initialized.

Returns
int The current time in seconds

◆ sensor_scheduling_init()

int sensor_scheduling_init ( const struct device *  timer)

Initialize the sensor scheduling module.

Parameters
timerThe timer device to use for scheduling
Returns
int 0 on success, negative error code on failure

◆ sensor_scheduling_remove_schedule()

int sensor_scheduling_remove_schedule ( sensor_scheduling_cfg_t schedule)

Remove a schedule from the sensor scheduling module.

Parameters
scheduleThe schedule to remove
Returns
int 0 on success, negative error code on failure

◆ sensor_scheduling_reset_schedule()

int sensor_scheduling_reset_schedule ( sensor_scheduling_cfg_t schedule)

Reset a schedule in the sensor scheduling module. This will set the alarm to trigger at the given frequency from the last event time. Triggering the next event based on the last event time keeps the schedule from drifting.

Parameters
scheduleThe schedule to reset
Returns
int 0 on success, negative error code on failure