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

#pragma once
#include <fu-input-stream.h>
/**
 * FuSynapticsVmm9CommandFlags:
 */
typedef enum {
    /**
     * FU_SYNAPTICS_VMM9_COMMAND_FLAG_NONE:
     */
    FU_SYNAPTICS_VMM9_COMMAND_FLAG_NONE = 0,
    /**
     * FU_SYNAPTICS_VMM9_COMMAND_FLAG_FULL_BUFFER:
     */
    FU_SYNAPTICS_VMM9_COMMAND_FLAG_FULL_BUFFER = 1 << 0,
    /**
     * FU_SYNAPTICS_VMM9_COMMAND_FLAG_NO_REPLY:
     */
    FU_SYNAPTICS_VMM9_COMMAND_FLAG_NO_REPLY = 1 << 1,
    /**
     * FU_SYNAPTICS_VMM9_COMMAND_FLAG_IGNORE_REPLY:
     */
    FU_SYNAPTICS_VMM9_COMMAND_FLAG_IGNORE_REPLY = 1 << 2,
} G_GNUC_FLAG_ENUM FuSynapticsVmm9CommandFlags;
/**
 * FuSynapticsVmm9RcCtrl:
 */
typedef enum {
    /**
     * FU_SYNAPTICS_VMM9_RC_CTRL_ENABLE_RC:
     */
    FU_SYNAPTICS_VMM9_RC_CTRL_ENABLE_RC = 0x01,
    /**
     * FU_SYNAPTICS_VMM9_RC_CTRL_DISABLE_RC:
     */
    FU_SYNAPTICS_VMM9_RC_CTRL_DISABLE_RC = 0x02,
    /**
     * FU_SYNAPTICS_VMM9_RC_CTRL_GET_ID:
     */
    FU_SYNAPTICS_VMM9_RC_CTRL_GET_ID = 0x03,
    /**
     * FU_SYNAPTICS_VMM9_RC_CTRL_ERASE_FLASH:
     */
    FU_SYNAPTICS_VMM9_RC_CTRL_ERASE_FLASH = 0x14,
    /**
     * FU_SYNAPTICS_VMM9_RC_CTRL_ACTIVATE_FIRMWARE:
     */
    FU_SYNAPTICS_VMM9_RC_CTRL_ACTIVATE_FIRMWARE = 0x18,
    /**
     * FU_SYNAPTICS_VMM9_RC_CTRL_WRITE_FLASH_DATA:
     */
    FU_SYNAPTICS_VMM9_RC_CTRL_WRITE_FLASH_DATA = 0x20,
    /**
     * FU_SYNAPTICS_VMM9_RC_CTRL_MEMORY_WRITE:
     */
    FU_SYNAPTICS_VMM9_RC_CTRL_MEMORY_WRITE = 0x21,
    /**
     * FU_SYNAPTICS_VMM9_RC_CTRL_TX_DPCD_REGISTER_WRITE:
     *
     * TX0 to TX3
     */
    FU_SYNAPTICS_VMM9_RC_CTRL_TX_DPCD_REGISTER_WRITE = 0x22,
    /**
     * FU_SYNAPTICS_VMM9_RC_CTRL_READ_FLASH_DATA:
     */
    FU_SYNAPTICS_VMM9_RC_CTRL_READ_FLASH_DATA = 0x30,
    /**
     * FU_SYNAPTICS_VMM9_RC_CTRL_MEMORY_READ:
     */
    FU_SYNAPTICS_VMM9_RC_CTRL_MEMORY_READ = 0x31,
    /**
     * FU_SYNAPTICS_VMM9_RC_CTRL_TX_DPCD_REGISTER_READ:
     *
     * TX0 to TX3
     */
    FU_SYNAPTICS_VMM9_RC_CTRL_TX_DPCD_REGISTER_READ = 0x32,
    /**
     * FU_SYNAPTICS_VMM9_RC_CTRL_ENABLE_RC_BUSY:
     *
     * these are fake, but useful for debugging
     */
    FU_SYNAPTICS_VMM9_RC_CTRL_ENABLE_RC_BUSY = 0x80|0x01,
    /**
     * FU_SYNAPTICS_VMM9_RC_CTRL_DISABLE_RC_BUSY:
     */
    FU_SYNAPTICS_VMM9_RC_CTRL_DISABLE_RC_BUSY = 0x80|0x02,
    /**
     * FU_SYNAPTICS_VMM9_RC_CTRL_GET_ID_BUSY:
     */
    FU_SYNAPTICS_VMM9_RC_CTRL_GET_ID_BUSY = 0x80|0x03,
    /**
     * FU_SYNAPTICS_VMM9_RC_CTRL_ERASE_FLASH_BUSY:
     */
    FU_SYNAPTICS_VMM9_RC_CTRL_ERASE_FLASH_BUSY = 0x80|0x14,
    /**
     * FU_SYNAPTICS_VMM9_RC_CTRL_ACTIVATE_FIRMWARE_BUSY:
     */
    FU_SYNAPTICS_VMM9_RC_CTRL_ACTIVATE_FIRMWARE_BUSY = 0x80|0x18,
    /**
     * FU_SYNAPTICS_VMM9_RC_CTRL_WRITE_FLASH_DATA_BUSY:
     */
    FU_SYNAPTICS_VMM9_RC_CTRL_WRITE_FLASH_DATA_BUSY = 0x80|0x20,
    /**
     * FU_SYNAPTICS_VMM9_RC_CTRL_MEMORY_WRITE_BUSY:
     */
    FU_SYNAPTICS_VMM9_RC_CTRL_MEMORY_WRITE_BUSY = 0x80|0x21,
    /**
     * FU_SYNAPTICS_VMM9_RC_CTRL_READ_FLASH_DATA_BUSY:
     */
    FU_SYNAPTICS_VMM9_RC_CTRL_READ_FLASH_DATA_BUSY = 0x80|0x30,
    /**
     * FU_SYNAPTICS_VMM9_RC_CTRL_MEMORY_READ_BUSY:
     */
    FU_SYNAPTICS_VMM9_RC_CTRL_MEMORY_READ_BUSY = 0x80|0x31,
}  FuSynapticsVmm9RcCtrl;
/**
 * FuSynapticsVmm9MemOffset:
 */
