/*
 * ui_menu_internal.h
 *
 *  Created on: 24.12.2016
 *      Author: danilo
 */

#ifndef DRIVERS_UI_UI_MENU_INTERNAL_H_
#define DRIVERS_UI_UI_MENU_INTERNAL_H_

#include "uhsdr_types.h"
#define UiMenuDesc(a)

//
// Enumeration for menu.
enum
{
    MENU_DSP_NR_STRENGTH = 0,
    MENU_AM_DISABLE,
    MENU_CW_DISABLE,
    MENU_DIGI_DISABLE,
    MENU_DEMOD_SAM,
    MENU_SSB_AUTO_MODE_SELECT,
    MENU_CW_AUTO_MODE_SELECT,
    MENU_FM_MODE_ENABLE,
    MENU_FM_GEN_SUBAUDIBLE_TONE,
    MENU_FM_DET_SUBAUDIBLE_TONE,
    MENU_FM_TONE_BURST_MODE,
    MENU_FM_DEV_MODE,
//    MENU_AGC_MODE,
//    MENU_RF_GAIN_ADJ,
//    MENU_CUSTOM_AGC,
//    MENU_AGC_WDSP_SWITCH,
    MENU_AGC_WDSP_MODE,
    MENU_AGC_WDSP_SLOPE,
    MENU_AGC_WDSP_TAU_DECAY,
    MENU_AGC_WDSP_THRESH,
    MENU_AGC_WDSP_HANG_ENABLE,
    MENU_AGC_WDSP_HANG_TIME,
    MENU_AGC_WDSP_HANG_THRESH,
    MENU_AGC_WDSP_TAU_HANG_DECAY,
    MENU_CODEC_GAIN_MODE,
    MENU_NOISE_BLANKER_SETTING,
    MENU_RX_FREQ_CONV,
    MENU_MIC_LINE_MODE,
    MENU_MIC_TYPE,
    MENU_MIC_GAIN,
    MENU_LINE_GAIN,
    MENU_ALC_RELEASE,
    MENU_ALC_POSTFILT_GAIN,
    MENU_TX_COMPRESSION_LEVEL,
    MENU_KEYER_MODE,
    MENU_KEYER_SPEED,
    MENU_KEYER_WEIGHT,
    MENU_SIDETONE_GAIN,
    MENU_SIDETONE_FREQUENCY,
    MENU_PADDLE_REVERSE,
    MENU_CW_TX_RX_DELAY,
    MENU_CW_OFFSET_MODE,
	MENU_CW_DECODER,
	MENU_CW_DECODER_THRESH,
//	MENU_CW_DECODER_AVERAGE,
	MENU_CW_DECODER_BLOCKSIZE,
//	MENU_CW_DECODER_AGC,
	MENU_CW_DECODER_NOISECANCEL,
	MENU_CW_DECODER_SPIKECANCEL,
	MENU_CW_DECODER_USE_3_GOERTZEL,
	MENU_CW_DECODER_SNAP_ENABLE,
	MENU_CW_DECODER_SHOW_CW_LED,
    MENU_TCXO_MODE,
    MENU_TCXO_C_F,
    MENU_SCOPE_SPEED,
    MENU_SPECTRUM_FILTER_STRENGTH,
    MENU_SCOPE_TRACE_COLOUR,
    MENU_SCOPE_TRACE_HL_COLOUR,
	MENU_SCOPE_BACKGROUND_HL_COLOUR,
	MENU_SCOPE_GRID_COLOUR,
    MENU_SPECTRUM_FREQSCALE_COLOUR,
    MENU_SPECTRUM_MAGNIFY,
    MENU_SCOPE_AGC_ADJUST,
    MENU_SCOPE_DB_DIVISION,
    MENU_SPECTRUM_CENTER_LINE_COLOUR,
    MENU_SCOPE_LIGHT_ENABLE,
    MENU_SPECTRUM_MODE,
    MENU_WFALL_COLOR_SCHEME,
    MENU_WFALL_STEP_SIZE,
    MENU_WFALL_OFFSET,
    MENU_WFALL_CONTRAST,
    MENU_WFALL_SPEED,
//  MENU_SCOPE_NOSIG_ADJUST,
//  MENU_WFALL_NOSIG_ADJUST,
//  MENU_S_METER,
    MENU_METER_COLOUR_UP,
    MENU_METER_COLOUR_DOWN,
    MENU_DBM_DISPLAY,
    MENU_DBM_CALIBRATE,
	MENU_UI_INVERSE_SCROLLING,
	MENU_FREQ_FONT,
    MENU_SPECTRUM_SIZE,
    MENU_BACKUP_CONFIG,
    MENU_RESTORE_CONFIG,
    MENU_HARDWARE_INFO,
    MENU_SAM_PLL_LOCKING_RANGE,
    MENU_SAM_PLL_STEP_RESPONSE,
    MENU_SAM_PLL_BANDWIDTH,
    MENU_SAM_FADE_LEVELER,
//    CONFIG_SAM_PLL_TAUR,
//    CONFIG_SAM_PLL_TAUI,
//    CONFIG_SAM_SIDEBAND,
    MENU_CONFIG_ENABLE,
    MENU_RESTART_CODEC,
    CONFIG_FREQ_STEP_MARKER_LINE,
    CONFIG_STEP_SIZE_BUTTON_SWAP,
    CONFIG_BAND_BUTTON_SWAP,
    CONFIG_TX_DISABLE,
    CONFIG_TX_OUT_ENABLE,
    CONFIG_AUDIO_MAIN_SCREEN_MENU_SWITCH,
    CONFIG_MUTE_LINE_OUT_TX,
    CONFIG_TXRX_SWITCH_AUDIO_MUTE,
    CONFIG_LCD_AUTO_OFF_MODE,
    CONFIG_VOLTMETER_CALIBRATION,
    MENU_LOW_POWER_SHUTDOWN,
    CONFIG_LOW_POWER_THRESHOLD,
    CONFIG_DISP_FILTER_BANDWIDTH,
    CONFIG_MAX_VOLUME,
//    CONFIG_MAX_RX_GAIN,
    CONFIG_LINEOUT_GAIN,
    CONFIG_BEEP_ENABLE,
    CONFIG_BEEP_FREQ,
    CONFIG_BEEP_VOLUME,
    CONFIG_CAT_ENABLE,
    CONFIG_FREQUENCY_CALIBRATE,
    CONFIG_FREQ_LIMIT_RELAX,
    CONFIG_FREQ_MEM_LIMIT_RELAX,
    CONFIG_IQ_AUTO_CORRECTION,

    CONFIG_80M_RX_IQ_GAIN_BAL,
    CONFIG_80M_RX_IQ_PHASE_BAL,
    CONFIG_10M_RX_IQ_GAIN_BAL,
    CONFIG_10M_RX_IQ_PHASE_BAL,

    CONFIG_160M_TX_IQ_GAIN_BAL,
    CONFIG_160M_TX_IQ_PHASE_BAL,
	CONFIG_80M_TX_IQ_GAIN_BAL,
    CONFIG_80M_TX_IQ_PHASE_BAL,
	CONFIG_40M_TX_IQ_GAIN_BAL,
    CONFIG_40M_TX_IQ_PHASE_BAL,
	CONFIG_30M_TX_IQ_GAIN_BAL,
    CONFIG_30M_TX_IQ_PHASE_BAL,
    CONFIG_20M_TX_IQ_GAIN_BAL,
    CONFIG_20M_TX_IQ_PHASE_BAL,
	CONFIG_17M_TX_IQ_GAIN_BAL,
    CONFIG_17M_TX_IQ_PHASE_BAL,
    CONFIG_15M_TX_IQ_GAIN_BAL,
    CONFIG_15M_TX_IQ_PHASE_BAL,
	CONFIG_12M_TX_IQ_GAIN_BAL,
    CONFIG_12M_TX_IQ_PHASE_BAL,
    CONFIG_10M_TX_IQ_GAIN_BAL,
    CONFIG_10M_TX_IQ_PHASE_BAL,
    CONFIG_10M_UP_TX_IQ_GAIN_BAL,
    CONFIG_10M_UP_TX_IQ_PHASE_BAL,
    CONFIG_6M_TX_IQ_GAIN_BAL,
    CONFIG_6M_TX_IQ_PHASE_BAL,

    CONFIG_160M_TX_IQ_GAIN_BAL_TRANS_OFF,
    CONFIG_160M_TX_IQ_PHASE_BAL_TRANS_OFF,
    CONFIG_80M_TX_IQ_GAIN_BAL_TRANS_OFF,
	CONFIG_80M_TX_IQ_PHASE_BAL_TRANS_OFF,
    CONFIG_40M_TX_IQ_GAIN_BAL_TRANS_OFF,
    CONFIG_40M_TX_IQ_PHASE_BAL_TRANS_OFF,
    CONFIG_30M_TX_IQ_GAIN_BAL_TRANS_OFF,
    CONFIG_30M_TX_IQ_PHASE_BAL_TRANS_OFF,
    CONFIG_20M_TX_IQ_GAIN_BAL_TRANS_OFF,
    CONFIG_20M_TX_IQ_PHASE_BAL_TRANS_OFF,
    CONFIG_17M_TX_IQ_GAIN_BAL_TRANS_OFF,
    CONFIG_17M_TX_IQ_PHASE_BAL_TRANS_OFF,
    CONFIG_15M_TX_IQ_GAIN_BAL_TRANS_OFF,
    CONFIG_15M_TX_IQ_PHASE_BAL_TRANS_OFF,
    CONFIG_12M_TX_IQ_GAIN_BAL_TRANS_OFF,
    CONFIG_12M_TX_IQ_PHASE_BAL_TRANS_OFF,
    CONFIG_10M_TX_IQ_GAIN_BAL_TRANS_OFF,
    CONFIG_10M_TX_IQ_PHASE_BAL_TRANS_OFF,
    CONFIG_10M_UP_TX_IQ_GAIN_BAL_TRANS_OFF,
    CONFIG_10M_UP_TX_IQ_PHASE_BAL_TRANS_OFF,
    CONFIG_6M_TX_IQ_GAIN_BAL_TRANS_OFF,
    CONFIG_6M_TX_IQ_PHASE_BAL_TRANS_OFF,

