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

#pragma once
#include <fu-input-stream.h>
/**
 * FuCcgxPureHidFwMode:
 */
typedef enum {
    /**
     * FU_CCGX_PURE_HID_FW_MODE_BOOT:
     */
    FU_CCGX_PURE_HID_FW_MODE_BOOT,
    /**
     * FU_CCGX_PURE_HID_FW_MODE_FW1:
     */
    FU_CCGX_PURE_HID_FW_MODE_FW1,
    /**
     * FU_CCGX_PURE_HID_FW_MODE_FW2:
     */
    FU_CCGX_PURE_HID_FW_MODE_FW2,
}  FuCcgxPureHidFwMode;
#define FU_CCGX_PURE_HID_FW_MODE_LAST 3
const gchar *fu_ccgx_pure_hid_fw_mode_to_string(FuCcgxPureHidFwMode val) G_GNUC_CONST;
/**
 * FuCcgxPureHidReportId:
 */
typedef enum {
    /**
     * FU_CCGX_PURE_HID_REPORT_ID_INFO:
     */
    FU_CCGX_PURE_HID_REPORT_ID_INFO = 0xE0,
    /**
     * FU_CCGX_PURE_HID_REPORT_ID_COMMAND:
     */
    FU_CCGX_PURE_HID_REPORT_ID_COMMAND = 0xE1,
    /**
     * FU_CCGX_PURE_HID_REPORT_ID_WRITE:
     */
    FU_CCGX_PURE_HID_REPORT_ID_WRITE = 0xE2,
    /**
     * FU_CCGX_PURE_HID_REPORT_ID_READ:
     */
    FU_CCGX_PURE_HID_REPORT_ID_READ = 0xE3,
    /**
     * FU_CCGX_PURE_HID_REPORT_ID_CUSTOM:
     */
    FU_CCGX_PURE_HID_REPORT_ID_CUSTOM = 0xE4,
}  FuCcgxPureHidReportId;
/**
 * FuCcgxPureHidCommand:
 */
typedef enum {
    /**
     * FU_CCGX_PURE_HID_COMMAND_JUMP:
     */
    FU_CCGX_PURE_HID_COMMAND_JUMP = 0x01,
    /**
     * FU_CCGX_PURE_HID_COMMAND_FLASH:
     */
    FU_CCGX_PURE_HID_COMMAND_FLASH = 0x02,
    /**
     * FU_CCGX_PURE_HID_COMMAND_SET_BOOT:
     */
    FU_CCGX_PURE_HID_COMMAND_SET_BOOT = 0x04,
    /**
     * FU_CCGX_PURE_HID_COMMAND_MODE:
     */
    FU_CCGX_PURE_HID_COMMAND_MODE = 0x06,
}  FuCcgxPureHidCommand;
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructCcgxPureHidFwInfo;

