Infuse-IoT SDK API 0.0.1
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
imu.h
Go to the documentation of this file.
1
9
10#ifndef INFUSE_SDK_INCLUDE_INFUSE_TASK_RUNNER_TASKS_IMU_H_
11#define INFUSE_SDK_INCLUDE_INFUSE_TASK_RUNNER_TASKS_IMU_H_
12
13#include <zephyr/kernel.h>
14
15#include <infuse/drivers/imu.h>
18
20
21#ifdef __cplusplus
22extern "C" {
23#endif
24
32void imu_task_fn(const struct task_schedule *schedule, struct k_poll_signal *terminate,
33 void *imu_dev);
34
42#define IMU_TASK(define_mem, define_config, imu_ptr) \
43 IF_ENABLED(define_mem, \
44 (K_THREAD_STACK_DEFINE(imu_stack_area, CONFIG_TASK_RUNNER_TASK_IMU_STACK_SIZE); \
45 struct k_thread imu_thread_obj)) \
46 IF_ENABLED(define_config, \
47 ({ \
48 .name = "imu", \
49 .task_id = TASK_ID_IMU, \
50 .exec_type = TASK_EXECUTOR_THREAD, \
51 .flags = TASK_FLAG_ARG_IS_DEVICE, \
52 .task_arg.dev = imu_ptr, \
53 .executor.thread = \
54 { \
55 .thread = &imu_thread_obj, \
56 .task_fn = imu_task_fn, \
57 .stack = imu_stack_area, \
58 .stack_size = K_THREAD_STACK_SIZEOF(imu_stack_area), \
59 }, \
60 }))
61
62#ifdef __cplusplus
63}
64#endif
65
66#endif /* INFUSE_SDK_INCLUDE_INFUSE_TASK_RUNNER_TASKS_IMU_H_ */
Specialised driver API for IMU devices.
Task Runner task scheduling.
Schedule for a given task.
Definition schedule.h:168
Task Runner Task API.
void imu_task_fn(const struct task_schedule *schedule, struct k_poll_signal *terminate, void *imu_dev)
IMU task function.