uv-k5-firmware/misc.h

185 lines
5.2 KiB
C
Raw Normal View History

/* Copyright 2023 Dual Tachyon
* 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 MISC_H
#define MISC_H
#include <stdbool.h>
#include <stdint.h>
2023-08-26 18:20:06 +08:00
enum {
FLASHLIGHT_OFF = 0U,
FLASHLIGHT_ON = 1U,
FLASHLIGHT_BLINK = 2U,
};
extern const uint32_t *gUpperLimitFrequencyBandTable;
extern const uint32_t *gLowerLimitFrequencyBandTable;
extern bool gSetting_350TX;
extern bool gSetting_KILLED;
extern bool gSetting_200TX;
extern bool gSetting_500TX;
extern bool gSetting_350EN;
extern uint8_t gSetting_F_LOCK;
extern bool gSetting_ScrambleEnable;
extern uint8_t gSetting_F_LOCK;
extern uint32_t gCustomPasswordKey[4];
extern bool bIsCheckExistingPassword;
extern uint8_t gEEPROM_1EC0_0[8];
extern uint8_t gEEPROM_1EC0_1[8];
extern uint8_t gEEPROM_1EC0_2[8];
extern uint8_t gEEPROM_1EC0_3[8];
2023-08-26 19:13:18 +08:00
extern uint16_t gEEPROM_RSSI_CALIB[3][4];
extern uint16_t gEEPROM_1F8A;
extern uint16_t gEEPROM_1F8C;
extern uint8_t gMR_ChannelParameters[207];
2023-08-16 05:39:26 +08:00
extern volatile bool gNextTimeslice500ms;
2023-08-15 06:38:59 +08:00
extern volatile uint16_t g_2000032E;
extern volatile uint16_t g_2000033A;
2023-08-16 05:39:26 +08:00
extern volatile uint16_t gTxTimerCountdown;
2023-08-15 06:38:59 +08:00
extern volatile uint16_t g_20000342;
extern volatile uint16_t g_2000034C;
extern volatile uint16_t g_20000356;
2023-08-16 02:02:42 +08:00
extern uint16_t g_20000362;
extern uint8_t g_2000036B;
2023-08-26 18:20:06 +08:00
extern uint8_t gKeyLockCountdown;
extern uint8_t g_2000036D;
2023-08-14 19:28:09 +08:00
extern uint8_t g_2000036E;
extern uint8_t g_2000036F;
2023-08-14 19:28:09 +08:00
extern uint8_t g_20000370;
extern uint8_t g_20000371[2];
extern uint8_t g_20000373;
2023-08-14 19:28:09 +08:00
extern uint8_t g_20000375;
extern uint8_t g_20000376;
extern uint8_t g_20000377;
2023-08-15 21:24:40 +08:00
extern uint8_t gVFO_RSSI_Level[2];
2023-08-14 19:28:09 +08:00
extern uint8_t g_2000037E;
2023-08-26 18:20:06 +08:00
extern uint8_t gBatteryVoltageIndex;
2023-08-15 06:38:59 +08:00
extern volatile uint8_t g_20000381;
2023-08-16 02:02:42 +08:00
extern uint8_t g_20000382;
2023-08-15 00:30:30 +08:00
extern uint8_t g_20000383;
2023-08-14 19:28:09 +08:00
extern uint16_t g_2000038E;
2023-08-26 18:20:06 +08:00
extern uint8_t g_20000393;
extern bool g_20000394;
2023-08-24 20:55:40 +08:00
extern uint8_t gKeypadLocked;
2023-08-14 05:40:33 +08:00
extern uint8_t g_200003AA;
2023-08-16 06:46:09 +08:00
extern bool g_CDCSS_Lost;
2023-08-26 19:41:11 +08:00
extern uint8_t gCDCSSCodeReceived;
2023-08-16 06:46:09 +08:00
extern bool g_CTCSS_Lost;
extern bool g_CxCSS_TAIL_Found;
extern bool g_VOX_Lost;
2023-08-26 19:41:11 +08:00
extern bool g_SquelchLost;
2023-08-26 18:20:06 +08:00
extern uint8_t gFlashLightState;
2023-08-14 19:28:09 +08:00
extern uint16_t g_200003B6;
2023-08-26 18:20:06 +08:00
extern uint16_t g_200003B8;
2023-08-14 19:28:09 +08:00
extern uint8_t g_200003BC;
extern uint8_t g_200003BD;
2023-08-14 19:28:09 +08:00
extern uint8_t g_200003BE;
2023-08-26 18:20:06 +08:00
extern bool g_200003C1;
extern uint8_t g_200003C3;
2023-08-26 18:20:06 +08:00
extern uint8_t g_200003C4;
extern uint16_t g_200003E2;
extern volatile uint16_t gFlashLightBlinkCounter;
extern uint8_t g_200003FD;
2023-08-14 19:28:09 +08:00
extern uint8_t g_20000400;
2023-08-15 21:24:40 +08:00
extern uint8_t g_20000410;
extern uint8_t g_20000411;
2023-08-16 02:02:42 +08:00
extern uint8_t g_20000413;
extern uint8_t g_20000415;
extern uint8_t g_20000416;
extern uint8_t g_2000041F;
2023-08-15 00:30:30 +08:00
extern uint8_t g_20000420;
2023-08-16 02:02:42 +08:00
extern uint8_t g_20000427;
2023-08-26 08:47:17 +08:00
extern bool gKeyBeingHeld;
extern bool gPttIsPressed;
2023-08-26 18:20:06 +08:00
extern uint8_t gPttDebounceCounter;
2023-08-16 06:54:04 +08:00
extern uint8_t gDTMF_WriteIndex;
2023-08-15 00:30:30 +08:00
extern uint8_t g_20000438;
2023-08-22 06:47:16 +08:00
extern uint8_t gMenuListCount;
2023-08-26 18:20:06 +08:00
extern uint8_t g_20000442;
2023-08-14 19:28:09 +08:00
extern uint8_t g_20000458;
2023-08-26 08:46:21 +08:00
extern uint8_t g_CxCSS_Type;
extern uint8_t g_CxCSS_Index;
2023-08-14 19:28:09 +08:00
extern uint8_t g_2000045C;
2023-08-26 18:20:06 +08:00
extern uint8_t g_2000045D;
extern uint8_t g_2000045F;
2023-08-14 19:28:09 +08:00
extern uint8_t g_20000461;
extern uint8_t g_20000464;
2023-08-26 18:20:06 +08:00
extern uint8_t gAircopySendCountdown;
2023-08-16 06:46:09 +08:00
extern uint8_t gFSKWriteIndex;
2023-08-16 02:02:42 +08:00
extern uint8_t g_20000474;
2023-08-24 20:55:40 +08:00
extern char g_20000D1C[15];
2023-08-16 06:54:04 +08:00
extern char gDTMF_Received[16];
2023-08-22 06:47:16 +08:00
extern bool gIsDtmfContactValid;
extern char gDTMF_ID[4];
extern char gDTMF_Contact0[4];
extern char gDTMF_Contact1[4];
2023-08-24 20:55:40 +08:00
extern uint8_t g_CalloutAndDTMF_State;
2023-08-14 05:40:33 +08:00
2023-08-14 19:28:09 +08:00
extern bool gIs_A_Scan;
extern bool gIsNoaaMode;
2023-08-15 18:14:43 +08:00
extern volatile bool gNextTimeslice;
2023-08-16 02:02:42 +08:00
extern uint8_t gNoaaChannel;
2023-08-14 19:28:09 +08:00
extern bool gUpdateDisplay;
2023-08-26 18:14:43 +08:00
extern uint8_t gFmRadioCountdown;
2023-08-14 19:28:09 +08:00
extern uint8_t gA_Scan_Channel;
extern uint8_t gDebounceCounter;
extern uint8_t gDTMF_AUTO_RESET_TIME;
extern uint8_t gF_LOCK;
extern char gNumberForPrintf[8];
extern uint8_t gNumberOffset;
2023-08-14 19:28:09 +08:00
extern uint8_t gScanChannel;
extern uint32_t gScanFrequency;
2023-08-15 21:24:40 +08:00
extern uint8_t gScanPauseMode;
2023-08-14 19:28:09 +08:00
extern uint8_t gScanState;
extern uint8_t gShowChPrefix;
2023-08-15 06:38:59 +08:00
extern volatile uint16_t gSystickCountdown2;
extern volatile uint8_t gSystickCountdown3;
extern volatile uint8_t gSystickCountdown4;
extern volatile uint16_t gSystickCountdown11;
extern volatile bool gSystickFlag0;
2023-08-16 05:39:26 +08:00
extern volatile bool gNextTimeslice40ms;
2023-08-15 06:38:59 +08:00
extern volatile bool gSystickFlag5;
2023-08-15 18:14:43 +08:00
extern volatile bool gBatterySaveCountdownExpired;
2023-08-15 06:38:59 +08:00
extern volatile bool gSystickFlag7;
extern volatile bool gSystickFlag8;
extern volatile bool gSystickFlag9;
extern volatile bool gSystickFlag10;
extern volatile bool gSystickFlag11;
extern volatile uint16_t ScanPauseDelayIn10msec;
2023-08-14 05:40:33 +08:00
2023-08-16 06:46:09 +08:00
extern uint16_t gFM_FrequencyDeviation;
extern uint16_t gCurrentRSSI;
// --------
2023-08-14 19:28:09 +08:00
void NUMBER_Append(char Digit);
void NUMBER_Get(char *pDigits, uint32_t *pInteger);
void NUMBER_ToDigits(uint32_t Value, char *pDigits);
#endif