Compare commits

..

No commits in common. "ef8c21b819758e3d1adb42d44c2f76d4dca1820c" and "a10110aa47f018a33c2ae1e7b56c28afde3469d8" have entirely different histories.

2 changed files with 192 additions and 320 deletions

141
README.md
View file

@ -7,144 +7,3 @@ Starting with firmware version 0.5 HF.
The base of the chirp driver is based on https://www.universirius.com/preppers/quansheng-uv-k5-manuale-del-firmware-ijv_2-9r5/#Firmware-IJV The base of the chirp driver is based on https://www.universirius.com/preppers/quansheng-uv-k5-manuale-del-firmware-ijv_2-9r5/#Firmware-IJV
## EEPROM content for 0.5 HF:
Address: 0x0D60
Content:
for(uint16_t i = 0; i < sizeof(MR_ChannelAttributes); i++) { ChannelAttributes_t *att = &MR_ChannelAttributes[i]; if(att->__val == 0xff){ att->__val = 0; att->band = 0xf; } }
Address: 0x0E70
Content:
0: CHAN_1_CALL
1: SQUELCH_LEVEL
2: TX_TIMEOUT_TIMER
3: NOAA_AUTO_SCAN
4: KEY_LOCK
5: VOX_SWITCH
6: VOX_LEVEL
7: MIC_SENSITIVITY
Address: 0x0E78
Content:
0: BACKLIGHT_MAX (0x0f) & BACKLIGHT_MIN (0xf0 >> 4)
1: CHANNEL_DISPLAY_MODE
2: CROSS_BAND_RX_TX
3: BATTERY_SAVE
4: DUAL_WATCH
5: BACKLIGHT_TIME
6: TAIL_TONE_ELIMINATION
7: VFO_OPEN
Address: 0x0E80
Content:
0: ScreenChannel[0]
1: ScreenChannel[1]
2: MrChannel[0]
3: MrChannel[1]
4: FreqChannel[0]
5: FreqChannel[1]
6: NoaaChannel[0]
7: NoaaChannel[1]
Address: 0x0E90
Content:
0: BEEP_CONTROL (0x01) & KEY_M_LONG_PRESS_ACTION (>> 1)
1: KEY_1_SHORT_PRESS_ACTION
2: KEY_1_LONG_PRESS_ACTION
3: KEY_2_SHORT_PRESS_ACTION
4: KEY_2_LONG_PRESS_ACTION
5: SCAN_RESUME_MODE
6: AUTO_KEYPAD_LOCK
7: POWER_ON_DISPLAY_MODE
Address: 0x0E98
Content:
0: memcpy(&POWER_ON_PASSWORD, Data, 4)
Address: 0x0EA0
Content:
0: VOICE_PROMPT
1: S0_LEVEL
2: S9_LEVEL
Address: 0x0EA8
Content:
0: ALARM_MODE
1: ROGER
2: REPEATER_TAIL_TONE_ELIMINATION
3: TX_VFO
4: BATTERY_TYPE
Address: 0x0EB0
Content:
EEPROM_WELCOMESTRING1 (16 byte)
EEPROM_WELCOMESTRING2 (16 byte)
Address: 0x0ED0
Content:
0: DTMF_SIDE_TONE
1: DTMF_SEPARATE_CODE
2: DTMF_GROUP_CALL_CODE
3: DTMF_DECODE_RESPONSE
4: DTMF_auto_reset_time
5: DTMF_PRELOAD_TIME
6: DTMF_FIRST_CODE_PERSIST_TIME
7: DTMF_HASH_CODE_PERSIST_TIME
Address: 0x0ED8
Content:
0: DTMF_CODE_PERSIST_TIME
1: DTMF_CODE_INTERVAL_TIME
2: PERMIT_REMOTE_KILL
Address: 0x0EE0
Content:
0: memcpy(ANI_DTMF_ID, Data, sizeof(ANI_DTMF_ID))
Address: 0x0EE8
Content:
0: memcpy(KILL_CODE, Data, sizeof(KILL_CODE))
Address: 0x0EF0
Content:
0: memcpy(REVIVE_CODE, Data, sizeof(REVIVE_CODE))
Address: 0x0EF8
Content:
0: memcpy(DTMF_UP_CODE, Data, sizeof(DTMF_UP_CODE))
Address: 0x0F08
Content:
0: memcpy(DTMF_DOWN_CODE, Data, sizeof(DTMF_DOWN_CODE))
Address: 0x0F18
Content:
0: SCAN_LIST_DEFAULT
1: SCAN_LIST_ENABLED[0]
2: SCANLIST_PRIORITY_CH1[0]
3: SCANLIST_PRIORITY_CH2[0]
4: SCAN_LIST_ENABLED[1]
5: SCANLIST_PRIORITY_CH1[1]
6: SCANLIST_PRIORITY_CH2[1]
Address: 0x0F30
Content:
bHasCustomAesKey: true/false
Address: 0x0F40
Content:
0: F_LOCK
1: 350TX
2: KILLED
3: 200TX
4: 500TX
5: 350EN
6: ScrambleEnable
7: live_DTMF_decoder
Address: CEC_EEPROM_START1 = 0x1D50
Content:
LiveSeekMode
CW_KEYTYPE
CW_SPEED
CW_TONE

