gr55xx_dfu.h
Go to the documentation of this file.
1 /**
2  ******************************************************************************
3  *
4  * @file gr55xx_dfu.h
5  *
6  * @brief Device Firmware Update API
7  *
8  ******************************************************************************
9  * @attention
10  #####Copyright (c) 2019 GOODIX
11  All rights reserved.
12 
13  Redistribution and use in source and binary forms, with or without
14  modification, are permitted provided that the following conditions are met:
15  * Redistributions of source code must retain the above copyright
16  notice, this list of conditions and the following disclaimer.
17  * Redistributions in binary form must reproduce the above copyright
18  notice, this list of conditions and the following disclaimer in the
19  documentation and/or other materials provided with the distribution.
20  * Neither the name of GOODIX nor the names of its contributors may be used
21  to endorse or promote products derived from this software without
22  specific prior written permission.
23 
24  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27  ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
28  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34  POSSIBILITY OF SUCH DAMAGE.
35  *****************************************************************************************
36  */
37 
38 /**
39  * @addtogroup SYSTEM
40  * @{
41  */
42 /**
43  * @addtogroup DFU Device Firmware Update
44  * @{
45  * @brief Definitions and prototypes for the DFU interface.
46  */
47 
48 #ifndef __GR55XX_DFU_H__
49 #define __GR55XX_DFU_H__
50 
51 #include <stdbool.h>
52 #include <stdint.h>
53 
54 /** @addtogroup DFU_DEFINES Defines
55  * @{ */
56 #define DFU_ADV_MAX_LENGTH 18 /**< The max length of advertisement is 18 bytes. */
57 #define HEADER_MAX_LEN 20 /**< The max length of header. */
58 #define RECEIVE_MAX_LEN (1024 * 8 + HEADER_MAX_LEN) /**< The max length of received data is (8192 + HEADER_MAX_LEN) bytes. */
59 
60 /**@defgroup DFU_CMD_DISABLE DFU cmd disable option (bitmask)
61  * @{ */
62 #define DFU_WRITE_RAM_DISABLE 0x0001 /**< Disable DFU write ram. */
63 #define DFU_READ_RAM_DISABLE 0x0002 /**< Disable DFU read ram. */
64 #define DFU_DUMP_FLASH_DISABLE 0x0004 /**< Disable DFU dump flash. */
65 #define DFU_ERASE_FLASH_DISABLE 0x0008 /**< Disable DFU erase flash. */
66 #define DFU_UPDAE_FLASH_DISABLE 0x0010 /**< Disable DFU update flash. */
67 #define DFU_OPERATE_SYSTEM_INFO_DISABLE 0x0020 /**< Disable DFU operate system info area. */
68 #define DFU_OPERATE_NVDS_DISABLE 0x0040 /**< Disable DFU operate NVDS. */
69 #define DFU_OPERATE_EFUSE_DISABLE 0x0080 /**< Disable DFU operate EFUSE. */
70 #define DFU_CONFIG_SPI_FLASH_DISABLE 0x0100 /**< Disable DFU config spi flash. */
71 #define DFU_OPERATE_REG_DISABLE 0x0200 /**< Disable DFU operate register. */
72 /**@} */
73 
74 /** @} */
75 
76 /**@addtogroup DFU_ENUMERATIONS Enumerations
77  * @{ */
78 
79 /**@brief UART baudrate definition. */
80 typedef enum
81 {
82  DFU_UART_BAUDRATE_9600 = 9600, /**< Baudrate 9600. */
83  DFU_UART_BAUDRATE_19200 = 19200, /**< Baudrate 19200. */
84  DFU_UART_BAUDRATE_38400 = 38400, /**< Baudrate 38400. */
85  DFU_UART_BAUDRATE_57600 = 57600, /**< Baudrate 57600. */
86  DFU_UART_BAUDRATE_115200 = 115200, /**< Baudrate 115200. */
87  DFU_UART_BAUDRATE_230400 = 230400, /**< Baudrate 230400. */
88  DFU_UART_BAUDRATE_921600 = 921600, /**< Baudrate 921600. */
90 
91 /**@brief UART data bit definition. */
92 typedef enum
93 {
94  DFU_UART_DATA_BIT_5 = 0, /**< Data bit 5. */
95  DFU_UART_DATA_BIT_6, /**< Data bit 6. */
96  DFU_UART_DATA_BIT_7, /**< Data bit 7. */
97  DFU_UART_DATA_BIT_8, /**< Data bit 8. */
99 
100 /**@brief UART stop bit definition. */
101 typedef enum
102 {
103  DFU_UART_STOP_BIT_1 = 0, /**< Stop bit 1. Avaliable when data bit = 5,6,7,8. */
104  DFU_UART_STOP_BIT_1_5, /**< Stop bit 1.5. Avaliable when data bit = 5. */
105  DFU_UART_STOP_BIT_2, /**< Stop bit 2. Avaliable when data bit = 6,7,8. */
107 
108 /**@brief UART parity definition. */
109 typedef enum
110 {
111  DFU_UART_PARITY_NONE = 0, /**< Parity none. */
112  DFU_UART_PARITY_ODD, /**< Parity odd. */
113  DFU_UART_PARITY_EVEN, /**< Parity even. */
114  DFU_UART_PARITY_SP_0, /**< Parity stick 0. */
115  DFU_UART_PARITY_SP_1, /**< Parity stick 1. */
117 
118 /**@brief UART pin group definition. */
119 typedef enum
120 {
121  DFU_UART_PIN_GROUP_0 = 0, /**< GPIO0_PIN3 -> UART0_TXD(MUX0),GPIO0_PIN4 -> UART0_RXD(MUX0)*/
122  DFU_UART_PIN_GROUP_1, /**< GPIO0_PIN10 -> UART0_TXD(MUX2),GPIO0_PIN11 -> UART0_RXD(MUX2)*/
123  DFU_UART_PIN_GROUP_2, /**< GPIO0_PIN0 -> UART0_TXD(MUX4),GPIO0_PIN1 -> UART0_RXD(MUX4)*/
124  DFU_UART_PIN_GROUP_3, /**< GPIO1_PIN14 -> UART0_TXD(MUX5),GPIO1_PIN10 -> UART0_RXD(MUX5)*/
125  DFU_UART_PIN_GROUP_4, /**< GPIO0_PIN7 -> UART1_TXD(MUX3),GPIO0_PIN6 -> UART1_RXD(MUX3)*/
126  DFU_UART_PIN_GROUP_5, /**< GPIO0_PIN9 -> UART1_TXD(MUX3),GPIO0_PIN8 -> UART1_RXD(MUX3)*/
128 
129 /**@brief DFU informatica status. */
130 typedef enum
131 {
132  DFU_INFO_DISABLE = 0x5775, /**< DFU Config Info Disable. */
133  DFU_INFO_ENABLE = 0x7ff7, /**< DFU Config Info Enable. */
134  DFU_INFO_DEFAULT = 0x4774, /**< DFU Config Info DEFAULT */
136 /** @} */
137 
138 /**@addtogroup DFU_STRUCTURES Structures
139  * @{ */
140 
141 /**@brief BootLoader information definition. */
142 typedef struct
143 {
144  uint32_t bin_size; /**< Firmware Size. */
145  uint32_t check_sum; /**< Firmware Check Sum Value. */
146  uint32_t load_addr; /**< Firmware Load Address. */
147  uint32_t run_addr ; /**< Firmware Run Address. */
148  uint32_t xqspi_xip_cmd; /**< XIP Read Mode. 0x03: Read mode, 0x0B: Fast Read mode, 0x3B: DualOut Fast Read mode,
149  0xBB: DualIO Fast Read mode, 0x6B: QuadOut Fast Read mode, 0xEB: QuadIO Fast Read mode */
150  uint32_t xqspi_speed: 4; /**< Bit: 0-3 clock speed. 0 :64 MHz, 1:48 MHz, 2:32 MHz, 3:24 MHz, 4:16 MHz. */
151  uint32_t code_copy_mode: 1; /**< Bit: 4 code copy mode. 0:XIP,1:QSPI. */
152  uint32_t system_clk: 3; /**< Bit: 5-7 system clock. 0:64 MHz, 1:48 MHz, 2:32 MHz(xo), 3:24 MHz, 4:16 MHz, 5:32 MHz(cpll). */
153  uint32_t check_image:1; /**< Bit: 8 check image. */
154  uint32_t boot_delay:1; /**< Bit: Boot delay flag. */
155  uint32_t is_dap_boot:1; /**< Bit: 11 check if boot dap mode. */
156  uint32_t reserved:21; /**< Bit: 24 reserved. */
157 } boot_info_t;
158 
159 
160 /**@brief DFU uart config definition. */
161 typedef struct
162 {
163  dfu_info_state state; /**< DFU UART Enable or Disable. This parameter can be a value of @ref dfu_info_state.*/
164  dfu_uart_baudrate_t baud_rate; /**< UART communication baudrate. This parameter can be a value of @ref dfu_uart_baudrate_t.*/
165  dfu_uart_data_bit_t data_bit; /**< The number of data bits transmitted or received in a frame. This parameter can be a value of @ref dfu_uart_data_bit_t.*/
166  dfu_uart_stop_bit_t stop_bits; /**< The number of stop bits transmitted. This parameter can be a value of @ref dfu_uart_stop_bit_t.*/
167  dfu_uart_parity_bit_t parity; /**< Specify the parity mode. This parameter can be a value of @ref dfu_uart_parity_bit_t.*/
168  dfu_uart_pin_group_t pin_group; /**< Uart pin group. This parameter can be a value of @ref dfu_uart_pin_group_t.*/
170 
171 /**@brief DFU Advertisement name config definition. */
172 typedef struct
173 {
174  dfu_info_state state; /**< If a set name is used, this parameter can be a value of @ref dfu_info_state.*/
175  uint8_t adv_name[DFU_ADV_MAX_LENGTH]; /**< Adv name data. */
176  uint16_t adv_name_length; /**< The length of the name. */
178 
179 /**@brief DFU NVDS init info definition. */
180 typedef struct
181 {
182  dfu_info_state state; /**< If NVDS init is required, this parameter can be a value of @ref dfu_info_state.*/
183  uint16_t page_size; /**< NVDS page size. */
184  uint32_t start_address; /**< NVDS start address. */
186 
187 /**@brief DFU cmd disable info definition. */
188 typedef struct
189 {
190  dfu_info_state state; /**< If DFU cmd disable config is required, this parameter can be a value of @ref dfu_info_state.*/
191  uint16_t cmd_bit_map; /**< NVDS start address. */
193 
194 
195 /**@brief DFU used functions config definition. */
196 typedef struct
197 {
198  void (*dfu_ble_send_data)(uint8_t *p_data, uint16_t length); /**< The function is used to send data to master by BLE. */
199  void (*dfu_uart_send_data)(uint8_t *p_data, uint16_t length); /**< The function is used to send data to master by UART. */
200  uint32_t (*dfu_flash_read)(const uint32_t addr, uint8_t *p_buf, const uint32_t size); /**< The function is used to read data from flash. */
201  uint32_t (*dfu_flash_write)(const uint32_t addr, const uint8_t *p_buf, const uint32_t size); /**< The function is used to write data to flash. */
202  bool (*dfu_flash_erase)(const uint32_t addr, const uint32_t size); /**< The function is used to erase flash by address. */
203  bool (*dfu_flash_erase_chip)(void); /**< The function is used to erase flash chip. */
204  void (*dfu_flash_set_security)(bool enable); /**< The function is used to set the flash security mode as Enable or Disable. */
205  bool (*dfu_flash_get_security)(void); /**< The function is used to get the flash security mode (Enable or Disable). */
206  void (*dfu_flash_get_info)(uint32_t *id, uint32_t *size); /**< The function is used to get the flash id and size. */
207  uint32_t (*dfu_flash_feat_enable)(uint32_t feature);
208 } dfu_func_t;
209 
210 typedef struct
211 {
212  uint8_t *rec_data_buffer;
214  uint8_t *flash_op_buffer;
216 }dfu_buffer_t;
217 
218 /**@brief SPI used functions config definition. */
219 typedef struct
220 {
221  void (*dfu_spi_flash_init)(uint8_t *p_data); /**< The function is used to config flash spi. */
222  uint32_t (*dfu_spi_flash_read)(uint32_t addr, uint8_t *buf, uint32_t size); /**< The function is used to read external flash . */
223  uint32_t (*dfu_spi_flash_write)(uint32_t addr, uint8_t *buf, uint32_t size); /**< The function is used to write external flash. */
224  bool (*dfu_spi_flash_erase)(uint32_t addr, uint32_t size); /**< The function is used to erase external flash by address. */
225  bool (*dfu_spi_flash_erase_chip)(void); /**< The function is used to erase exteral flash chip. */
226  void (*dfu_spi_flash_get_info)(uint32_t *id, uint32_t *size); /**< The function is used to get external flash id and size. */
228 
229 
230 /**@brief DFU program state callback definition. */
231 typedef struct
232 {
233  void (*dfu_program_start_callback)(void); /**<DFU program start callback. */
234  void (*dfu_programing_callback)(uint8_t pro); /**<DFU programing callback. */
235  void (*dfu_program_end_callback)(uint8_t status); /**<DFU program end callback. */
237 
238 /** @} */
239 
240 
241 /** @addtogroup DFU_FUNCTIONS Functions
242  * @{ */
243 /**
244  *****************************************************************************************
245  * @brief Function for initializing the DFU Used and Program State Callback.
246  *
247  * @note When APP wants to add DFU features, the flash_read and flash_write functions should be registered.
248  * To creat own DFU bootloaders, all functions in dfu_func_t should be registered. In order to show
249  * DFU program states by own DFU bootloaders, all functions in @ref dfu_pro_callback_t should be registered.
250  *
251  * @param[in] p_app_dfu_func: DFU used functions.
252  * @param[in] dfu_buffer: DFU data receiving buffer.
253  * @param[in] p_dfu_callback: DFU program state callback functions.
254  *****************************************************************************************
255  */
256 void dfu_init(dfu_func_t *p_app_dfu_func, dfu_buffer_t *dfu_buffer, dfu_pro_callback_t *p_dfu_callback);
257 
258 /**
259  *****************************************************************************************
260  * @brief Function for reset the DFU cmd parse state.
261  *
262  * @note When APP wants to add DFU timeout feature, shoulde reset DFU cmd parse state when timeout.
263  *****************************************************************************************
264  */
266 
267 /**
268  *****************************************************************************************
269  * @brief Function for setting the BLE MTU size.
270  *
271  * @note If the user wants to create his or her own DFU bootloader, the DFU MTU size should be
272  * set by using this function (when the MTU size is updated, this function should be called).
273  *
274  * @param[in] mtu_size: The BLE MTU size.
275  *****************************************************************************************
276  */
277 void dfu_ble_set_mtu_size(uint16_t mtu_size);
278 
279 /**
280  *****************************************************************************************
281  * @brief This function should be called when BLE stack sends data completely.
282  *
283  * @note This function should be used when the user wants to create his or her own DFU bootloader.
284  *
285  * @retval void
286  *****************************************************************************************
287  */
289 
290 /**
291  *****************************************************************************************
292  * @brief This function should be called when BLE receives data.
293  *
294  * @note This function should be used when the user wants to create his or her own DFU bootloader.
295  *
296  * @param[in] p_data: The received data from BLE.
297  * @param[in] length: The length of data.
298  *****************************************************************************************
299  */
300 void dfu_ble_receive_data_process(uint8_t *p_data, uint16_t length);
301 
302 /**
303  *****************************************************************************************
304  * @brief This function should be called when UART receives data.
305  *
306  * @note This function should be used when the user wants to create his or her own DFU bootloader.
307  *
308  * @param[in] p_data: The received data from UART
309  * @param[in] length: The length of data
310  *****************************************************************************************
311  */
312 void dfu_uart_receive_data_process(uint8_t *p_data, uint16_t length);
313 
314 /**
315  *****************************************************************************************
316  * @brief Function for checking DFU cmd.
317  *
318  * @note This function should be called in main loop.
319  *****************************************************************************************
320  */
321 void dfu_schedule(void);
322 
323 /**
324  *****************************************************************************************
325  * @brief Function for jumping to address to run.
326  *
327  * @note In Apps, if the user wants to jump to another APP or own a DFU bootloader and run the code,
328  * this function can be called. This function does not change the boot info, so the original APP will run after resetting.
329  *
330  * @param[in] start_addr: The jumped address.
331  *****************************************************************************************
332  */
333 void dfu_start_jump(uint32_t start_addr);
334 
335 /**
336  *****************************************************************************************
337  * @brief Function for changing the boot info and reseting device.
338  *
339  * @note In Apps, if the user wants to jump to another APP or own a DFU bootloader and run the code,
340  * this function can be called (the boot info will be changed).
341  *
342  * @param[in] p_boot_info: The boot info of the APP you want to run.
343  *****************************************************************************************
344  */
345 void dfu_start_address(boot_info_t *p_boot_info);
346 
347 /**
348  *****************************************************************************************
349  * @brief Function for set DFU disable cmd.
350  *
351  * @note In Apps, if the user wants to jump to ROM DFU run,but want to be able to control the operation permissions of DFU,
352  * this function can be called.
353  *
354  * @param[in] disable_cmd_bit_map: The bitmask of DFU disable cmd See @ref DFU_CMD_DISABLE.
355  *****************************************************************************************
356  */
357 void dfu_set_disable_cmd(uint16_t disable_cmd_bit_map);
358 
359 /**
360  *****************************************************************************************
361  * @brief Function for initializing the DFU SPI Flash Callback.
362  *
363  * @note When APP wants to add DFU operationally external flash feature, the dfu_spi_flash_func_t should be registered.
364  *
365  * @param[in] spi_flash_func: DFU operationally external flash used functions.
366  *****************************************************************************************
367  */
369 
370 /** @} */
371 #endif
372 /** @} */
373 /** @} */
dfu_uart_info_t::pin_group
dfu_uart_pin_group_t pin_group
Definition: gr55xx_dfu.h:168
DFU_ADV_MAX_LENGTH
#define DFU_ADV_MAX_LENGTH
Definition: gr55xx_dfu.h:56
dfu_set_disable_cmd
void dfu_set_disable_cmd(uint16_t disable_cmd_bit_map)
Function for set DFU disable cmd.
boot_info_t::load_addr
uint32_t load_addr
Definition: gr55xx_dfu.h:146
boot_info_t::code_copy_mode
uint32_t code_copy_mode
Definition: gr55xx_dfu.h:151
DFU_UART_PARITY_ODD
@ DFU_UART_PARITY_ODD
Definition: gr55xx_dfu.h:112
dfu_func_t
DFU used functions config definition.
Definition: gr55xx_dfu.h:197
dfu_ble_receive_data_process
void dfu_ble_receive_data_process(uint8_t *p_data, uint16_t length)
This function should be called when BLE receives data.
DFU_UART_STOP_BIT_1_5
@ DFU_UART_STOP_BIT_1_5
Definition: gr55xx_dfu.h:104
DFU_UART_PIN_GROUP_0
@ DFU_UART_PIN_GROUP_0
Definition: gr55xx_dfu.h:121
dfu_uart_info_t
DFU uart config definition.
Definition: gr55xx_dfu.h:162
DFU_UART_BAUDRATE_9600
@ DFU_UART_BAUDRATE_9600
Definition: gr55xx_dfu.h:82
DFU_UART_PIN_GROUP_3
@ DFU_UART_PIN_GROUP_3
Definition: gr55xx_dfu.h:124
dfu_uart_receive_data_process
void dfu_uart_receive_data_process(uint8_t *p_data, uint16_t length)
This function should be called when UART receives data.
dfu_start_jump
void dfu_start_jump(uint32_t start_addr)
Function for jumping to address to run.
dfu_buffer_t::rec_data_buffer_size
uint16_t rec_data_buffer_size
Definition: gr55xx_dfu.h:213
DFU_UART_DATA_BIT_5
@ DFU_UART_DATA_BIT_5
Definition: gr55xx_dfu.h:94
dfu_nvds_info_t
DFU NVDS init info definition.
Definition: gr55xx_dfu.h:181
dfu_uart_info_t::parity
dfu_uart_parity_bit_t parity
Definition: gr55xx_dfu.h:167
DFU_UART_PARITY_SP_1
@ DFU_UART_PARITY_SP_1
Definition: gr55xx_dfu.h:115
dfu_uart_info_t::data_bit
dfu_uart_data_bit_t data_bit
Definition: gr55xx_dfu.h:165
boot_info_t::xqspi_speed
uint32_t xqspi_speed
Definition: gr55xx_dfu.h:150
boot_info_t::boot_delay
uint32_t boot_delay
Definition: gr55xx_dfu.h:154
dfu_ble_set_mtu_size
void dfu_ble_set_mtu_size(uint16_t mtu_size)
Function for setting the BLE MTU size.
dfu_buffer_t::flash_op_buffer_size
uint16_t flash_op_buffer_size
Definition: gr55xx_dfu.h:215
DFU_UART_BAUDRATE_921600
@ DFU_UART_BAUDRATE_921600
Definition: gr55xx_dfu.h:88
dfu_ble_send_data_cmpl_process
void dfu_ble_send_data_cmpl_process(void)
This function should be called when BLE stack sends data completely.
boot_info_t::bin_size
uint32_t bin_size
Definition: gr55xx_dfu.h:144
DFU_UART_PARITY_SP_0
@ DFU_UART_PARITY_SP_0
Definition: gr55xx_dfu.h:114
dfu_uart_stop_bit_t
dfu_uart_stop_bit_t
UART stop bit definition.
Definition: gr55xx_dfu.h:102
dfu_uart_parity_bit_t
dfu_uart_parity_bit_t
UART parity definition.
Definition: gr55xx_dfu.h:110
DFU_UART_BAUDRATE_230400
@ DFU_UART_BAUDRATE_230400
Definition: gr55xx_dfu.h:87
DFU_UART_BAUDRATE_19200
@ DFU_UART_BAUDRATE_19200
Definition: gr55xx_dfu.h:83
dfu_cmd_disable_t::state
dfu_info_state state
Definition: gr55xx_dfu.h:190
dfu_uart_info_t::stop_bits
dfu_uart_stop_bit_t stop_bits
Definition: gr55xx_dfu.h:166
DFU_UART_STOP_BIT_1
@ DFU_UART_STOP_BIT_1
Definition: gr55xx_dfu.h:103
dfu_info_state
dfu_info_state
DFU informatica status.
Definition: gr55xx_dfu.h:131
DFU_INFO_DISABLE
@ DFU_INFO_DISABLE
Definition: gr55xx_dfu.h:132
dfu_schedule
void dfu_schedule(void)
Function for checking DFU cmd.
dfu_uart_info_t::state
dfu_info_state state
Definition: gr55xx_dfu.h:163
DFU_UART_BAUDRATE_115200
@ DFU_UART_BAUDRATE_115200
Definition: gr55xx_dfu.h:86
dfu_nvds_info_t::page_size
uint16_t page_size
Definition: gr55xx_dfu.h:183
DFU_UART_DATA_BIT_7
@ DFU_UART_DATA_BIT_7
Definition: gr55xx_dfu.h:96
dfu_buffer_t::flash_op_buffer
uint8_t * flash_op_buffer
Definition: gr55xx_dfu.h:214
DFU_UART_PIN_GROUP_2
@ DFU_UART_PIN_GROUP_2
Definition: gr55xx_dfu.h:123
dfu_init
void dfu_init(dfu_func_t *p_app_dfu_func, dfu_buffer_t *dfu_buffer, dfu_pro_callback_t *p_dfu_callback)
Function for initializing the DFU Used and Program State Callback.
boot_info_t::run_addr
uint32_t run_addr
Definition: gr55xx_dfu.h:147
DFU_INFO_DEFAULT
@ DFU_INFO_DEFAULT
Definition: gr55xx_dfu.h:134
DFU_UART_BAUDRATE_38400
@ DFU_UART_BAUDRATE_38400
Definition: gr55xx_dfu.h:84
dfu_start_address
void dfu_start_address(boot_info_t *p_boot_info)
Function for changing the boot info and reseting device.
dfu_uart_pin_group_t
dfu_uart_pin_group_t
UART pin group definition.
Definition: gr55xx_dfu.h:120
boot_info_t::check_sum
uint32_t check_sum
Definition: gr55xx_dfu.h:145
DFU_UART_PIN_GROUP_1
@ DFU_UART_PIN_GROUP_1
Definition: gr55xx_dfu.h:122
dfu_adv_name_info_t::adv_name_length
uint16_t adv_name_length
Definition: gr55xx_dfu.h:176
dfu_uart_data_bit_t
dfu_uart_data_bit_t
UART data bit definition.
Definition: gr55xx_dfu.h:93
dfu_adv_name_info_t::state
dfu_info_state state
Definition: gr55xx_dfu.h:174
DFU_UART_PARITY_EVEN
@ DFU_UART_PARITY_EVEN
Definition: gr55xx_dfu.h:113
dfu_uart_baudrate_t
dfu_uart_baudrate_t
UART baudrate definition.
Definition: gr55xx_dfu.h:81
dfu_spi_flash_func_config
void dfu_spi_flash_func_config(dfu_spi_flash_func_t *spi_flash_func)
Function for initializing the DFU SPI Flash Callback.
dfu_uart_info_t::baud_rate
dfu_uart_baudrate_t baud_rate
Definition: gr55xx_dfu.h:164
dfu_cmd_disable_t::cmd_bit_map
uint16_t cmd_bit_map
Definition: gr55xx_dfu.h:191
DFU_UART_DATA_BIT_6
@ DFU_UART_DATA_BIT_6
Definition: gr55xx_dfu.h:95
boot_info_t
BootLoader information definition.
Definition: gr55xx_dfu.h:143
DFU_UART_STOP_BIT_2
@ DFU_UART_STOP_BIT_2
Definition: gr55xx_dfu.h:105
boot_info_t::check_image
uint32_t check_image
Definition: gr55xx_dfu.h:153
dfu_nvds_info_t::start_address
uint32_t start_address
Definition: gr55xx_dfu.h:184
dfu_buffer_t::rec_data_buffer
uint8_t * rec_data_buffer
Definition: gr55xx_dfu.h:212
dfu_adv_name_info_t
DFU Advertisement name config definition.
Definition: gr55xx_dfu.h:173
boot_info_t::xqspi_xip_cmd
uint32_t xqspi_xip_cmd
Definition: gr55xx_dfu.h:148
dfu_spi_flash_func_t
SPI used functions config definition.
Definition: gr55xx_dfu.h:220
DFU_UART_BAUDRATE_57600
@ DFU_UART_BAUDRATE_57600
Definition: gr55xx_dfu.h:85
boot_info_t::is_dap_boot
uint32_t is_dap_boot
Definition: gr55xx_dfu.h:155
boot_info_t::system_clk
uint32_t system_clk
Definition: gr55xx_dfu.h:152
dfu_pro_callback_t
DFU program state callback definition.
Definition: gr55xx_dfu.h:232
dfu_nvds_info_t::state
dfu_info_state state
Definition: gr55xx_dfu.h:182
dfu_cmd_parse_state_reset
void dfu_cmd_parse_state_reset(void)
Function for reset the DFU cmd parse state.
DFU_UART_PARITY_NONE
@ DFU_UART_PARITY_NONE
Definition: gr55xx_dfu.h:111
DFU_UART_PIN_GROUP_5
@ DFU_UART_PIN_GROUP_5
Definition: gr55xx_dfu.h:126
DFU_INFO_ENABLE
@ DFU_INFO_ENABLE
Definition: gr55xx_dfu.h:133
dfu_cmd_disable_t
DFU cmd disable info definition.
Definition: gr55xx_dfu.h:189
DFU_UART_DATA_BIT_8
@ DFU_UART_DATA_BIT_8
Definition: gr55xx_dfu.h:97
boot_info_t::reserved
uint32_t reserved
Definition: gr55xx_dfu.h:156
dfu_buffer_t
Definition: gr55xx_dfu.h:211
DFU_UART_PIN_GROUP_4
@ DFU_UART_PIN_GROUP_4
Definition: gr55xx_dfu.h:125