Infuse-IoT SDK API 0.0.1
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
gnss.h
Go to the documentation of this file.
1
9
10#ifndef INFUSE_SDK_INCLUDE_INFUSE_TASK_RUNNER_TASKS_GNSS_H_
11#define INFUSE_SDK_INCLUDE_INFUSE_TASK_RUNNER_TASKS_GNSS_H_
12
13#include <zephyr/kernel.h>
14#include <zephyr/drivers/gnss.h>
15
18
19#include <infuse/task_runner/tasks/gnss_args.h>
21
22/* UBLOX definitions are used since they are more specific than generic Zephyr */
23#include <infuse/gnss/ubx/cfg.h>
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
29BUILD_ASSERT((uint32_t)TASK_GNSS_CONSTELLATIONS_GPS == (uint32_t)GNSS_SYSTEM_GPS);
30BUILD_ASSERT((uint32_t)TASK_GNSS_CONSTELLATIONS_GLONASS == (uint32_t)GNSS_SYSTEM_GLONASS);
31BUILD_ASSERT((uint32_t)TASK_GNSS_CONSTELLATIONS_GALILEO == (uint32_t)GNSS_SYSTEM_GALILEO);
32BUILD_ASSERT((uint32_t)TASK_GNSS_CONSTELLATIONS_BEIDOU == (uint32_t)GNSS_SYSTEM_BEIDOU);
33BUILD_ASSERT((uint32_t)TASK_GNSS_CONSTELLATIONS_QZSS == (uint32_t)GNSS_SYSTEM_QZSS);
34BUILD_ASSERT((uint32_t)TASK_GNSS_CONSTELLATIONS_IRNSS == (uint32_t)GNSS_SYSTEM_IRNSS);
35BUILD_ASSERT((uint32_t)TASK_GNSS_CONSTELLATIONS_SBAS == (uint32_t)GNSS_SYSTEM_SBAS);
36BUILD_ASSERT((uint32_t)TASK_GNSS_CONSTELLATIONS_IMES == (uint32_t)GNSS_SYSTEM_IMES);
37
38#ifdef CONFIG_TASK_RUNNER_TASK_GNSS_THREAD
39
47void gnss_task_fn(const struct task_schedule *schedule, struct k_poll_signal *terminate,
48 void *gnss_dev);
49
57#define GNSS_TASK(define_mem, define_config, gnss_ptr) \
58 IF_ENABLED(define_mem, (K_THREAD_STACK_DEFINE(gnss_stack_area, \
59 CONFIG_TASK_RUNNER_TASK_GNSS_STACK_SIZE); \
60 struct k_thread gnss_thread_obj)) \
61 IF_ENABLED(define_config, \
62 ({ \
63 .name = "gnss", \
64 .task_id = TASK_ID_GNSS, \
65 .exec_type = TASK_EXECUTOR_THREAD, \
66 .flags = TASK_FLAG_ARG_IS_DEVICE, \
67 .task_arg.dev = gnss_ptr, \
68 .executor.thread = \
69 { \
70 .thread = &gnss_thread_obj, \
71 .task_fn = gnss_task_fn, \
72 .stack = gnss_stack_area, \
73 .stack_size = K_THREAD_STACK_SIZEOF(gnss_stack_area), \
74 }, \
75 }))
76
77#endif /* CONFIG_TASK_RUNNER_TASK_GNSS_THREAD */
78
79#ifdef CONFIG_TASK_RUNNER_TASK_GNSS_WORKQUEUE
80
86void gnss_task_fn(struct k_work *work);
87
95#define GNSS_TASK(define_mem, define_config, gnss_ptr) \
96 IF_ENABLED(define_config, ({.name = "gnss", \
97 .task_id = TASK_ID_GNSS, \
98 .exec_type = TASK_EXECUTOR_WORKQUEUE, \
99 .flags = TASK_FLAG_ARG_IS_DEVICE, \
100 .task_arg.dev = gnss_ptr, \
101 .executor.workqueue = { \
102 .worker_fn = gnss_task_fn, \
103 }}))
104
105#endif /* CONFIG_TASK_RUNNER_TASK_GNSS_WORKQUEUE */
106
107#ifdef __cplusplus
108}
109#endif
110
111#endif /* INFUSE_SDK_INCLUDE_INFUSE_TASK_RUNNER_TASKS_GNSS_H_ */
Autogenerated task runner task IDs.
Task Runner task scheduling.
Schedule for a given task.
Definition schedule.h:166
Task Runner Task API.
TASK_GNSS_CONSTELLATIONS_GPS
Definition gnss.h:29
TASK_GNSS_CONSTELLATIONS_QZSS
Definition gnss.h:33
TASK_GNSS_CONSTELLATIONS_IRNSS
Definition gnss.h:34
TASK_GNSS_CONSTELLATIONS_SBAS
Definition gnss.h:35
TASK_GNSS_CONSTELLATIONS_BEIDOU
Definition gnss.h:32
TASK_GNSS_CONSTELLATIONS_GLONASS
Definition gnss.h:30
TASK_GNSS_CONSTELLATIONS_GALILEO
Definition gnss.h:31
TASK_GNSS_CONSTELLATIONS_IMES
Definition gnss.h:36