    CONFIG_CW_PA_BIAS,
    CONFIG_PA_BIAS,
    CONFIG_FWD_REV_PWR_DISP,
    CONFIG_RF_FWD_PWR_NULL,
    CONFIG_FWD_REV_COUPLING_2200M_ADJ,
    CONFIG_FWD_REV_COUPLING_630M_ADJ,
    CONFIG_FWD_REV_COUPLING_160M_ADJ,
    CONFIG_FWD_REV_COUPLING_80M_ADJ,
    CONFIG_FWD_REV_COUPLING_40M_ADJ,
    CONFIG_FWD_REV_COUPLING_20M_ADJ,
    CONFIG_FWD_REV_COUPLING_15M_ADJ,
    CONFIG_FWD_REV_COUPLING_10M_ADJ,
    CONFIG_FWD_REV_COUPLING_6M_ADJ,
    CONFIG_FWD_REV_COUPLING_2M_ADJ,
    CONFIG_FWD_REV_COUPLING_70CM_ADJ,
    CONFIG_FWD_REV_COUPLING_23CM_ADJ,
    CONFIG_FWD_REV_SENSE_SWAP,
    CONFIG_XVTR_OFFSET_MULT,
    CONFIG_XVTR_FREQUENCY_OFFSET,
    CONFIG_XVTR_FREQUENCY_OFFSET_TX,
    CONFIG_2200M_5W_ADJUST,
    CONFIG_630M_5W_ADJUST,
    CONFIG_160M_5W_ADJUST,
    CONFIG_80M_5W_ADJUST,
    CONFIG_60M_5W_ADJUST,
    CONFIG_40M_5W_ADJUST,
    CONFIG_30M_5W_ADJUST,
    CONFIG_20M_5W_ADJUST,
    CONFIG_17M_5W_ADJUST,
    CONFIG_15M_5W_ADJUST,
    CONFIG_12M_5W_ADJUST,
    CONFIG_10M_5W_ADJUST,
    CONFIG_6M_5W_ADJUST,
    CONFIG_4M_5W_ADJUST,
    CONFIG_2M_5W_ADJUST,
    CONFIG_70CM_5W_ADJUST,
    CONFIG_23CM_5W_ADJUST,
    CONFIG_2200M_FULL_POWER_ADJUST,
    CONFIG_630M_FULL_POWER_ADJUST,
    CONFIG_160M_FULL_POWER_ADJUST,
    CONFIG_80M_FULL_POWER_ADJUST,
    CONFIG_60M_FULL_POWER_ADJUST,
    CONFIG_40M_FULL_POWER_ADJUST,
    CONFIG_30M_FULL_POWER_ADJUST,
    CONFIG_20M_FULL_POWER_ADJUST,
    CONFIG_17M_FULL_POWER_ADJUST,
    CONFIG_15M_FULL_POWER_ADJUST,
    CONFIG_12M_FULL_POWER_ADJUST,
    CONFIG_10M_FULL_POWER_ADJUST,
    CONFIG_6M_FULL_POWER_ADJUST,
    CONFIG_4M_FULL_POWER_ADJUST,
    CONFIG_2M_FULL_POWER_ADJUST,
    CONFIG_70CM_FULL_POWER_ADJUST,
    CONFIG_23CM_FULL_POWER_ADJUST,
#ifdef OBSOLETE_NR
    CONFIG_DSP_NR_DECORRELATOR_BUFFER_LENGTH,
    CONFIG_DSP_NR_FFT_NUMTAPS,
//    CONFIG_DSP_NR_POST_AGC_SELECT,
    CONFIG_DSP_NOTCH_CONVERGE_RATE,
    CONFIG_DSP_NOTCH_DECORRELATOR_BUFFER_LENGTH,
    CONFIG_DSP_NOTCH_FFT_NUMTAPS,
#endif
#ifdef USE_LMS_AUTONOTCH
    CONFIG_DSP_NOTCH_CONVERGE_RATE,
    CONFIG_DSP_NOTCH_DECORRELATOR_BUFFER_LENGTH,
    CONFIG_DSP_NOTCH_FFT_NUMTAPS,
#endif
//    CONFIG_AGC_TIME_CONSTANT,
    CONFIG_AM_TX_FILTER_DISABLE,
//    CONFIG_SSB_TX_FILTER_DISABLE,
    CONFIG_SSB_TX_FILTER,
    CONFIG_TUNE_POWER_LEVEL,
    CONFIG_TUNE_TONE_MODE,
//    CONFIG_SPECTRUM_FFT_WINDOW_TYPE,
    CONFIG_RESET_SER_EEPROM,
    CONFIG_RESET_SER_EEPROM_SIGNATURE,
    CONFIG_CAT_IN_SANDBOX,
    CONFIG_CAT_XLAT,
    CONFIG_CAT_PTT_RTS,
    CONFIG_REDUCE_POWER_ON_LOW_BANDS,
    CONFIG_REDUCE_POWER_ON_HIGH_BANDS,
    MENU_FP_CW_01,
    MENU_FP_CW_02,
    MENU_FP_CW_03,
    MENU_FP_CW_04,
    MENU_FP_AM_01,
    MENU_FP_AM_02,
    MENU_FP_AM_03,
    MENU_FP_AM_04,
    MENU_FP_SSB_01,
    MENU_FP_SSB_02,
    MENU_FP_SSB_03,
    MENU_FP_SSB_04,
//    MENU_FP_SAM_01,
//    MENU_FP_SAM_02,
//    MENU_FP_SAM_03,
//    MENU_FP_SAM_04,
    MENU_DEBUG_TX_AUDIO,
    CONFIG_I2C1_SPEED,
    CONFIG_I2C2_SPEED,
	MENU_DEBUG_ENABLE_INFO,
    MENU_DEBUG_CLONEOUT,
    MENU_DEBUG_CLONEIN,
//    MENU_DEBUG_NEW_NB,
//	MENU_DEBUG_NR_ENABLE,
//	MENU_DEBUG_NR_GAIN_SMOOTH_ENABLE,
	MENU_DEBUG_NR_GAIN_SHOW,
//	MENU_DEBUG_NR_LONG_TONE_ENABLE,
//	MENU_DEBUG_NR_LONG_TONE_THRESH,
//	MENU_DEBUG_NR_LONG_TONE_ALPHA,
//	MENU_DEBUG_NR_GAIN_SMOOTH_ALPHA,
//	MENU_DEBUG_NR_ALPHA,
//	MENU_DEBUG_NR_THRESH,
//	MENU_DEBUG_NR_VAD_TYPE,
//	MENU_DEBUG_NR_VAD_DELAY,
	MENU_DEBUG_NR_BETA,
//	MENU_DEBUG_NR_Mode,
//#if defined(STM32F7) || defined(STM32H7)
//	MENU_DEBUG_NR_FFT_SIZE,
//	MENU_DEBUG_NR_DEC_ENABLE,
//#endif
	MENU_DEBUG_NR_ASNR,
	MENU_DEBUG_NR_GAIN_SMOOTH_WIDTH,
	MENU_DEBUG_NR_GAIN_SMOOTH_THRESHOLD,
//	MENU_DEBUG_RTTY_ATC,
#ifdef USE_TWO_CHANNEL_AUDIO
	MENU_DEBUG_ENABLE_STEREO,
#endif
	//	MENU_DEBUG_CW_DECODER,
#ifdef USE_LEAKY_LMS
	MENU_DEBUG_LEAKY_LMS,
	MENU_DEBUG_NR_POST_AGC_SELECT,
	MENU_DEBUG_ANR_TAPS,
	MENU_DEBUG_ANR_DELAY,
	MENU_DEBUG_ANR_GAIN,
	MENU_DEBUG_ANR_LEAK,
#endif
	MENU_DEBUG_OSC_SI5351_PLLRESET,
	MENU_DEBUG_HMC1023_COARSE,
	MENU_DEBUG_HMC1023_FINE,
    MENU_DEBUG_HMC1023_GAIN,
    MENU_DEBUG_HMC1023_BYPASS,
    MENU_DEBUG_HMC1023_OPAMP,
    MENU_DEBUG_HMC1023_DRVR,
    MENU_DEBUG_TWINPEAKS_CORR_RUN,
    CONFIG_VSWR_PROTECTION_THRESHOLD,
    MENU_DEBUG_FREEDV_MODE,
    MENU_DEBUG_FREEDV_SQL_THRESHOLD,

