Infuse-IoT SDK API 0.0.1
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
generic_sim.h File Reference

Generic simulated sensor. More...

#include <zephyr/device.h>
#include <zephyr/drivers/sensor.h>

Go to the source code of this file.

Functions

void generic_sim_reset (const struct device *dev, bool reset_rc)
 Reset all channels back to unconfigured.
void generic_sim_func_rc (const struct device *dev, int resume_rc, int suspend_rc, int fetch_rc)
 Configure return value for generic sensor device.
int generic_sim_channel_set (const struct device *dev, enum sensor_channel chan, struct sensor_value val)
 Set the value to be returned for a given channel.

Detailed Description

Generic simulated sensor.

Author
Jordan Yates jorda.nosp@m.n@em.nosp@m.beint.nosp@m..com

SPDX-License-Identifier: FSL-1.1-ALv2

Function Documentation

◆ generic_sim_channel_set()

int generic_sim_channel_set ( const struct device * dev,
enum sensor_channel chan,
struct sensor_value val )

Set the value to be returned for a given channel.

Parameters
devGeneric simulator sensor device
chanChannel to configure
valValue to return when channel queried
Return values
0on success
-EINVALon invalid channel

◆ generic_sim_func_rc()

void generic_sim_func_rc ( const struct device * dev,
int resume_rc,
int suspend_rc,
int fetch_rc )

Configure return value for generic sensor device.

Parameters
devGeneric simulator sensor device to reset
resume_rcReturn code for PM_DEVICE_ACTION_RESUME
suspend_rcReturn code for PM_DEVICE_ACTION_SUSPEND
fetch_rcReturn code for sensor_sample_fetch

◆ generic_sim_reset()

void generic_sim_reset ( const struct device * dev,
bool reset_rc )

Reset all channels back to unconfigured.

Parameters
devGeneric simulator sensor device to reset
reset_rcReset the return codes