/* auto-generated, do not modify */
#pragma once
#include <fwupd-common.h>
typedef enum {
    FU_USI_DOCK_SPI_STATE_NONE,
    FU_USI_DOCK_SPI_STATE_SWITCH_SUCCESS,
    FU_USI_DOCK_SPI_STATE_SWITCH_FAIL,
    FU_USI_DOCK_SPI_STATE_CMD_SUCCESS,
    FU_USI_DOCK_SPI_STATE_CMD_FAIL,
    FU_USI_DOCK_SPI_STATE_RW_SUCCESS,
    FU_USI_DOCK_SPI_STATE_RW_FAIL,
    FU_USI_DOCK_SPI_STATE_READY,
    FU_USI_DOCK_SPI_STATE_BUSY,
    FU_USI_DOCK_SPI_STATE_TIMEOUT,
    FU_USI_DOCK_SPI_STATE_FLASH_FOUND,
    FU_USI_DOCK_SPI_STATE_FLASH_NOT_FOUND,
} FuUsiDockSpiState;
const gchar *fu_usi_dock_spi_state_to_string(FuUsiDockSpiState val);
typedef enum {
    FU_USI_DOCK_FIRMWARE_IDX_NONE = 0x00,
    FU_USI_DOCK_FIRMWARE_IDX_DMC_PD = 0x01,
    FU_USI_DOCK_FIRMWARE_IDX_DP = 0x02,
    FU_USI_DOCK_FIRMWARE_IDX_TBT4 = 0x04,
    FU_USI_DOCK_FIRMWARE_IDX_USB3 = 0x08,
    FU_USI_DOCK_FIRMWARE_IDX_USB2 = 0x10,
    FU_USI_DOCK_FIRMWARE_IDX_AUDIO = 0x20,
    FU_USI_DOCK_FIRMWARE_IDX_I225 = 0x40,
    FU_USI_DOCK_FIRMWARE_IDX_MCU = 0x80,
} FuUsiDockFirmwareIdx;
typedef enum {
    FU_USI_DOCK_TAG2_ISP_BOOT = 0,
    FU_USI_DOCK_TAG2_ISP = 0x5A,
    FU_USI_DOCK_TAG2_CMD_MCU = 0x6A,
    FU_USI_DOCK_TAG2_CMD_SPI = 0x7A,
    FU_USI_DOCK_TAG2_CMD_I2C = 0x8A,
    FU_USI_DOCK_TAG2_MASS_DATA_MCU = 0x6B,
    FU_USI_DOCK_TAG2_MASS_DATA_SPI = 0x7B,
    FU_USI_DOCK_TAG2_MASS_DATA_I2C = 0x8B,
} FuUsiDockTag2;
typedef enum {
    FU_USI_DOCK_MCU_CMD_MCU_NONE = 0x0,
    FU_USI_DOCK_MCU_CMD_MCU_STATUS = 0x1,
    FU_USI_DOCK_MCU_CMD_MCU_JUMP2BOOT = 0x2,
    FU_USI_DOCK_MCU_CMD_READ_MCU_VERSIONPAGE = 0x3,
    FU_USI_DOCK_MCU_CMD_SET_I225_PWR = 0x4,
    FU_USI_DOCK_MCU_CMD_DOCK_RESET = 0x5,
    FU_USI_DOCK_MCU_CMD_VERSION_WRITEBACK = 0x6,
    FU_USI_DOCK_MCU_CMD_SET_CHIP_TYPE = 0x9,
    FU_USI_DOCK_MCU_CMD_FW_INITIAL = 0x0A,
    FU_USI_DOCK_MCU_CMD_FW_UPDATE = 0x0B,
    FU_USI_DOCK_MCU_CMD_FW_TARGET_CHECKSUM = 0x0C,
    FU_USI_DOCK_MCU_CMD_FW_ISP_END = 0x0D,
    FU_USI_DOCK_MCU_CMD_ALL = 0xFF,
} FuUsiDockMcuCmd;
typedef enum {
    FU_USI_DOCK_SPI_CMD_INITIAL = 0x01,
    FU_USI_DOCK_SPI_CMD_ERASE_FLASH = 0x02,
    FU_USI_DOCK_SPI_CMD_PROGRAM = 0x03,
    FU_USI_DOCK_SPI_CMD_WRITE_RESPONSE = 0x04,
    FU_USI_DOCK_SPI_CMD_READ_STATUS = 0x05,
    FU_USI_DOCK_SPI_CMD_CHECKSUM = 0x06,
    FU_USI_DOCK_SPI_CMD_END = 0x07,
    FU_USI_DOCK_SPI_CMD_TRANSFER_FINISH = 0x08,
    FU_USI_DOCK_SPI_CMD_ERROR_END = 0x09,
} FuUsiDockSpiCmd;

