nRF Connect SDK API
2.8.0
Loading...
Searching...
No Matches
wave_gen.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
11
#ifndef _WAVE_GEN_H
12
#define _WAVE_GEN_H
13
21
#ifdef __cplusplus
22
extern
"C"
{
23
#endif
24
25
#include <zephyr/types.h>
26
29
enum
wave_gen_type
{
30
WAVE_GEN_TYPE_SINE
,
31
WAVE_GEN_TYPE_TRIANGLE
,
32
WAVE_GEN_TYPE_SQUARE
,
33
WAVE_GEN_TYPE_NONE
,
34
35
WAVE_GEN_TYPE_COUNT
,
36
};
37
40
struct
wave_gen_param
{
42
enum
wave_gen_type
type
;
43
45
uint32_t
period_ms
;
46
48
double
offset
;
49
51
double
amplitude
;
52
54
double
noise
;
55
};
56
67
int
wave_gen_generate_value
(uint32_t time,
const
struct
wave_gen_param
*params,
double
*out_val);
68
69
#ifdef __cplusplus
70
}
71
#endif
72
77
#endif
/* _WAVE_GEN_H */
wave_gen_generate_value
int wave_gen_generate_value(uint32_t time, const struct wave_gen_param *params, double *out_val)
Generate wave value.
wave_gen_type
wave_gen_type
Available generated wave types.
Definition
wave_gen.h:29
WAVE_GEN_TYPE_SQUARE
@ WAVE_GEN_TYPE_SQUARE
Definition
wave_gen.h:32
WAVE_GEN_TYPE_TRIANGLE
@ WAVE_GEN_TYPE_TRIANGLE
Definition
wave_gen.h:31
WAVE_GEN_TYPE_COUNT
@ WAVE_GEN_TYPE_COUNT
Definition
wave_gen.h:35
WAVE_GEN_TYPE_SINE
@ WAVE_GEN_TYPE_SINE
Definition
wave_gen.h:30
WAVE_GEN_TYPE_NONE
@ WAVE_GEN_TYPE_NONE
Definition
wave_gen.h:33
wave_gen_param::offset
double offset
Definition
wave_gen.h:48
wave_gen_param::period_ms
uint32_t period_ms
Definition
wave_gen.h:45
wave_gen_param::type
enum wave_gen_type type
Definition
wave_gen.h:42
wave_gen_param::noise
double noise
Definition
wave_gen.h:54
wave_gen_param::amplitude
double amplitude
Definition
wave_gen.h:51
wave_gen_param
Generated wave parameters.
Definition
wave_gen.h:40
include
wave_gen.h
Generated on Thu Nov 14 2024 12:11:44 for nRF Connect SDK API by
1.12.0