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

Battery measurement task. More...

Go to the source code of this file.

Macros

#define BATTERY_TASK(define_mem, define_config, bat_ptr)
 Battery task.
 

Functions

void battery_task_fn (struct k_work *work)
 Battery task function.
 
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.
 

Detailed Description

Battery measurement task.

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

SPDX-License-Identifier: FSL-1.1-ALv2

Macro Definition Documentation

◆ BATTERY_TASK

#define BATTERY_TASK ( define_mem,
define_config,
bat_ptr )
Value:
IF_ENABLED(define_config, ({.name = "bat", \
.task_id = TASK_ID_BATTERY, \
.exec_type = TASK_EXECUTOR_WORKQUEUE, \
.task_arg.dev = bat_ptr, \
.executor.workqueue = { \
.worker_fn = battery_task_fn, \
}}))
void battery_task_fn(struct k_work *work)
Battery task function.
@ TASK_ID_BATTERY
Definition infuse_task_ids.h:26
@ TASK_FLAG_ARG_IS_DEVICE
task_arg union is a device pointer
Definition task.h:38
@ TASK_EXECUTOR_WORKQUEUE
Task runs on the system workqueue.
Definition task.h:33

Battery task.

Parameters
define_memDefine memory
define_configDefine task
bat_ptrFuel-gauge device bound to task

Function Documentation

◆ battery_task_fn()

void battery_task_fn ( struct k_work * work)

Battery task function.

Parameters
workDelayable work item

◆ task_battery_manual_run()

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.

Parameters
devFuel gauge device
argsTask arguments
tdfBattery parameters that were measured
Return values
0on success
-errnoon failure