FuStructCcgxPureHidFwInfo *fu_struct_ccgx_pure_hid_fw_info_ref(FuStructCcgxPureHidFwInfo *st) G_GNUC_NON_NULL(1);
void fu_struct_ccgx_pure_hid_fw_info_unref(FuStructCcgxPureHidFwInfo *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructCcgxPureHidFwInfo, fu_struct_ccgx_pure_hid_fw_info_unref)
FuStructCcgxPureHidFwInfo *fu_struct_ccgx_pure_hid_fw_info_parse(const guint8 *buf, gsize bufsz, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
FuCcgxPureHidFwMode fu_struct_ccgx_pure_hid_fw_info_get_operating_mode(const FuStructCcgxPureHidFwInfo *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_ccgx_pure_hid_fw_info_get_bootloader_info(const FuStructCcgxPureHidFwInfo *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_ccgx_pure_hid_fw_info_get_bootmode_reason(const FuStructCcgxPureHidFwInfo *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_ccgx_pure_hid_fw_info_get_silicon_id(const FuStructCcgxPureHidFwInfo *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_ccgx_pure_hid_fw_info_get_bl_version(const FuStructCcgxPureHidFwInfo *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_ccgx_pure_hid_fw_info_get_image1_version(const FuStructCcgxPureHidFwInfo *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_ccgx_pure_hid_fw_info_get_image2_version(const FuStructCcgxPureHidFwInfo *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_ccgx_pure_hid_fw_info_get_image1_row(const FuStructCcgxPureHidFwInfo *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_ccgx_pure_hid_fw_info_get_image2_row(const FuStructCcgxPureHidFwInfo *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
const guint8 *fu_struct_ccgx_pure_hid_fw_info_get_device_uid(const FuStructCcgxPureHidFwInfo *st, gsize *bufsz) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;

#ifndef __GI_SCANNER__
#define FU_STRUCT_CCGX_PURE_HID_FW_INFO_OFFSET_REPORT_ID 0x0
#define FU_STRUCT_CCGX_PURE_HID_FW_INFO_OFFSET_SIGNATURE 0x2
#define FU_STRUCT_CCGX_PURE_HID_FW_INFO_OFFSET_OPERATING_MODE 0x4
#define FU_STRUCT_CCGX_PURE_HID_FW_INFO_OFFSET_BOOTLOADER_INFO 0x5
#define FU_STRUCT_CCGX_PURE_HID_FW_INFO_OFFSET_BOOTMODE_REASON 0x6
#define FU_STRUCT_CCGX_PURE_HID_FW_INFO_OFFSET_SILICON_ID 0x8
#define FU_STRUCT_CCGX_PURE_HID_FW_INFO_OFFSET_BL_VERSION 0xC
#define FU_STRUCT_CCGX_PURE_HID_FW_INFO_OFFSET_IMAGE1_VERSION 0x14
#define FU_STRUCT_CCGX_PURE_HID_FW_INFO_OFFSET_IMAGE2_VERSION 0x1C
#define FU_STRUCT_CCGX_PURE_HID_FW_INFO_OFFSET_IMAGE1_ROW 0x24
#define FU_STRUCT_CCGX_PURE_HID_FW_INFO_OFFSET_IMAGE2_ROW 0x28
#define FU_STRUCT_CCGX_PURE_HID_FW_INFO_OFFSET_DEVICE_UID 0x2C
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_CCGX_PURE_HID_FW_INFO_SIZE_DEVICE_UID 0x6
#define FU_STRUCT_CCGX_PURE_HID_FW_INFO_N_ELEMENTS_DEVICE_UID 6
#define FU_STRUCT_CCGX_PURE_HID_FW_INFO_SIZE 0x3C
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_CCGX_PURE_HID_FW_INFO_DEFAULT_REPORT_ID FU_CCGX_PURE_HID_REPORT_ID_INFO
#define FU_STRUCT_CCGX_PURE_HID_FW_INFO_DEFAULT_SIGNATURE 0x5943
#endif
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructCcgxPureHidCommand;

FuStructCcgxPureHidCommand *fu_struct_ccgx_pure_hid_command_ref(FuStructCcgxPureHidCommand *st) G_GNUC_NON_NULL(1);
void fu_struct_ccgx_pure_hid_command_unref(FuStructCcgxPureHidCommand *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructCcgxPureHidCommand, fu_struct_ccgx_pure_hid_command_unref)
FuStructCcgxPureHidCommand *fu_struct_ccgx_pure_hid_command_new(void) G_GNUC_WARN_UNUSED_RESULT;
void fu_struct_ccgx_pure_hid_command_set_cmd(FuStructCcgxPureHidCommand *st, guint8 value) G_GNUC_NON_NULL(1);
void fu_struct_ccgx_pure_hid_command_set_opt(FuStructCcgxPureHidCommand *st, guint8 value) G_GNUC_NON_NULL(1);
void fu_struct_ccgx_pure_hid_command_set_pad1(FuStructCcgxPureHidCommand *st, guint8 value) G_GNUC_NON_NULL(1);
void fu_struct_ccgx_pure_hid_command_set_pad2(FuStructCcgxPureHidCommand *st, guint32 value) G_GNUC_NON_NULL(1);

#ifndef __GI_SCANNER__
#define FU_STRUCT_CCGX_PURE_HID_COMMAND_OFFSET_REPORT_ID 0x0
#define FU_STRUCT_CCGX_PURE_HID_COMMAND_OFFSET_CMD 0x1
#define FU_STRUCT_CCGX_PURE_HID_COMMAND_OFFSET_OPT 0x2
#define FU_STRUCT_CCGX_PURE_HID_COMMAND_OFFSET_PAD1 0x3
#define FU_STRUCT_CCGX_PURE_HID_COMMAND_OFFSET_PAD2 0x4
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_CCGX_PURE_HID_COMMAND_SIZE 0x8
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_CCGX_PURE_HID_COMMAND_DEFAULT_REPORT_ID FU_CCGX_PURE_HID_REPORT_ID_COMMAND
#define FU_STRUCT_CCGX_PURE_HID_COMMAND_DEFAULT_PAD1 0x00
#define FU_STRUCT_CCGX_PURE_HID_COMMAND_DEFAULT_PAD2 0xCCCCCCCC
#endif
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructCcgxPureHidWriteHdr;

FuStructCcgxPureHidWriteHdr *fu_struct_ccgx_pure_hid_write_hdr_ref(FuStructCcgxPureHidWriteHdr *st) G_GNUC_NON_NULL(1);
void fu_struct_ccgx_pure_hid_write_hdr_unref(FuStructCcgxPureHidWriteHdr *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructCcgxPureHidWriteHdr, fu_struct_ccgx_pure_hid_write_hdr_unref)
FuStructCcgxPureHidWriteHdr *fu_struct_ccgx_pure_hid_write_hdr_new(void) G_GNUC_WARN_UNUSED_RESULT;
void fu_struct_ccgx_pure_hid_write_hdr_set_pd_resp(FuStructCcgxPureHidWriteHdr *st, guint8 value) G_GNUC_NON_NULL(1);
void fu_struct_ccgx_pure_hid_write_hdr_set_addr(FuStructCcgxPureHidWriteHdr *st, guint16 value) G_GNUC_NON_NULL(1);
gboolean fu_struct_ccgx_pure_hid_write_hdr_set_data(FuStructCcgxPureHidWriteHdr *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_CCGX_PURE_HID_WRITE_HDR_OFFSET_REPORT_ID 0x0
#define FU_STRUCT_CCGX_PURE_HID_WRITE_HDR_OFFSET_PD_RESP 0x1
#define FU_STRUCT_CCGX_PURE_HID_WRITE_HDR_OFFSET_ADDR 0x2
#define FU_STRUCT_CCGX_PURE_HID_WRITE_HDR_OFFSET_DATA 0x4
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_CCGX_PURE_HID_WRITE_HDR_SIZE_DATA 0x80
#define FU_STRUCT_CCGX_PURE_HID_WRITE_HDR_N_ELEMENTS_DATA 128
#define FU_STRUCT_CCGX_PURE_HID_WRITE_HDR_SIZE 0x84
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_CCGX_PURE_HID_WRITE_HDR_DEFAULT_REPORT_ID FU_CCGX_PURE_HID_REPORT_ID_WRITE
#endif
