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

#pragma once
#include <fu-input-stream.h>
/**
 * FuEtpRptid:
 */
typedef enum {
    /**
     * FU_ETP_RPTID_TP_FEATURE:
     */
    FU_ETP_RPTID_TP_FEATURE = 0x0d,
    /**
     * FU_ETP_RPTID_TP_IAP:
     */
    FU_ETP_RPTID_TP_IAP = 0x0b,
    /**
     * FU_ETP_RPTID_MCU_FEATURE:
     */
    FU_ETP_RPTID_MCU_FEATURE = 0x70,
    /**
     * FU_ETP_RPTID_MCU_IAP:
     */
    FU_ETP_RPTID_MCU_IAP = 0x72,
}  FuEtpRptid;
/**
 * FuEtpIc:
 */
typedef enum {
    /**
     * FU_ETP_IC_NUM12:
     */
    FU_ETP_IC_NUM12 = 0x12,
    /**
     * FU_ETP_IC_NUM13:
     */
    FU_ETP_IC_NUM13 = 0x13,
    /**
     * FU_ETP_IC_NUM14:
     */
    FU_ETP_IC_NUM14 = 0x14,
    /**
     * FU_ETP_IC_NUM15:
     */
    FU_ETP_IC_NUM15 = 0x15,
    /**
     * FU_ETP_IC_NUM16:
     */
    FU_ETP_IC_NUM16 = 0x16,
}  FuEtpIc;
/**
 * FuEtpCmd:
 */
