Infuse-IoT SDK API 0.0.1
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
environmental.h
Go to the documentation of this file.
1
9
10#ifndef INFUSE_SDK_INCLUDE_INFUSE_TASK_RUNNER_TASKS_ENVIRONMENTAL_H_
11#define INFUSE_SDK_INCLUDE_INFUSE_TASK_RUNNER_TASKS_ENVIRONMENTAL_H_
12
13#include <zephyr/kernel.h>
14
17
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
27 const struct device *primary;
29 const struct device *secondary;
30};
31
37void environmental_task_fn(struct k_work *work);
38
47#define ENVIRONMENTAL_TASK(define_mem, define_config, env_primary, env_secondary) \
48 IF_ENABLED(define_mem, (const struct task_environmental_devices _env_task_devices = { \
49 .primary = env_primary, \
50 .secondary = env_secondary, \
51 })) \
52 IF_ENABLED(define_config, ({.name = "env", \
53 .task_id = TASK_ID_ENVIRONMENTAL, \
54 .exec_type = TASK_EXECUTOR_WORKQUEUE, \
55 .task_arg.const_arg = &_env_task_devices, \
56 .executor.workqueue = { \
57 .worker_fn = environmental_task_fn, \
58 }}))
59
60#ifdef __cplusplus
61}
62#endif
63
64#endif /* INFUSE_SDK_INCLUDE_INFUSE_TASK_RUNNER_TASKS_ENVIRONMENTAL_H_ */
void environmental_task_fn(struct k_work *work)
Environmental task function.
Task Runner task scheduling.
Configuration struct to hold multiple devices.
Definition environmental.h:25
const struct device * secondary
Secondary environmental sensor, used if a channel doesn't exist on primary.
Definition environmental.h:29
const struct device * primary
Primary environmental sensor, used in preference to secondary.
Definition environmental.h:27
Task Runner Task API.