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

#pragma once
#include <fu-input-stream.h>
/**
 * FuEp963xSmbusError:
 *
 * byte = 0x07
 */
typedef enum {
    /**
     * FU_EP963X_SMBUS_ERROR_NONE:
     */
    FU_EP963X_SMBUS_ERROR_NONE = 0x00,
    /**
     * FU_EP963X_SMBUS_ERROR_ADDRESS:
     */
    FU_EP963X_SMBUS_ERROR_ADDRESS = 0x01,
    /**
     * FU_EP963X_SMBUS_ERROR_NO_ACK:
     */
    FU_EP963X_SMBUS_ERROR_NO_ACK = 0x02,
    /**
     * FU_EP963X_SMBUS_ERROR_ARBITRATION:
     */
    FU_EP963X_SMBUS_ERROR_ARBITRATION = 0x04,
    /**
     * FU_EP963X_SMBUS_ERROR_COMMAND:
     */
    FU_EP963X_SMBUS_ERROR_COMMAND = 0x08,
    /**
     * FU_EP963X_SMBUS_ERROR_TIMEOUT:
     */
    FU_EP963X_SMBUS_ERROR_TIMEOUT = 0x10,
    /**
     * FU_EP963X_SMBUS_ERROR_BUSY:
     */
    FU_EP963X_SMBUS_ERROR_BUSY = 0x20,
}  FuEp963xSmbusError;
const gchar *fu_ep963x_smbus_error_to_string(FuEp963xSmbusError val) G_GNUC_CONST;
/**
 * FuEp963Icp:
 */
typedef enum {
    /**
     * FU_EP963_ICP_ENTER:
     */
    FU_EP963_ICP_ENTER = 0x40,
    /**
     * FU_EP963_ICP_EXIT:
     */
    FU_EP963_ICP_EXIT = 0x82,
    /**
     * FU_EP963_ICP_BANK:
     */
    FU_EP963_ICP_BANK = 0x83,
    /**
     * FU_EP963_ICP_ADDRESS:
     */
    FU_EP963_ICP_ADDRESS = 0x84,
    /**
     * FU_EP963_ICP_READBLOCK:
     */
    FU_EP963_ICP_READBLOCK = 0x85,
    /**
     * FU_EP963_ICP_WRITEBLOCK:
     */
    FU_EP963_ICP_WRITEBLOCK = 0x86,
    /**
     * FU_EP963_ICP_MCUID:
     */
    FU_EP963_ICP_MCUID = 0x87,
    /**
     * FU_EP963_ICP_DONE:
     */
    FU_EP963_ICP_DONE = 0x5A,
}  FuEp963Icp;
/**
 * FuEp963Opcode:
 */
