nRF Connect SDK API 3.3.99
Loading...
Searching...
No Matches
sensor_sim_ctrl_def.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2021 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5 */
6
7#include "sensor_sim_ctrl.h"
8
9/* This configuration file is included only once from sensor_sim_ctrl module and holds
10 * information about wave signals that should be generated by simulated sensor.
11 */
12
13/* This structure enforces the header file is included only once in the build.
14 * Violating this requirement triggers a multiple definition error at link time.
15 */
17
18static const struct sim_wave sim_waves[] = {
19 {
20 .label = "sine",
21 .wave_param = {
22 .type = WAVE_GEN_TYPE_SINE,
23 .period_ms = 2000,
24 .offset = 0.0,
25 .amplitude = 0.5,
26 .noise = 0.1,
27 }
28 },
29 {
30 .label = "triangle",
31 .wave_param = {
33 .period_ms = 2000,
34 .offset = 0.0,
35 .amplitude = 0.5,
36 .noise = 0.1,
37 },
38 },
39 {
40 .label = "square",
41 .wave_param = {
43 .period_ms = 2000,
44 .offset = 0.0,
45 .amplitude = 0.5,
46 .noise = 0.1,
47 },
48 },
49 {
50 .label = "idle",
51 .wave_param = {
52 .type = WAVE_GEN_TYPE_NONE,
53 .period_ms = 0,
54 .offset = 0.0,
55 .amplitude = 0.0,
56 .noise = 0.1,
57 },
58 },
59};
60
61BUILD_ASSERT(ARRAY_SIZE(sim_waves) <= UCHAR_MAX);
62
63static const struct sim_signal_params sim_signal_params = {
64 .chan = SENSOR_CHAN_ACCEL_XYZ,
65 .waves = sim_waves,
66 .waves_cnt = ARRAY_SIZE(sim_waves),
67};
@ WAVE_GEN_TYPE_SQUARE
Definition wave_gen.h:32
@ WAVE_GEN_TYPE_TRIANGLE
Definition wave_gen.h:31
@ WAVE_GEN_TYPE_SINE
Definition wave_gen.h:30
@ WAVE_GEN_TYPE_NONE
Definition wave_gen.h:33
static const struct sim_wave sim_waves[]
Definition sensor_sim_ctrl_def.h:18
const struct @5 sensor_sim_ctrl_def_include_once
static const struct sim_wave sim_waves[]
Definition sensor_sim_ctrl_def.h:18
Definition sensor_sim_ctrl.h:23
Definition sensor_sim_ctrl.h:18