View file

@ -61,206 +61,219 @@ DEBUG_SHOW_MEMORY_ACTIONS = False
MEM_FORMAT = """ MEM_FORMAT = """
#seekto 0x0000; #seekto 0x0000;
struct { struct {
// FREQ_Config_t start ul32 freq;
u32 freq; ul32 offset;
// DCS_CodeType_t u8 rxcode;
u8 freq_CodeType; u8 txcode;
u8 freq_Code;
u8 freq_Padding[2];
// end
// end
// FREQ_Config_t start
u32 offset;
// DCS_CodeType_t start
u8 offset_CodeType;
u8 offset_Code;
u8 offset_Padding[2];
// end
// end
u8 pRX; u8 unknown1:2,
u8 pTX; txcodeflag:2,
unknown2:2,
rxcodeflag:2;
u32 TX_OFFSET_FREQUENCY; //u8 flags1;
u16 StepFrequency; u8 flags1_unknown7:1,
flags1_unknown6:1,
enable_extramodes:1,
enable_am:1,
flags1_unknown3:1,
is_in_scanlist:1,
shift:2;
u8 SquelchOpenRSSIThresh; //u8 flags2;
u8 SquelchOpenNoiseThresh; u8 flags2_unknown7:1,
u8 SquelchCloseGlitchThresh; flags2_unknown6:1,
u8 SquelchCloseRSSIThresh; bclo:1,
u8 SquelchCloseNoiseThresh; txpower:2,
u8 SquelchOpenGlitchThresh; bandwidth:2,
freq_reverse:1;
// STEP_Setting_t //u8 dtmf_flags;
u16 STEP_SETTING; u8 dtmf_flags_unknown7:1,
dtmf_flags_unknown6:1,
dtmf_pttid:5,
dtmf_decode:1;
u8 OUTPUT_POWER;
u8 TXP_CalculatedSetting;
bool FrequencyReverse;
u8 SCRAMBLING_TYPE; u8 step;
u8 CHANNEL_BANDWIDTH; u8 scrambler;
} channel[200];
u8 SCANLIST1_PARTICIPATION; #seekto 0xd60;
u8 SCANLIST2_PARTICIPATION;
u8 Band;
u8 DTMF_DECODING_ENABLE;
// PTT_ID_t
u8 DTMF_PTT_ID_TX_MODE;
u8 BUSY_CHANNEL_LOCK;
// ModulationMode_t
u8 Modulation;
u8 Compander;
char name[16];
} channel[207];
#seekto 0x0D60;
struct { struct {
// ChannelAttributes_t start u8 is_scanlist1:1,
u8 band; is_scanlist2:1,
u8 compander; unknown1:1,
u8 is_scanlist2; unknown2:1,
u8 is_scanlist1; is_free:1,
// end band:3;
} channel_attributes[207]; } channel_attributes[200];
#seekto 0x0E70; #seekto 0xd7e;
u8 CHAN_1_CALL; u8 compander;
u8 SQUELCH_LEVEL;
u8 TX_TIMEOUT_TIMER;
u8 NOAA_AUTO_SCAN;
u8 KEY_LOCK;
u8 VOX_SWITCH;
u8 VOX_LEVEL;
u8 MIC_SENSITIVITY;
#seekto 0x0E78; #seekto 0xe40;
ul16 fmfreq[20];
#seekto 0xe70;
u8 call_channel;
u8 squelch_a;
u8 max_talk_time;
u8 squelch_b;
u8 key_lock;
u8 vox_switch;
u8 vox_level;
u8 mic_gain;
u8 unknown3;
u8 channel_display_mode;
u8 crossband;
u8 battery_save;
u8 dual_watch;
u8 backlight_auto_mode;
u8 tail_note_elimination;
u8 vfo_open;
#seekto 0xe90;
u8 beep_control;
u8 key1_shortpress_action;
u8 key1_longpress_action;
u8 key2_shortpress_action;
u8 key2_longpress_action;
u8 scan_resume_mode;
u8 auto_keypad_lock;
u8 power_on_dispmode;
u8 password[4];
#seekto 0xea0;
u8 keypad_tone;
u8 language;
#seekto 0xea0;
char qrz_label[8];
#seekto 0xea8;
u8 alarm_mode;
u8 reminding_of_end_talk;
u8 repeater_tail_elimination;
#seekto 0xeab;
u8 bands_tx;
#seekto 0xeb0;
char logo_line1[16];
char logo_line2[16];
#seekto 0xed0;
struct { struct {
u8 BACKLIGHT_MIN:4, BACKLIGHT_MAX:4; u8 side_tone;
} backlight; char separate_code;
u8 CHANNEL_DISPLAY_MODE; char group_call_code;
u8 CROSS_BAND_RX_TX; u8 decode_response;
u8 BATTERY_SAVE; u8 auto_reset_time;
u8 DUAL_WATCH; u8 preload_time;
u8 BACKLIGHT_TIME; u8 first_code_persist_time;
u8 TAIL_TONE_ELIMINATION; u8 hash_persist_time;
u8 VFO_OPEN; u8 code_persist_time;
u8 code_interval_time;
u8 permit_remote_kill;
} dtmf_settings;
#seekto 0x0E80; #seekto 0xee0;
u8 ScreenChannel[0];
u8 ScreenChannel[1];
u8 MrChannel[0];
u8 MrChannel[1];
u8 FreqChannel[0];
u8 FreqChannel[1];
u8 NoaaChannel[0];
u8 NoaaChannel[1];
#seekto 0x0E90;
struct { struct {
u8 BEEP_CONTROL:1, KEY_M_LONG_PRESS_ACTION: 7; char dtmf_local_code[8];
} beep_key_long_press; char kill_code[5];
char unused1[3];
char revive_code[5];
char unused2[3];
char dtmf_up_code[8];
char unused3[8];
char dtmf_down_code[8];
} dtmf_settings_numbers;
u8 KEY_1_SHORT_PRESS_ACTION; #seekto 0xf18;
u8 KEY_1_LONG_PRESS_ACTION; u8 scanlist_default;
u8 KEY_2_SHORT_PRESS_ACTION; u8 scanlist1_priority_scan;
u8 KEY_2_LONG_PRESS_ACTION; u8 scanlist1_priority_ch1;
u8 SCAN_RESUME_MODE; u8 scanlist1_priority_ch2;
u8 AUTO_KEYPAD_LOCK; u8 scanlist2_priority_scan;
u8 POWER_ON_DISPLAY_MODE; u8 scanlist2_priority_ch1;
u8 scanlist2_priority_ch2;
u8 scanlist_unknown_0xff;
#seekto 0x0E98
#seekto 0xf40;
struct { struct {
u32 POWER_ON_PASSWORD:4, unknown_1:4; u8 flock;
} password; u8 tx350;
u8 killed;
#seekto 0x0EA0; u8 tx200;
u8 VOICE_PROMPT; u8 tx500;
u8 S0_LEVEL;
u8 S9_LEVEL;
#seekto 0x0EA8;
u8 ALARM_MODE;
u8 ROGER;
u8 REPEATER_TAIL_TONE_ELIMINATION;
u8 TX_VFO;
u8 BATTERY_TYPE;
#seekto 0x0EB0;
char EEPROM_WELCOMESTRING1[16];
char EEPROM_WELCOMESTRING2[16];
#seekto 0x0ED0;
u8 DTMF_SIDE_TONE;
char DTMF_SEPARATE_CODE;
char DTMF_GROUP_CALL_CODE;
u8 DTMF_DECODE_RESPONSE;
u8 DTMF_auto_reset_time;
u8 DTMF_PRELOAD_TIME;
u8 DTMF_FIRST_CODE_PERSIST_TIME;
u8 DTMF_HASH_CODE_PERSIST_TIME;
u8 DTMF_CODE_PERSIST_TIME;
u8 DTMF_CODE_INTERVAL_TIME;
u8 PERMIT_REMOTE_KILL;
#seekto 0x0EE0;
char ANI_DTMF_ID[8];
#seekto 0x0EE8;
char KILL_CODE[8];
#seekto 0x0EF0;
char REVIVE_CODE[8];
#seekto 0x0EF8;
char DTMF_UP_CODE[16];
#seekto 0x0F08;
char DTMF_DOWN_CODE[16];
#seekto 0x0F18;
u8 SCANLIST_DEFAULT;
u8 SCANLIST1_ENABLED;
u8 SCANLIST1_PRIORITY_CH1;
u8 SCANLIST1_PRIORITY_CH2;
u8 SCANLIST2_ENABLED;
u8 SCANLIST2_PRIORITY_CH1;
u8 SCANLIST2_PRIORITY_CH2;
#seekto 0x0F30;
bool bHasCustomAesKey;
#seekto 0x0F40;
u8 F_LOCK;
u8 350TX;
u8 KILLED;
u8 200TX;
u8 350EN;
u8 en350; u8 en350;
u8 ScrambleEnable; } lock;
u8 live_DTMF_decoder_bat_txt_micbar_am_fix_bl_txrx;
#seekto 0x1D50; #seekto 0xf46;
u8 CEC_LiveSeekMode; u8 beacon;
u8 CW_KEYTYPE;
u8 CW_SPEED;
u8 CW_TONE;
#seekto 0x1C00; #seekto 0xf47;
u8 micbar;
#seekto 0xf47;
u8 bl_mode;
#seekto 0xf47;
u8 tx_enable;
#seekto 0xf4f;
u8 single_vfo;
#seekto 0xf4f;
u8 signal_meter;
#seekto 0xf4f;
u8 satcom;
#seekto 0xf4f;
u8 upconv;
#seekto 0xf50;
struct { struct {
char name[8]; char name[16];
char number[3]; } channelname[200];
char unused_00[5];
} dtmfcontact[16];
"""
#seekto 0x1c00;
struct {
char name[8];
char number[3];
char unused_00[5];
} dtmfcontact[16];
#seekto 0x1ed0;
struct {
struct {
u8 start;
u8 mid;
u8 end;
} low;
struct {
u8 start;
u8 mid;
u8 end;
} medium;
struct {
u8 start;
u8 mid;
u8 end;
} high;
u8 unused_00[7];
} perbandpowersettings[7];
#seekto 0x1f40;
ul16 battery_level[6];
"""
# bits that we will save from the channel structure (mostly unknown) # bits that we will save from the channel structure (mostly unknown)
SAVE_MASK_0A = 0b11001100 SAVE_MASK_0A = 0b11001100
SAVE_MASK_0B = 0b11101100 SAVE_MASK_0B = 0b11101100