#ifndef __BSP_PARAM_H
#define __BSP_PARAM_H

#define PARAM_MSC_NUM_SD            0
#define PARAM_MSC_NUM_USB           2
#define PARAM_SYS_VOL               4
#define PARAM_HSF_VOL               5
#define PARAM_LANG_ID               6
#define PARAM_RANDOM_KEY            7           //4Byte random number
#define PARAM_BT_XOSC_CAP           0x0b        //1Byte xosc value
#define PARAM_SYS_MODE              0x0c        //System mode memory
#define PARAM_MSC_NUM_SD1           0x0d        //2BYTE

#define PARAM_MSC_BRKPT_SD          0x10        //10BYTE = frame_count(4byte) +  file_ptr(4byte) + fname_crc(2byte)
#define PARAM_MSC_BRKPT_USB         0x1a        //10BYTE = frame_count(4byte) +  file_ptr(4byte) + fname_crc(2byte)
#define PARAM_MSC_BRKPT_SD1         0x24        //10BYTE = frame_count(4byte) +  file_ptr(4byte) + fname_crc(2byte)

#define PARAM_FMRX_CHCUR            0x30
#define PARAM_FMRX_CHCNT            0x31
#define PARAM_FMRX_CHBUF            0x32        //26Byte
#define PARAM_FMTX_FREQ             0x4C        //FM TX freq 2 Byte
#define PARAM_ECHO_LEVEL            0x4E        //echo level 1 Byte
#define PARAM_ECHO_DELAY            0x4F        //echo delay 1 Byte

#define PARAM_MASTER_ADDR_VALID     0x50        //Whether the address used to record the main ear is valid
#define PARAM_MASTER_ADDR           0x51        //6BYTE
#define PARAM_NEW_LOCAL_NAME        0x57        //64byte=len+sum+62BYTE

//#define PARAM_ANC_MIC0_VAL          0x97        //1Byte，anc mic0 gain
//#define PARAM_ANC_MIC1_VAL          0x98        //1Byte，anc mic1 gain
//#define PARAM_ANC_NR_STA            0x99        //1Byte，anc nr sta
#define PARAM_LHL_SFV               0x97        //4Byte,programmatic softVersion
#define PARAM_LHL_HDV               0x9b        //1Byte,programmatic hardwareVersion
#define PARAM_LHL_OFFTIME           0x9c        //2Byte,Automatic shutdown time of the program,xcfg_cb.sys_off_time = 600;(10 minutes)


#define PARAM_VHOUSE_CH_VALID       0x9F        //Fixed headphone channel of intelligent charging bin
#define PARAM_TKEY_PARAM            0xa0        //tkey param 2byte

#define PARAM_FOT_ADDR              0xa2        //4BYTE
#define PARAM_FOT_REMOTE_VER        0xa6        //2BYTE
#define PARAM_FOT_HEAD_INFO         0xa8        //8BYTE
#define PARAM_FOT_HASH              0xb0        //4BYTE

#define RTCRAM_PWROFF_FLAG          63         //The soft shutdown mark is placed on the last BYTE of RTCRAM

#define PARAM_QR_ADDR_VALID         0xb4        //Used to record whether the Bluetooth address has been modified
#define PARAM_QR_ADDR               (PARAM_QR_ADDR_VALID+1)     //Use the modified Bluetooth address 6byte
#define PARAM_BT_NAME_LEN           (PARAM_QR_ADDR+6)           //Record the maximum Bluetooth length of 32, 1 byte
#define PARAM_BT_NAME               (PARAM_BT_NAME_LEN+1)       //Use the new Bluetooth name 32 byte
#define PARAM_BLE_NAME_LEN          (PARAM_BT_NAME+32)           //Record the maximum Bluetooth length of 32, 1 byte
#define PARAM_BLE_NAME              (PARAM_BLE_NAME_LEN+1)       //Use the new Bluetooth name 32 byte
#define PARAM_RST_FLAG              (PARAM_BLE_NAME+32)          //Reset flag 1 byte
#define PARAM_LHL_UID               (PARAM_RST_FLAG+1)          //6Byte, program UID
//#define PARAM_MIC_ANL_FLG           0xde                      //Analog gain value for recording mic 1 byte
//#define PARAM_MIC_DIG_FLG           0xdf                      //Digital gain value for recording mic 1 byte

#if DUEROS_SUPPORT_EN
#define PARAM_DMA_RAND_FLG			(PARAM_LHL_UID+6)		        //Used to record Dueros DMA rand index 2byte
#define PARAM_DMA_LEFT_TAP_SETTING  (PARAM_DMA_RAND_FLG+1)		    //Used to record the left ear tapping effect of Dueros DMA
#define PARAM_DMA_RIGHT_TAP_SETTING (PARAM_DMA_LEFT_TAP_SETTING+1)  //Used to record the right ear tapping effect of Dueros DMA
#define PARAM_DMA_EAR_DETECTION     (PARAM_DMA_RIGHT_TAP_SETTING+1) //Used to record Dueros DMA headphone detection switch
#endif

#if DUEROS_SUPPORT_EN
#define PARAM_VUART_POPUP_FLAG      (PARAM_DMA_EAR_DETECTION+1)     //Used to record whether the broadcast function is enabled 1byte
#else
#define PARAM_VUART_POPUP_FLAG      (PARAM_LHL_UID+6)               //Used to record whether the broadcast function is enabled 1byte
#endif
#define PARAM_ANC_TP_MIC0_VAL       (PARAM_VUART_POPUP_FLAG+1)      //1Byte，anc_tansparency mic0 gain
#define PARAM_ANC_TP_MIC1_VAL       (PARAM_ANC_TP_MIC0_VAL+1)       //1Byte，anc_tansparency mic1 gain
#define PARAM_QCHECK_CODE           (PARAM_ANC_TP_MIC1_VAL+1)       //4Byte, fast check code of program

void param_init(bool reset);
void param_sync(void);

void param_fot_addr_write(u8 *param);
void param_fot_addr_read(u8 *param);
void param_fot_remote_ver_write(u8 *param);
void param_fot_remote_ver_read(u8 *param);
void param_fot_head_info_write(u8 *param);
void param_fot_head_info_read(u8 *param);
void param_fot_hash_write(u8 *param);
void param_fot_hash_read(u8 *param);
void param_clear_history_reset_write(u8 param);
u8 param_clear_history_reset_read(void);
//wav
void param_sys_vol_write(void);
void param_sys_vol_read(void);

#endif // __BSP_PARAM_H

