0
mirror of https://github.com/OneOfEleven/uv-k5-firmware-custom.git synced 2025-04-28 06:11:24 +03:00

241 lines
5.9 KiB
C
Raw Normal View History

2023-09-09 08:03:56 +01:00
/* 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 UI_MENU_H
#define UI_MENU_H
#include <stdbool.h>
#include <stdint.h>
2023-10-08 17:14:13 +01:00
#include "audio.h" // voice_id_t
typedef struct {
2023-10-08 20:23:37 +01:00
const char name[7]; // menu display area only has room for 6 characters
voice_id_t voice_id;
uint8_t menu_id;
} t_menu_item;
// currently this list MUST be in exactly the same order
2023-10-08 20:23:37 +01:00
// as the other menu list "g_menu_list[]" in "ui/menu.c", otherwise
// you'll have big problems
//
// I'm going to fix that so that you can reorder the menu items
// anyway you like simply by editing this list only (the other list
// you just leave as is, or any which way, it won't matter)
//
2023-09-09 08:03:56 +01:00
enum
{
// ************************************
2023-09-09 08:03:56 +01:00
MENU_SQL = 0,
MENU_CHAN_SQL,
2023-09-09 08:03:56 +01:00
MENU_STEP,
MENU_BANDWIDTH,
MENU_TX_POWER,
2023-11-24 17:51:59 +00:00
// MENU_TX_POWER_USER,
MENU_RX_CDCSS,
MENU_RX_CTCSS,
MENU_TX_CDCSS,
MENU_TX_CTCSS,
MENU_SHIFT_DIR,
2023-09-09 08:03:56 +01:00
MENU_OFFSET,
MENU_TX_TO,
MENU_CROSS_VFO,
MENU_DUAL_WATCH,
2023-10-23 14:02:54 +01:00
MENU_SCAN_CAR_RESUME,
MENU_SCAN_HOLD,
MENU_SCRAMBLER,
MENU_BUSY_CHAN_LOCK,
MENU_MEM_SAVE,
MENU_MEM_NAME,
MENU_MEM_DEL,
MENU_MEM_DISP,
MENU_BAT_SAVE,
#ifdef ENABLE_VOX
2023-09-09 08:03:56 +01:00
MENU_VOX,
#endif
MENU_AUTO_BACKLITE,
MENU_AUTO_BACKLITE_ON_TX_RX,
2023-10-18 11:31:30 +01:00
#ifdef ENABLE_CONTRAST
MENU_CONTRAST,
2023-11-09 12:22:54 +00:00
#endif
#ifdef ENABLE_SCAN_RANGES
MENU_SCAN_RANGES,
#endif
2023-09-09 08:03:56 +01:00
MENU_S_ADD1,
MENU_S_ADD2,
2023-10-18 11:31:30 +01:00
#ifdef ENABLE_NOAA
MENU_NOAA_SCAN,
#endif
MENU_1_CALL,
2023-09-09 08:03:56 +01:00
MENU_STE,
MENU_RP_STE,
MENU_MIC_GAIN,
2023-10-17 21:22:40 +01:00
MENU_COMPAND,
2023-11-18 18:44:10 +00:00
#ifdef ENABLE_PANADAPTER
MENU_PANADAPTER,
#endif
2023-10-18 11:31:30 +01:00
#ifdef ENABLE_TX_AUDIO_BAR
2023-10-17 21:22:40 +01:00
MENU_TX_BAR,
#endif
2023-10-17 21:22:40 +01:00
MENU_RX_BAR,
2023-09-09 08:03:56 +01:00
MENU_S_LIST,
MENU_SLIST1,
MENU_SLIST2,
2023-12-08 14:04:02 +00:00
#ifdef ENABLE_DTMF_CALLING
2023-09-09 08:03:56 +01:00
MENU_ANI_ID,
2023-12-08 14:04:02 +00:00
#endif
MENU_UP_CODE,
MENU_DN_CODE,
MENU_DTMF_ST,
2023-12-08 14:04:02 +00:00
#ifdef ENABLE_DTMF_CALLING
MENU_DTMF_HOLD,
MENU_DTMF_LIST,
2023-11-26 05:57:00 +00:00
MENU_DTMF_RSP,
MENU_DTMF_DCD,
2023-12-08 14:04:02 +00:00
#endif
#ifdef ENABLE_DTMF_LIVE_DECODER
MENU_DTMF_LIVE_DEC,
#endif
2023-12-06 08:42:17 +00:00
#ifdef ENABLE_DTMF_TIMING_SETTINGS
MENU_DTMF_PRE,
MENU_DTMF_1ST_PERSIST,
MENU_DTMF_HASH_PERSIST,
MENU_DTMF_PERSIST,
MENU_DTMF_INTERVAL,
2023-12-06 08:42:17 +00:00
#endif
2023-10-25 13:07:12 +01:00
#ifdef ENABLE_MDC1200
2023-10-25 19:26:22 +01:00
MENU_MDC1200_MODE,
2023-10-25 13:07:12 +01:00
MENU_MDC1200_ID,
#endif
2023-10-18 11:31:30 +01:00
MENU_PTT_ID,
MENU_ROGER_MODE,
2023-10-18 11:31:30 +01:00
#ifdef ENABLE_ALARM
MENU_ALARM_MODE,
#endif
MENU_PON_MSG,
MENU_VOLTAGE,
MENU_BAT_TXT,
MENU_MOD_MODE,
#ifdef ENABLE_AM_FIX
2023-10-24 18:36:29 +01:00
// MENU_AM_FIX,
#endif
#ifdef ENABLE_AM_FIX_TEST1
MENU_AM_FIX_TEST1,
#endif
2023-10-18 11:31:30 +01:00
MENU_BEEP,
#ifdef ENABLE_VOICE
MENU_VOICE,
#endif
#ifdef ENABLE_KEYLOCK
2023-10-18 11:31:30 +01:00
MENU_AUTO_KEY_LOCK,
#endif
#ifdef ENABLE_SIDE_BUTT_MENU
2023-10-06 22:16:03 +01:00
MENU_SIDE1_SHORT,
MENU_SIDE1_LONG,
MENU_SIDE2_SHORT,
MENU_SIDE2_LONG,
#endif
MENU_VERSION,
2023-09-09 08:03:56 +01:00
MENU_RESET,
// ************************************
// ************************************
// ************************************
2023-09-19 09:16:57 +01:00
// items after here are normally hidden
2023-10-20 21:48:44 +08:00
MENU_BAT_CAL, // battery voltage calibration
2023-11-23 20:43:13 +00:00
#ifdef ENABLE_TX_POWER_CAL_MENU
MENU_TX_CALI, // L/M/H TX power calibration
#endif
#ifdef ENABLE_FM_DEV_CAL_MENU
MENU_TX_FM_DEV_CAL, // FM deviation calibration
#endif
#ifdef ENABLE_F_CAL_MENU
2023-10-20 21:48:44 +08:00
MENU_F_CALI, // 26MHz reference xtal calibration
#endif
MENU_SCRAMBLER_EN, // scrambler enable/disable
2023-10-20 21:48:44 +08:00
MENU_FREQ_LOCK, // lock to a selected region
MENU_350_EN, // 350~400MHz enable/disable
MENU_174_TX, // 174~350MHz TX enable/disable
MENU_350_TX, // 350~400MHz TX enable/disable
MENU_470_TX, // 470MHz and up TX enable/disable
MENU_TX_EN, // disable the TX entirely
// ************************************
// ************************************
// ************************************
2023-09-09 08:03:56 +01:00
};
2023-10-08 20:23:37 +01:00
extern const t_menu_item g_menu_list[];
extern uint8_t g_menu_list_sorted[];
2023-10-30 02:10:36 +00:00
extern const char g_sub_menu_mod_mode[3][4];
2023-11-24 11:52:11 +00:00
extern const char g_sub_menu_tx_power[4][5];
2023-10-08 20:23:37 +01:00
extern const char g_sub_menu_shift_dir[3][4];
extern const char g_sub_menu_bandwidth[2][7];
2023-10-08 20:23:37 +01:00
extern const char g_sub_menu_off_on[2][4];
extern const char g_sub_menu_bat_save[5][9];
extern const char g_sub_menu_tx_timeout[11][7];
extern const char g_sub_menu_dual_watch[3][10];
extern const char g_sub_menu_cross_vfo[3][10];
2023-10-25 19:26:22 +01:00
#ifdef ENABLE_VOICE
2023-10-08 20:23:37 +01:00
extern const char g_sub_menu_voice[3][4];
2023-10-25 19:26:22 +01:00
#endif
2023-10-24 18:16:16 +01:00
extern const char g_sub_menu_scan_car_resume[3][8];
2023-11-24 11:52:11 +00:00
extern const char g_sub_menu_mem_disp[4][12];
2023-10-25 19:26:22 +01:00
#ifdef ENABLE_ALARM
extern const char g_sub_menu_alarm_mode[2][5];
2023-10-25 19:26:22 +01:00
#endif
2023-12-08 14:04:02 +00:00
#ifdef ENABLE_DTMF_CALLING
extern const char g_sub_menu_dtmf_rsp[4][9];
#endif
2023-11-02 10:00:51 +00:00
extern const char g_sub_menu_ptt_id[5][16];
2023-10-25 19:26:22 +01:00
#ifdef ENABLE_MDC1200
2023-11-24 11:52:11 +00:00
extern const char g_sub_menu_mdc1200_mode[4][5];
2023-10-25 19:26:22 +01:00
#endif
2023-11-24 11:52:11 +00:00
extern const char g_sub_menu_pwr_on_msg[4][11];
extern const char g_sub_menu_roger_mode[3][8];
extern const char g_sub_menu_reset[2][4];
2023-10-08 20:23:37 +01:00
extern const char g_sub_menu_backlight[8][7];
extern const char g_sub_menu_rx_tx[4][6];
2023-09-23 17:23:21 +01:00
#ifdef ENABLE_AM_FIX_TEST1
extern const char g_sub_menu_AM_FIX_test1[4][8];
2023-10-25 19:26:22 +01:00
#endif
extern const char g_sub_menu_bat_text[3][8];
#ifdef ENABLE_SIDE_BUTT_MENU
extern const char g_sub_menu_side_butt[9][16];
#endif
2023-10-25 19:26:22 +01:00
2023-10-20 18:00:36 +01:00
extern bool g_in_sub_menu;
2023-10-25 19:26:22 +01:00
2023-10-08 20:23:37 +01:00
extern uint8_t g_menu_cursor;
2023-10-20 16:06:38 +01:00
extern int8_t g_menu_scroll_direction;
2023-10-08 20:23:37 +01:00
extern int32_t g_sub_menu_selection;
2023-10-25 19:26:22 +01:00
2023-10-08 20:23:37 +01:00
extern char g_edit_original[17];
extern char g_edit[17];
extern int g_edit_index;
void UI_SortMenu(const bool hide_hidden);
2023-09-09 08:03:56 +01:00
void UI_DisplayMenu(void);
#endif