typedef enum {
    /**
     * FU_ETP_CMD_I2C_EEPROM_SETTING_INITIAL:
     */
    FU_ETP_CMD_I2C_EEPROM_SETTING_INITIAL = 0x0000,
    /**
     * FU_ETP_CMD_GET_HID_DESCRIPTOR:
     */
    FU_ETP_CMD_GET_HID_DESCRIPTOR = 0x0001,
    /**
     * FU_ETP_CMD_GET_HARDWARE_ID:
     */
    FU_ETP_CMD_GET_HARDWARE_ID = 0x0100,
    /**
     * FU_ETP_CMD_I2C_GET_HID_ID:
     */
    FU_ETP_CMD_I2C_GET_HID_ID = 0x0100,
    /**
     * FU_ETP_CMD_GET_MODULE_ID:
     */
    FU_ETP_CMD_GET_MODULE_ID = 0x0101,
    /**
     * FU_ETP_CMD_I2C_FW_VERSION:
     */
    FU_ETP_CMD_I2C_FW_VERSION = 0x0102,
    /**
     * FU_ETP_CMD_I2C_OSM_VERSION:
     */
    FU_ETP_CMD_I2C_OSM_VERSION = 0x0103,
    /**
     * FU_ETP_CMD_I2C_FORCE_TYPE_ENABLE:
     */
    FU_ETP_CMD_I2C_FORCE_TYPE_ENABLE = 0x0104,
    /**
     * FU_ETP_CMD_I2C_IAP_ICBODY:
     */
    FU_ETP_CMD_I2C_IAP_ICBODY = 0x0110,
    /**
     * FU_ETP_CMD_I2C_IAP_VERSION_2:
     */
    FU_ETP_CMD_I2C_IAP_VERSION_2 = 0x0110,
    /**
     * FU_ETP_CMD_I2C_IAP_VERSION:
     */
    FU_ETP_CMD_I2C_IAP_VERSION = 0x0111,
    /**
     * FU_ETP_CMD_I2C_IAP_TYPE:
     */
    FU_ETP_CMD_I2C_IAP_TYPE = 0x0304,
    /**
     * FU_ETP_CMD_I2C_GET_FEATURE_ADDR:
     */
    FU_ETP_CMD_I2C_GET_FEATURE_ADDR = 0x0305,
    /**
     * FU_ETP_CMD_I2C_FW_PW:
     */
    FU_ETP_CMD_I2C_FW_PW = 0x030e,
    /**
     * FU_ETP_CMD_I2C_FW_CHECKSUM:
     */
    FU_ETP_CMD_I2C_FW_CHECKSUM = 0x030f,
    /**
     * FU_ETP_CMD_I2C_IAP_CTRL:
     */
    FU_ETP_CMD_I2C_IAP_CTRL = 0x0310,
    /**
     * FU_ETP_CMD_I2C_IAP:
     */
    FU_ETP_CMD_I2C_IAP = 0x0311,
    /**
     * FU_ETP_CMD_I2C_IAP_RESET:
     */
    FU_ETP_CMD_I2C_IAP_RESET = 0x0314,
    /**
     * FU_ETP_CMD_I2C_IAP_CHECKSUM:
     */
    FU_ETP_CMD_I2C_IAP_CHECKSUM = 0x0315,
    /**
     * FU_ETP_CMD_I2C_SET_EEPROM_CTRL:
     */
    FU_ETP_CMD_I2C_SET_EEPROM_CTRL = 0x0321,
    /**
     * FU_ETP_CMD_I2C_TP_SETTING:
     */
    FU_ETP_CMD_I2C_TP_SETTING = 0x0322,
    /**
     * FU_ETP_CMD_FORCE_ADDR:
     */
    FU_ETP_CMD_FORCE_ADDR = 0x03ad,
    /**
     * FU_ETP_CMD_I2C_EEPROM_WRITE_CHECKSUM:
     */
    FU_ETP_CMD_I2C_EEPROM_WRITE_CHECKSUM = 0x048B,
    /**
     * FU_ETP_CMD_I2C_HAPTIC_RESTART:
     */
    FU_ETP_CMD_I2C_HAPTIC_RESTART = 0x0601,
    /**
     * FU_ETP_CMD_I2C_SET_EEPROM_LEAVE_IAP:
     */
    FU_ETP_CMD_I2C_SET_EEPROM_LEAVE_IAP = 0x0606,
    /**
     * FU_ETP_CMD_I2C_SET_EEPROM_ENTER_IAP:
     */
    FU_ETP_CMD_I2C_SET_EEPROM_ENTER_IAP = 0x0607,
    /**
     * FU_ETP_CMD_I2C_CALC_EEPROM_CHECKSUM:
     */
    FU_ETP_CMD_I2C_CALC_EEPROM_CHECKSUM = 0x060F,
    /**
     * FU_ETP_CMD_I2C_SET_EEPROM_DATATYPE:
     */
    FU_ETP_CMD_I2C_SET_EEPROM_DATATYPE = 0x0702,
    /**
     * FU_ETP_CMD_I2C_READ_EEPROM_CHECKSUM:
     */
    FU_ETP_CMD_I2C_READ_EEPROM_CHECKSUM = 0x070A,
    /**
     * FU_ETP_CMD_I2C_GET_EEPROM_FW_VERSION:
     */
    FU_ETP_CMD_I2C_GET_EEPROM_FW_VERSION = 0x0710,
    /**
     * FU_ETP_CMD_I2C_GET_EEPROM_IAP_VERSION:
     */
    FU_ETP_CMD_I2C_GET_EEPROM_IAP_VERSION = 0x0711,
    /**
     * FU_ETP_CMD_I2C_EEPROM_LONG_TRANS_ENABLE:
     */
    FU_ETP_CMD_I2C_EEPROM_LONG_TRANS_ENABLE = 0x4607,
    /**
     * FU_ETP_CMD_I2C_EEPROM_WRITE_INFORMATION:
     */
    FU_ETP_CMD_I2C_EEPROM_WRITE_INFORMATION = 0x4600,
}  FuEtpCmd;
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructElantpFirmwareFtr;

