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

#pragma once
#include <fu-input-stream.h>
/**
 * FuSunwinonHidReport:
 */
typedef enum {
    /**
     * FU_SUNWINON_HID_REPORT_CHANNEL_ID:
     */
    FU_SUNWINON_HID_REPORT_CHANNEL_ID = 0x61,
}  FuSunwinonHidReport;
/**
 * FuSunwinonDfuCmd:
 */
typedef enum {
    /**
     * FU_SUNWINON_DFU_CMD_GET_INFO:
     */
    FU_SUNWINON_DFU_CMD_GET_INFO = 0x0001,
    /**
     * FU_SUNWINON_DFU_CMD_PROGRAM_START:
     */
    FU_SUNWINON_DFU_CMD_PROGRAM_START = 0x0023,
    /**
     * FU_SUNWINON_DFU_CMD_PROGRAM_FLASH:
     */
    FU_SUNWINON_DFU_CMD_PROGRAM_FLASH = 0x0024,
    /**
     * FU_SUNWINON_DFU_CMD_PROGRAM_END:
     */
    FU_SUNWINON_DFU_CMD_PROGRAM_END = 0x0025,
    /**
     * FU_SUNWINON_DFU_CMD_SYSTEM_INFO:
     */
    FU_SUNWINON_DFU_CMD_SYSTEM_INFO = 0x0027,
    /**
     * FU_SUNWINON_DFU_CMD_MODE_SET:
     */
    FU_SUNWINON_DFU_CMD_MODE_SET = 0x0041,
    /**
     * FU_SUNWINON_DFU_CMD_FW_INFO_GET:
     */
    FU_SUNWINON_DFU_CMD_FW_INFO_GET = 0x0042,
    /**
     * FU_SUNWINON_DFU_CMD_FAST_DFU_FLASH_SUCCESS:
     */
    FU_SUNWINON_DFU_CMD_FAST_DFU_FLASH_SUCCESS = 0x00FF,
}  FuSunwinonDfuCmd;
const gchar *fu_sunwinon_dfu_cmd_to_string(FuSunwinonDfuCmd val) G_GNUC_CONST;
/**
 * FuSunwinonDfuAck:
 */
typedef enum {
    /**
     * FU_SUNWINON_DFU_ACK_SUCCESS:
     */
    FU_SUNWINON_DFU_ACK_SUCCESS = 0x01,
    /**
     * FU_SUNWINON_DFU_ACK_ERROR:
     */
    FU_SUNWINON_DFU_ACK_ERROR = 0x02,
}  FuSunwinonDfuAck;
/**
 * FuSunwinonFwType:
 */
typedef enum {
    /**
     * FU_SUNWINON_FW_TYPE_NORMAL:
     */
    FU_SUNWINON_FW_TYPE_NORMAL = 0x00,
    /**
     * FU_SUNWINON_FW_TYPE_SIGNED:
     */
    FU_SUNWINON_FW_TYPE_SIGNED = 0x10,
}  FuSunwinonFwType;
const gchar *fu_sunwinon_fw_type_to_string(FuSunwinonFwType val) G_GNUC_CONST;
/**
 * FuSunwinonDfuUpgradeMode:
 */
typedef enum {
    /**
     * FU_SUNWINON_DFU_UPGRADE_MODE_COPY:
     */
    FU_SUNWINON_DFU_UPGRADE_MODE_COPY = 1,
    /**
     * FU_SUNWINON_DFU_UPGRADE_MODE_NON_COPY:
     */
    FU_SUNWINON_DFU_UPGRADE_MODE_NON_COPY = 2,
}  FuSunwinonDfuUpgradeMode;
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructSunwinonHidOut;

