/* auto-generated, do not modify */
#pragma once
#include <fwupd-common.h>
typedef enum {
    FU_WAC_REPORT_ID_FW_DESCRIPTOR = 0xCB,
    FU_WAC_REPORT_ID_SWITCH_TO_FLASH_LOADER = 0xCC,
    FU_WAC_REPORT_ID_QUIT_AND_RESET = 0xCD,
    FU_WAC_REPORT_ID_READ_BLOCK_DATA = 0xD1,
    FU_WAC_REPORT_ID_WRITE_BLOCK = 0xD2,
    FU_WAC_REPORT_ID_ERASE_BLOCK = 0xD3,
    FU_WAC_REPORT_ID_SET_READ_ADDRESS = 0xD4,
    FU_WAC_REPORT_ID_GET_STATUS = 0xD5,
    FU_WAC_REPORT_ID_UPDATE_RESET = 0xD6,
    FU_WAC_REPORT_ID_WRITE_WORD = 0xD7,
    FU_WAC_REPORT_ID_GET_PARAMETERS = 0xD8,
    FU_WAC_REPORT_ID_GET_FLASH_DESCRIPTOR = 0xD9,
    FU_WAC_REPORT_ID_GET_CHECKSUMS = 0xDA,
    FU_WAC_REPORT_ID_SET_CHECKSUM_FOR_BLOCK = 0xDB,
    FU_WAC_REPORT_ID_CALCULATE_CHECKSUM_FOR_BLOCK = 0xDC,
    FU_WAC_REPORT_ID_WRITE_CHECKSUM_TABLE = 0xDE,
    FU_WAC_REPORT_ID_GET_CURRENT_FIRMWARE_IDX = 0xE2,
    FU_WAC_REPORT_ID_MODULE = 0xE4,
} FuWacReportId;
const gchar *fu_wac_report_id_to_string(FuWacReportId val);
typedef enum {
    FU_WAC_MODULE_FW_TYPE_TOUCH = 0x00,
    FU_WAC_MODULE_FW_TYPE_BLUETOOTH = 0x01,
    FU_WAC_MODULE_FW_TYPE_EMR_CORRECTION = 0x02,
    FU_WAC_MODULE_FW_TYPE_BLUETOOTH_HID = 0x03,
    FU_WAC_MODULE_FW_TYPE_SCALER = 0x04,
    FU_WAC_MODULE_FW_TYPE_BLUETOOTH_ID6 = 0x06,
    FU_WAC_MODULE_FW_TYPE_TOUCH_ID7 = 0x07,
    FU_WAC_MODULE_FW_TYPE_BLUETOOTH_ID9 = 0x09,
    FU_WAC_MODULE_FW_TYPE_MAIN = 0x3F,
} FuWacModuleFwType;
const gchar *fu_wac_module_fw_type_to_string(FuWacModuleFwType val);
typedef enum {
    FU_WAC_MODULE_COMMAND_START = 0x01,
    FU_WAC_MODULE_COMMAND_DATA = 0x02,
    FU_WAC_MODULE_COMMAND_END = 0x03,
} FuWacModuleCommand;
const gchar *fu_wac_module_command_to_string(FuWacModuleCommand val);
typedef enum {
    FU_WAC_MODULE_STATUS_OK,
    FU_WAC_MODULE_STATUS_BUSY,
    FU_WAC_MODULE_STATUS_ERR_CRC,
    FU_WAC_MODULE_STATUS_ERR_CMD,
    FU_WAC_MODULE_STATUS_ERR_HW_ACCESS_FAIL,
    FU_WAC_MODULE_STATUS_ERR_FLASH_NO_SUPPORT,
    FU_WAC_MODULE_STATUS_ERR_MODE_WRONG,
    FU_WAC_MODULE_STATUS_ERR_MPU_NO_SUPPORT,
    FU_WAC_MODULE_STATUS_ERR_VERSION_NO_SUPPORT,
    FU_WAC_MODULE_STATUS_ERR_ERASE,
    FU_WAC_MODULE_STATUS_ERR_WRITE,
    FU_WAC_MODULE_STATUS_ERR_EXIT,
    FU_WAC_MODULE_STATUS_ERR,
    FU_WAC_MODULE_STATUS_ERR_INVALID_OP,
    FU_WAC_MODULE_STATUS_ERR_WRONG_IMAGE,
} FuWacModuleStatus;
const gchar *fu_wac_module_status_to_string(FuWacModuleStatus val);
typedef enum {
    FU_WAC_DEVICE_STATUS_UNKNOWN = 0,
    FU_WAC_DEVICE_STATUS_WRITING = 1<<0,
    FU_WAC_DEVICE_STATUS_ERASING = 1<<1,
    FU_WAC_DEVICE_STATUS_ERROR_WRITE = 1<<2,
    FU_WAC_DEVICE_STATUS_ERROR_ERASE = 1<<3,
    FU_WAC_DEVICE_STATUS_WRITE_PROTECTED = 1<<4,
} FuWacDeviceStatus;
gchar *fu_wac_device_status_to_string(FuWacDeviceStatus val);