FuStructElantpFirmwareFtr *fu_struct_elantp_firmware_ftr_ref(FuStructElantpFirmwareFtr *st) G_GNUC_NON_NULL(1);
void fu_struct_elantp_firmware_ftr_unref(FuStructElantpFirmwareFtr *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructElantpFirmwareFtr, fu_struct_elantp_firmware_ftr_unref)
FuStructElantpFirmwareFtr *fu_struct_elantp_firmware_ftr_new(void) G_GNUC_WARN_UNUSED_RESULT;
gboolean fu_struct_elantp_firmware_ftr_validate_stream(GInputStream *stream, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;

#ifndef __GI_SCANNER__
#define FU_STRUCT_ELANTP_FIRMWARE_FTR_OFFSET_MAGIC 0x0
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_ELANTP_FIRMWARE_FTR_SIZE_MAGIC 0x6
#define FU_STRUCT_ELANTP_FIRMWARE_FTR_N_ELEMENTS_MAGIC 6
#define FU_STRUCT_ELANTP_FIRMWARE_FTR_SIZE 0x6
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_ELANTP_FIRMWARE_FTR_DEFAULT_MAGIC "\xAA\x55\xCC\x33\xFF\xFF"
#endif
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructElantpFirmwareHdr;

FuStructElantpFirmwareHdr *fu_struct_elantp_firmware_hdr_ref(FuStructElantpFirmwareHdr *st) G_GNUC_NON_NULL(1);
void fu_struct_elantp_firmware_hdr_unref(FuStructElantpFirmwareHdr *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructElantpFirmwareHdr, fu_struct_elantp_firmware_hdr_unref)
FuStructElantpFirmwareHdr *fu_struct_elantp_firmware_hdr_new(void) G_GNUC_WARN_UNUSED_RESULT;
FuStructElantpFirmwareHdr *fu_struct_elantp_firmware_hdr_parse_stream(GInputStream *stream, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_elantp_firmware_hdr_get_ic_type(const FuStructElantpFirmwareHdr *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_elantp_firmware_hdr_get_iap_ver(const FuStructElantpFirmwareHdr *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_elantp_firmware_hdr_get_iap_start(const FuStructElantpFirmwareHdr *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_elantp_firmware_hdr_get_iap_forcetable(const FuStructElantpFirmwareHdr *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
void fu_struct_elantp_firmware_hdr_set_ic_type(FuStructElantpFirmwareHdr *st, guint16 value) G_GNUC_NON_NULL(1);
void fu_struct_elantp_firmware_hdr_set_iap_ver(FuStructElantpFirmwareHdr *st, guint16 value) G_GNUC_NON_NULL(1);
void fu_struct_elantp_firmware_hdr_set_iap_start(FuStructElantpFirmwareHdr *st, guint16 value) G_GNUC_NON_NULL(1);
void fu_struct_elantp_firmware_hdr_set_iap_forcetable(FuStructElantpFirmwareHdr *st, guint16 value) G_GNUC_NON_NULL(1);

#ifndef __GI_SCANNER__
#define FU_STRUCT_ELANTP_FIRMWARE_HDR_OFFSET_IC_TYPE 0x0
#define FU_STRUCT_ELANTP_FIRMWARE_HDR_OFFSET_IAP_VER 0x4
#define FU_STRUCT_ELANTP_FIRMWARE_HDR_OFFSET_IAP_START 0x6
#define FU_STRUCT_ELANTP_FIRMWARE_HDR_OFFSET_IAP_FORCETABLE 0xA
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_ELANTP_FIRMWARE_HDR_SIZE 0xC
#endif

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

FuStructElantpHapticFirmwareHdr *fu_struct_elantp_haptic_firmware_hdr_ref(FuStructElantpHapticFirmwareHdr *st) G_GNUC_NON_NULL(1);
void fu_struct_elantp_haptic_firmware_hdr_unref(FuStructElantpHapticFirmwareHdr *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructElantpHapticFirmwareHdr, fu_struct_elantp_haptic_firmware_hdr_unref)
FuStructElantpHapticFirmwareHdr *fu_struct_elantp_haptic_firmware_hdr_parse_stream(GInputStream *stream, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
gboolean fu_struct_elantp_haptic_firmware_hdr_validate_stream(GInputStream *stream, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_elantp_haptic_firmware_hdr_get_ver_sm(const FuStructElantpHapticFirmwareHdr *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_elantp_haptic_firmware_hdr_get_ver_d(const FuStructElantpHapticFirmwareHdr *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_elantp_haptic_firmware_hdr_get_ver_y(const FuStructElantpHapticFirmwareHdr *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;

#ifndef __GI_SCANNER__
#define FU_STRUCT_ELANTP_HAPTIC_FIRMWARE_HDR_OFFSET_MAGIC 0x0
#define FU_STRUCT_ELANTP_HAPTIC_FIRMWARE_HDR_OFFSET_VER_SM 0x4
#define FU_STRUCT_ELANTP_HAPTIC_FIRMWARE_HDR_OFFSET_VER_D 0x5
#define FU_STRUCT_ELANTP_HAPTIC_FIRMWARE_HDR_OFFSET_VER_Y 0x6
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_ELANTP_HAPTIC_FIRMWARE_HDR_SIZE_MAGIC 0x4
#define FU_STRUCT_ELANTP_HAPTIC_FIRMWARE_HDR_N_ELEMENTS_MAGIC 4
#define FU_STRUCT_ELANTP_HAPTIC_FIRMWARE_HDR_SIZE 0x7
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_ELANTP_HAPTIC_FIRMWARE_HDR_DEFAULT_MAGIC "\xFF\x40\xA2\x5B"
#endif
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructElantpReadCmdReq;

FuStructElantpReadCmdReq *fu_struct_elantp_read_cmd_req_ref(FuStructElantpReadCmdReq *st) G_GNUC_NON_NULL(1);
void fu_struct_elantp_read_cmd_req_unref(FuStructElantpReadCmdReq *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructElantpReadCmdReq, fu_struct_elantp_read_cmd_req_unref)
FuStructElantpReadCmdReq *fu_struct_elantp_read_cmd_req_new(void) G_GNUC_WARN_UNUSED_RESULT;
void fu_struct_elantp_read_cmd_req_set_report_id(FuStructElantpReadCmdReq *st, FuEtpRptid value) G_GNUC_NON_NULL(1);
void fu_struct_elantp_read_cmd_req_set_cmd(FuStructElantpReadCmdReq *st, FuEtpCmd value) G_GNUC_NON_NULL(1);
void fu_struct_elantp_read_cmd_req_set_reg(FuStructElantpReadCmdReq *st, guint16 value) G_GNUC_NON_NULL(1);

#ifndef __GI_SCANNER__
#define FU_STRUCT_ELANTP_READ_CMD_REQ_OFFSET_REPORT_ID 0x0
#define FU_STRUCT_ELANTP_READ_CMD_REQ_OFFSET_CMD 0x1
#define FU_STRUCT_ELANTP_READ_CMD_REQ_OFFSET_REG 0x3
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_ELANTP_READ_CMD_REQ_SIZE 0x5
#endif

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

FuStructElantpReadCmdRes *fu_struct_elantp_read_cmd_res_ref(FuStructElantpReadCmdRes *st) G_GNUC_NON_NULL(1);
void fu_struct_elantp_read_cmd_res_unref(FuStructElantpReadCmdRes *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructElantpReadCmdRes, fu_struct_elantp_read_cmd_res_unref)
FuStructElantpReadCmdRes *fu_struct_elantp_read_cmd_res_parse(const guint8 *buf, gsize bufsz, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
FuEtpRptid fu_struct_elantp_read_cmd_res_get_report_id(const FuStructElantpReadCmdRes *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_elantp_read_cmd_res_get_value(const FuStructElantpReadCmdRes *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;

#ifndef __GI_SCANNER__
#define FU_STRUCT_ELANTP_READ_CMD_RES_OFFSET_REPORT_ID 0x0
#define FU_STRUCT_ELANTP_READ_CMD_RES_OFFSET_VALUE 0x3
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_ELANTP_READ_CMD_RES_SIZE 0x5
#endif

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

FuStructElantpWriteCmdReq *fu_struct_elantp_write_cmd_req_ref(FuStructElantpWriteCmdReq *st) G_GNUC_NON_NULL(1);
void fu_struct_elantp_write_cmd_req_unref(FuStructElantpWriteCmdReq *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructElantpWriteCmdReq, fu_struct_elantp_write_cmd_req_unref)
FuStructElantpWriteCmdReq *fu_struct_elantp_write_cmd_req_new(void) G_GNUC_WARN_UNUSED_RESULT;
void fu_struct_elantp_write_cmd_req_set_report_id(FuStructElantpWriteCmdReq *st, FuEtpRptid value) G_GNUC_NON_NULL(1);
void fu_struct_elantp_write_cmd_req_set_reg(FuStructElantpWriteCmdReq *st, guint16 value) G_GNUC_NON_NULL(1);
void fu_struct_elantp_write_cmd_req_set_cmd(FuStructElantpWriteCmdReq *st, FuEtpCmd value) G_GNUC_NON_NULL(1);

#ifndef __GI_SCANNER__
#define FU_STRUCT_ELANTP_WRITE_CMD_REQ_OFFSET_REPORT_ID 0x0
#define FU_STRUCT_ELANTP_WRITE_CMD_REQ_OFFSET_REG 0x1
#define FU_STRUCT_ELANTP_WRITE_CMD_REQ_OFFSET_CMD 0x3
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_ELANTP_WRITE_CMD_REQ_SIZE 0x5
#endif

#ifndef __GI_SCANNER__
#endif
