/*
 * This file is auto-generated, do not modify!
 *
 * SPDX-License-Identifier: LGPL-2.1-or-later
 */

#pragma once
#include <fu-input-stream.h>
/**
 * FuUsiDockSpiState:
 */
typedef enum {
    /**
     * FU_USI_DOCK_SPI_STATE_NONE:
     */
    FU_USI_DOCK_SPI_STATE_NONE,
    /**
     * FU_USI_DOCK_SPI_STATE_SWITCH_SUCCESS:
     */
    FU_USI_DOCK_SPI_STATE_SWITCH_SUCCESS,
    /**
     * FU_USI_DOCK_SPI_STATE_SWITCH_FAIL:
     */
    FU_USI_DOCK_SPI_STATE_SWITCH_FAIL,
    /**
     * FU_USI_DOCK_SPI_STATE_CMD_SUCCESS:
     */
    FU_USI_DOCK_SPI_STATE_CMD_SUCCESS,
    /**
     * FU_USI_DOCK_SPI_STATE_CMD_FAIL:
     */
    FU_USI_DOCK_SPI_STATE_CMD_FAIL,
    /**
     * FU_USI_DOCK_SPI_STATE_RW_SUCCESS:
     */
    FU_USI_DOCK_SPI_STATE_RW_SUCCESS,
    /**
     * FU_USI_DOCK_SPI_STATE_RW_FAIL:
     */
    FU_USI_DOCK_SPI_STATE_RW_FAIL,
    /**
     * FU_USI_DOCK_SPI_STATE_READY:
     */
    FU_USI_DOCK_SPI_STATE_READY,
    /**
     * FU_USI_DOCK_SPI_STATE_BUSY:
     */
    FU_USI_DOCK_SPI_STATE_BUSY,
    /**
     * FU_USI_DOCK_SPI_STATE_TIMEOUT:
     */
    FU_USI_DOCK_SPI_STATE_TIMEOUT,
    /**
     * FU_USI_DOCK_SPI_STATE_FLASH_FOUND:
     */
    FU_USI_DOCK_SPI_STATE_FLASH_FOUND,
    /**
     * FU_USI_DOCK_SPI_STATE_FLASH_NOT_FOUND:
     */
    FU_USI_DOCK_SPI_STATE_FLASH_NOT_FOUND,
}  FuUsiDockSpiState;
#define FU_USI_DOCK_SPI_STATE_LAST 12
const gchar *fu_usi_dock_spi_state_to_string(FuUsiDockSpiState val) G_GNUC_CONST;
/**
 * FuUsiDockFirmwareIdx:
 */
typedef enum {
    /**
     * FU_USI_DOCK_FIRMWARE_IDX_NONE:
     */
    FU_USI_DOCK_FIRMWARE_IDX_NONE = 0x00,
    /**
     * FU_USI_DOCK_FIRMWARE_IDX_DMC_PD:
     */
    FU_USI_DOCK_FIRMWARE_IDX_DMC_PD = 0x01,
    /**
     * FU_USI_DOCK_FIRMWARE_IDX_DP:
     */
    FU_USI_DOCK_FIRMWARE_IDX_DP = 0x02,
    /**
     * FU_USI_DOCK_FIRMWARE_IDX_TBT4:
     */
    FU_USI_DOCK_FIRMWARE_IDX_TBT4 = 0x04,
    /**
     * FU_USI_DOCK_FIRMWARE_IDX_USB3:
     */
    FU_USI_DOCK_FIRMWARE_IDX_USB3 = 0x08,
    /**
     * FU_USI_DOCK_FIRMWARE_IDX_USB2:
     */
    FU_USI_DOCK_FIRMWARE_IDX_USB2 = 0x10,
    /**
     * FU_USI_DOCK_FIRMWARE_IDX_AUDIO:
     */
    FU_USI_DOCK_FIRMWARE_IDX_AUDIO = 0x20,
    /**
     * FU_USI_DOCK_FIRMWARE_IDX_I225:
     */
    FU_USI_DOCK_FIRMWARE_IDX_I225 = 0x40,
    /**
     * FU_USI_DOCK_FIRMWARE_IDX_MCU:
     */
    FU_USI_DOCK_FIRMWARE_IDX_MCU = 0x80,
}  FuUsiDockFirmwareIdx;
const gchar *fu_usi_dock_firmware_idx_to_string(FuUsiDockFirmwareIdx val) G_GNUC_CONST;
/**
 * FuUsiDockTag2:
 */