typedef enum {
    /**
     * FU_SYNAPTICS_VMM9_MEM_OFFSET_CHIP_SERIAL:
     *
     * 0x4 bytes, %02x
     */
    FU_SYNAPTICS_VMM9_MEM_OFFSET_CHIP_SERIAL = 0x20200D3C,
    /**
     * FU_SYNAPTICS_VMM9_MEM_OFFSET_RC_TRIGGER:
     *
     * write 0xF5000000 to reset
     */
    FU_SYNAPTICS_VMM9_MEM_OFFSET_RC_TRIGGER = 0x2020A024,
    /**
     * FU_SYNAPTICS_VMM9_MEM_OFFSET_MCU_BOOTLOADER_STS:
     *
     * bootloader status
     */
    FU_SYNAPTICS_VMM9_MEM_OFFSET_MCU_BOOTLOADER_STS = 0x2020A030,
    /**
     * FU_SYNAPTICS_VMM9_MEM_OFFSET_MCU_FW_VERSION:
     *
     * 0x4 bytes, maj.min.mic.?
     */
    FU_SYNAPTICS_VMM9_MEM_OFFSET_MCU_FW_VERSION = 0x2020A038,
    /**
     * FU_SYNAPTICS_VMM9_MEM_OFFSET_FIRMWARE_BUILD:
     *
     * 0x4 bytes, be
     */
    FU_SYNAPTICS_VMM9_MEM_OFFSET_FIRMWARE_BUILD = 0x2020A084,
    /**
     * FU_SYNAPTICS_VMM9_MEM_OFFSET_RC_COMMAND:
     */
    FU_SYNAPTICS_VMM9_MEM_OFFSET_RC_COMMAND = 0x2020B000,
    /**
     * FU_SYNAPTICS_VMM9_MEM_OFFSET_RC_OFFSET:
     */
    FU_SYNAPTICS_VMM9_MEM_OFFSET_RC_OFFSET = 0x2020B004,
    /**
     * FU_SYNAPTICS_VMM9_MEM_OFFSET_RC_LENGTH:
     */
    FU_SYNAPTICS_VMM9_MEM_OFFSET_RC_LENGTH = 0x2020B008,
    /**
     * FU_SYNAPTICS_VMM9_MEM_OFFSET_RC_DATA:
     *
     * until 0x2020B02C
     */
    FU_SYNAPTICS_VMM9_MEM_OFFSET_RC_DATA = 0x2020B010,
    /**
     * FU_SYNAPTICS_VMM9_MEM_OFFSET_FIRMWARE_NAME:
     *
     * 0xF bytes, ASCII
     */
    FU_SYNAPTICS_VMM9_MEM_OFFSET_FIRMWARE_NAME = 0x90000230,
    /**
     * FU_SYNAPTICS_VMM9_MEM_OFFSET_BOARD_ID:
     *
     * 0x2 bytes, customer.hardware
     */
    FU_SYNAPTICS_VMM9_MEM_OFFSET_BOARD_ID = 0x9000014E,
}  FuSynapticsVmm9MemOffset;
/**
 * FuSynapticsVmm9RcSts:
 */