FuStructSunwinonHidOut *fu_struct_sunwinon_hid_out_ref(FuStructSunwinonHidOut *st) G_GNUC_NON_NULL(1);
void fu_struct_sunwinon_hid_out_unref(FuStructSunwinonHidOut *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructSunwinonHidOut, fu_struct_sunwinon_hid_out_unref)
FuStructSunwinonHidOut *fu_struct_sunwinon_hid_out_new(void) G_GNUC_WARN_UNUSED_RESULT;
void fu_struct_sunwinon_hid_out_set_device_id(FuStructSunwinonHidOut *st, guint8 value) G_GNUC_NON_NULL(1);
void fu_struct_sunwinon_hid_out_set_sub_id(FuStructSunwinonHidOut *st, guint8 value) G_GNUC_NON_NULL(1);
void fu_struct_sunwinon_hid_out_set_data_len(FuStructSunwinonHidOut *st, guint16 value) G_GNUC_NON_NULL(1);
void fu_struct_sunwinon_hid_out_set_dfu_cmd_type(FuStructSunwinonHidOut *st, FuSunwinonDfuCmd value) G_GNUC_NON_NULL(1);
void fu_struct_sunwinon_hid_out_set_dfu_data_len(FuStructSunwinonHidOut *st, guint16 value) G_GNUC_NON_NULL(1);
gboolean fu_struct_sunwinon_hid_out_set_data(FuStructSunwinonHidOut *st, const guint8 *buf, gsize bufsz, GError **error) G_GNUC_NON_NULL(1, 2) G_GNUC_WARN_UNUSED_RESULT;

#ifndef __GI_SCANNER__
#define FU_STRUCT_SUNWINON_HID_OUT_OFFSET_REPORT_ID 0x0
#define FU_STRUCT_SUNWINON_HID_OUT_OFFSET_DEVICE_ID 0x1
#define FU_STRUCT_SUNWINON_HID_OUT_OFFSET_SUB_ID 0x2
#define FU_STRUCT_SUNWINON_HID_OUT_OFFSET_DATA_LEN 0x3
#define FU_STRUCT_SUNWINON_HID_OUT_OFFSET_DFU_MAGIC 0x5
#define FU_STRUCT_SUNWINON_HID_OUT_OFFSET_DFU_CMD_TYPE 0x7
#define FU_STRUCT_SUNWINON_HID_OUT_OFFSET_DFU_DATA_LEN 0x9
#define FU_STRUCT_SUNWINON_HID_OUT_OFFSET_DATA 0xB
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_SUNWINON_HID_OUT_SIZE_DATA 0x1DA
#define FU_STRUCT_SUNWINON_HID_OUT_N_ELEMENTS_DATA 474
#define FU_STRUCT_SUNWINON_HID_OUT_SIZE 0x1E5
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_SUNWINON_HID_OUT_DEFAULT_REPORT_ID FU_SUNWINON_HID_REPORT_CHANNEL_ID
#define FU_STRUCT_SUNWINON_HID_OUT_DEFAULT_DEVICE_ID 0x00
#define FU_STRUCT_SUNWINON_HID_OUT_DEFAULT_SUB_ID 0x01
#define FU_STRUCT_SUNWINON_HID_OUT_DEFAULT_DFU_MAGIC 0x4744
#endif
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructSunwinonHidIn;