typedef enum {
    /**
     * FU_USI_DOCK_TAG2_ISP_BOOT:
     *
     * before Common CMD for bootload, with TAG0, TAG1, CMD
     */
    FU_USI_DOCK_TAG2_ISP_BOOT = 0,
    /**
     * FU_USI_DOCK_TAG2_ISP:
     *
     * before Common, with TAG0, TAG1, CMD
     */
    FU_USI_DOCK_TAG2_ISP = 0x5A,
    /**
     * FU_USI_DOCK_TAG2_CMD_MCU:
     *
     * USB->MCU(Common-cmd mode), with TAG0, TAG1, CMD
     */
    FU_USI_DOCK_TAG2_CMD_MCU = 0x6A,
    /**
     * FU_USI_DOCK_TAG2_CMD_SPI:
     *
     * USB->MCU->SPI(Common-cmd mode), with TAG0, TAG1, CMD
     */
    FU_USI_DOCK_TAG2_CMD_SPI = 0x7A,
    /**
     * FU_USI_DOCK_TAG2_CMD_I2C:
     *
     * USB->MCU->I2C(Mass data transmission)
     */
    FU_USI_DOCK_TAG2_CMD_I2C = 0x8A,
    /**
     * FU_USI_DOCK_TAG2_MASS_DATA_MCU:
     *
     * MASS data transfer for MCU 0xA0
     */
    FU_USI_DOCK_TAG2_MASS_DATA_MCU = 0x6B,
    /**
     * FU_USI_DOCK_TAG2_MASS_DATA_SPI:
     *
     * MASS data transfer for External flash 0xA1
     */
    FU_USI_DOCK_TAG2_MASS_DATA_SPI = 0x7B,
    /**
     * FU_USI_DOCK_TAG2_MASS_DATA_I2C:
     *
     * MASS data transfer for TBT flash
     */
    FU_USI_DOCK_TAG2_MASS_DATA_I2C = 0x8B,
}  FuUsiDockTag2;
/**
 * FuUsiDockMcuCmd:
 */
