48 #ifndef __GR533X_DFU_H__
49 #define __GR533X_DFU_H__
58 #define DFU_MAX_HEADER_LEN 20
59 #define DFU_MAX_BUFFER_LEN 8192
60 #define DFU_FW_COPY_PATTERN 0x434f5059
61 #define DFU_INFO_ADDR 0x0027E000
63 #define DFU_FRAME_RECEIVE_MAX_LENGTH 2048
64 #define DFU_IMG_INFO_PATTERN 0x4744
118 uint8_t comments[12];
125 void (*dfu_ble_send_data)(uint8_t *data, uint16_t size);
126 void (*dfu_uart_send_data)(uint8_t *data, uint16_t size);
128 uint32_t (*dfu_flash_read)(uint32_t addr, uint8_t *buf, uint32_t size);
129 uint32_t (*dfu_flash_write)(uint32_t addr, uint8_t *buf, uint32_t size);
130 uint32_t (*dfu_flash_erase)(uint32_t erase_type, uint32_t addr, uint32_t size);
131 void (*dfu_flash_get_info)(uint32_t *id, uint32_t *size);
132 uint32_t (*dfu_flash_feat_enable)(uint32_t feature);
139 void (*dfu_spi_flash_init)(uint8_t *p_data);
140 uint32_t (*dfu_spi_flash_read)(uint32_t addr, uint8_t *buf, uint32_t size);
141 uint32_t (*dfu_spi_flash_write)(uint32_t addr, uint8_t *buf, uint32_t size);
142 bool (*dfu_spi_flash_erase)(uint32_t erase_type, uint32_t addr, uint32_t size);
143 void (*dfu_spi_flash_get_info)(uint32_t *id, uint32_t *size);
144 uint32_t (*dfu_flash_feat_enable)(uint32_t feature);
165 void (*dfu_program_start_callback)(void);
166 void (*dfu_programing_callback)(uint8_t pro);
167 void (*dfu_program_end_callback)(uint8_t status);
168 void (*dfu_flash_copy_process)(uint32_t addr);