48 #ifndef __GR55XX_DFU_H__
49 #define __GR55XX_DFU_H__
56 #define DFU_FRAME_RECEIVE_MAX_LENGTH 2048
57 #define DFU_IMG_INFO_PATTERN 0x4744
61 #define DFU_WRITE_RAM_DISABLE 0x0001
62 #define DFU_READ_RAM_DISABLE 0x0002
63 #define DFU_DUMP_FLASH_DISABLE 0x0004
64 #define DFU_ERASE_FLASH_DISABLE 0x0008
65 #define DFU_UPDAE_FLASH_DISABLE 0x0010
66 #define DFU_OPERATE_SYSTEM_INFO_DISABLE 0x0020
67 #define DFU_OPERATE_NVDS_DISABLE 0x0040
68 #define DFU_OPERATE_EFUSE_DISABLE 0x0080
69 #define DFU_CONFIG_SPI_FLASH_DISABLE 0x0100
70 #define DFU_OPERATE_REG_DISABLE 0x0200
109 uint8_t comments[12];
116 void (*dfu_ble_send_data)(uint8_t *p_data, uint16_t length);
117 void (*dfu_uart_send_data)(uint8_t *p_data, uint16_t length);
118 uint32_t (*dfu_flash_read)(
const uint32_t addr, uint8_t *p_buf,
const uint32_t size);
119 uint32_t (*dfu_flash_write)(
const uint32_t addr,
const uint8_t *p_buf,
const uint32_t size);
120 bool (*dfu_flash_erase)(
const uint32_t addr,
const uint32_t size);
121 bool (*dfu_flash_erase_chip)(void);
122 void (*dfu_flash_set_security)(
bool enable);
123 bool (*dfu_flash_get_security)(void);
124 void (*dfu_flash_get_info)(uint32_t *id, uint32_t *size);
130 void (*dfu_spi_flash_init)(uint8_t *p_data);
131 uint32_t (*dfu_spi_flash_read)(uint32_t addr, uint8_t *buf, uint32_t size);
132 uint32_t (*dfu_spi_flash_write)(uint32_t addr, uint8_t *buf, uint32_t size);
133 bool (*dfu_spi_flash_erase)(uint32_t addr, uint32_t size);
134 bool (*dfu_spi_flash_erase_chip)(void);
135 void (*dfu_spi_flash_get_info)(uint32_t *id, uint32_t *size);
142 void (*dfu_program_start_callback)(void);
143 void (*dfu_programing_callback)(uint8_t pro);
144 void (*dfu_program_end_callback)(uint8_t status);