typedef enum {
    /**
     * FU_USI_DOCK_MCU_CMD_MCU_NONE:
     */
    FU_USI_DOCK_MCU_CMD_MCU_NONE = 0x0,
    /**
     * FU_USI_DOCK_MCU_CMD_MCU_STATUS:
     */
    FU_USI_DOCK_MCU_CMD_MCU_STATUS = 0x1,
    /**
     * FU_USI_DOCK_MCU_CMD_MCU_JUMP2BOOT:
     */
    FU_USI_DOCK_MCU_CMD_MCU_JUMP2BOOT = 0x2,
    /**
     * FU_USI_DOCK_MCU_CMD_READ_MCU_VERSIONPAGE:
     */
    FU_USI_DOCK_MCU_CMD_READ_MCU_VERSIONPAGE = 0x3,
    /**
     * FU_USI_DOCK_MCU_CMD_SET_I225_PWR:
     */
    FU_USI_DOCK_MCU_CMD_SET_I225_PWR = 0x4,
    /**
     * FU_USI_DOCK_MCU_CMD_DOCK_RESET:
     */
    FU_USI_DOCK_MCU_CMD_DOCK_RESET = 0x5,
    /**
     * FU_USI_DOCK_MCU_CMD_VERSION_WRITEBACK:
     */
    FU_USI_DOCK_MCU_CMD_VERSION_WRITEBACK = 0x6,
    /**
     * FU_USI_DOCK_MCU_CMD_SET_CHIP_TYPE:
     */
    FU_USI_DOCK_MCU_CMD_SET_CHIP_TYPE = 0x9,
    /**
     * FU_USI_DOCK_MCU_CMD_FW_INITIAL:
     */
    FU_USI_DOCK_MCU_CMD_FW_INITIAL = 0x0A,
    /**
     * FU_USI_DOCK_MCU_CMD_FW_UPDATE:
     */
    FU_USI_DOCK_MCU_CMD_FW_UPDATE = 0x0B,
    /**
     * FU_USI_DOCK_MCU_CMD_FW_TARGET_CHECKSUM:
     */
    FU_USI_DOCK_MCU_CMD_FW_TARGET_CHECKSUM = 0x0C,
    /**
     * FU_USI_DOCK_MCU_CMD_FW_ISP_END:
     */
    FU_USI_DOCK_MCU_CMD_FW_ISP_END = 0x0D,
    /**
     * FU_USI_DOCK_MCU_CMD_SET_PHASE2_DISCONNECT:
     */
    FU_USI_DOCK_MCU_CMD_SET_PHASE2_DISCONNECT = 0x12,
    /**
     * FU_USI_DOCK_MCU_CMD_SET_PHASE2_DELAY:
     */
    FU_USI_DOCK_MCU_CMD_SET_PHASE2_DELAY = 0x13,
    /**
     * FU_USI_DOCK_MCU_CMD_SET_PHASE2_TIMEOUT:
     */
    FU_USI_DOCK_MCU_CMD_SET_PHASE2_TIMEOUT = 0x14,
    /**
     * FU_USI_DOCK_MCU_CMD_GET_PHASE2_PARAMETER:
     */
    FU_USI_DOCK_MCU_CMD_GET_PHASE2_PARAMETER = 0x15,
    /**
     * FU_USI_DOCK_MCU_CMD_ALL:
     */
    FU_USI_DOCK_MCU_CMD_ALL = 0xFF,
}  FuUsiDockMcuCmd;
/**
 * FuUsiDockSpiCmd:
 */
typedef enum {
    /**
     * FU_USI_DOCK_SPI_CMD_INITIAL:
     */
    FU_USI_DOCK_SPI_CMD_INITIAL = 0x01,
    /**
     * FU_USI_DOCK_SPI_CMD_ERASE_FLASH:
     */
    FU_USI_DOCK_SPI_CMD_ERASE_FLASH = 0x02,
    /**
     * FU_USI_DOCK_SPI_CMD_PROGRAM:
     */
    FU_USI_DOCK_SPI_CMD_PROGRAM = 0x03,
    /**
     * FU_USI_DOCK_SPI_CMD_WRITE_RESPONSE:
     */
    FU_USI_DOCK_SPI_CMD_WRITE_RESPONSE = 0x04,
    /**
     * FU_USI_DOCK_SPI_CMD_READ_STATUS:
     */
    FU_USI_DOCK_SPI_CMD_READ_STATUS = 0x05,
    /**
     * FU_USI_DOCK_SPI_CMD_CHECKSUM:
     */
    FU_USI_DOCK_SPI_CMD_CHECKSUM = 0x06,
    /**
     * FU_USI_DOCK_SPI_CMD_END:
     */
    FU_USI_DOCK_SPI_CMD_END = 0x07,
    /**
     * FU_USI_DOCK_SPI_CMD_TRANSFER_FINISH:
     */
    FU_USI_DOCK_SPI_CMD_TRANSFER_FINISH = 0x08,
    /**
     * FU_USI_DOCK_SPI_CMD_ERROR_END:
     */
    FU_USI_DOCK_SPI_CMD_ERROR_END = 0x09,
}  FuUsiDockSpiCmd;
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructUsiDockHidReq;