    CONFIG_RTC_START,
    CONFIG_RTC_HOUR,
    CONFIG_RTC_MIN,
    CONFIG_RTC_SEC,
    CONFIG_RTC_RESET,
    CONFIG_RTC_CALIB,
    MENU_DYNAMICTUNE,
    MENU_DIGITAL_MODE_SELECT,
    MENU_DEBUG_CW_OFFSET_SHIFT_KEEP_SIGNAL,
    CONFIG_SMETER_ATTACK,
    CONFIG_SMETER_DECAY,
    MENU_DEBUG_SMOOTH_DYN_TUNE,
    CONFIG_BANDEF_SELECT,
    INFO_LO_TX_SUPR_DACs,
    MENU_DEBUG_CAL_LO_TX_SUPR_0,
    MENU_DEBUG_CAL_LO_TX_SUPR_1,
	CONFIG_WIDE_SPEC_DEF,
	MENU_NO_SHOW_BNDMEM,
	CONFIG_BANDCH_JUMP_SWAP,
	MENU_INPUT_STATE,
	MENU_BOX_COLOUR,
	MENU_TXTLINE_COLOUR,
	CONFIG_ENC1_REVERSE,
	CONFIG_ENC2_REVERSE,
	CONFIG_ENC3_REVERSE,
	CONFIG_ENC4_REVERSE,
	MENU_CW_MACRO_INTERVAL,
	MENU_CW_BEACON_INTERVAL,
	MENU_DEBUG_SHOW_GREETING,
	MENU_PEAK_IND_TUNE,
	MENU_CLEAR_PAN_ON_TX,
	MENU_SMETER_AM_NOT_LO,
	MENU_CW_FAST_MACRO_1_2,
	MENU_DEBUG_CLEAN_TX_CW_RTTY_BPSK,
	MENU_CW_SMOOTH,
    MENU_DEBUG_CB_27MC_TX_ENABLE,
    MENU_DEBUG_CB_26MC_TX_ENABLE,
    MENU_DEBUG_CB_12W_SSB_TX_ENABLE,
	MENU_DEBUG_CB_10W_TX_ENABLE,
	MENU_DEBUG_MEM_BW_MOD_BAND,
	MENU_DEBUG_ILLUM_BUTT,
	MENU_DEBUG_BPF_OPTION,
	MENU_DEBUG_XVTR_OFF_PA,
	MENU_DEBUG_BANDCODE,
	MENU_DEBUG_DISABLE_TP,
	MENU_DEBUG_FMENUS_SEL,
	MENU_DEBUG_F6_IND_SEL,
	MENU_DEBUG_F7_IND_SEL,
	MENU_DEBUG_ALT_PWR_CTRL,
	MENU_DEBUG_ALT_PWR_CTRL_VOL,
	MENU_DEBUG_IMPROV_IQ_ADJ,
	CONFIG_TX_REVERB_GAIN,
	CONFIG_TX_REVERB_DELAY,
    CONFIG_TX_EQ0,
    CONFIG_TX_EQ1,
    CONFIG_TX_EQ2,
    CONFIG_TX_EQ3,
    CONFIG_TX_EQ4,
	MENU_DEBUG_BEEP_GEN,
	MENU_DEBUG_BAND_OFF_160M,
	MENU_DEBUG_BAND_OFF_80M,
	MENU_DEBUG_BAND_OFF_60M,
	MENU_DEBUG_BAND_OFF_40M,
	MENU_DEBUG_BAND_OFF_30M,
	MENU_DEBUG_BAND_OFF_20M,
	MENU_DEBUG_BAND_OFF_17M,
	MENU_DEBUG_BAND_OFF_15M,
	MENU_DEBUG_BAND_OFF_12M,
	MENU_DEBUG_BAND_OFF_10M,
	MENU_DEBUG_BAND_OFF_6M,
	MENU_DEBUG_REDUCE_POWER_ON_LOW_BANDS_MORE,
	MENU_DEBUG_SHOW_SWR_ONLY_TUNE,
	MENU_DEBUG_CONTEST,
//	MENU_DEBUG_CONTEST_COLOUR,
    MAX_RADIO_CONFIG_ITEM   // Number of radio configuration menu items - This must ALWAYS remain as the LAST item!
};


// menu entry kind constants
enum MENU_KIND
{
    MENU_STOP = 0, // last entry in a menu / group
    MENU_ITEM, // standard menu entry
    MENU_GROUP, // menu group entry
    MENU_INFO, // just like a normal entry (read-only) but just for display purposes.
    MENU_SEP, // separator line
    MENU_BLANK, // blank
    MENU_TEXT,	// text output only
};


struct  MenuGroupDescriptor_s;

// items are stored in RAM
// Each menu group has to have a MenuGroupItem pointing to the descriptor
// a MenuGroupItem is used to keep track of the fold/unfold state and to link the
// Descriptors are stored in flash

typedef struct
{
    const uint16_t menuId; // backlink to the menu we are part of. That implies, an entry can only be part of a single menu group
    const uint16_t kind; // use the enum defined above to indicate what this entry represents
    const uint16_t number; // this is an identification number which is passed to the menu entry handled
    // for standard items it is the id of the value to be changed, intepretation is left to handler
    // MENU_GROUP: for menu groups this MUST BE the index in the menu group table, THIS IS USED INTERNALLY
    volatile bool* enabled;      // pointer to a variable which contains a boolean value to tell us if the menu entry is enabled right now, set to NULL if always enabled
    // this was a visual 3 letter identification which may be display, depending on the render approach
    const char* label;     // this is the label which will be display, depending on the render approach
} MenuDescriptor;

typedef struct
{
    bool unfolded;            // runtime variable, tells if the user wants to have this groups items to be shown
    uint16_t count;           // number of menu entries. This will be filled automatically on first use by internal code
    // do not write to this variable unless you know what you are doing.
    const MenuDescriptor* me; // pointer to the MenuDescriptor of this menu group in its parent menu. This is the backlink to our parent.
    // This will be filled automatically on first use by internal code in order to avoid search through the menu structure.
    // do not write to this variable unless you know what you are doing.
} MenuGroupState;

#ifdef HELP_MENU
typedef struct
{
	const uint16_t count;     // number of menu entries
	const char* txt;	 	  // text of help
} HelpDescriptor;
#endif

// This data structure is intended to be placed in flash
// all data is placed here at compile time
typedef struct MenuGroupDescriptor_s
{
    const MenuDescriptor* entries;          // array of member entries in the menu group
    MenuGroupState* state;                  // writable data structure for menu management, pointer has to go into RAM
    const MenuDescriptor* parent;           // pointer to the first element of the array in which our menu group is located in. It does not have
    // to point to the MENU_GROUP item, wich can be at any position in this array. Used to calculate the real
    // pointer later and to identify the parent menu group of this menu.
    // use NULL for top level menus here (i.e. no parent).
} MenuGroupDescriptor;


// Runtime management of menu entries for onscreen rendering.
typedef struct
{
    const MenuDescriptor* entryItem;
} MenuDisplaySlot;

#define MENU_START_IDX 0

extern const MenuGroupDescriptor groups[];

void UiMenu_UpdateItem(uint16_t select, MenuProcessingMode_t mode, int pos, int var, char* options, const char** txt_ptr_ptr, uint32_t* clr_ptr);
void UiMenu_DisplayValue(const char* value,uint32_t clr,uint16_t pos);

#endif /* DRIVERS_UI_UI_MENU_INTERNAL_H_ */