GByteArray *fu_struct_usi_dock_hid_req_new(void);
void fu_struct_usi_dock_hid_req_set_length(GByteArray *st, guint8 value);
gboolean fu_struct_usi_dock_hid_req_set_buf(GByteArray *st, const guint8 *buf, gsize bufsz, GError **error);
void fu_struct_usi_dock_hid_req_set_tag3(GByteArray *st, FuUsiDockTag2 value);
#define FU_STRUCT_USI_DOCK_HID_REQ_OFFSET_ID 0x0
#define FU_STRUCT_USI_DOCK_HID_REQ_OFFSET_LENGTH 0x1
#define FU_STRUCT_USI_DOCK_HID_REQ_OFFSET_BUF 0x2
#define FU_STRUCT_USI_DOCK_HID_REQ_OFFSET_TAG3 0x3F
#define FU_STRUCT_USI_DOCK_HID_REQ_SIZE_BUF 0x3D
#define FU_STRUCT_USI_DOCK_HID_REQ_SIZE 0x40
#define FU_STRUCT_USI_DOCK_HID_REQ_DEFAULT_ID 2

GByteArray *fu_struct_usi_dock_mcu_cmd_req_new(void);
void fu_struct_usi_dock_mcu_cmd_req_set_length(GByteArray *st, guint8 value);
gboolean fu_struct_usi_dock_mcu_cmd_req_set_buf(GByteArray *st, const guint8 *buf, gsize bufsz, GError **error);
void fu_struct_usi_dock_mcu_cmd_req_set_tag3(GByteArray *st, FuUsiDockTag2 value);
#define FU_STRUCT_USI_DOCK_MCU_CMD_REQ_OFFSET_ID 0x0
#define FU_STRUCT_USI_DOCK_MCU_CMD_REQ_OFFSET_LENGTH 0x1
#define FU_STRUCT_USI_DOCK_MCU_CMD_REQ_OFFSET_TAG1 0x2
#define FU_STRUCT_USI_DOCK_MCU_CMD_REQ_OFFSET_TAG2 0x3
#define FU_STRUCT_USI_DOCK_MCU_CMD_REQ_OFFSET_BUF 0x4
#define FU_STRUCT_USI_DOCK_MCU_CMD_REQ_OFFSET_TAG3 0x3F
#define FU_STRUCT_USI_DOCK_MCU_CMD_REQ_SIZE_BUF 0x3B
#define FU_STRUCT_USI_DOCK_MCU_CMD_REQ_SIZE 0x40
#define FU_STRUCT_USI_DOCK_MCU_CMD_REQ_DEFAULT_ID 2
#define FU_STRUCT_USI_DOCK_MCU_CMD_REQ_DEFAULT_TAG1 0xFE
#define FU_STRUCT_USI_DOCK_MCU_CMD_REQ_DEFAULT_TAG2 0xFF

