gr55xx_dfu.h File Reference

Device Firmware Update API. More...

#include <stdbool.h>
#include <stdint.h>

Go to the source code of this file.

Classes

struct  boot_info_t
 BootLoader information definition. More...
 
struct  dfu_uart_info_t
 DFU uart config definition. More...
 
struct  dfu_adv_name_info_t
 DFU Advertisement name config definition. More...
 
struct  dfu_nvds_info_t
 DFU NVDS init info definition. More...
 
struct  dfu_cmd_disable_t
 DFU cmd disable info definition. More...
 
struct  dfu_func_t
 DFU used functions config definition. More...
 
struct  dfu_spi_flash_func_t
 SPI used functions config definition. More...
 
struct  dfu_pro_callback_t
 DFU program state callback definition. More...
 

Macros

#define DFU_ADV_MAX_LENGTH   18
 The max length of advertisement is 18 bytes. More...
 
#define RECEIVE_MAX_LEN   2048
 The max length of received data is 2048 bytes. More...
 
#define DFU_WRITE_RAM_DISABLE   0x0001
 Disable DFU write ram. More...
 
#define DFU_READ_RAM_DISABLE   0x0002
 Disable DFU read ram. More...
 
#define DFU_DUMP_FLASH_DISABLE   0x0004
 Disable DFU dump flash. More...
 
#define DFU_ERASE_FLASH_DISABLE   0x0008
 Disable DFU erase flash. More...
 
#define DFU_UPDAE_FLASH_DISABLE   0x0010
 Disable DFU update flash. More...
 
#define DFU_OPERATE_SYSTEM_INFO_DISABLE   0x0020
 Disable DFU operate system info area. More...
 
#define DFU_OPERATE_NVDS_DISABLE   0x0040
 Disable DFU operate NVDS. More...
 
#define DFU_OPERATE_EFUSE_DISABLE   0x0080
 Disable DFU operate EFUSE. More...
 
#define DFU_CONFIG_SPI_FLASH_DISABLE   0x0100
 Disable DFU config spi flash. More...
 
#define DFU_OPERATE_REG_DISABLE   0x0200
 Disable DFU operate register. More...
 

Enumerations

enum  dfu_uart_baudrate_t {
  DFU_UART_BAUDRATE_9600 = 9600, DFU_UART_BAUDRATE_19200 = 19200, DFU_UART_BAUDRATE_38400 = 38400, DFU_UART_BAUDRATE_57600 = 57600,
  DFU_UART_BAUDRATE_115200 = 115200, DFU_UART_BAUDRATE_230400 = 230400, DFU_UART_BAUDRATE_921600 = 921600
}
 UART baudrate definition. More...
 
enum  dfu_uart_data_bit_t { DFU_UART_DATA_BIT_5 = 0, DFU_UART_DATA_BIT_6, DFU_UART_DATA_BIT_7, DFU_UART_DATA_BIT_8 }
 UART data bit definition. More...
 
enum  dfu_uart_stop_bit_t { DFU_UART_STOP_BIT_1 = 0, DFU_UART_STOP_BIT_1_5, DFU_UART_STOP_BIT_2 }
 UART stop bit definition. More...
 
enum  dfu_uart_parity_bit_t {
  DFU_UART_PARITY_NONE = 0, DFU_UART_PARITY_ODD, DFU_UART_PARITY_EVEN, DFU_UART_PARITY_SP_0,
  DFU_UART_PARITY_SP_1
}
 UART parity definition. More...
 
enum  dfu_uart_pin_group_t {
  DFU_UART_PIN_GROUP_0 = 0, DFU_UART_PIN_GROUP_1, DFU_UART_PIN_GROUP_2, DFU_UART_PIN_GROUP_3,
  DFU_UART_PIN_GROUP_4, DFU_UART_PIN_GROUP_5
}
 UART pin group definition. More...
 
enum  dfu_info_state { DFU_INFO_DISABLE = 0x5775, DFU_INFO_ENABLE = 0x7ff7, DFU_INFO_DEFAULT = 0x4774 }
 DFU informatica status. More...
 

Functions

void dfu_init (dfu_func_t *p_app_dfu_func, uint8_t *p_dfu_buffer, dfu_pro_callback_t *p_dfu_callback)
 Function for initializing the DFU Used and Program State Callback. More...
 
void dfu_cmd_parse_state_reset (void)
 Function for reset the DFU cmd parse state. More...
 
void dfu_ble_set_mtu_size (uint16_t mtu_size)
 Function for setting the BLE MTU size. More...
 
void dfu_ble_send_data_cmpl_process (void)
 This function should be called when BLE stack sends data completely. More...
 
void dfu_ble_receive_data_process (uint8_t *p_data, uint16_t length)
 This function should be called when BLE receives data. More...
 
void dfu_uart_receive_data_process (uint8_t *p_data, uint16_t length)
 This function should be called when UART receives data. More...
 
void dfu_schedule (void)
 Function for checking DFU cmd. More...
 
void dfu_start_jump (uint32_t start_addr)
 Function for jumping to address to run. More...
 
void dfu_start_address (boot_info_t *p_boot_info)
 Function for changing the boot info and reseting device. More...
 
void dfu_set_disable_cmd (uint16_t disable_cmd_bit_map)
 Function for set DFU disable cmd. More...
 
void dfu_spi_flash_func_config (dfu_spi_flash_func_t *spi_flash_func)
 Function for initializing the DFU SPI Flash Callback. More...
 

Detailed Description

Device Firmware Update API.

Attention
Copyright (c) 2019 GOODIX

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of GOODIX nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file gr55xx_dfu.h.