FuStructUsiDockHidReq *fu_struct_usi_dock_hid_req_ref(FuStructUsiDockHidReq *st) G_GNUC_NON_NULL(1);
void fu_struct_usi_dock_hid_req_unref(FuStructUsiDockHidReq *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructUsiDockHidReq, fu_struct_usi_dock_hid_req_unref)
FuStructUsiDockHidReq *fu_struct_usi_dock_hid_req_new(void) G_GNUC_WARN_UNUSED_RESULT;
void fu_struct_usi_dock_hid_req_set_length(FuStructUsiDockHidReq *st, guint8 value) G_GNUC_NON_NULL(1);
gboolean fu_struct_usi_dock_hid_req_set_buf(FuStructUsiDockHidReq *st, const guint8 *buf, gsize bufsz, GError **error) G_GNUC_NON_NULL(1, 2) G_GNUC_WARN_UNUSED_RESULT;
void fu_struct_usi_dock_hid_req_set_tag3(FuStructUsiDockHidReq *st, FuUsiDockTag2 value) G_GNUC_NON_NULL(1);

#ifndef __GI_SCANNER__
#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
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_USI_DOCK_HID_REQ_SIZE_BUF 0x3D
#define FU_STRUCT_USI_DOCK_HID_REQ_N_ELEMENTS_BUF 61
#define FU_STRUCT_USI_DOCK_HID_REQ_SIZE 0x40
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_USI_DOCK_HID_REQ_DEFAULT_ID 2
#endif
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructUsiDockMcuCmdReq;

FuStructUsiDockMcuCmdReq *fu_struct_usi_dock_mcu_cmd_req_ref(FuStructUsiDockMcuCmdReq *st) G_GNUC_NON_NULL(1);
void fu_struct_usi_dock_mcu_cmd_req_unref(FuStructUsiDockMcuCmdReq *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructUsiDockMcuCmdReq, fu_struct_usi_dock_mcu_cmd_req_unref)
FuStructUsiDockMcuCmdReq *fu_struct_usi_dock_mcu_cmd_req_new(void) G_GNUC_WARN_UNUSED_RESULT;
void fu_struct_usi_dock_mcu_cmd_req_set_length(FuStructUsiDockMcuCmdReq *st, guint8 value) G_GNUC_NON_NULL(1);
gboolean fu_struct_usi_dock_mcu_cmd_req_set_buf(FuStructUsiDockMcuCmdReq *st, const guint8 *buf, gsize bufsz, GError **error) G_GNUC_NON_NULL(1, 2) G_GNUC_WARN_UNUSED_RESULT;
void fu_struct_usi_dock_mcu_cmd_req_set_tag3(FuStructUsiDockMcuCmdReq *st, FuUsiDockTag2 value) G_GNUC_NON_NULL(1);

#ifndef __GI_SCANNER__
#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
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_USI_DOCK_MCU_CMD_REQ_SIZE_BUF 0x3B
#define FU_STRUCT_USI_DOCK_MCU_CMD_REQ_N_ELEMENTS_BUF 59
#define FU_STRUCT_USI_DOCK_MCU_CMD_REQ_SIZE 0x40
#endif

#ifndef __GI_SCANNER__
#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
#endif
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructUsiDockMcuCmdRes;

