#ifndef __BSP_PARAM_H
#define __BSP_PARAM_H

#define PARAM_BT_XOSC_CAP           (0x00)                                                  //1Byte
#define PARAM_BT_XOSC_CAP_LEN       1
#define PARAM_FOT_ADDR              (PARAM_BT_XOSC_CAP + PARAM_BT_XOSC_CAP_LEN)             //4BYTE
#define PARAM_FOT_ADDR_LEN          4
#define PARAM_FOT_REMOTE_VER        (PARAM_FOT_ADDR + PARAM_FOT_ADDR_LEN)                   //2BYTE
#define PARAM_FOT_REMOTE_VER_LEN    2
#define PARAM_FOT_HEAD_INFO         (PARAM_FOT_REMOTE_VER + PARAM_FOT_REMOTE_VER_LEN)       //8BYTE
#define PARAM_FOT_HEAD_INFO_LEN     8
#define PARAM_FOT_HASH              (PARAM_FOT_HEAD_INFO + PARAM_FOT_HEAD_INFO_LEN)         //4BYTE
#define PARAM_FOT_HASH_LEN          4
#define PARAM_WL_ADDR_INFO          (PARAM_FOT_HASH + PARAM_FOT_HASH_LEN)                   //7BYTE
#define PARAM_WL_ADDR_INFO_LEN      7
#define PARAM_WL_BT_MODE            (PARAM_WL_ADDR_INFO + PARAM_WL_ADDR_INFO_LEN)           //1BYTE
#define PARAM_WL_BT_MODE_LEN        1
#define PARAM_BLE_CENTRAL_ADDR      (PARAM_WL_BT_MODE + PARAM_WL_BT_MODE_LEN)               //7BYTE
#define PARAM_BLE_CENTRAL_ADDR_LEN  7
#define TOUCH_CONFIG_ADDR           (PARAM_BLE_CENTRAL_ADDR + PARAM_BLE_CENTRAL_ADDR_LEN)
#define TOUCH_CONFIG_LEN            36
#define TOUCH_CHIP_TYPE_ADDR        (TOUCH_CONFIG_ADDR + TOUCH_CONFIG_LEN)
#define TOUCH_CHIP_TYPE_LEN          1
#define TOUCH_HASH_FLAG_ADDR         (TOUCH_CHIP_TYPE_ADDR + TOUCH_CHIP_TYPE_LEN)
#define TOUCH_HASH_FLAG_LEN          4


void bsp_param_init(void);
void bsp_param_write(u8 *buf, u32 addr, uint len);
void bsp_param_read(u8 *buf, u32 addr, uint len);
void bsp_param_sync(void);

//fota
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_wl_bt_mode_write(uint8_t mode);
uint8_t param_wl_bt_mode_read(void);

void param_ble_central_addr_write(uint8_t *addr);
void param_ble_central_addr_read(uint8_t *addr);

#endif // __BSP_PARAM_H