FuStructSunwinonHidIn *fu_struct_sunwinon_hid_in_ref(FuStructSunwinonHidIn *st) G_GNUC_NON_NULL(1);
void fu_struct_sunwinon_hid_in_unref(FuStructSunwinonHidIn *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructSunwinonHidIn, fu_struct_sunwinon_hid_in_unref)
FuStructSunwinonHidIn *fu_struct_sunwinon_hid_in_parse(const guint8 *buf, gsize bufsz, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_sunwinon_hid_in_get_device_id(const FuStructSunwinonHidIn *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_sunwinon_hid_in_get_sub_id(const FuStructSunwinonHidIn *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_sunwinon_hid_in_get_data_len(const FuStructSunwinonHidIn *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
FuSunwinonDfuCmd fu_struct_sunwinon_hid_in_get_dfu_cmd_type(const FuStructSunwinonHidIn *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_sunwinon_hid_in_get_dfu_data_len(const FuStructSunwinonHidIn *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
const guint8 *fu_struct_sunwinon_hid_in_get_data(const FuStructSunwinonHidIn *st, gsize *bufsz) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;

#ifndef __GI_SCANNER__
#define FU_STRUCT_SUNWINON_HID_IN_OFFSET_REPORT_ID 0x0
#define FU_STRUCT_SUNWINON_HID_IN_OFFSET_DEVICE_ID 0x1
#define FU_STRUCT_SUNWINON_HID_IN_OFFSET_SUB_ID 0x2
#define FU_STRUCT_SUNWINON_HID_IN_OFFSET_DATA_LEN 0x3
#define FU_STRUCT_SUNWINON_HID_IN_OFFSET_DFU_MAGIC 0x5
#define FU_STRUCT_SUNWINON_HID_IN_OFFSET_DFU_CMD_TYPE 0x7
#define FU_STRUCT_SUNWINON_HID_IN_OFFSET_DFU_DATA_LEN 0x9
#define FU_STRUCT_SUNWINON_HID_IN_OFFSET_DATA 0xB
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_SUNWINON_HID_IN_SIZE_DATA 0x1DA
#define FU_STRUCT_SUNWINON_HID_IN_N_ELEMENTS_DATA 474
#define FU_STRUCT_SUNWINON_HID_IN_SIZE 0x1E5
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_SUNWINON_HID_IN_DEFAULT_REPORT_ID FU_SUNWINON_HID_REPORT_CHANNEL_ID
#define FU_STRUCT_SUNWINON_HID_IN_DEFAULT_DFU_MAGIC 0x4744
#endif
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructSunwinonDfuPayloadSystemInfo;

FuStructSunwinonDfuPayloadSystemInfo *fu_struct_sunwinon_dfu_payload_system_info_ref(FuStructSunwinonDfuPayloadSystemInfo *st) G_GNUC_NON_NULL(1);
void fu_struct_sunwinon_dfu_payload_system_info_unref(FuStructSunwinonDfuPayloadSystemInfo *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructSunwinonDfuPayloadSystemInfo, fu_struct_sunwinon_dfu_payload_system_info_unref)
FuStructSunwinonDfuPayloadSystemInfo *fu_struct_sunwinon_dfu_payload_system_info_new(void) G_GNUC_WARN_UNUSED_RESULT;
void fu_struct_sunwinon_dfu_payload_system_info_set_flash_start_addr(FuStructSunwinonDfuPayloadSystemInfo *st, guint32 value) G_GNUC_NON_NULL(1);

#ifndef __GI_SCANNER__
#define FU_STRUCT_SUNWINON_DFU_PAYLOAD_SYSTEM_INFO_OFFSET_OPCODE 0x0
#define FU_STRUCT_SUNWINON_DFU_PAYLOAD_SYSTEM_INFO_OFFSET_FLASH_START_ADDR 0x1
#define FU_STRUCT_SUNWINON_DFU_PAYLOAD_SYSTEM_INFO_OFFSET_LEN 0x5
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_SUNWINON_DFU_PAYLOAD_SYSTEM_INFO_SIZE 0x7
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_SUNWINON_DFU_PAYLOAD_SYSTEM_INFO_DEFAULT_OPCODE 0x00
#define FU_STRUCT_SUNWINON_DFU_PAYLOAD_SYSTEM_INFO_DEFAULT_LEN 0x30
#endif
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructSunwinonDfuPayloadProgramStart;

FuStructSunwinonDfuPayloadProgramStart *fu_struct_sunwinon_dfu_payload_program_start_ref(FuStructSunwinonDfuPayloadProgramStart *st) G_GNUC_NON_NULL(1);
void fu_struct_sunwinon_dfu_payload_program_start_unref(FuStructSunwinonDfuPayloadProgramStart *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructSunwinonDfuPayloadProgramStart, fu_struct_sunwinon_dfu_payload_program_start_unref)
FuStructSunwinonDfuPayloadProgramStart *fu_struct_sunwinon_dfu_payload_program_start_new(void) G_GNUC_WARN_UNUSED_RESULT;
void fu_struct_sunwinon_dfu_payload_program_start_set_mode(FuStructSunwinonDfuPayloadProgramStart *st, guint8 value) G_GNUC_NON_NULL(1);
gboolean fu_struct_sunwinon_dfu_payload_program_start_set_image_info_raw(FuStructSunwinonDfuPayloadProgramStart *st, const guint8 *buf, gsize bufsz, GError **error) G_GNUC_NON_NULL(1, 2) G_GNUC_WARN_UNUSED_RESULT;

#ifndef __GI_SCANNER__
#define FU_STRUCT_SUNWINON_DFU_PAYLOAD_PROGRAM_START_OFFSET_MODE 0x0
#define FU_STRUCT_SUNWINON_DFU_PAYLOAD_PROGRAM_START_OFFSET_IMAGE_INFO_RAW 0x1
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_SUNWINON_DFU_PAYLOAD_PROGRAM_START_SIZE_IMAGE_INFO_RAW 0x28
#define FU_STRUCT_SUNWINON_DFU_PAYLOAD_PROGRAM_START_N_ELEMENTS_IMAGE_INFO_RAW 40
#define FU_STRUCT_SUNWINON_DFU_PAYLOAD_PROGRAM_START_SIZE 0x29
#endif

#ifndef __GI_SCANNER__
#endif
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructSunwinonDfuPayloadProgramFlash;

FuStructSunwinonDfuPayloadProgramFlash *fu_struct_sunwinon_dfu_payload_program_flash_ref(FuStructSunwinonDfuPayloadProgramFlash *st) G_GNUC_NON_NULL(1);
void fu_struct_sunwinon_dfu_payload_program_flash_unref(FuStructSunwinonDfuPayloadProgramFlash *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructSunwinonDfuPayloadProgramFlash, fu_struct_sunwinon_dfu_payload_program_flash_unref)
FuStructSunwinonDfuPayloadProgramFlash *fu_struct_sunwinon_dfu_payload_program_flash_new(void) G_GNUC_WARN_UNUSED_RESULT;
void fu_struct_sunwinon_dfu_payload_program_flash_set_dfu_save_addr(FuStructSunwinonDfuPayloadProgramFlash *st, guint32 value) G_GNUC_NON_NULL(1);
void fu_struct_sunwinon_dfu_payload_program_flash_set_data_len(FuStructSunwinonDfuPayloadProgramFlash *st, guint16 value) G_GNUC_NON_NULL(1);
gboolean fu_struct_sunwinon_dfu_payload_program_flash_set_fw_data(FuStructSunwinonDfuPayloadProgramFlash *st, const guint8 *buf, gsize bufsz, GError **error) G_GNUC_NON_NULL(1, 2) G_GNUC_WARN_UNUSED_RESULT;

#ifndef __GI_SCANNER__
#define FU_STRUCT_SUNWINON_DFU_PAYLOAD_PROGRAM_FLASH_OFFSET_WRITE_MODE 0x0
#define FU_STRUCT_SUNWINON_DFU_PAYLOAD_PROGRAM_FLASH_OFFSET_DFU_SAVE_ADDR 0x1
#define FU_STRUCT_SUNWINON_DFU_PAYLOAD_PROGRAM_FLASH_OFFSET_DATA_LEN 0x5
#define FU_STRUCT_SUNWINON_DFU_PAYLOAD_PROGRAM_FLASH_OFFSET_FW_DATA 0x7
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_SUNWINON_DFU_PAYLOAD_PROGRAM_FLASH_SIZE_FW_DATA 0x1D0
#define FU_STRUCT_SUNWINON_DFU_PAYLOAD_PROGRAM_FLASH_N_ELEMENTS_FW_DATA 464
#define FU_STRUCT_SUNWINON_DFU_PAYLOAD_PROGRAM_FLASH_SIZE 0x1D7
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_SUNWINON_DFU_PAYLOAD_PROGRAM_FLASH_DEFAULT_WRITE_MODE 0x01
#endif
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructSunwinonDfuPayloadProgramEnd;

FuStructSunwinonDfuPayloadProgramEnd *fu_struct_sunwinon_dfu_payload_program_end_ref(FuStructSunwinonDfuPayloadProgramEnd *st) G_GNUC_NON_NULL(1);
void fu_struct_sunwinon_dfu_payload_program_end_unref(FuStructSunwinonDfuPayloadProgramEnd *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructSunwinonDfuPayloadProgramEnd, fu_struct_sunwinon_dfu_payload_program_end_unref)
FuStructSunwinonDfuPayloadProgramEnd *fu_struct_sunwinon_dfu_payload_program_end_new(void) G_GNUC_WARN_UNUSED_RESULT;
void fu_struct_sunwinon_dfu_payload_program_end_set_file_checksum(FuStructSunwinonDfuPayloadProgramEnd *st, guint32 value) G_GNUC_NON_NULL(1);

#ifndef __GI_SCANNER__
#define FU_STRUCT_SUNWINON_DFU_PAYLOAD_PROGRAM_END_OFFSET_END_MODE 0x0
#define FU_STRUCT_SUNWINON_DFU_PAYLOAD_PROGRAM_END_OFFSET_FILE_CHECKSUM 0x1
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_SUNWINON_DFU_PAYLOAD_PROGRAM_END_SIZE 0x5
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_SUNWINON_DFU_PAYLOAD_PROGRAM_END_DEFAULT_END_MODE 0x01
#endif
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructSunwinonDfuRspGetInfo;

FuStructSunwinonDfuRspGetInfo *fu_struct_sunwinon_dfu_rsp_get_info_ref(FuStructSunwinonDfuRspGetInfo *st) G_GNUC_NON_NULL(1);
void fu_struct_sunwinon_dfu_rsp_get_info_unref(FuStructSunwinonDfuRspGetInfo *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructSunwinonDfuRspGetInfo, fu_struct_sunwinon_dfu_rsp_get_info_unref)
FuStructSunwinonDfuRspGetInfo *fu_struct_sunwinon_dfu_rsp_get_info_parse(const guint8 *buf, gsize bufsz, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
FuSunwinonDfuAck fu_struct_sunwinon_dfu_rsp_get_info_get_ack_status(const FuStructSunwinonDfuRspGetInfo *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
const guint8 *fu_struct_sunwinon_dfu_rsp_get_info_get_info_that_this_program_dont_care(const FuStructSunwinonDfuRspGetInfo *st, gsize *bufsz) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;

#ifndef __GI_SCANNER__
#define FU_STRUCT_SUNWINON_DFU_RSP_GET_INFO_OFFSET_ACK_STATUS 0x0
#define FU_STRUCT_SUNWINON_DFU_RSP_GET_INFO_OFFSET_INFO_THAT_THIS_PROGRAM_DONT_CARE 0x1
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_SUNWINON_DFU_RSP_GET_INFO_SIZE_INFO_THAT_THIS_PROGRAM_DONT_CARE 0x13
#define FU_STRUCT_SUNWINON_DFU_RSP_GET_INFO_N_ELEMENTS_INFO_THAT_THIS_PROGRAM_DONT_CARE 19
#define FU_STRUCT_SUNWINON_DFU_RSP_GET_INFO_SIZE 0x14
#endif

#ifndef __GI_SCANNER__
#endif
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructSunwinonDfuBootInfoFlags;

FuStructSunwinonDfuBootInfoFlags *fu_struct_sunwinon_dfu_boot_info_flags_ref(FuStructSunwinonDfuBootInfoFlags *st) G_GNUC_NON_NULL(1);
void fu_struct_sunwinon_dfu_boot_info_flags_unref(FuStructSunwinonDfuBootInfoFlags *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructSunwinonDfuBootInfoFlags, fu_struct_sunwinon_dfu_boot_info_flags_unref)
guint32 fu_struct_sunwinon_dfu_boot_info_flags_get_xqspi_speed(const FuStructSunwinonDfuBootInfoFlags *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_sunwinon_dfu_boot_info_flags_get_code_copy_mode(const FuStructSunwinonDfuBootInfoFlags *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_sunwinon_dfu_boot_info_flags_get_system_clk(const FuStructSunwinonDfuBootInfoFlags *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_sunwinon_dfu_boot_info_flags_get_check_image(const FuStructSunwinonDfuBootInfoFlags *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_sunwinon_dfu_boot_info_flags_get_boot_delay(const FuStructSunwinonDfuBootInfoFlags *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_sunwinon_dfu_boot_info_flags_get_signature_algorithm(const FuStructSunwinonDfuBootInfoFlags *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;

#ifndef __GI_SCANNER__
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_SUNWINON_DFU_BOOT_INFO_FLAGS_SIZE 0x4
#endif

#ifndef __GI_SCANNER__
#endif
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructSunwinonDfuRspSystemInfo;

FuStructSunwinonDfuRspSystemInfo *fu_struct_sunwinon_dfu_rsp_system_info_ref(FuStructSunwinonDfuRspSystemInfo *st) G_GNUC_NON_NULL(1);
void fu_struct_sunwinon_dfu_rsp_system_info_unref(FuStructSunwinonDfuRspSystemInfo *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructSunwinonDfuRspSystemInfo, fu_struct_sunwinon_dfu_rsp_system_info_unref)
FuStructSunwinonDfuRspSystemInfo *fu_struct_sunwinon_dfu_rsp_system_info_parse(const guint8 *buf, gsize bufsz, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
FuSunwinonDfuAck fu_struct_sunwinon_dfu_rsp_system_info_get_ack_status(const FuStructSunwinonDfuRspSystemInfo *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_sunwinon_dfu_rsp_system_info_get_opcode(const FuStructSunwinonDfuRspSystemInfo *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_sunwinon_dfu_rsp_system_info_get_start_addr(const FuStructSunwinonDfuRspSystemInfo *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_sunwinon_dfu_rsp_system_info_get_bin_size(const FuStructSunwinonDfuRspSystemInfo *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_sunwinon_dfu_rsp_system_info_get_checksum(const FuStructSunwinonDfuRspSystemInfo *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_sunwinon_dfu_rsp_system_info_get_load_addr(const FuStructSunwinonDfuRspSystemInfo *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_sunwinon_dfu_rsp_system_info_get_run_addr(const FuStructSunwinonDfuRspSystemInfo *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_sunwinon_dfu_rsp_system_info_get_xqspi_xip_cmd(const FuStructSunwinonDfuRspSystemInfo *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
FuStructSunwinonDfuBootInfoFlags *fu_struct_sunwinon_dfu_rsp_system_info_get_flags(const FuStructSunwinonDfuRspSystemInfo *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;

#ifndef __GI_SCANNER__
#define FU_STRUCT_SUNWINON_DFU_RSP_SYSTEM_INFO_OFFSET_ACK_STATUS 0x0
#define FU_STRUCT_SUNWINON_DFU_RSP_SYSTEM_INFO_OFFSET_OPCODE 0x1
#define FU_STRUCT_SUNWINON_DFU_RSP_SYSTEM_INFO_OFFSET_START_ADDR 0x2
#define FU_STRUCT_SUNWINON_DFU_RSP_SYSTEM_INFO_OFFSET_LENGTH 0x6
#define FU_STRUCT_SUNWINON_DFU_RSP_SYSTEM_INFO_OFFSET_BIN_SIZE 0x8
#define FU_STRUCT_SUNWINON_DFU_RSP_SYSTEM_INFO_OFFSET_CHECKSUM 0xC
#define FU_STRUCT_SUNWINON_DFU_RSP_SYSTEM_INFO_OFFSET_LOAD_ADDR 0x10
#define FU_STRUCT_SUNWINON_DFU_RSP_SYSTEM_INFO_OFFSET_RUN_ADDR 0x14
#define FU_STRUCT_SUNWINON_DFU_RSP_SYSTEM_INFO_OFFSET_XQSPI_XIP_CMD 0x18
#define FU_STRUCT_SUNWINON_DFU_RSP_SYSTEM_INFO_OFFSET_FLAGS 0x1C
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_SUNWINON_DFU_RSP_SYSTEM_INFO_SIZE 0x38
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_SUNWINON_DFU_RSP_SYSTEM_INFO_DEFAULT_LENGTH 0x30
#endif
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructSunwinonDfuImageInfo;

FuStructSunwinonDfuImageInfo *fu_struct_sunwinon_dfu_image_info_ref(FuStructSunwinonDfuImageInfo *st) G_GNUC_NON_NULL(1);
void fu_struct_sunwinon_dfu_image_info_unref(FuStructSunwinonDfuImageInfo *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructSunwinonDfuImageInfo, fu_struct_sunwinon_dfu_image_info_unref)
FuStructSunwinonDfuImageInfo *fu_struct_sunwinon_dfu_image_info_parse_stream(GInputStream *stream, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_sunwinon_dfu_image_info_get_version(const FuStructSunwinonDfuImageInfo *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_sunwinon_dfu_image_info_get_bin_size(const FuStructSunwinonDfuImageInfo *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_sunwinon_dfu_image_info_get_checksum(const FuStructSunwinonDfuImageInfo *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_sunwinon_dfu_image_info_get_load_addr(const FuStructSunwinonDfuImageInfo *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_sunwinon_dfu_image_info_get_run_addr(const FuStructSunwinonDfuImageInfo *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_sunwinon_dfu_image_info_get_xqspi_xip_cmd(const FuStructSunwinonDfuImageInfo *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
FuStructSunwinonDfuBootInfoFlags *fu_struct_sunwinon_dfu_image_info_get_flags(const FuStructSunwinonDfuImageInfo *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
gchar *fu_struct_sunwinon_dfu_image_info_get_comments(const FuStructSunwinonDfuImageInfo *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
void fu_struct_sunwinon_dfu_image_info_set_version(FuStructSunwinonDfuImageInfo *st, guint16 value) G_GNUC_NON_NULL(1);
void fu_struct_sunwinon_dfu_image_info_set_bin_size(FuStructSunwinonDfuImageInfo *st, guint32 value) G_GNUC_NON_NULL(1);
void fu_struct_sunwinon_dfu_image_info_set_checksum(FuStructSunwinonDfuImageInfo *st, guint32 value) G_GNUC_NON_NULL(1);
void fu_struct_sunwinon_dfu_image_info_set_load_addr(FuStructSunwinonDfuImageInfo *st, guint32 value) G_GNUC_NON_NULL(1);
void fu_struct_sunwinon_dfu_image_info_set_run_addr(FuStructSunwinonDfuImageInfo *st, guint32 value) G_GNUC_NON_NULL(1);
void fu_struct_sunwinon_dfu_image_info_set_xqspi_xip_cmd(FuStructSunwinonDfuImageInfo *st, guint32 value) G_GNUC_NON_NULL(1);
gboolean
fu_struct_sunwinon_dfu_image_info_set_flags(FuStructSunwinonDfuImageInfo *st, const FuStructSunwinonDfuBootInfoFlags *st_donor, GError **error) G_GNUC_NON_NULL(1, 2) G_GNUC_WARN_UNUSED_RESULT;
gboolean fu_struct_sunwinon_dfu_image_info_set_comments(FuStructSunwinonDfuImageInfo *st, const gchar *value, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;

#ifndef __GI_SCANNER__
#define FU_STRUCT_SUNWINON_DFU_IMAGE_INFO_OFFSET_PATTERN 0x0
#define FU_STRUCT_SUNWINON_DFU_IMAGE_INFO_OFFSET_VERSION 0x2
#define FU_STRUCT_SUNWINON_DFU_IMAGE_INFO_OFFSET_BIN_SIZE 0x4
#define FU_STRUCT_SUNWINON_DFU_IMAGE_INFO_OFFSET_CHECKSUM 0x8
#define FU_STRUCT_SUNWINON_DFU_IMAGE_INFO_OFFSET_LOAD_ADDR 0xC
#define FU_STRUCT_SUNWINON_DFU_IMAGE_INFO_OFFSET_RUN_ADDR 0x10
#define FU_STRUCT_SUNWINON_DFU_IMAGE_INFO_OFFSET_XQSPI_XIP_CMD 0x14
#define FU_STRUCT_SUNWINON_DFU_IMAGE_INFO_OFFSET_FLAGS 0x18
#define FU_STRUCT_SUNWINON_DFU_IMAGE_INFO_OFFSET_COMMENTS 0x1C
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_SUNWINON_DFU_IMAGE_INFO_SIZE_COMMENTS 0xC
#define FU_STRUCT_SUNWINON_DFU_IMAGE_INFO_N_ELEMENTS_COMMENTS 12
#define FU_STRUCT_SUNWINON_DFU_IMAGE_INFO_SIZE 0x30
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_SUNWINON_DFU_IMAGE_INFO_DEFAULT_PATTERN 0x4744
#endif
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructSunwinonDfuRspFwInfoGet;

FuStructSunwinonDfuRspFwInfoGet *fu_struct_sunwinon_dfu_rsp_fw_info_get_ref(FuStructSunwinonDfuRspFwInfoGet *st) G_GNUC_NON_NULL(1);
void fu_struct_sunwinon_dfu_rsp_fw_info_get_unref(FuStructSunwinonDfuRspFwInfoGet *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructSunwinonDfuRspFwInfoGet, fu_struct_sunwinon_dfu_rsp_fw_info_get_unref)
FuStructSunwinonDfuRspFwInfoGet *fu_struct_sunwinon_dfu_rsp_fw_info_get_parse(const guint8 *buf, gsize bufsz, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
FuSunwinonDfuAck fu_struct_sunwinon_dfu_rsp_fw_info_get_get_ack_status(const FuStructSunwinonDfuRspFwInfoGet *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_sunwinon_dfu_rsp_fw_info_get_get_dfu_save_addr(const FuStructSunwinonDfuRspFwInfoGet *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_sunwinon_dfu_rsp_fw_info_get_get_run_position(const FuStructSunwinonDfuRspFwInfoGet *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
FuStructSunwinonDfuImageInfo *fu_struct_sunwinon_dfu_rsp_fw_info_get_get_image_info(const FuStructSunwinonDfuRspFwInfoGet *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;

#ifndef __GI_SCANNER__
#define FU_STRUCT_SUNWINON_DFU_RSP_FW_INFO_GET_OFFSET_ACK_STATUS 0x0
#define FU_STRUCT_SUNWINON_DFU_RSP_FW_INFO_GET_OFFSET_DFU_SAVE_ADDR 0x1
#define FU_STRUCT_SUNWINON_DFU_RSP_FW_INFO_GET_OFFSET_RUN_POSITION 0x5
#define FU_STRUCT_SUNWINON_DFU_RSP_FW_INFO_GET_OFFSET_IMAGE_INFO 0x6
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_SUNWINON_DFU_RSP_FW_INFO_GET_SIZE 0x36
#endif

#ifndef __GI_SCANNER__
#endif
