Infuse-IoT SDK API 0.0.1
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
battery.h
Go to the documentation of this file.
1
9
10#ifndef INFUSE_SDK_INCLUDE_INFUSE_TASK_RUNNER_TASKS_BATTERY_H_
11#define INFUSE_SDK_INCLUDE_INFUSE_TASK_RUNNER_TASKS_BATTERY_H_
12
13#include <zephyr/kernel.h>
14
16
19
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
31
37void battery_task_fn(struct k_work *work);
38
49int task_battery_manual_run(const struct device *dev, const struct task_battery_args *args,
50 struct tdf_battery_state *tdf);
51
59#define BATTERY_TASK(define_mem, define_config, bat_ptr) \
60 IF_ENABLED(define_config, ({.name = "bat", \
61 .task_id = TASK_ID_BATTERY, \
62 .exec_type = TASK_EXECUTOR_WORKQUEUE, \
63 .flags = TASK_FLAG_ARG_IS_DEVICE, \
64 .task_arg.dev = bat_ptr, \
65 .executor.workqueue = { \
66 .worker_fn = battery_task_fn, \
67 }}))
68
72
73#ifdef __cplusplus
74}
75#endif
76
77#endif /* INFUSE_SDK_INCLUDE_INFUSE_TASK_RUNNER_TASKS_BATTERY_H_ */
Autogenerated TDF definitions.
int task_battery_manual_run(const struct device *dev, const struct task_battery_args *args, struct tdf_battery_state *tdf)
Manually run the core battery sampling logic.
void battery_task_fn(struct k_work *work)
Battery task function.
Autogenerated task runner task IDs.
Task Runner task scheduling.
Battery task arguments (task_battery_args)
Definition battery_args.h:39
General battery state.
Definition definitions.h:164
Task Runner Task API.