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
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
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
32void battery_task_fn(struct k_work *work);
33
44int task_battery_manual_run(const struct device *dev, const struct task_battery_args *args,
45 struct tdf_battery_state *tdf);
46
54#define BATTERY_TASK(define_mem, define_config, bat_ptr) \
55 IF_ENABLED(define_config, ({.name = "bat", \
56 .task_id = TASK_ID_BATTERY, \
57 .exec_type = TASK_EXECUTOR_WORKQUEUE, \
58 .flags = TASK_FLAG_ARG_IS_DEVICE, \
59 .task_arg.dev = bat_ptr, \
60 .executor.workqueue = { \
61 .worker_fn = battery_task_fn, \
62 }}))
63
64#ifdef __cplusplus
65}
66#endif
67
68#endif /* INFUSE_SDK_INCLUDE_INFUSE_TASK_RUNNER_TASKS_BATTERY_H_ */
Battery measurement task.
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 TDF definitions.
Task Runner task scheduling.
Battery task arguments.
Definition battery_args.h:31
General battery state.
Definition definitions.h:154
Task Runner Task API.