K-FSW ec10f94
Modular flight software on Zephyr, for small satellites
Loading...
Searching...
No Matches
Temperature sensor example module

Data Structures

struct  kfsw_temp_example_reading
 

Functions

int kfsw_temp_example_init (void)
 
int kfsw_temp_example_get (struct kfsw_temp_example_reading *reading)
 

Variables

const struct kfsw_param_definition_set kfsw_temp_example_param_definitions
 

Description

A sensor read into a parameter table, for housekeeping.

Function Documentation

◆ kfsw_temp_example_get()

int kfsw_temp_example_get ( struct kfsw_temp_example_reading *  reading)

#include <temperature_sensor_example.h>

Copy a consistent snapshot of the cached reading.

Doesn't touch the ADC, so it can be called from a parameter sample callback. Readings older than CONFIG_KFSW_TEMP_EXAMPLE_MAX_AGE_MS are returned as invalid.

Parameters
readingDestination.
Returns
0 on success, -EINVAL for a NULL destination, or -EACCES before initialization.

◆ kfsw_temp_example_init()

int kfsw_temp_example_init ( void  )

#include <temperature_sensor_example.h>

Initialize the cache and start the configured sensor.

Queues the first reading on the module's workqueue. The cache stays invalid until that read completes; initialization does not wait for a conversion.

Returns
0 when initialized, or a negative errno if the sensor cannot be bound.

Variable Documentation

◆ kfsw_temp_example_param_definitions

const struct kfsw_param_definition_set kfsw_temp_example_param_definitions
extern

#include <temperature_sensor_example.h>

Parameter table of the temperature example.