typedef enum {
    /**
     * FU_SYNAPTICS_VMM9_RC_STS_SUCCESS:
     */
    FU_SYNAPTICS_VMM9_RC_STS_SUCCESS,
    /**
     * FU_SYNAPTICS_VMM9_RC_STS_INVALID:
     */
    FU_SYNAPTICS_VMM9_RC_STS_INVALID,
    /**
     * FU_SYNAPTICS_VMM9_RC_STS_UNSUPPORTED:
     */
    FU_SYNAPTICS_VMM9_RC_STS_UNSUPPORTED,
    /**
     * FU_SYNAPTICS_VMM9_RC_STS_FAILED:
     */
    FU_SYNAPTICS_VMM9_RC_STS_FAILED,
    /**
     * FU_SYNAPTICS_VMM9_RC_STS_DISABLED:
     */
    FU_SYNAPTICS_VMM9_RC_STS_DISABLED,
    /**
     * FU_SYNAPTICS_VMM9_RC_STS_CONFIGURE_SIGN_FAILED:
     */
    FU_SYNAPTICS_VMM9_RC_STS_CONFIGURE_SIGN_FAILED,
    /**
     * FU_SYNAPTICS_VMM9_RC_STS_FIRMWARE_SIGN_FAILED:
     */
    FU_SYNAPTICS_VMM9_RC_STS_FIRMWARE_SIGN_FAILED,
    /**
     * FU_SYNAPTICS_VMM9_RC_STS_ROLLBACK_FAILED:
     */
    FU_SYNAPTICS_VMM9_RC_STS_ROLLBACK_FAILED,
}  FuSynapticsVmm9RcSts;
#define FU_SYNAPTICS_VMM9_RC_STS_LAST 8
const gchar *fu_synaptics_vmm9_rc_sts_to_string(FuSynapticsVmm9RcSts val) G_GNUC_CONST;
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructSynapticsVmm9;

