-
Notifications
You must be signed in to change notification settings - Fork 2
/
settings.h
63 lines (41 loc) · 1.07 KB
/
settings.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#ifndef SETTINGS_H
#define SETTINGS_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
//FIR filter order
#define FILTER_ORDER (uint32_t)45
//FIR filter coefficients number
#define NUM_OF_COEF (uint32_t)FILTER_ORDER + 1
//splitter, from 0 to SPLITTER core 0 (M7) is calculating, from SPLITTER to NUM_OF_COEF core 1 (M4) is calculating
#define SPLITTER (uint32_t)35
#define ADC_BUF_START_ADDRESS (uint32_t)0x38000000
#define ADC_BUF_END_ADDRESS (uint32_t)(ADC_BUF_START_ADDRESS + (NUM_OF_COEF-1)*sizeof(uint32_t))
#define ADC_DMA_ADDRESS (uint32_t)0x38000400
typedef enum
{
READY_FOR_OUTPUT,
CALCULATION,
} FIR_State;
typedef struct
{
const uint32_t splitter,
coefNum;
float result_c0,
result_c1;
FIR_State *FIR_state_c0,
*FIR_state_c1;
const float * const FIR_coef;
uint32_t *bufferStartPointer,
*bufferCurrentPointer,
*bufferEndPointer;
} FIR_Instance;
extern FIR_Instance FIR_filter;
extern const float FIR_coefficients[NUM_OF_COEF];
extern FIR_State FIR_state_core0,
FIR_state_core1;
#ifdef __cplusplus
}
#endif
#endif