GByteArray *fu_struct_usi_dock_mcu_cmd_res_parse(const guint8 *buf, gsize bufsz, gsize offset, GError **error);
FuUsiDockMcuCmd fu_struct_usi_dock_mcu_cmd_res_get_cmd1(const GByteArray *st);
FuUsiDockMcuCmd fu_struct_usi_dock_mcu_cmd_res_get_cmd2(const GByteArray *st);
const guint8 *fu_struct_usi_dock_mcu_cmd_res_get_buf(const GByteArray *st, gsize *bufsz);
FuUsiDockTag2 fu_struct_usi_dock_mcu_cmd_res_get_tag3(const GByteArray *st);
#define FU_STRUCT_USI_DOCK_MCU_CMD_RES_OFFSET_ID 0x0
#define FU_STRUCT_USI_DOCK_MCU_CMD_RES_OFFSET_CMD1 0x1
#define FU_STRUCT_USI_DOCK_MCU_CMD_RES_OFFSET_TAG1 0x2
#define FU_STRUCT_USI_DOCK_MCU_CMD_RES_OFFSET_TAG2 0x3
#define FU_STRUCT_USI_DOCK_MCU_CMD_RES_OFFSET_CMD2 0x4
#define FU_STRUCT_USI_DOCK_MCU_CMD_RES_OFFSET_BUF 0x5
#define FU_STRUCT_USI_DOCK_MCU_CMD_RES_OFFSET_TAG3 0x3F
#define FU_STRUCT_USI_DOCK_MCU_CMD_RES_SIZE_BUF 0x3A
#define FU_STRUCT_USI_DOCK_MCU_CMD_RES_SIZE 0x40
#define FU_STRUCT_USI_DOCK_MCU_CMD_RES_DEFAULT_ID 2
#define FU_STRUCT_USI_DOCK_MCU_CMD_RES_DEFAULT_TAG1 0xFE
#define FU_STRUCT_USI_DOCK_MCU_CMD_RES_DEFAULT_TAG2 0xFF

#define FU_STRUCT_USI_DOCK_ISP_VERSION_OFFSET_DMC 0x0
#define FU_STRUCT_USI_DOCK_ISP_VERSION_OFFSET_PD 0x5
#define FU_STRUCT_USI_DOCK_ISP_VERSION_OFFSET_DP5X 0xA
#define FU_STRUCT_USI_DOCK_ISP_VERSION_OFFSET_DP6X 0xF
#define FU_STRUCT_USI_DOCK_ISP_VERSION_OFFSET_TBT4 0x14
#define FU_STRUCT_USI_DOCK_ISP_VERSION_OFFSET_USB3 0x19
#define FU_STRUCT_USI_DOCK_ISP_VERSION_OFFSET_USB2 0x1E
#define FU_STRUCT_USI_DOCK_ISP_VERSION_OFFSET_AUDIO 0x23
#define FU_STRUCT_USI_DOCK_ISP_VERSION_OFFSET_I255 0x28
#define FU_STRUCT_USI_DOCK_ISP_VERSION_OFFSET_MCU 0x2D
#define FU_STRUCT_USI_DOCK_ISP_VERSION_OFFSET_BCDVERSION 0x2F
#define FU_STRUCT_USI_DOCK_ISP_VERSION_SIZE_DMC 0x5
#define FU_STRUCT_USI_DOCK_ISP_VERSION_SIZE_PD 0x5
#define FU_STRUCT_USI_DOCK_ISP_VERSION_SIZE_DP5X 0x5
#define FU_STRUCT_USI_DOCK_ISP_VERSION_SIZE_DP6X 0x5
#define FU_STRUCT_USI_DOCK_ISP_VERSION_SIZE_TBT4 0x5
#define FU_STRUCT_USI_DOCK_ISP_VERSION_SIZE_USB3 0x5
#define FU_STRUCT_USI_DOCK_ISP_VERSION_SIZE_USB2 0x5
#define FU_STRUCT_USI_DOCK_ISP_VERSION_SIZE_AUDIO 0x5
#define FU_STRUCT_USI_DOCK_ISP_VERSION_SIZE_I255 0x5
#define FU_STRUCT_USI_DOCK_ISP_VERSION_SIZE_MCU 0x2
#define FU_STRUCT_USI_DOCK_ISP_VERSION_SIZE_BCDVERSION 0x2
#define FU_STRUCT_USI_DOCK_ISP_VERSION_SIZE 0x31