FuStructUsiDockMcuCmdRes *fu_struct_usi_dock_mcu_cmd_res_ref(FuStructUsiDockMcuCmdRes *st) G_GNUC_NON_NULL(1);
void fu_struct_usi_dock_mcu_cmd_res_unref(FuStructUsiDockMcuCmdRes *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructUsiDockMcuCmdRes, fu_struct_usi_dock_mcu_cmd_res_unref)
FuStructUsiDockMcuCmdRes *fu_struct_usi_dock_mcu_cmd_res_parse(const guint8 *buf, gsize bufsz, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
FuUsiDockMcuCmd fu_struct_usi_dock_mcu_cmd_res_get_cmd1(const FuStructUsiDockMcuCmdRes *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
FuUsiDockMcuCmd fu_struct_usi_dock_mcu_cmd_res_get_cmd2(const FuStructUsiDockMcuCmdRes *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
const guint8 *fu_struct_usi_dock_mcu_cmd_res_get_buf(const FuStructUsiDockMcuCmdRes *st, gsize *bufsz) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
FuUsiDockTag2 fu_struct_usi_dock_mcu_cmd_res_get_tag3(const FuStructUsiDockMcuCmdRes *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;

#ifndef __GI_SCANNER__
#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
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_USI_DOCK_MCU_CMD_RES_SIZE_BUF 0x3A
#define FU_STRUCT_USI_DOCK_MCU_CMD_RES_N_ELEMENTS_BUF 58
#define FU_STRUCT_USI_DOCK_MCU_CMD_RES_SIZE 0x40
#endif

#ifndef __GI_SCANNER__
#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
#endif
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructUsiDockIspVersion;

FuStructUsiDockIspVersion *fu_struct_usi_dock_isp_version_ref(FuStructUsiDockIspVersion *st) G_GNUC_NON_NULL(1);
void fu_struct_usi_dock_isp_version_unref(FuStructUsiDockIspVersion *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructUsiDockIspVersion, fu_struct_usi_dock_isp_version_unref)

#ifndef __GI_SCANNER__
#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
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_USI_DOCK_ISP_VERSION_SIZE_DMC 0x5
#define FU_STRUCT_USI_DOCK_ISP_VERSION_N_ELEMENTS_DMC 5
#define FU_STRUCT_USI_DOCK_ISP_VERSION_SIZE_PD 0x5
#define FU_STRUCT_USI_DOCK_ISP_VERSION_N_ELEMENTS_PD 5
#define FU_STRUCT_USI_DOCK_ISP_VERSION_SIZE_DP5X 0x5
#define FU_STRUCT_USI_DOCK_ISP_VERSION_N_ELEMENTS_DP5X 5
#define FU_STRUCT_USI_DOCK_ISP_VERSION_SIZE_DP6X 0x5
#define FU_STRUCT_USI_DOCK_ISP_VERSION_N_ELEMENTS_DP6X 5
#define FU_STRUCT_USI_DOCK_ISP_VERSION_SIZE_TBT4 0x5
#define FU_STRUCT_USI_DOCK_ISP_VERSION_N_ELEMENTS_TBT4 5
#define FU_STRUCT_USI_DOCK_ISP_VERSION_SIZE_USB3 0x5
#define FU_STRUCT_USI_DOCK_ISP_VERSION_N_ELEMENTS_USB3 5
#define FU_STRUCT_USI_DOCK_ISP_VERSION_SIZE_USB2 0x5
#define FU_STRUCT_USI_DOCK_ISP_VERSION_N_ELEMENTS_USB2 5
#define FU_STRUCT_USI_DOCK_ISP_VERSION_SIZE_AUDIO 0x5
#define FU_STRUCT_USI_DOCK_ISP_VERSION_N_ELEMENTS_AUDIO 5
#define FU_STRUCT_USI_DOCK_ISP_VERSION_SIZE_I255 0x5
#define FU_STRUCT_USI_DOCK_ISP_VERSION_N_ELEMENTS_I255 5
#define FU_STRUCT_USI_DOCK_ISP_VERSION_SIZE_MCU 0x2
#define FU_STRUCT_USI_DOCK_ISP_VERSION_N_ELEMENTS_MCU 2
#define FU_STRUCT_USI_DOCK_ISP_VERSION_SIZE_BCDVERSION 0x2
#define FU_STRUCT_USI_DOCK_ISP_VERSION_N_ELEMENTS_BCDVERSION 2
#define FU_STRUCT_USI_DOCK_ISP_VERSION_SIZE 0x31
#endif

#ifndef __GI_SCANNER__
#endif