FuStructSynapticsVmm9 *fu_struct_synaptics_vmm9_ref(FuStructSynapticsVmm9 *st) G_GNUC_NON_NULL(1);
void fu_struct_synaptics_vmm9_unref(FuStructSynapticsVmm9 *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructSynapticsVmm9, fu_struct_synaptics_vmm9_unref)
FuStructSynapticsVmm9 *fu_struct_synaptics_vmm9_parse_stream(GInputStream *stream, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
gboolean fu_struct_synaptics_vmm9_validate_stream(GInputStream *stream, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;

#ifndef __GI_SCANNER__
#define FU_STRUCT_SYNAPTICS_VMM9_OFFSET_SIGNATURE 0x0
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_SYNAPTICS_VMM9_SIZE_SIGNATURE 0x7
#define FU_STRUCT_SYNAPTICS_VMM9_N_ELEMENTS_SIGNATURE 7
#define FU_STRUCT_SYNAPTICS_VMM9_SIZE 0x7
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_SYNAPTICS_VMM9_DEFAULT_SIGNATURE "CARRERA"
#endif
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructHidPayload;

FuStructHidPayload *fu_struct_hid_payload_ref(FuStructHidPayload *st) G_GNUC_NON_NULL(1);
void fu_struct_hid_payload_unref(FuStructHidPayload *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructHidPayload, fu_struct_hid_payload_unref)
FuStructHidPayload *fu_struct_hid_payload_new(void) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_hid_payload_get_cap(const FuStructHidPayload *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_hid_payload_get_state(const FuStructHidPayload *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
FuSynapticsVmm9RcCtrl fu_struct_hid_payload_get_ctrl(const FuStructHidPayload *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
FuSynapticsVmm9RcSts fu_struct_hid_payload_get_sts(const FuStructHidPayload *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_hid_payload_get_offset(const FuStructHidPayload *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_hid_payload_get_length(const FuStructHidPayload *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
const guint8 *fu_struct_hid_payload_get_fifo(const FuStructHidPayload *st, gsize *bufsz) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
void fu_struct_hid_payload_set_cap(FuStructHidPayload *st, guint8 value) G_GNUC_NON_NULL(1);
void fu_struct_hid_payload_set_state(FuStructHidPayload *st, guint8 value) G_GNUC_NON_NULL(1);
void fu_struct_hid_payload_set_ctrl(FuStructHidPayload *st, FuSynapticsVmm9RcCtrl value) G_GNUC_NON_NULL(1);
void fu_struct_hid_payload_set_sts(FuStructHidPayload *st, FuSynapticsVmm9RcSts value) G_GNUC_NON_NULL(1);
void fu_struct_hid_payload_set_offset(FuStructHidPayload *st, guint32 value) G_GNUC_NON_NULL(1);
void fu_struct_hid_payload_set_length(FuStructHidPayload *st, guint32 value) G_GNUC_NON_NULL(1);
gboolean fu_struct_hid_payload_set_fifo(FuStructHidPayload *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_HID_PAYLOAD_OFFSET_CAP 0x0
#define FU_STRUCT_HID_PAYLOAD_OFFSET_STATE 0x1
#define FU_STRUCT_HID_PAYLOAD_OFFSET_CTRL 0x2
#define FU_STRUCT_HID_PAYLOAD_OFFSET_STS 0x3
#define FU_STRUCT_HID_PAYLOAD_OFFSET_OFFSET 0x4
#define FU_STRUCT_HID_PAYLOAD_OFFSET_LENGTH 0x8
#define FU_STRUCT_HID_PAYLOAD_OFFSET_FIFO 0xC
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_HID_PAYLOAD_SIZE_FIFO 0x20
#define FU_STRUCT_HID_PAYLOAD_N_ELEMENTS_FIFO 32
#define FU_STRUCT_HID_PAYLOAD_SIZE 0x2C
#endif

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

FuStructHidSetCommand *fu_struct_hid_set_command_ref(FuStructHidSetCommand *st) G_GNUC_NON_NULL(1);
void fu_struct_hid_set_command_unref(FuStructHidSetCommand *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructHidSetCommand, fu_struct_hid_set_command_unref)
FuStructHidSetCommand *fu_struct_hid_set_command_new(void) G_GNUC_WARN_UNUSED_RESULT;
gchar *fu_struct_hid_set_command_to_string(const FuStructHidSetCommand *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_hid_set_command_get_size(const FuStructHidSetCommand *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
FuStructHidPayload *fu_struct_hid_set_command_get_payload(const FuStructHidSetCommand *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_hid_set_command_get_checksum(const FuStructHidSetCommand *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
void fu_struct_hid_set_command_set_size(FuStructHidSetCommand *st, guint8 value) G_GNUC_NON_NULL(1);
gboolean
fu_struct_hid_set_command_set_payload(FuStructHidSetCommand *st, const FuStructHidPayload *st_donor, GError **error) G_GNUC_NON_NULL(1, 2) G_GNUC_WARN_UNUSED_RESULT;
void fu_struct_hid_set_command_set_checksum(FuStructHidSetCommand *st, guint8 value) G_GNUC_NON_NULL(1);

#ifndef __GI_SCANNER__
#define FU_STRUCT_HID_SET_COMMAND_OFFSET_ID 0x0
#define FU_STRUCT_HID_SET_COMMAND_OFFSET_TYPE 0x1
#define FU_STRUCT_HID_SET_COMMAND_OFFSET_SIZE 0x2
#define FU_STRUCT_HID_SET_COMMAND_OFFSET_PAYLOAD 0x3
#define FU_STRUCT_HID_SET_COMMAND_OFFSET_CHECKSUM 0x2F
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_HID_SET_COMMAND_SIZE 0x30
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_HID_SET_COMMAND_DEFAULT_ID 0x1
#define FU_STRUCT_HID_SET_COMMAND_DEFAULT_TYPE 0x0
#endif
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructHidGetCommand;

FuStructHidGetCommand *fu_struct_hid_get_command_ref(FuStructHidGetCommand *st) G_GNUC_NON_NULL(1);
void fu_struct_hid_get_command_unref(FuStructHidGetCommand *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructHidGetCommand, fu_struct_hid_get_command_unref)
FuStructHidGetCommand *fu_struct_hid_get_command_new(void) G_GNUC_WARN_UNUSED_RESULT;
FuStructHidGetCommand *fu_struct_hid_get_command_parse(const guint8 *buf, gsize bufsz, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_hid_get_command_get_size(const FuStructHidGetCommand *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
FuStructHidPayload *fu_struct_hid_get_command_get_payload(const FuStructHidGetCommand *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_hid_get_command_get_checksum(const FuStructHidGetCommand *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
void fu_struct_hid_get_command_set_size(FuStructHidGetCommand *st, guint8 value) G_GNUC_NON_NULL(1);
gboolean
fu_struct_hid_get_command_set_payload(FuStructHidGetCommand *st, const FuStructHidPayload *st_donor, GError **error) G_GNUC_NON_NULL(1, 2) G_GNUC_WARN_UNUSED_RESULT;
void fu_struct_hid_get_command_set_checksum(FuStructHidGetCommand *st, guint8 value) G_GNUC_NON_NULL(1);

#ifndef __GI_SCANNER__
#define FU_STRUCT_HID_GET_COMMAND_OFFSET_ID 0x0
#define FU_STRUCT_HID_GET_COMMAND_OFFSET_TYPE 0x1
#define FU_STRUCT_HID_GET_COMMAND_OFFSET_SIZE 0x2
#define FU_STRUCT_HID_GET_COMMAND_OFFSET_PAYLOAD 0x3
#define FU_STRUCT_HID_GET_COMMAND_OFFSET_CHECKSUM 0x2F
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_HID_GET_COMMAND_SIZE 0x30
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_HID_GET_COMMAND_DEFAULT_ID 0x1
#define FU_STRUCT_HID_GET_COMMAND_DEFAULT_TYPE 0x0
#endif
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructSynapticsUpdGetId;

FuStructSynapticsUpdGetId *fu_struct_synaptics_upd_get_id_ref(FuStructSynapticsUpdGetId *st) G_GNUC_NON_NULL(1);
void fu_struct_synaptics_upd_get_id_unref(FuStructSynapticsUpdGetId *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructSynapticsUpdGetId, fu_struct_synaptics_upd_get_id_unref)
FuStructSynapticsUpdGetId *fu_struct_synaptics_upd_get_id_parse(const guint8 *buf, gsize bufsz, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_synaptics_upd_get_id_get_cid(const FuStructSynapticsUpdGetId *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_synaptics_upd_get_id_get_bid(const FuStructSynapticsUpdGetId *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;

#ifndef __GI_SCANNER__
#define FU_STRUCT_SYNAPTICS_UPD_GET_ID_OFFSET_CID 0x2
#define FU_STRUCT_SYNAPTICS_UPD_GET_ID_OFFSET_BID 0x3
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_SYNAPTICS_UPD_GET_ID_SIZE 0x4
#endif

#ifndef __GI_SCANNER__
#endif