typedef enum {
    /**
     * FU_EP963_OPCODE_SMBUS_READ:
     */
    FU_EP963_OPCODE_SMBUS_READ = 0x01,
    /**
     * FU_EP963_OPCODE_ERASE_SPI:
     */
    FU_EP963_OPCODE_ERASE_SPI = 0x02,
    /**
     * FU_EP963_OPCODE_RESET_BLOCK_INDEX:
     */
    FU_EP963_OPCODE_RESET_BLOCK_INDEX = 0x03,
    /**
     * FU_EP963_OPCODE_WRITE_BLOCK_DATA:
     */
    FU_EP963_OPCODE_WRITE_BLOCK_DATA = 0x04,
    /**
     * FU_EP963_OPCODE_PROGRAM_SPI_BLOCK:
     */
    FU_EP963_OPCODE_PROGRAM_SPI_BLOCK = 0x05,
    /**
     * FU_EP963_OPCODE_PROGRAM_SPI_FINISH:
     */
    FU_EP963_OPCODE_PROGRAM_SPI_FINISH = 0x06,
    /**
     * FU_EP963_OPCODE_GET_SPI_CHECKSUM:
     */
    FU_EP963_OPCODE_GET_SPI_CHECKSUM = 0x07,
    /**
     * FU_EP963_OPCODE_PROGRAM_EP_FLASH:
     */
    FU_EP963_OPCODE_PROGRAM_EP_FLASH = 0x08,
    /**
     * FU_EP963_OPCODE_GET_EP_CHECKSUM:
     */
    FU_EP963_OPCODE_GET_EP_CHECKSUM = 0x09,
    /**
     * FU_EP963_OPCODE_START_THROW_PAGE:
     */
    FU_EP963_OPCODE_START_THROW_PAGE = 0x0b,
    /**
     * FU_EP963_OPCODE_GET_EP_SITE_TYPE:
     */
    FU_EP963_OPCODE_GET_EP_SITE_TYPE = 0x0c,
    /**
     * FU_EP963_OPCODE_COMMAND_VERSION:
     */
    FU_EP963_OPCODE_COMMAND_VERSION = 0x10,
    /**
     * FU_EP963_OPCODE_COMMAND_STATUS:
     */
    FU_EP963_OPCODE_COMMAND_STATUS = 0x20,
    /**
     * FU_EP963_OPCODE_SUBMCU_ENTER_ICP:
     */
    FU_EP963_OPCODE_SUBMCU_ENTER_ICP = 0x30,
    /**
     * FU_EP963_OPCODE_SUBMCU_RESET_BLOCK_IDX:
     */
    FU_EP963_OPCODE_SUBMCU_RESET_BLOCK_IDX = 0x31,
    /**
     * FU_EP963_OPCODE_SUBMCU_WRITE_BLOCK_DATA:
     */
    FU_EP963_OPCODE_SUBMCU_WRITE_BLOCK_DATA = 0x32,
    /**
     * FU_EP963_OPCODE_SUBMCU_PROGRAM_BLOCK:
     */
    FU_EP963_OPCODE_SUBMCU_PROGRAM_BLOCK = 0x33,
    /**
     * FU_EP963_OPCODE_SUBMCU_PROGRAM_FINISHED:
     */
    FU_EP963_OPCODE_SUBMCU_PROGRAM_FINISHED = 0x34,
}  FuEp963Opcode;
/**
 * FuEp963UfCmd:
 */
typedef enum {
    /**
     * FU_EP963_UF_CMD_VERSION:
     */
    FU_EP963_UF_CMD_VERSION = 0x00,
    /**
     * FU_EP963_UF_CMD_ENTERISP:
     */
    FU_EP963_UF_CMD_ENTERISP = 0x01,
    /**
     * FU_EP963_UF_CMD_PROGRAM:
     */
    FU_EP963_UF_CMD_PROGRAM = 0x02,
    /**
     * FU_EP963_UF_CMD_READ:
     */
    FU_EP963_UF_CMD_READ = 0x03,
    /**
     * FU_EP963_UF_CMD_MODE:
     */
    FU_EP963_UF_CMD_MODE = 0x04,
}  FuEp963UfCmd;
/**
 * FuEp963UsbState:
 */
typedef enum {
    /**
     * FU_EP963_USB_STATE_READY:
     */
    FU_EP963_USB_STATE_READY = 0x00,
    /**
     * FU_EP963_USB_STATE_BUSY:
     */
    FU_EP963_USB_STATE_BUSY = 0x01,
    /**
     * FU_EP963_USB_STATE_FAIL:
     */
    FU_EP963_USB_STATE_FAIL = 0x02,
    /**
     * FU_EP963_USB_STATE_UNKNOWN:
     */
    FU_EP963_USB_STATE_UNKNOWN = 0xff,
}  FuEp963UsbState;
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructEp963xFirmwareHdr;

FuStructEp963xFirmwareHdr *fu_struct_ep963x_firmware_hdr_ref(FuStructEp963xFirmwareHdr *st) G_GNUC_NON_NULL(1);
void fu_struct_ep963x_firmware_hdr_unref(FuStructEp963xFirmwareHdr *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructEp963xFirmwareHdr, fu_struct_ep963x_firmware_hdr_unref)
gboolean fu_struct_ep963x_firmware_hdr_validate_stream(GInputStream *stream, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;

#ifndef __GI_SCANNER__
#define FU_STRUCT_EP963X_FIRMWARE_HDR_OFFSET_MAGIC 0x10
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_EP963X_FIRMWARE_HDR_SIZE_MAGIC 0x5
#define FU_STRUCT_EP963X_FIRMWARE_HDR_N_ELEMENTS_MAGIC 5
#define FU_STRUCT_EP963X_FIRMWARE_HDR_SIZE 0x15
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_EP963X_FIRMWARE_HDR_DEFAULT_MAGIC "EP963"
#endif
