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
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
34
35BUILD_ASSERT((uint32_t)TASK_GNSS_CONSTELLATIONS_GPS == (uint32_t)GNSS_SYSTEM_GPS);
36BUILD_ASSERT((uint32_t)TASK_GNSS_CONSTELLATIONS_GLONASS == (uint32_t)GNSS_SYSTEM_GLONASS);
37BUILD_ASSERT((uint32_t)TASK_GNSS_CONSTELLATIONS_GALILEO == (uint32_t)GNSS_SYSTEM_GALILEO);
38BUILD_ASSERT((uint32_t)TASK_GNSS_CONSTELLATIONS_BEIDOU == (uint32_t)GNSS_SYSTEM_BEIDOU);
39BUILD_ASSERT((uint32_t)TASK_GNSS_CONSTELLATIONS_QZSS == (uint32_t)GNSS_SYSTEM_QZSS);
40BUILD_ASSERT((uint32_t)TASK_GNSS_CONSTELLATIONS_IRNSS == (uint32_t)GNSS_SYSTEM_IRNSS);
41BUILD_ASSERT((uint32_t)TASK_GNSS_CONSTELLATIONS_SBAS == (uint32_t)GNSS_SYSTEM_SBAS);
42BUILD_ASSERT((uint32_t)TASK_GNSS_CONSTELLATIONS_IMES == (uint32_t)GNSS_SYSTEM_IMES);
43
44#ifdef CONFIG_TASK_RUNNER_TASK_GNSS_THREAD
45
53void gnss_task_fn(const struct task_schedule *schedule, struct k_poll_signal *terminate,
54 void *gnss_dev);
55
63#define GNSS_TASK(define_mem, define_config, gnss_ptr) \
64 IF_ENABLED(define_mem, (K_THREAD_STACK_DEFINE(gnss_stack_area, \
65 CONFIG_TASK_RUNNER_TASK_GNSS_STACK_SIZE); \
66 struct k_thread gnss_thread_obj)) \
67 IF_ENABLED(define_config, \
68 ({ \
69 .name = "gnss", \
70 .task_id = TASK_ID_GNSS, \
71 .exec_type = TASK_EXECUTOR_THREAD, \
72 .flags = TASK_FLAG_ARG_IS_DEVICE, \
73 .task_arg.dev = gnss_ptr, \
74 .executor.thread = \
75 { \
76 .thread = &gnss_thread_obj, \
77 .task_fn = gnss_task_fn, \
78 .stack = gnss_stack_area, \
79 .stack_size = K_THREAD_STACK_SIZEOF(gnss_stack_area), \
80 }, \
81 }))
82
83#endif /* CONFIG_TASK_RUNNER_TASK_GNSS_THREAD */
84
85#ifdef CONFIG_TASK_RUNNER_TASK_GNSS_WORKQUEUE
86
92void gnss_task_fn(struct k_work *work);
93
101#define GNSS_TASK(define_mem, define_config, gnss_ptr) \
102 IF_ENABLED(define_config, ({.name = "gnss", \
103 .task_id = TASK_ID_GNSS, \
104 .exec_type = TASK_EXECUTOR_WORKQUEUE, \
105 .flags = TASK_FLAG_ARG_IS_DEVICE, \
106 .task_arg.dev = gnss_ptr, \
107 .executor.workqueue = { \
108 .worker_fn = gnss_task_fn, \
109 }}))
110
111#endif /* CONFIG_TASK_RUNNER_TASK_GNSS_WORKQUEUE */
112
116
117#ifdef __cplusplus
118}
119#endif
120
121#endif /* INFUSE_SDK_INCLUDE_INFUSE_TASK_RUNNER_TASKS_GNSS_H_ */
Autogenerated GNSS task arguments.
@ TASK_GNSS_CONSTELLATIONS_QZSS
QZSS constellation.
Definition gnss_args.h:51
@ TASK_GNSS_CONSTELLATIONS_IRNSS
IRNSS constellation.
Definition gnss_args.h:53
@ TASK_GNSS_CONSTELLATIONS_SBAS
SBAS constellation.
Definition gnss_args.h:55
@ TASK_GNSS_CONSTELLATIONS_GLONASS
GLONASS constellation.
Definition gnss_args.h:45
@ TASK_GNSS_CONSTELLATIONS_IMES
IMES constellation.
Definition gnss_args.h:57
@ TASK_GNSS_CONSTELLATIONS_BEIDOU
BeiDou constellation.
Definition gnss_args.h:49
@ TASK_GNSS_CONSTELLATIONS_GPS
GPS constellation.
Definition gnss_args.h:43
@ TASK_GNSS_CONSTELLATIONS_GALILEO
Galileo constellation.
Definition gnss_args.h:47
void gnss_task_fn(const struct task_schedule *schedule, struct k_poll_signal *terminate, void *gnss_dev)
GNSS task function.
Autogenerated task runner task IDs.
Task Runner task scheduling.
Schedule for a given task.
Definition schedule.h:169
Task Runner Task API.