GByteArray *fu_struct_wta_block_header_parse(const guint8 *buf, gsize bufsz, gsize offset, GError **error);
guint32 fu_struct_wta_block_header_get_block_start(const GByteArray *st);
guint32 fu_struct_wta_block_header_get_block_size(const GByteArray *st);
#define FU_STRUCT_WTA_BLOCK_HEADER_OFFSET_BLOCK_START 0x0
#define FU_STRUCT_WTA_BLOCK_HEADER_OFFSET_BLOCK_SIZE 0x4
#define FU_STRUCT_WTA_BLOCK_HEADER_SIZE 0x8

GByteArray *fu_struct_id9_unknown_cmd_new(void);
void fu_struct_id9_unknown_cmd_set_size(GByteArray *st, guint16 value);
#define FU_STRUCT_ID9_UNKNOWN_CMD_OFFSET_UNKNOWN1 0x0
#define FU_STRUCT_ID9_UNKNOWN_CMD_OFFSET_UNKNOWN2 0x2
#define FU_STRUCT_ID9_UNKNOWN_CMD_OFFSET_SIZE 0x6
#define FU_STRUCT_ID9_UNKNOWN_CMD_SIZE 0x8
#define FU_STRUCT_ID9_UNKNOWN_CMD_DEFAULT_UNKNOWN1 0x7050
#define FU_STRUCT_ID9_UNKNOWN_CMD_DEFAULT_UNKNOWN2 0

GByteArray *fu_struct_id9_spi_cmd_new(void);
void fu_struct_id9_spi_cmd_set_size(GByteArray *st, guint16 value);
gboolean
fu_struct_id9_spi_cmd_set_data(GByteArray *st, GByteArray *st_donor, GError **error);
#define FU_STRUCT_ID9_SPI_CMD_OFFSET_COMMAND 0x0
#define FU_STRUCT_ID9_SPI_CMD_OFFSET_START_ADDR 0x1
#define FU_STRUCT_ID9_SPI_CMD_OFFSET_SIZE 0x5
#define FU_STRUCT_ID9_SPI_CMD_OFFSET_DATA 0x7
#define FU_STRUCT_ID9_SPI_CMD_SIZE_DATA 0x8
#define FU_STRUCT_ID9_SPI_CMD_SIZE 0xF
#define FU_STRUCT_ID9_SPI_CMD_DEFAULT_COMMAND 0x91
#define FU_STRUCT_ID9_SPI_CMD_DEFAULT_START_ADDR 0

GByteArray *fu_struct_id9_loader_cmd_new(void);
gboolean fu_struct_id9_loader_cmd_validate(const guint8 *buf, gsize bufsz, gsize offset, GError **error);
void fu_struct_id9_loader_cmd_set_command(GByteArray *st, guint8 value);
void fu_struct_id9_loader_cmd_set_size(GByteArray *st, guint16 value);
void fu_struct_id9_loader_cmd_set_crc(GByteArray *st, guint32 value);
gboolean
fu_struct_id9_loader_cmd_set_data(GByteArray *st, GByteArray *st_donor, GError **error);
#define FU_STRUCT_ID9_LOADER_CMD_OFFSET_COMMAND 0x0
#define FU_STRUCT_ID9_LOADER_CMD_OFFSET_SIZE 0x1
#define FU_STRUCT_ID9_LOADER_CMD_OFFSET_CRC 0x3
#define FU_STRUCT_ID9_LOADER_CMD_OFFSET_DATA 0x7
#define FU_STRUCT_ID9_LOADER_CMD_SIZE_DATA 0xF
#define FU_STRUCT_ID9_LOADER_CMD_SIZE 0x16
