2026-08-26 07:26:58 +08:00
|
|
|
|
#ifndef __GLOBAL_H__
|
|
|
|
|
|
#define __GLOBAL_H__
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define MSG_ID_POWER_ON 0
|
|
|
|
|
|
#define MSG_ID_POWER_OFF 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define MSG_TYPE_MN_TASK 2
|
|
|
|
|
|
#define MSG_TYPE_UI_TASK 3
|
|
|
|
|
|
#define MSG_TYPE_BL_TASK 4
|
|
|
|
|
|
|
|
|
|
|
|
#define MSG_ID_TM1629_KEY 10
|
|
|
|
|
|
#define MSG_ID_TM1617_KEY 11
|
|
|
|
|
|
#define MSG_ID_TOUCH 12
|
|
|
|
|
|
#define MSG_ID_TOUCH_LONG_REPEAT 13
|
|
|
|
|
|
#define MSG_ID_BP_KEY 14
|
|
|
|
|
|
#define MSG_ID_ADCIN1KEY 15
|
|
|
|
|
|
#define MSG_ID_HP_SPK_IN 16
|
|
|
|
|
|
#define MSG_ID_EC_VOL 17
|
|
|
|
|
|
#define MSG_ID_BATTERY_VALUE 18
|
|
|
|
|
|
#define MSG_ID_POWOFF_CHARG 19
|
|
|
|
|
|
#define MSG_ID_LIGHT_LED 20
|
|
|
|
|
|
#define MSG_ID_PITCH_OFFSET 21
|
|
|
|
|
|
#define MSG_ID_KEY_1617 22
|
|
|
|
|
|
#define MSG_ID_CHORD_OFFSET 23
|
|
|
|
|
|
#define MSG_ID_BP_TRANSPOSE 24
|
|
|
|
|
|
#define MSG_ID_TAP_SPEED 25
|
|
|
|
|
|
#define MSG_ID_LOOP_LIGHT 26
|
|
|
|
|
|
#define MSG_ID_CHARG 27
|
|
|
|
|
|
|
|
|
|
|
|
#define GPIO_PIN_RESET false
|
|
|
|
|
|
#define GPIO_PIN_SET true
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define HAL_GPIO_ReadPin(gpio_x, pins) gpio_output_data_bit_read(gpio_x, pins)
|
|
|
|
|
|
#define HAL_GPIO_WritePin(gpio_x, pins, flag) gpio_bits_write(gpio_x,pins,flag)
|
|
|
|
|
|
|
|
|
|
|
|
#define GPIO_InitStruct gpio_init_struct
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
|
uint16_t MessageType;
|
|
|
|
|
|
uint16_t ID; // Key ID / Encorder ID
|
|
|
|
|
|
uint16_t HiByte;
|
|
|
|
|
|
uint16_t LoByte;
|
|
|
|
|
|
}DisplayTaskMessage_Type;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
|
uint8_t x;
|
|
|
|
|
|
uint8_t w; // Сд w
|
|
|
|
|
|
uint8_t y;
|
|
|
|
|
|
uint8_t h;
|
|
|
|
|
|
const unsigned char *p;
|
|
|
|
|
|
uint8_t Tab_Align; // <20><>д A
|
|
|
|
|
|
uint16_t Tab_fc; // <20><>ɫ<EFBFBD><C9AB><EFBFBD><EFBFBD> 16λ<36><CEBB>
|
|
|
|
|
|
uint16_t Tab_bc;
|
|
|
|
|
|
uint8_t Tab_size;
|
|
|
|
|
|
uint8_t Text_Align;
|
|
|
|
|
|
uint16_t Text_fc;
|
|
|
|
|
|
uint16_t Text_bc;
|
|
|
|
|
|
uint8_t Text_size;
|
|
|
|
|
|
uint8_t Id;
|
|
|
|
|
|
} LEBEL_UI;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
|
uint16_t Current;
|
|
|
|
|
|
uint16_t Min;
|
|
|
|
|
|
uint16_t Max;
|
|
|
|
|
|
uint16_t Id;
|
|
|
|
|
|
}GUI_SWITCH;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ṹ<EFBFBD><E1B9B9>
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
|
uint16_t x_min; // X<><58>С
|
|
|
|
|
|
uint16_t x_max; // X<><58><EFBFBD>
|
|
|
|
|
|
uint16_t y_min; // Y<><59>С
|
|
|
|
|
|
uint16_t y_max; // Y<><59><EFBFBD>
|
|
|
|
|
|
int8_t Flag; //-1-<2D><> 1-<2D><>
|
|
|
|
|
|
uint8_t Value;
|
|
|
|
|
|
uint8_t ID;
|
|
|
|
|
|
void (*action)(uint8_t,const LEBEL_UI *,GUI_SWITCH *); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ִ<EFBFBD>еĺ<D0B5><C4BA><EFBFBD>
|
|
|
|
|
|
} Touch_AreaTypeDef;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// <20><><EFBFBD>ӿؼ<D3BF><D8BC>ṹ<EFBFBD>壨<EFBFBD><E5A3A8>ȫ<EFBFBD><C8AB><EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC>240x320<32><30><EFBFBD><EFBFBD>
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
|
uint16_t x; // <20><><EFBFBD>Ӳ<EFBFBD><D3B2><EFBFBD><EFBFBD>Ͻ<EFBFBD>X
|
|
|
|
|
|
uint16_t y; // <20><><EFBFBD>Ӳ<EFBFBD><D3B2><EFBFBD><EFBFBD>Ͻ<EFBFBD>Y
|
|
|
|
|
|
uint16_t w; // <20><><EFBFBD>Ӳۿ<D3B2><DBBF><EFBFBD>
|
|
|
|
|
|
uint16_t h; // <20><><EFBFBD>Ӳ<EFBFBD><D3B2>ܸ߶<DCB8>
|
|
|
|
|
|
uint8_t val; // <20><>ǰֵ 0~10<31><30>0=<3D><><EFBFBD>£<EFBFBD>10=<3D><><EFBFBD>ϣ<EFBFBD>
|
|
|
|
|
|
uint8_t id; // <20><><EFBFBD> 0~3
|
|
|
|
|
|
uint16_t prev_slider_y; // <20>ϴλ<CFB4><CEBB><EFBFBD>Y<EFBFBD><59><EFBFBD>꣬<EFBFBD><EAA3AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˢ<EFBFBD><CBA2>
|
|
|
|
|
|
char name[8]; // <20><><EFBFBD>ӱ<EFBFBD><D3B1>⣨MIX/STR/MIC/REV<45><56>
|
|
|
|
|
|
} Fader_t;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
|
|
GUI_TRANSPOSE = 0,
|
|
|
|
|
|
GUI_SPEED,
|
|
|
|
|
|
GUI_MODE_PARAM,
|
|
|
|
|
|
GUI_TIMBRE_SELECT,
|
|
|
|
|
|
GUI_PLAY_SECTION=4,
|
|
|
|
|
|
GUI_TAB_INDEX,
|
|
|
|
|
|
GUI_AUTOBAND_SW,
|
|
|
|
|
|
GUI_BL_SW,
|
|
|
|
|
|
GUI_TAB_LAST_INDEX,
|
2026-09-03 11:58:08 +08:00
|
|
|
|
GUI_NAV_BAR, /* 0902 底栏:Value 0万能 1普通 2专业 3设置 */
|
2026-08-26 07:26:58 +08:00
|
|
|
|
}GUIID;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
|
|
SONG_MODE_PARAM = 0,
|
|
|
|
|
|
EXPRESS_MODE_PARAM = 1,
|
|
|
|
|
|
ALL_MODE_PARAM = 2,
|
|
|
|
|
|
}PARAM_ID;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// TAB <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
typedef enum {
|
|
|
|
|
|
TAB_A = 0, // <20><><EFBFBD><EFBFBD>
|
|
|
|
|
|
TAB_B = 1, // <20><><EFBFBD><EFBFBD>
|
|
|
|
|
|
TAB_C = 2, // <20><><EFBFBD><EFBFBD>
|
|
|
|
|
|
TAB_D = 3, // <20><><EFBFBD><EFBFBD>
|
|
|
|
|
|
} TAB_SECTION_INDEX;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
|
|
GUI_VERSION = 0,
|
|
|
|
|
|
GUI_BLUETOOTH_SW = 1,
|
|
|
|
|
|
GUI_AUTOCLOSE = 2,
|
|
|
|
|
|
GUI_RESTORE = 3,
|
|
|
|
|
|
GUI_CANCEL,
|
|
|
|
|
|
GUI_CONFIRM,
|
|
|
|
|
|
}GUI_SYSTEMSETTING_ID;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// <20><>ɫ<EFBFBD><C9AB><EFBFBD>壨<EFBFBD>ͽ<EFBFBD>ͼ<EFBFBD><CDBC>ȫһ<C8AB>£<EFBFBD>
|
|
|
|
|
|
#define FADER_BG 0x001F // <20><><EFBFBD>Ӳ۱<D3B2><DBB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
#define FADER_GREEN 0x07E0 // <20><>ɫ<EFBFBD><C9AB>
|
|
|
|
|
|
#define FADER_YELLOW 0xFFE0 // <20><>ɫ<EFBFBD><C9AB>
|
|
|
|
|
|
#define FADER_RED 0xF800 // <20><>ɫ<EFBFBD><C9AB>
|
|
|
|
|
|
#define FADER_SLIDER 0x039F // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɫ
|
|
|
|
|
|
#define FADER_TEXT 0xFFFF // <20><><EFBFBD>ְ<EFBFBD>ɫ
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern rt_mutex_t TM1629_Mutex;
|
|
|
|
|
|
extern rt_mutex_t TM1617_Mutex;
|
|
|
|
|
|
extern rt_mq_t MainTask_msg;
|
|
|
|
|
|
extern rt_mq_t UITask_msg;
|
|
|
|
|
|
extern rt_mq_t BLTask_msg;
|
|
|
|
|
|
extern rt_sem_t UART4_sem;
|
|
|
|
|
|
|
|
|
|
|
|
extern rt_timer_t OutTime_Stop_timer;
|
|
|
|
|
|
|
|
|
|
|
|
extern uint8_t KEY_ID_1629;
|
|
|
|
|
|
|
|
|
|
|
|
extern bool powon;
|
2026-08-31 08:20:24 +08:00
|
|
|
|
void Power_Key_Scan(void);
|
2026-09-05 18:13:31 +08:00
|
|
|
|
void AutoPowerOff_Scan(void);
|
2026-08-31 08:20:24 +08:00
|
|
|
|
void System_PowerOn(void);
|
2026-09-08 10:00:55 +08:00
|
|
|
|
void System_RequestPowerOff(void);
|
|
|
|
|
|
void System_PowerOff_Poll(void);
|
2026-08-26 07:26:58 +08:00
|
|
|
|
extern uint8_t Led;
|
|
|
|
|
|
extern bool PressFlag;
|
|
|
|
|
|
|
|
|
|
|
|
extern volatile uint32_t ADDRESS;
|
|
|
|
|
|
|
|
|
|
|
|
extern uint8_t key_toggle[4];
|
|
|
|
|
|
|
|
|
|
|
|
extern bool StartFlag;
|
|
|
|
|
|
|
2026-09-05 21:56:14 +08:00
|
|
|
|
extern int16_t MIC_VOL_MAP[11];
|
2026-08-26 07:26:58 +08:00
|
|
|
|
extern const uint8_t Version[3];
|
|
|
|
|
|
extern uint8_t AutoCloseTime;
|
|
|
|
|
|
extern uint16_t mAutoPowerOffCount;
|
|
|
|
|
|
extern bool AutoCloseFlag;
|
|
|
|
|
|
|
|
|
|
|
|
extern const Touch_AreaTypeDef *pCurrentTouch_Area;
|
|
|
|
|
|
extern const Touch_AreaTypeDef Touch_Areas[];
|
|
|
|
|
|
|
|
|
|
|
|
extern uint8_t TOUCH_AREA_NUM;
|
|
|
|
|
|
// 4<><34><EFBFBD><EFBFBD><EFBFBD>ӣ<EFBFBD><D3A3><EFBFBD><EFBFBD>ࡢ<EFBFBD><E0A1A2><EFBFBD>֡<EFBFBD><D6A1><EFBFBD>˷硢<CBB7><E7A1A2><EFBFBD>죩
|
|
|
|
|
|
extern Fader_t faders[4];
|
|
|
|
|
|
extern GUI_SWITCH mGuiData[];
|
|
|
|
|
|
extern const LEBEL_UI UI_Label[];
|
|
|
|
|
|
extern GUI_SWITCH ParamGuiData[];
|
|
|
|
|
|
|
|
|
|
|
|
extern void (*CurrUIProcress)(DisplayTaskMessage_Type xEvent);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void Stop_AutoBand();
|
|
|
|
|
|
|
|
|
|
|
|
static void ShowPowerOn();
|
|
|
|
|
|
|
|
|
|
|
|
void GET_ParamNum_Str(int16_t NUM, uint8_t ValidLen, char* Str, uint8_t hasSign);
|
|
|
|
|
|
|
|
|
|
|
|
void MainTask_Sendmsg(uint16_t ID, uint16_t ID2, uint16_t HiByte, uint16_t LoByte);
|
|
|
|
|
|
void UITask_Sendmsg(uint16_t ID, uint16_t ID2, uint16_t HiByte, uint16_t LoByte);
|
|
|
|
|
|
void BLTask_Sendmsg(uint16_t ID, uint16_t ID2, uint16_t HiByte, uint16_t LoByte);
|
|
|
|
|
|
|
|
|
|
|
|
void ResetAutoPowerCount(void);
|
|
|
|
|
|
uint8_t GUI_Item_AjustValue(GUI_SWITCH * Group, int8_t Dir);
|
|
|
|
|
|
void GUI_Item_AjustLoopValue(GUI_SWITCH * Group, int8_t Dir);
|
|
|
|
|
|
|
|
|
|
|
|
void Send_volume(uint8_t vol);
|
|
|
|
|
|
|
|
|
|
|
|
void ADC_IN1_KEY_Handle(uint8_t key,bool on);
|
|
|
|
|
|
void TM1617_Handle(uint8_t key);
|
|
|
|
|
|
void TM1629_Handle(uint8_t key);
|
|
|
|
|
|
void Pick_Handle();
|
|
|
|
|
|
void Loop_Light_Handle(uint8_t measure);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void BL_Set_led(uint8_t Led, uint8_t chord_type);
|
|
|
|
|
|
|
|
|
|
|
|
uint8_t GetChordNotesByType(uint8_t MIDI_Index,uint8_t type,uint8_t *buff);
|
2026-09-04 17:06:02 +08:00
|
|
|
|
/* 伴奏已在播时仅更新和弦音,不 Restart(快转调) */
|
|
|
|
|
|
void Accomp_UpdatePlayingChord(void);
|
2026-08-26 07:26:58 +08:00
|
|
|
|
void BT_Chord_offset_map(uint8_t pos_offset,uint8_t chord_offset);
|
|
|
|
|
|
void BT_Pitch_offset_map(uint8_t pos_offset,uint8_t pitch_offset);
|
|
|
|
|
|
void Read_Cur_Measure();
|
|
|
|
|
|
#endif
|