#ifdef HELP_MENU
const HelpDescriptor Helps[] =
{
    { MENU_SSB_AUTO_MODE_SELECT, "If enabled, the appropriate sideband mode for SSB and FreeDV is chosen as default for each band by its frequency.\0"},
    { MENU_DIGI_DISABLE, "Disable appearance of digital modes when pressing Mode button.\0"},
    { MENU_CW_DISABLE, "Disable appearance of CW mode when pressing Mode button.\0"},
    { MENU_AM_DISABLE, "Disable appearance of AM mode when pressing Mode button.\0"},
    { MENU_DEMOD_SAM, "Disable appearance of SyncAM modes when pressing Mode button.\0"},
    { MENU_SAM_PLL_LOCKING_RANGE, "SAM PLL Locking Range in Hz: this determines how far up and down from the carrier frequency of an AM station we can offtune the receiver, so that the PLL will still lock to the carrier.\0"},
    { MENU_SAM_PLL_STEP_RESPONSE, "Step response = Zeta = damping factor of the SAM PLL. Sets the stability and transient response of the PLL. Larger values give faster lock even if you are offtune, but PLL is also more sensitive.\0"},
    { MENU_SAM_PLL_BANDWIDTH, "Bandwidth of the PLL loop = OmegaN in Hz: smaller bandwidth = more stable lock. FAST LOCK SAM PLL - set Step response and PLL bandwidth to large values [eg. 80 / 350]; DX (SLOW & STABLE) SAM PLL - set Step response and PLL bandwidth to small values [eg. 30 / 100].\0"},
    { MENU_SAM_FADE_LEVELER, "Fade leveler (in AM/SAM mode) ON/OFF. Fade leveler is helpful in situations with very fast QSB of the carrier ´flutter´. It is designed to remove the rapidly changing carrier and replace it with a more stable carrier. If there is no QSB on the carrier, there is no change.\0"},
    { MENU_FM_MODE_ENABLE, "Disable appearance of FM mode when pressing Mode button.\0"},
    { MENU_FM_GEN_SUBAUDIBLE_TONE, "Enable generation of CTCSS tones during FM transmissions.\0"},
    { MENU_FM_DET_SUBAUDIBLE_TONE, "Enable detection of CTCSS tones during FM receive. RX is muted unless tone is detected.\0"},
    { MENU_FM_TONE_BURST_MODE, "Enabled sending of short tone at beginning of each FM transmission. Used to open repeaters. Available frequencies are 1750 Hz and 2135 Hz.\0"},
    { MENU_FM_DEV_MODE, "Select between normal and narrow deviation (5 and 2.5kHz) for FM RX/TX.\0"},
    { MENU_DEBUG_FREEDV_MODE, "Change active FreeDV mode. Please note, you have to reboot to activate new mode.\0"},
    { MENU_DEBUG_FREEDV_SQL_THRESHOLD, "If not OFF, FreeDV will squelch if detected SNR is below set value.\0"},
    { MENU_AGC_WDSP_MODE, "Choose a bundle of preset AGC parameters for the WDSP AGC: FAST / MED / SLOW / LONG / very LONG or switch OFF the AGC.\0"},
    { MENU_AGC_WDSP_SLOPE, "Slope of the AGC is the difference between the loudest signal and the quietest signal after the AGC action has taken place. Given in dB.\0"},
    { MENU_AGC_WDSP_TAU_DECAY, "Time constant for the AGC decay (speed of recovery of the AGC gain) in milliseconds.\0"},
    { MENU_AGC_WDSP_THRESH, "Threshold = Knee of the AGC: input signal level from which on the AGC action takes place. AGC threshold should be placed/adjusted just above the band noise for every particular RX situation to allow for optimal AGC action. The blue AGC box indicates when AGC action takes place and helps in adjusting this threshold.\0"},
    { MENU_AGC_WDSP_HANG_ENABLE, "Enable/Disable Hang AGC function: If enabled: after the signal has decreased, the gain of the AGC is held constant for a certain time period (the hang time) in order to allow for speech pauses without disturbing noise because of fast acting AGC.\0"},
    { MENU_AGC_WDSP_HANG_TIME, "Hang AGC: hang time is the time period over which the AGC gain is held constant when in AGC Hang mode. After this period the gain is increased fast.\0"},
    { MENU_AGC_WDSP_HANG_THRESH, "´Threshold´ for the Hang AGC: Hang AGC is useful for medium to strong signals. The Hang threshold determines the signal strength a signal has to exceed for Hang AGC to take place.\0"},
    { MENU_AGC_WDSP_TAU_HANG_DECAY, "Time constant for the Hang AGC decay (speed of recovery of the AGC gain after hang time has expired) in milliseconds.\0"},
    { MENU_CODEC_GAIN_MODE, "Sets the Codec IQ signal gain. Higher values represent higher gain. If set to AUTO the mcHF controls the gain so that the best dynamic range is used.\0"},
    { MENU_RX_FREQ_CONV, "Controls offset of the receiver IQ signal base frequency from the dial frequency. Use of +/-12Khz is recommended. Switching it to OFF is not recommended as it disables certain features.\0"},
    { MENU_BACKUP_CONFIG, "Backup your I2C Configuration to flash. If you don't have suitable I2C EEPROM installed this function is not available.\0"},
    { MENU_RESTORE_CONFIG, "Restore your I2C Configuration from flash. If you don't have suitable I2C EEPROM installed this function is not available.\0"},
    { CONFIG_RESET_SER_EEPROM, "Clear the EEPROM so that at next start all stored configuration data is reset to the values stored in Flash (see Backup/Restore).\0"},
    { CONFIG_RESET_SER_EEPROM_SIGNATURE, "Clear the EEPROMi signature but keep all config values. This is mainly for debugging purposes).\0"},
    { CONFIG_BANDEF_SELECT, "Select which band definition to use for ham bands. Original UHSDR or IARU Region 1 - 3.\0"},
    { CONFIG_FREQ_MEM_LIMIT_RELAX, "Select ON to save and restore frequencies which do not fit into the band during configuration saving (Power-Off or long press on Menu button).\0"},
    { CONFIG_TX_OUT_ENABLE, "Permit low power transmission even if the frequency is out of the official ham bands. DO NOT USE WITH CONNECTED ANTENNA! Use a dummy load!\0"},
    { CONFIG_AUDIO_MAIN_SCREEN_MENU_SWITCH, "Control if the screen automatically adapts Encoder value focus when switching between RX and TX.\0"},
    { CONFIG_MUTE_LINE_OUT_TX, "During transmission with frequency translation off, line out will carry one of the two signal channels. Good for CW but not very useful otherwise. You may switch this signal off here.\0"},
    { CONFIG_TXRX_SWITCH_AUDIO_MUTE, "When switching from RX to TX the audio and HF output will be muted for roughly VALUE ms. There are now several minimum times for muting defined in the firmware:<br/><br/> Input from Mic: 40ms<br/> Input from Line In: 40ms<br/> Digital Inputs (CW, USB): less than 1ms.<br/><br/> If the user defined 'TX Initial Muting Time' is set to more than zero, the maximum of both fixed input time and user defined time is used. Your microphone PTT switch is a potential source of noise if Mic is input! You need to increase the delay or change switches!\0"},
    { CONFIG_MAX_VOLUME, "Set maximum speaker&headphone volume.\0"},
    { CONFIG_LINEOUT_GAIN, "Set the constant gain level for the analog lineout jack.\0"},
    { CONFIG_BEEP_FREQ, "Set key beep frequency in Hz.\0"},
    { CONFIG_BEEP_VOLUME, "Set key beep volume.\0"},
    { CONFIG_CAT_IN_SANDBOX, "If On, frequency Changes made via CAT will not automatically switch bands and affect the manually selected frequencies.\0"},
    { CONFIG_CAT_XLAT, "Select which frequency is reported via CAT Interface to the connected PC in Digital IQ Mode. If ON, it reports the displayed frequency. If OFF, it reports the center frequency, which is more useful with SDR programs.\0"},
    { CONFIG_CAT_PTT_RTS, "The virtual serial port signal RTS can be used to switch to TX. Use with care, many CAT-able programs also set RTS to aktiv and make the TRX go to TX mode.\0"},
    { CONFIG_XVTR_OFFSET_MULT, "When connecting to a transverter, set this to 1 and set the XVERTER Offset to the LO Frequency of it. The mcHF frequency is multiplied by this factor before the offset is added, so anything but 1 will result in each Hz in the mcHF being displayed as 2 to 10 Hz change on display.\0"},
    { CONFIG_XVTR_FREQUENCY_OFFSET, "When transverter mode is enabled, this value is added to the mcHF frequency after being multiplied with the XVTR Offs/Mult. Use Step+ to set a good step width, much less turns with the dial knob if it is set to 1Mhz.\0"},
    { CONFIG_XVTR_FREQUENCY_OFFSET_TX, "When transverter mode is enabled, this value is added to the displayed mcHF TX frequency after being multiplied with the XVTR Offs/Mult. Setting it to 0 uses RX offset for TX. Use Step+ to set a good step width, much less turns with the dial knob if it is set to 1Mhz.\0"},
    { CONFIG_STEP_SIZE_BUTTON_SWAP, "If ON, Step- behaves like Step+ and vice versa.\0"},
    { CONFIG_BAND_BUTTON_SWAP, "If ON, Band- behaves like Band+ and vice versa.\0"},
    { CONFIG_BANDCH_JUMP_SWAP, "If ON, LongAction of Band+/- is band change, ShortAction is jump by freq on panorama width.\0"},
    { CONFIG_ENC1_REVERSE, "If ON, encoder 1 are reversed.\0"},
    { CONFIG_ENC2_REVERSE, "If ON, encoder 2 are reversed.\0"},
    { CONFIG_ENC3_REVERSE, "If ON, encoder 3 are reversed.\0"},
    { CONFIG_ENC4_REVERSE, "If ON, encoder 4 are reversed.\0"},
    { CONFIG_VOLTMETER_CALIBRATION, "Adjusts the displayed value of the voltmeter.\0"},
    { CONFIG_LOW_POWER_THRESHOLD, "Voltage threshold for voltage warning colors and auto shutdown.\0"},
    { MENU_LOW_POWER_SHUTDOWN, "Shutdown automatically when supply voltage is below threshold for 60 seconds (only in RX).\0"},
    { CONFIG_FREQUENCY_CALIBRATE, "Adjust the frequency correction of the local oscillator. Measure TX frequency and adjust until both match. Or use receive a know reference signal and zero-beat it and then adjust. More information in the Wiki.\0"},
    { CONFIG_RF_FWD_PWR_NULL, "Set the forward and reverse power sensors ADC zero power offset. This setting is enabled ONLY when Disp. Pwr (mW), is enabled. Needs SWR meter hardware modification to work. See Wiki Adjustment and Calibration.\0"},
    { CONFIG_FWD_REV_SENSE_SWAP, "Exchange the assignment of the Power/SWR FWD and REV measurement ADC. Use if your power meter does not show anything during TX.\0"},
    { CONFIG_I2C1_SPEED, "Sets speed of the I2C1 bus (Si570 oscillator and MCP9801 temperature sensor). Higher speeds provide quicker RX/TX switching but may also cause tuning issues (red digits). Be careful with speeds above 200 kHz.\0"},
    { CONFIG_I2C2_SPEED, "Sets speed of the I2C2 bus (Audio Codec and I2C EEPROM). Higher speeds provide quicker RX/TX switching, configuration save and power off. Speeds above 200 kHz are not recommended for unmodified mcHF. Many modified mcHF seem to run with 300kHz without problems.\0"},
    { CONFIG_IQ_AUTO_CORRECTION, "Receive IQ phase and amplitude imbalance can be automatically adjusted by the mcHF. Switch ON/OFF here. If OFF, it takes the following menu values for compensating the imbalance. The automatic algorithm achieves up to 60dB mirror rejection. See Wiki Adjustments and Calibration.\0"},
    { CONFIG_80M_RX_IQ_GAIN_BAL, "IQ Balance Adjust for all receive if frequency translation is NOT OFF. Requires USB/LSB/CW mode to be changeable.See Wiki Adjustments and Calibration.\0"},
    { CONFIG_80M_RX_IQ_PHASE_BAL, "IQ Phase Adjust for all receive if frequency translation is NOT OFF. Requires USB/LSB/CW mode to be changeable.See Wiki Adjustments and Calibration.\0"},
    { CONFIG_10M_RX_IQ_GAIN_BAL, "IQ Balance Adjust for all receive if frequency translation is NOT OFF. Requires USB/LSB/CW mode to be changeable.See Wiki Adjustments and Calibration.\0"},
    { CONFIG_10M_RX_IQ_PHASE_BAL, "IQ Phase Adjust for all receive if frequency translation is NOT OFF. Requires USB/LSB/CW mode to be changeable. See Wiki Adjustments and Calibration.\0"},
    { MENU_NOISE_BLANKER_SETTING, "Set the Noise Blanker strength. Higher values mean more agressive blanking. Also changeable using Encoder 2 if Noise Blanker is active.\0"},
#ifdef OBSOLETE_NR
    { CONFIG_DSP_NR_DECORRELATOR_BUFFER_LENGTH, "DSP LMS noise reduction: length of the audio buffer that is used for simulation of a reference for the LMS algorithm. The longer the buffer, the better the performance, but this buffer length must always be larger than the number of taps in the FIR filter used. Thus, a larger buffer (and larger FIR filter) uses more MCU resources.\0"},
    { CONFIG_DSP_NR_FFT_NUMTAPS, "DSP LMS noise reduction: Number of taps in the DSP noise reduction FIR filter. The larger the number of taps in the filter, the better the performance, but the slower the performance of the filter and the mcHF.\0"},
    { CONFIG_DSP_NOTCH_CONVERGE_RATE, "DSP LMS automatic notch filter: converge rate.\0"},
    { CONFIG_DSP_NOTCH_DECORRELATOR_BUFFER_LENGTH, "DSP LMS automatic notch filter: length of the audio buffer that is used for simulation of a reference for the LMS algorithm. The longer the buffer, the better -and the slower- the performance, but this buffer length must always be larger than the number of taps in the FIR filter used. Thus, a larger buffer (and larger FIR filter) uses more MCU resources.\0"},
    { CONFIG_DSP_NOTCH_FFT_NUMTAPS, "DSP LMS automatic notch filter: Number of taps in the DSP automatic notch FIR filter. The larger the number of taps in the filter, the better the performance, but the slower the performance of the filter and the mcHF.\0"},
#endif
#ifdef USE_LMS_AUTONOTCH
    { CONFIG_DSP_NOTCH_CONVERGE_RATE, "DSP LMS automatic notch filter: converge rate.\0"},
    { CONFIG_DSP_NOTCH_DECORRELATOR_BUFFER_LENGTH, "DSP LMS automatic notch filter: length of the audio buffer that is used for simulation of a reference for the LMS algorithm. The longer the buffer, the better -and the slower- the performance, but this buffer length must always be larger than the number of taps in the FIR filter used. Thus, a larger buffer (and larger FIR filter) uses more MCU resources.\0"},
    { CONFIG_DSP_NOTCH_FFT_NUMTAPS, "DSP LMS automatic notch filter: Number of taps in the DSP automatic notch FIR filter. The larger the number of taps in the filter, the better the performance, but the slower the performance of the filter and the mcHF.\0"},
#endif
    { MENU_DEBUG_NR_GAIN_SHOW, "Debugging: show gains of spectral noise reduction.\0"},
    { MENU_DSP_NR_STRENGTH, "Set the Noise Reduction Strength. Higher values mean more agressive noise reduction but also higher CPU load. Use with extreme care. Also changeable using Encoder 2 if DSP is active.\0"},
    { MENU_DEBUG_NR_BETA, "Time constant beta for spectral noise reduction, leave at 0.85.\0"},
    { MENU_DEBUG_NR_ASNR, "Devel 2 NR: asnr.\0"},
    { MENU_DEBUG_NR_GAIN_SMOOTH_WIDTH, "Devel 2 NR: width of gain smoothing window.\0"},
    { MENU_DEBUG_NR_GAIN_SMOOTH_THRESHOLD, "Devel 2 NR: threhold for gain smoothing.\0"},
    { MENU_DEBUG_NR_POST_AGC_SELECT, "DSP LMS noise reduction: Perform the DSP LMS noise reduction BEFORE or AFTER the AGC. NO = before AGC, YES = after AGC.\0"},
    { MENU_DEBUG_ANR_TAPS, "Number of taps of leaky LMS noise reduction.\0"},
    { MENU_DEBUG_ANR_DELAY, "Delay length of leaky LMS noise reduction.\0"},
    { MENU_DEBUG_ANR_GAIN, "Gain of leaky LMS noise reduction.\0"},
    { MENU_DEBUG_ANR_LEAK, "Leak of leaky LMS noise reduction.\0"},
    { CONFIG_WIDE_SPEC_DEF, "Wide mode of spectrum on screen 320x240 is default.\0"},
    { CONFIG_LCD_AUTO_OFF_MODE, "After x seconds LCD turns dark and LCD data sections stop. So power consumption is decreased and RX hum is decreased, too. LCD operation starts when using any button or the touchscreen.\0"},
    { MENU_CW_DECODER_SNAP_ENABLE, "Graphical tune helper: adjust frequency until yellow vertical line is in centre of green box --> right on CW carrier frequency.\0"},
    { CONFIG_FREQ_STEP_MARKER_LINE, "If enabled, you'll see a line under the digit which is currently representing the selected tuning step size.\0"},
    { MENU_NO_SHOW_BNDMEM, "Don't show BndMemory.\0"},
    { MENU_CLEAR_PAN_ON_TX, "Clear panoram on TX/TUNE.\0"},
    { CONFIG_DISP_FILTER_BANDWIDTH, "Colour of the horizontal Filter Bandwidth indicator bar.\0"},
    { MENU_SPECTRUM_SIZE, "Change height of spectrum display.\0"},
    { MENU_SPECTRUM_FILTER_STRENGTH, "Lowpass filter for the spectrum FFT. Low values: fast and nervous spectrum; High values: slow and calm spectrum.\0"},
    { MENU_SPECTRUM_FREQSCALE_COLOUR, "Colour of the small frequency digits under the spectrum display.\0"},
    { MENU_SPECTRUM_CENTER_LINE_COLOUR, "Colour of the vertical line indicating the TX carrier frequency in the spectrum or waterdall display.\0"},
    { MENU_SCOPE_LIGHT_ENABLE, "The scope uses bars (NORMAL) or points (LIGHT) to represent data. LIGHT is a little less resource intensive.\0"},
    { MENU_SCOPE_SPEED, "Lower Values: Higher refresh rate. Set to 0 to disable scope.\0"},
    { MENU_SCOPE_AGC_ADJUST, "Adjusting of scope / waterfall AGC for fitting graphs to screen.\0"},
    { MENU_SCOPE_TRACE_COLOUR, "Set colour of scope.\0"},
    { MENU_SCOPE_TRACE_HL_COLOUR, "Set colour of highlighted BW scope.\0"},
    { MENU_SCOPE_BACKGROUND_HL_COLOUR, "Set colour of highlighted BW background.\0"},
    { MENU_SCOPE_GRID_COLOUR, "Set colour of scope grid.\0"},
    { MENU_SCOPE_DB_DIVISION, "Set rf range for scope.\0"},
    { MENU_WFALL_SPEED, "Lower Values: Higher refresh rate. Set to 0 to disable waterfall.\0"},
    { MENU_WFALL_COLOR_SCHEME, "Select colour scheme for waterfall display.\0"},
    { MENU_WFALL_STEP_SIZE, "How many lines are moved in a single screen update.\0"},
    { MENU_WFALL_CONTRAST, "Adjust to fit your personal input level range to displayable colour range for waterfall.\0"},
    { MENU_METER_COLOUR_UP, "Set the colour of the scale of combined S/Power-Meter.\0"},
    { MENU_METER_COLOUR_DOWN, "Set the colour of the scale of combined SWR/AUD/ALC-Meter.\0"},
    { MENU_BOX_COLOUR, "Screen boxes colour.\0"},
    { MENU_TXTLINE_COLOUR, "Ticker colour.\0"},
    { MENU_DBM_DISPLAY, "RX signal power (measured within the filter bandwidth) can be displayed in dBm or normalized as dBm/Hz. This value is supposed to be quite accurate to +-3dB. Preferably use low spectrum display magnify settings. Accuracy is lower for very very weak and very very strong signals.\0"},
    { MENU_DBM_CALIBRATE, "dBm display calibration. Just an offset (in dB) that is added to the internally calculated dBm or dBm/Hz value.\0"},
    { CONFIG_SMETER_ATTACK, "Attack controls how quickly the S-Meter reacts to rising signal levels, higher values represent quicker reaction.\0"},
    { CONFIG_SMETER_DECAY, "Decay controls how quickly the S-Meter reacts to falling signal levels, higher values represent quicker reaction.\0"},
    { MENU_PEAK_IND_TUNE, "Tune/OFF S/PWR meter peak indicator.\0"},
    { MENU_SMETER_AM_NOT_LO, "Don't calculate LO in AM mode RX.\0"},
    { MENU_TCXO_MODE, "The software TCXO can be turned ON (set frequency is adjusted so that generated frequency matches the wanted frequency); OFF (no correction or measurement done); or STOP (no correction but measurement).\0"},
    { MENU_TCXO_C_F, "Show the measure TCXO temperature in Celsius or Fahrenheit.\0"},
    { CONFIG_RTC_START, "Start using the RTC and use the modified button layout. Will reboot your mcHF. Please use only if you completed the RTC mod otherwise you will need to disconnect battery and power and reboot to get a working mcHF. This menu is only visible if Backup RAM (VBat) was detected.\0"},
    { CONFIG_RTC_HOUR, "Sets the Real Time Clock Hour. Needs HW Modifications.\0"},
    { CONFIG_RTC_MIN, "Sets the Real Time Clock Minutes. Needs HW Modifications.\0"},
    { CONFIG_RTC_SEC, "Sets the Real Time Clock Seconds. Needs HW Modifications.\0"},
    { CONFIG_RTC_RESET, "Full Reset of STM32 RTC. Can be used to simulate first start with RTC mod completed.\0"},
    { CONFIG_RTC_CALIB, "Sets the Real Time Clock Frequency calibration value in ppm. 1s/day deviation equals 11.57 ppm deviation.\0"},
    { MENU_FREQ_FONT, "Font selection for frequency display. Allows selection of old/modern fonts.\0"},
    { MENU_UI_INVERSE_SCROLLING, "Inverts Enc2/Enc3 behavior in menu up/down and show/hide UI scrolling actions, used for side-mounted encoder dials.\0"},
    { MENU_KEYER_MODE, "Select how the mcHF interprets the connected keyer signals. Supported modes: Iambic A and B Keyer (IAM A/B), Straight Key (STR_K), and Ultimatic Keyer (ULTIM).\0"},
    { MENU_KEYER_SPEED, "Keyer Speed for the automatic keyer modes in WpM. Also changeable via Encoder 3 if in CW Mode.\0"},
    { MENU_KEYER_WEIGHT, "Keyer Dit/Pause ratio for the automatic keyer modes. Higher values increase length of dit, decreases length of pause so that the total time is still according to the set WpM value.\0"},
    { MENU_CW_SMOOTH, "Smooth of CW signal edges.\0"},
    { MENU_SIDETONE_GAIN, "Audio volume for the monitor sidetone in CW TX. Also changeable via Encoder 1 if in CW Mode.\0"},
    { MENU_SIDETONE_FREQUENCY, "Sidetone Frequency (also Offset frequency, see CW Freq. Offset below).\0"},
    { MENU_PADDLE_REVERSE, "Dit is Dah and Dah is Dit. Use if your keyer needs reverse meaning of the paddles.\0"},
    { MENU_CW_TX_RX_DELAY, "How long to stay in CW TX mode after stop sending a signal.\0"},
    { MENU_CW_OFFSET_MODE, "TX: display is TX frequency if received frequency was zero-beated. DISP: display is RX frequency if received signal is matched to sidetone. SHIFT: LO shifts, display is RX frequency if signal is matched to sidetone.\0"},
    { MENU_CW_AUTO_MODE_SELECT, "Set appropriate sideband mode for CW. If AUTO, sideband is chosen for bands by its frequency. A long press on Mode button gets the other sideband mode.\0"},
    { MENU_CW_DECODER, "Enable experimental CW decoding.\0"},
    { MENU_CW_DECODER_THRESH, "All signals above this threshold are intepreted as a dit or daah.\0"},
    { MENU_CW_DECODER_BLOCKSIZE, "How many samples are taken for the signal detection with the Goertzel algorithm?\0"},
    { MENU_CW_DECODER_NOISECANCEL, "Enable/disable noise canceler for CW decoder.\0"},
    { MENU_CW_DECODER_SPIKECANCEL, "Enable/disable spike canceler or short cancel for CW decoder.\0"},
    { MENU_CW_DECODER_USE_3_GOERTZEL, "Enable/disable AGC for CW decoder.\0"},
    { MENU_CW_DECODER_SHOW_CW_LED, "Enable/disable LED for CW decoder.\0"},
    { MENU_CW_MACRO_INTERVAL, "CW Macros Cycled TX interval, sec.\0"},
    { MENU_CW_BEACON_INTERVAL, "CW Beacon interval, min.\0"},
    { MENU_CW_FAST_MACRO_1_2, "Enable/disable fast TXing CW macro 1 and 2.\0"},
    { MENU_FP_SSB_01, "Filter bandwidth #1 when toggling with filter select button in LSB or USB.\0"},
    { MENU_FP_SSB_02, "Filter bandwidth #2 when toggling with filter select button in LSB or USB.\0"},
    { MENU_FP_SSB_03, "Filter bandwidth #3 when toggling with filter select button in LSB or USB.\0"},
    { MENU_FP_SSB_04, "Filter bandwidth #4 when toggling with filter select button in LSB or USB.\0"},
    { MENU_FP_CW_01, "Filter bandwidth #1 when toggling with filter select button in CW.\0"},
    { MENU_FP_CW_02, "Filter bandwidth #2 when toggling with filter select button in CW.\0"},
    { MENU_FP_CW_03, "Filter bandwidth #3 when toggling with filter select button in CW.\0"},
    { MENU_FP_CW_04, "Filter bandwidth #4 when toggling with filter select button in CW.\0"},
    { MENU_FP_AM_01, "Filter bandwidth #1 when toggling with filter select button in AM & SAM.\0"},
    { MENU_FP_AM_02, "Filter bandwidth #2 when toggling with filter select button in AM & SAM.\0"},
    { MENU_FP_AM_03, "Filter bandwidth #3 when toggling with filter select button in AM & SAM.\0"},
    { MENU_FP_AM_04, "Filter bandwidth #4 when toggling with filter select button in AM & SAM.\0"},
    { CONFIG_AM_TX_FILTER_DISABLE, "Select if AM-TX signal is filtered (strongly recommended to agree to regulations).\0"},
    { CONFIG_SSB_TX_FILTER, "Select if SSB-TX signal is filtered (strongly recommended to agree to regulations).\0"},
    { CONFIG_TX_REVERB_GAIN, "TX reverberation gain, OFF - disabled.\0"},
    { CONFIG_TX_REVERB_DELAY, "TX reverberation delay.\0"},
    { CONFIG_TX_EQ0, "Equalizer band level adjustment -20 ... + 20 dB, 0 - no adjustment.\0"},
    { CONFIG_TX_EQ1, "Equalizer band level adjustment -20 ... + 20 dB, 0 - no adjustment.\0"},
    { CONFIG_TX_EQ2, "Equalizer band level adjustment -20 ... + 20 dB, 0 - no adjustment.\0"},
    { CONFIG_TX_EQ3, "Equalizer band level adjustment -20 ... + 20 dB, 0 - no adjustment.\0"},
    { CONFIG_TX_EQ4, "Equalizer band level adjustment -20 ... + 20 dB, 0 - no adjustment.\0"},
    { CONFIG_TX_DISABLE, "Disable all transmissions unconditionally. In CW you will be able to hear a sidetone but no transmission is made.\0"},
    { CONFIG_VSWR_PROTECTION_THRESHOLD, "If not OFF, on TX/tune the bias of PA will be down to 0 etc when exceeding the specified value of VSWR.\0"},
    { MENU_MIC_TYPE, "Microphone type. Electret or Dynamic. ELECTRET is recommended. Selecting DYNAMIC when an Electret mic is present will likely cause terrible audio distortion.\0"},
    { MENU_MIC_GAIN, "Microphone gain. Also changeable via Encoder 3 if Microphone is selected as Input.\0"},
    { MENU_LINE_GAIN, "LineIn gain. Also changeable via Encoder 3 if LineIn Left (L>L) or LineIn Right (L>R) is selected as Input.\0"},
    { MENU_TX_COMPRESSION_LEVEL, "Control the TX audio compressor. Higher values give more compression. Set to CUSTOM for user defined compression parameters. See below. Also changeable via Encoder 1 (CMP).\0"},
    { MENU_ALC_RELEASE, "If Audio Compressor Config is set to CUSTOM, sets the value of the Audio Compressor Release time. Otherwise shows predefined value of selected compression level.\0"},
    { MENU_ALC_POSTFILT_GAIN, "If Audio Compressor Config is set to CUSTOM, sets the value of the ALC Input Gain. Otherwise shows predefined value of selected compression level.\0"},
    { CONFIG_TUNE_POWER_LEVEL, "Select the power level for TUNE operation. May be set using the selected power level or have a fixed power level.\0"},
    { CONFIG_TUNE_TONE_MODE, "Select if single tone or two tone is generated during TUNE operation. Not persistent.\0"},
    { CONFIG_CW_PA_BIAS, "If set to a value above 0, this BIAS is used during CW transmission; otherwise normal BIAS is used during CW.\0"},
    { CONFIG_REDUCE_POWER_ON_LOW_BANDS, "If set (recommended!)  frequencies below 8Mhz (40m or lower) require higher power adjust values (four times). This permits better control of generated power on these frequencies.\0"},
    { CONFIG_REDUCE_POWER_ON_HIGH_BANDS, "If set frequencies above 8Mhz (30m or higher) require higher power adjust values (four times). This permits better control of generated power on these frequencies.\0"},
    { CONFIG_PA_BIAS, "Defines the BIAS value of the PA. See Adjustment and Calibration for more information.\0"},
    { CONFIG_2200M_5W_ADJUST, "RTFM.\0"},
    { CONFIG_630M_5W_ADJUST, "RTFM.\0"},
    { CONFIG_160M_5W_ADJUST, "RTFM.\0"},
    { CONFIG_80M_5W_ADJUST, "RTFM.\0"},
    { CONFIG_60M_5W_ADJUST, "RTFM.\0"},
    { CONFIG_40M_5W_ADJUST, "RTFM.\0"},
    { CONFIG_30M_5W_ADJUST, "RTFM.\0"},
    { CONFIG_20M_5W_ADJUST, "RTFM.\0"},
    { CONFIG_17M_5W_ADJUST, "RTFM.\0"},
    { CONFIG_15M_5W_ADJUST, "RTFM.\0"},
    { CONFIG_12M_5W_ADJUST, "RTFM.\0"},
    { CONFIG_10M_5W_ADJUST, "RTFM.\0"},
    { CONFIG_6M_5W_ADJUST, "RTFM.\0"},
    { CONFIG_4M_5W_ADJUST, "RTFM.\0"},
    { CONFIG_2M_5W_ADJUST, "RTFM.\0"},
    { CONFIG_70CM_5W_ADJUST, "RTFM.\0"},
    { CONFIG_23CM_5W_ADJUST, "RTFM.\0"},
    { CONFIG_2200M_FULL_POWER_ADJUST, "RTFM.\0"},
    { CONFIG_630M_FULL_POWER_ADJUST, "RTFM.\0"},
    { CONFIG_160M_FULL_POWER_ADJUST, "RTFM.\0"},
    { CONFIG_80M_FULL_POWER_ADJUST, "RTFM.\0"},
    { CONFIG_60M_FULL_POWER_ADJUST, "RTFM.\0"},
    { CONFIG_40M_FULL_POWER_ADJUST, "RTFM.\0"},
    { CONFIG_30M_FULL_POWER_ADJUST,  "RTFM.\0"},
    { CONFIG_20M_FULL_POWER_ADJUST, "RTFM.\0"},
    { CONFIG_17M_FULL_POWER_ADJUST, "RTFM.\0"},
    { CONFIG_15M_FULL_POWER_ADJUST, "RTFM.\0"},
    { CONFIG_12M_FULL_POWER_ADJUST, "RTFM.\0"},
    { CONFIG_10M_FULL_POWER_ADJUST, "RTFM.\0"},
    { CONFIG_6M_FULL_POWER_ADJUST, "RTFM.\0"},
    { CONFIG_4M_FULL_POWER_ADJUST, "RTFM.\0"},
    { CONFIG_2M_FULL_POWER_ADJUST, "RTFM.\0"},
    { CONFIG_70CM_FULL_POWER_ADJUST, "RTFM.\0"},
    { CONFIG_23CM_FULL_POWER_ADJUST, "RTFM.\0"},
    { CONFIG_FWD_REV_COUPLING_2200M_ADJ, "RTFM.\0"},
    { CONFIG_FWD_REV_COUPLING_630M_ADJ, "RTFM.\0"},
    { CONFIG_FWD_REV_COUPLING_160M_ADJ, "RTFM.\0"},
    { CONFIG_FWD_REV_COUPLING_80M_ADJ, "RTFM.\0"},
    { CONFIG_FWD_REV_COUPLING_40M_ADJ, "RTFM.\0"},
    { CONFIG_FWD_REV_COUPLING_20M_ADJ, "RTFM.\0"},
    { CONFIG_FWD_REV_COUPLING_15M_ADJ, "RTFM.\0"},
    { CONFIG_FWD_REV_COUPLING_10M_ADJ, "RTFM.\0"},
    { CONFIG_FWD_REV_COUPLING_6M_ADJ, "RTFM.\0"},
    { CONFIG_FWD_REV_COUPLING_2M_ADJ, "RTFM.\0"},
    { CONFIG_FWD_REV_COUPLING_70CM_ADJ, "RTFM.\0"},
    { CONFIG_FWD_REV_COUPLING_23CM_ADJ, "RTFM.\0"},
    { CONFIG_160M_TX_IQ_GAIN_BAL, "RTFM.\0"},
    { CONFIG_160M_TX_IQ_PHASE_BAL, "RTFM.\0"},
    { CONFIG_80M_TX_IQ_GAIN_BAL, "RTFM.\0"},
    { CONFIG_80M_TX_IQ_PHASE_BAL, "RTFM.\0"},
    { CONFIG_40M_TX_IQ_GAIN_BAL, "RTFM.\0"},
    { CONFIG_40M_TX_IQ_PHASE_BAL, "RTFM.\0"},
    { CONFIG_30M_TX_IQ_GAIN_BAL, "RTFM.\0"},
    { CONFIG_30M_TX_IQ_PHASE_BAL, "RTFM.\0"},
    { CONFIG_20M_TX_IQ_GAIN_BAL, "RTFM.\0"},
    { CONFIG_20M_TX_IQ_PHASE_BAL, "RTFM.\0"},
    { CONFIG_17M_TX_IQ_GAIN_BAL, "RTFM.\0"},
    { CONFIG_17M_TX_IQ_PHASE_BAL, "RTFM.\0"},
    { CONFIG_15M_TX_IQ_GAIN_BAL, "RTFM.\0"},
    { CONFIG_15M_TX_IQ_PHASE_BAL, "RTFM.\0"},
    { CONFIG_12M_TX_IQ_GAIN_BAL, "RTFM.\0"},
    { CONFIG_12M_TX_IQ_PHASE_BAL, "RTFM.\0"},
    { CONFIG_10M_TX_IQ_GAIN_BAL, "RTFM.\0"},
    { CONFIG_10M_TX_IQ_PHASE_BAL, "RTFM.\0"},
    { CONFIG_10M_UP_TX_IQ_GAIN_BAL, "RTFM.\0"},
    { CONFIG_10M_UP_TX_IQ_PHASE_BAL, "RTFM.\0"},
    { CONFIG_6M_TX_IQ_GAIN_BAL, "RTFM.\0"},
    { CONFIG_6M_TX_IQ_PHASE_BAL, "RTFM.\0"},
    { CONFIG_160M_TX_IQ_GAIN_BAL_TRANS_OFF, "RTFM.\0"},
    { CONFIG_160M_TX_IQ_PHASE_BAL_TRANS_OFF, "RTFM.\0"},
    { CONFIG_80M_TX_IQ_GAIN_BAL_TRANS_OFF, "RTFM.\0"},
    { CONFIG_80M_TX_IQ_PHASE_BAL_TRANS_OFF, "RTFM.\0"},
    { CONFIG_40M_TX_IQ_GAIN_BAL_TRANS_OFF, "RTFM.\0"},
    { CONFIG_40M_TX_IQ_PHASE_BAL_TRANS_OFF, "RTFM.\0"},
    { CONFIG_30M_TX_IQ_GAIN_BAL_TRANS_OFF, "RTFM.\0"},
    { CONFIG_30M_TX_IQ_PHASE_BAL_TRANS_OFF, "RTFM.\0"},
    { CONFIG_20M_TX_IQ_GAIN_BAL_TRANS_OFF, "RTFM.\0"},
    { CONFIG_20M_TX_IQ_PHASE_BAL_TRANS_OFF, "RTFM.\0"},
    { CONFIG_17M_TX_IQ_GAIN_BAL_TRANS_OFF, "RTFM.\0"},
    { CONFIG_17M_TX_IQ_PHASE_BAL_TRANS_OFF, "RTFM.\0"},
    { CONFIG_15M_TX_IQ_GAIN_BAL_TRANS_OFF, "RTFM.\0"},
    { CONFIG_15M_TX_IQ_PHASE_BAL_TRANS_OFF, "RTFM.\0"},
    { CONFIG_12M_TX_IQ_GAIN_BAL_TRANS_OFF, "RTFM.\0"},
    { CONFIG_12M_TX_IQ_PHASE_BAL_TRANS_OFF, "RTFM.\0"},
    { CONFIG_10M_TX_IQ_GAIN_BAL_TRANS_OFF, "RTFM.\0"},
    { CONFIG_10M_TX_IQ_PHASE_BAL_TRANS_OFF, "RTFM.\0"},
    { CONFIG_10M_UP_TX_IQ_GAIN_BAL_TRANS_OFF, "RTFM.\0"},
    { CONFIG_10M_UP_TX_IQ_PHASE_BAL_TRANS_OFF, "RTFM.\0"},
    { CONFIG_6M_TX_IQ_GAIN_BAL_TRANS_OFF, "RTFM.\0"},
    { CONFIG_6M_TX_IQ_PHASE_BAL_TRANS_OFF, "RTFM.\0"},
    { MENU_INPUT_STATE, "Amber - State of RX input group.\0"},
    { MENU_DYNAMICTUNE, "Toggles dynamic tune mode.\0"},
    { MENU_MIC_LINE_MODE, "Select the required signal input for transmit (except in CW). Also changeable via long press on M3.\0"},
    { MENU_SPECTRUM_MODE, "Select if you want a scope-like or a waterfall-like (actually a fountain) display.\0"},
    { MENU_SPECTRUM_MAGNIFY, "Select level of magnification (1x, 2x, 4x, 8x, 16x, 32x) of spectrum and waterfall display. Also changeable via touch screen. Refresh rate is much slower with high magnification settings. The dBm display has its maximum accuracy in magnify 1x setting.\0"},
    { MENU_RESTART_CODEC, "Sometimes there is a problem with the I2S IQ signal stream from the Codec, resulting in mirrored signal reception. Restarting the CODEC Stream will cure that problem. Try more than once, if first call did not help.\0"},
    { MENU_DIGITAL_MODE_SELECT, "Select the active digital mode (FreeDV,RTTY, ...).\0"},
    { INFO_DISPLAY, "Displays working mode (SPI/parallel.\0"},
    { INFO_DISPLAY_CTRL, "Identified LCD controller chip.\0"},
    { INFO_OSC_NAME, "Local oscillator type.\0"},
    { INFO_SI570, "Startup frequency and I2C address of local oscillator Type SI570.\0"},
    { INFO_EEPROM, "Type of serial EEPROM and its capacity.\0"},
    { INFO_TP, "Touchscreen state.\0"},
    { INFO_CPU, "Identification of fitted MCU.\0"},
    { INFO_FLASH, "Flash size of MCU.\0"},
    { INFO_RAM, "RAM size of MCU.\0"},
    { INFO_FW_VERSION, "Firmware version.\0"},
    { INFO_BUILD, "Firmware: timestamp of building.\0"},
    { INFO_BL_VERSION, "Bootloader version.\0"},
    { INFO_RFBOARD, "Displays the detected RF Board hardware identification.\0"},
    { INFO_CODEC, "Audio Codec I2C communication successfully tested? This is not a full test of the Audio Codec functionality, it only reports if I2C communication reported no problem talking to the codec.\0"},
    { INFO_CODEC_TWINPEAKS, "In some cases the audio codec needs to be restarted to produce correct IQ. The IQ auto correction detects this. If this fixes the problem, Done is displayed, Failed otherwise.\0"},
    { INFO_VBAT, "Battery Support for Backup RAM present?\0"},
    { INFO_RTC, "Battery Supported Real Time Clock present?\0"},
    { INFO_LO_TX_SUPR_DACs, "LO_TX Supression DACs (0/1) are present?\0"},
    { INFO_AMBER_IO8, "Amber - I/Ox8 PCF8574A is present?\0"},
    { INFO_AMBER_IO4, "Amber - I/Ox4 PCA9536 is present?\0"},
    { INFO_AMBER_DAC_PWR_TX, "Amber - DAC MCP4725 for TX PWR reg. is present?\0"},
    { INFO_LICENCE, "Display license of firmware.\0"},
    { INFO_HWLICENCE, "Display license of hardware.\0"},
    { MENU_DEBUG_ENABLE_INFO, "Enable debug outputs on LCD for testing purposes (touch screen coordinates, load) and audio interrupt duration indication via green led.\0"},
    { CONFIG_FWD_REV_PWR_DISP, "Shows the forward and reverse power values in mW, can be used to calibrate the SWR meter.\0"},
    { MENU_DEBUG_CW_OFFSET_SHIFT_KEEP_SIGNAL, "Enable automatic sidetone correction for CW OFFSET MODE = SHIFT. If you tuned in SSB to a CW signal around the sidetone frequency, you'll keep that signal when going to CW. Even if you switch from USB to CW-LSB etc.\0"},
    { MENU_DEBUG_TX_AUDIO, "If enabled, send generated audio to PC during TX.\0"},
    { MENU_DEBUG_CLONEOUT, "Will in future send out memory data to an FT817 Clone Info (to be used with CHIRP).\0"},
    { MENU_DEBUG_CLONEIN, "Will in future get memory data from an FT817 Clone Info (to be used with CHIRP).\0"},
#ifdef USE_TWO_CHANNEL_AUDIO
    { MENU_DEBUG_ENABLE_STEREO, "Enable stereo demodulation modes.\0"},
#endif
    { MENU_DEBUG_OSC_SI5351_PLLRESET, "Debug Setting: Select when the Si5351a does a PLL RESET.\0"},
    { MENU_DEBUG_HMC1023_COARSE, "Debug Setting: Change LPF HMC1023LP5E coarse bandwidth.\0"},
    { MENU_DEBUG_HMC1023_FINE, "Debug Setting: Change LPF HMC1023LP5E fine bandwidth.\0"},
    { MENU_DEBUG_HMC1023_GAIN, "Debug Setting: Switch LPF HMC1023LP5E +10db Amp on/off.\0"},
    { MENU_DEBUG_HMC1023_BYPASS, "Debug Setting: Set HMC1023 to bypass mode.\0"},
    { MENU_DEBUG_HMC1023_OPAMP, "Debug Setting: Switch LPF HMC1023LP5E Opamp Bias.\0"},
    { MENU_DEBUG_HMC1023_DRVR, "Debug Setting: Set HMC1023 Driver Bias.\0"},
    { MENU_DEBUG_TWINPEAKS_CORR_RUN, "Trigger Twinpeaks Correction Manually if IQ Auto Correction is enabled, otherwise you will see Not Possible.\0"},
    { MENU_DEBUG_CB_27MC_TX_ENABLE, "Enable transmitting (4W) on CB band 27 MHz (AM, FM, SSB, CW).\0"},
    { MENU_DEBUG_CB_26MC_TX_ENABLE, "Enable transmitting (4W) on CB band 26 MHz (AM, FM, SSB, CW).\0"},
    { MENU_DEBUG_CB_12W_SSB_TX_ENABLE, "Enable transmitting 12W SSB on CB bands, where TX is open.\0"},
    { MENU_DEBUG_CB_10W_TX_ENABLE, "Enable transmitting 10W for any mode on CB bands, where TX is open.\0"},
    { MENU_DEBUG_CAL_LO_TX_SUPR_0, "Calibration of LO_TX Supression on every band via balancing of TX mixer, channel 0.\0"},
    { MENU_DEBUG_CAL_LO_TX_SUPR_1, "Calibration of LO_TX Supression on every band via balancing of TX mixer, channel 1.\0"},
    { MENU_DEBUG_SHOW_GREETING, "Not for users.\0"},
    { MENU_DEBUG_SMOOTH_DYN_TUNE, "Activate smooth dynamic tune.\0"},
    { MENU_DEBUG_CLEAN_TX_CW_RTTY_BPSK, "Forming CW/RTTY/BPSK signal at intermediate frequency for clean TX.\0"},
    { MENU_DEBUG_MEM_BW_MOD_BAND, "Remember the filter settings of each mode in each range for the duration of the session.\0"},
    { MENU_DEBUG_ILLUM_BUTT, "Illumination of buttons.\0"},
    { MENU_DEBUG_BPF_OPTION, "3 extra BPF instead of 2 on Amber-RF board.\0"},
    { MENU_DEBUG_XVTR_OFF_PA, "Transverter mode - blocking PA on TX. The optional 'XVTR TX' SMA connector must be soldered and connected with coaxial cable to the output of the amplifier before PA driver (XVTR_TX contacts).\0"},
    { MENU_DEBUG_BANDCODE, "PA bandcode variant, if not OFF.\0"},
    { MENU_DEBUG_ALT_PWR_CTRL, "Alternative POWER lewel control ON/OFF.\0"},
    { MENU_DEBUG_ALT_PWR_CTRL_VOL, "Alternative POWER lewel control - DAC volume in points, 0-4096 (0-5V).\0"},
    { MENU_DEBUG_DISABLE_TP, "Disable touchscreen actions.\0"},
    { MENU_DEBUG_FMENUS_SEL, "Type of F-menus selection.\0"},
    { MENU_DEBUG_IMPROV_IQ_ADJ, "Improved I/Q adjusting. Added 160, 40, 30, 17, 12m.\0"},
    { MENU_DEBUG_BEEP_GEN, "Activate beep (as button beep set) when the band border is crossed.\0"},
    { MENU_DEBUG_F6_IND_SEL, "Amber 4 inch - Indication of F6 button.\0"},
    { MENU_DEBUG_F7_IND_SEL, "Amber 4 inch - Indication of F7 button.\0"},
    { MENU_DEBUG_BAND_OFF_160M, "Remove this band from switching queue.\0"},
    { MENU_DEBUG_BAND_OFF_80M, "Remove this band from switching queue.\0"},
    { MENU_DEBUG_BAND_OFF_60M, "Remove this band from switching queue.\0"},
    { MENU_DEBUG_BAND_OFF_40M, "Remove this band from switching queue.\0"},
    { MENU_DEBUG_BAND_OFF_30M, "Remove this band from switching queue.\0"},
    { MENU_DEBUG_BAND_OFF_20M, "Remove this band from switching queue.\0"},
    { MENU_DEBUG_BAND_OFF_17M, "Remove this band from switching queue.\0"},
    { MENU_DEBUG_BAND_OFF_15M, "Remove this band from switching queue.\0"},
    { MENU_DEBUG_BAND_OFF_12M, "Remove this band from switching queue.\0"},
    { MENU_DEBUG_BAND_OFF_10M, "Remove this band from switching queue.\0"},
    { MENU_DEBUG_BAND_OFF_6M, "Remove this band from switching queue.\0"},
    { MENU_DEBUG_REDUCE_POWER_ON_LOW_BANDS_MORE, "Reduce power x20 (instead of x4) for F < 8 MHz.\0"},
};
#endif
