forked from DualTachyon/uv-k5-firmware
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsettings.h
161 lines (142 loc) · 3.66 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
/* Copyright 2023 Dual Tachyon
* Copyright 2023 OneOfEleven
* https://github.com/DualTachyon
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef SETTINGS_H
#define SETTINGS_H
#include <stdbool.h>
#include <stdint.h>
#include "radio.h"
enum {
F_LOCK_OFF = 0U,
F_LOCK_FCC = 1U,
F_LOCK_CE = 2U,
F_LOCK_PMR = 3U,
};
enum {
SCAN_RESUME_TO = 0U,
SCAN_RESUME_CO = 1U,
SCAN_RESUME_SE = 2U,
};
enum {
CROSS_BAND_OFF = 0U,
CROSS_BAND_CHAN_A = 1U,
CROSS_BAND_CHAN_B = 2U,
};
enum {
DUAL_WATCH_OFF = 0U,
DUAL_WATCH_CHAN_A = 1U,
DUAL_WATCH_CHAN_B = 2U,
};
enum {
FREQUENCY_DEVIATION_OFF = 0U,
FREQUENCY_DEVIATION_ADD = 1U,
FREQUENCY_DEVIATION_SUB = 2U,
};
enum {
OUTPUT_POWER_LOW = 0U,
OUTPUT_POWER_MID = 1U,
OUTPUT_POWER_HIGH = 2U,
};
enum CHANNEL_DisplayMode_t {
MDF_FREQUENCY = 0U,
MDF_CHANNEL = 1U,
MDF_NAME = 2U,
};
typedef enum CHANNEL_DisplayMode_t CHANNEL_DisplayMode_t;
// 1o11
#if defined(ENABLE_MDC1200)
enum MDC1200_Mode_t {
MDC1200_MODE_OFF = 0U,
MDC1200_MODE_BOT = 1U, // BEGIN OF TX
MDC1200_MODE_EOT = 2U, // END OF TX
MDC1200_MODE_BOTH = 3U,
};
typedef enum MDC1200_Mode_t MDC1200_Mode_t;
#endif
typedef struct {
uint32_t POWER_ON_PASSWORD;
uint8_t ScreenChannel[2];
uint8_t FreqChannel[2];
uint8_t MrChannel[2];
uint8_t RX_VFO;
uint8_t TX_VFO;
uint8_t SQUELCH_LEVEL;
uint8_t TX_TIMEOUT_TIMER;
bool KEY_LOCK;
uint8_t CHANNEL_DISPLAY_MODE;
uint8_t TAIL_NOTE_ELIMINATION;
uint8_t VFO_OPEN;
uint8_t DUAL_WATCH;
uint8_t CROSS_BAND_RX_TX;
uint8_t BACKLIGHT;
uint8_t SCAN_RESUME_MODE;
uint8_t SCAN_LIST_DEFAULT;
uint8_t SCAN_LIST_ENABLED[2];
uint8_t SCANLIST_PRIORITY_CH1[2];
uint8_t SCANLIST_PRIORITY_CH2[2];
uint8_t AUTO_KEYPAD_LOCK;
uint16_t FM_FrequencyPlaying;
bool DTMF_SIDE_TONE;
uint8_t ROGER;
uint8_t REPEATER_TAIL_TONE_ELIMINATION;
uint8_t KEY_1_SHORT_PRESS_ACTION;
uint8_t KEY_1_LONG_PRESS_ACTION;
uint8_t KEY_2_SHORT_PRESS_ACTION;
uint8_t KEY_2_LONG_PRESS_ACTION;
uint8_t MIC_SENSITIVITY;
uint8_t MIC_SENSITIVITY_TUNING;
uint8_t CHAN_1_CALL;
char ANI_DTMF_ID[8];
char DTMF_UP_CODE[16];
char DTMF_DOWN_CODE[16];
char DTMF_SEPARATE_CODE;
char DTMF_GROUP_CALL_CODE;
uint8_t DTMF_DECODE_RESPONSE;
uint8_t DTMF_AUTO_RESET_TIME;
uint16_t DTMF_PRELOAD_TIME;
uint16_t DTMF_FIRST_CODE_PERSIST_TIME;
uint16_t DTMF_HASH_CODE_PERSIST_TIME;
uint16_t DTMF_CODE_PERSIST_TIME;
uint16_t DTMF_CODE_INTERVAL_TIME;
uint16_t MDC1200_ID;
} EEPROM_Config_t;
typedef struct {
VFO_Info_t Info[2];
} EEPROM_VFO_t;
typedef struct {
int16_t BK4819_XTAL_FREQ_LOW;
uint16_t EEPROM_1F8A;
uint16_t EEPROM_1F8C;
uint8_t VOLUME_GAIN;
uint8_t DAC_GAIN;
} EEPROM_Calibration_t;
#if defined(ENABLE_FMRADIO)
typedef struct {
uint16_t SelectedFrequency;
uint8_t SelectedChannel;
bool IsMrMode;
} EEPROM_FM_t;
extern EEPROM_FM_t gFM;
#endif
extern EEPROM_Config_t gEeprom;
extern EEPROM_VFO_t gVFO;
extern EEPROM_Calibration_t gCalibration;
void SETTINGS_SaveFM(void);
void SETTINGS_SaveVfoIndices(void);
void SETTINGS_SaveSettings(void);
void SETTINGS_SaveChannel(uint8_t Channel, uint8_t VFO, const VFO_Info_t *pVFO, uint8_t Mode);
void SETTINGS_UpdateChannel(uint8_t Channel, const VFO_Info_t *pVFO, bool bUpdate);
#endif