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

#pragma once
#include <fu-input-stream.h>
/**
 * FuTiTps6598xSfwi:
 */
typedef enum {
    /**
     * FU_TI_TPS6598X_SFWI_SUCCESS:
     */
    FU_TI_TPS6598X_SFWI_SUCCESS = 0x0,
    /**
     * FU_TI_TPS6598X_SFWI_FAIL_FLASH_ERROR_OR_BUSY:
     */
    FU_TI_TPS6598X_SFWI_FAIL_FLASH_ERROR_OR_BUSY = 0x4,
    /**
     * FU_TI_TPS6598X_SFWI_FAIL_FLASH_INVALID_ADDRESS:
     */
    FU_TI_TPS6598X_SFWI_FAIL_FLASH_INVALID_ADDRESS = 0x5,
    /**
     * FU_TI_TPS6598X_SFWI_FAIL_LAST_BOOT_WAS_UART:
     */
    FU_TI_TPS6598X_SFWI_FAIL_LAST_BOOT_WAS_UART = 0x6,
    /**
     * FU_TI_TPS6598X_SFWI_FAIL_SFWI_AFTER_COMPLETE:
     */
    FU_TI_TPS6598X_SFWI_FAIL_SFWI_AFTER_COMPLETE = 0x7,
    /**
     * FU_TI_TPS6598X_SFWI_FAIL_NO_VALID_FLASH_REGION:
     */
    FU_TI_TPS6598X_SFWI_FAIL_NO_VALID_FLASH_REGION = 0x8,
    /**
     * FU_TI_TPS6598X_SFWI_FAIL_UNKNOWN_ERROR:
     */
    FU_TI_TPS6598X_SFWI_FAIL_UNKNOWN_ERROR = 0xF,
}  FuTiTps6598xSfwi;
const gchar *fu_ti_tps6598x_sfwi_to_string(FuTiTps6598xSfwi val) G_GNUC_CONST;
/**
 * FuTiTps6598xSfwd:
 */
typedef enum {
    /**
     * FU_TI_TPS6598X_SFWD_SUCCESS:
     */
    FU_TI_TPS6598X_SFWD_SUCCESS = 0x0,
    /**
     * FU_TI_TPS6598X_SFWD_FAIL_FLASH_ERASE_WRITE_ERROR:
     */
    FU_TI_TPS6598X_SFWD_FAIL_FLASH_ERASE_WRITE_ERROR = 0x4,
    /**
     * FU_TI_TPS6598X_SFWD_FAIL_SFWI_NOT_RUN_FIRST:
     */
    FU_TI_TPS6598X_SFWD_FAIL_SFWI_NOT_RUN_FIRST = 0x6,
    /**
     * FU_TI_TPS6598X_SFWD_FAIL_TOO_MUCH_DATA:
     */
    FU_TI_TPS6598X_SFWD_FAIL_TOO_MUCH_DATA = 0x7,
    /**
     * FU_TI_TPS6598X_SFWD_FAIL_ID_NOT_IN_HEADER:
     */
    FU_TI_TPS6598X_SFWD_FAIL_ID_NOT_IN_HEADER = 0x8,
    /**
     * FU_TI_TPS6598X_SFWD_FAIL_BINARY_TOO_LARGE:
     */
    FU_TI_TPS6598X_SFWD_FAIL_BINARY_TOO_LARGE = 0x9,
    /**
     * FU_TI_TPS6598X_SFWD_FAIL_DEVICE_ID_MISMATCH:
     */
    FU_TI_TPS6598X_SFWD_FAIL_DEVICE_ID_MISMATCH = 0xA,
    /**
     * FU_TI_TPS6598X_SFWD_FAIL_FLASH_ERROR_READ_ONLY:
     */
    FU_TI_TPS6598X_SFWD_FAIL_FLASH_ERROR_READ_ONLY = 0xD,
    /**
     * FU_TI_TPS6598X_SFWD_FAIL_UNKNOWN_ERROR:
     */
    FU_TI_TPS6598X_SFWD_FAIL_UNKNOWN_ERROR = 0xF,
}  FuTiTps6598xSfwd;
const gchar *fu_ti_tps6598x_sfwd_to_string(FuTiTps6598xSfwd val) G_GNUC_CONST;
/**
 * FuTiTps6598xSfws:
 */
typedef enum {
    /**
     * FU_TI_TPS6598X_SFWS_SUCCESS:
     */
    FU_TI_TPS6598X_SFWS_SUCCESS = 0x0,
    /**
     * FU_TI_TPS6598X_SFWS_FAIL_FLASH_ERASE_WRITE_ERROR:
     */
    FU_TI_TPS6598X_SFWS_FAIL_FLASH_ERASE_WRITE_ERROR = 0x4,
    /**
     * FU_TI_TPS6598X_SFWS_FAIL_SFWD_NOT_RUN_OR_NO_KEY_EXISTS:
     */
    FU_TI_TPS6598X_SFWS_FAIL_SFWD_NOT_RUN_OR_NO_KEY_EXISTS = 0x6,
    /**
     * FU_TI_TPS6598X_SFWS_FAIL_TOO_MUCH_DATA:
     */
    FU_TI_TPS6598X_SFWS_FAIL_TOO_MUCH_DATA = 0x7,
    /**
     * FU_TI_TPS6598X_SFWS_FAIL_CRC_FAIL:
     */
    FU_TI_TPS6598X_SFWS_FAIL_CRC_FAIL = 0x8,
    /**
     * FU_TI_TPS6598X_SFWS_FAIL_DID_CHECK_FAIL:
     */
    FU_TI_TPS6598X_SFWS_FAIL_DID_CHECK_FAIL = 0x9,
    /**
     * FU_TI_TPS6598X_SFWS_FAIL_VERSION_CHECK_FAIL:
     */
    FU_TI_TPS6598X_SFWS_FAIL_VERSION_CHECK_FAIL = 0xA,
    /**
     * FU_TI_TPS6598X_SFWS_FAIL_NO_HASH_MATCH_RULE_SATISFIED:
     */
    FU_TI_TPS6598X_SFWS_FAIL_NO_HASH_MATCH_RULE_SATISFIED = 0xB,
    /**
     * FU_TI_TPS6598X_SFWS_FAIL_ENGR_FW_UPDATE_ATTEMPT_WHILE_RUNNING_PROD:
     */
    FU_TI_TPS6598X_SFWS_FAIL_ENGR_FW_UPDATE_ATTEMPT_WHILE_RUNNING_PROD = 0xC,
    /**
     * FU_TI_TPS6598X_SFWS_FAIL_INCOMPATIBLE_ROM_VERSION:
     */
    FU_TI_TPS6598X_SFWS_FAIL_INCOMPATIBLE_ROM_VERSION = 0xD,
    /**
     * FU_TI_TPS6598X_SFWS_FAIL_CRC_BUSY:
     */
    FU_TI_TPS6598X_SFWS_FAIL_CRC_BUSY = 0xE,
    /**
     * FU_TI_TPS6598X_SFWS_FAIL_UNKNOWN_ERROR:
     */
    FU_TI_TPS6598X_SFWS_FAIL_UNKNOWN_ERROR = 0xF,
}  FuTiTps6598xSfws;
const gchar *fu_ti_tps6598x_sfws_to_string(FuTiTps6598xSfws val) G_GNUC_CONST;
/**
 * FuTiTps6598xRegister:
 */
typedef enum {
    /**
     * FU_TI_TPS6598X_REGISTER_TBT_VID:
     *
     * ro, 4 bytes -- Intel assigned
     */
    FU_TI_TPS6598X_REGISTER_TBT_VID = 0x00,
    /**
     * FU_TI_TPS6598X_REGISTER_TBT_DID:
     *
     * ro, 4 bytes -- Intel assigned
     */
    FU_TI_TPS6598X_REGISTER_TBT_DID = 0x01,
    /**
     * FU_TI_TPS6598X_REGISTER_PROTO_VER:
     *
     * ro, 4 bytes
     */
    FU_TI_TPS6598X_REGISTER_PROTO_VER = 0x02,
    /**
     * FU_TI_TPS6598X_REGISTER_MODE:
     *
     * ro, 4 bytes
     */
    FU_TI_TPS6598X_REGISTER_MODE = 0x03,
    /**
     * FU_TI_TPS6598X_REGISTER_TYPE:
     *
     * ro, 4 bytes
     */
    FU_TI_TPS6598X_REGISTER_TYPE = 0x04,
    /**
     * FU_TI_TPS6598X_REGISTER_UID:
     *
     * ro, 16 bytes
     */
    FU_TI_TPS6598X_REGISTER_UID = 0x05,
    /**
     * FU_TI_TPS6598X_REGISTER_OUID:
     *
     * ro, 8 bytes
     */
    FU_TI_TPS6598X_REGISTER_OUID = 0x06,
    /**
     * FU_TI_TPS6598X_REGISTER_CMD1:
     *
     * ro, 4CC
     */
    FU_TI_TPS6598X_REGISTER_CMD1 = 0x08,
    /**
     * FU_TI_TPS6598X_REGISTER_DATA1:
     *
     * rw, 64 bytes
     */
    FU_TI_TPS6598X_REGISTER_DATA1 = 0x09,
    /**
     * FU_TI_TPS6598X_REGISTER_VERSION:
     *
     * rw, 4 bytes
     */
    FU_TI_TPS6598X_REGISTER_VERSION = 0x0F,
    /**
     * FU_TI_TPS6598X_REGISTER_CMD2:
     *
     * ro, 4CC
     */
    FU_TI_TPS6598X_REGISTER_CMD2 = 0x10,
    /**
     * FU_TI_TPS6598X_REGISTER_DATA2:
     *
     * rw, 64 bytes
     */
    FU_TI_TPS6598X_REGISTER_DATA2 = 0x11,
    /**
     * FU_TI_TPS6598X_REGISTER_CMD3:
     *
     * ro, variable
     */
    FU_TI_TPS6598X_REGISTER_CMD3 = 0x1E,
    /**
     * FU_TI_TPS6598X_REGISTER_DATA3:
     *
     * ro, variable
     */
    FU_TI_TPS6598X_REGISTER_DATA3 = 0x1F,
    /**
     * FU_TI_TPS6598X_REGISTER_OTP_CONFIG:
     *
     * ro, 12 bytes
     */
    FU_TI_TPS6598X_REGISTER_OTP_CONFIG = 0x2D,
    /**
     * FU_TI_TPS6598X_REGISTER_BUILD_IDENTIFIER:
     *
     * ro, 64 bytes
     */
    FU_TI_TPS6598X_REGISTER_BUILD_IDENTIFIER = 0x2E,
    /**
     * FU_TI_TPS6598X_REGISTER_DEVICE_INFO:
     *
     * ro, 47 bytes
     */
    FU_TI_TPS6598X_REGISTER_DEVICE_INFO = 0x2F,
    /**
     * FU_TI_TPS6598X_REGISTER_TX_IDENTITY:
     *
     * rw, 49 bytes
     */
    FU_TI_TPS6598X_REGISTER_TX_IDENTITY = 0x47,
}  FuTiTps6598xRegister;
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructTiTps6598xFirmwareHdr;

FuStructTiTps6598xFirmwareHdr *fu_struct_ti_tps6598x_firmware_hdr_ref(FuStructTiTps6598xFirmwareHdr *st) G_GNUC_NON_NULL(1);
void fu_struct_ti_tps6598x_firmware_hdr_unref(FuStructTiTps6598xFirmwareHdr *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructTiTps6598xFirmwareHdr, fu_struct_ti_tps6598x_firmware_hdr_unref)
gboolean fu_struct_ti_tps6598x_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_TI_TPS6598X_FIRMWARE_HDR_OFFSET_MAGIC 0x0
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_TI_TPS6598X_FIRMWARE_HDR_SIZE 0x4
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_TI_TPS6598X_FIRMWARE_HDR_DEFAULT_MAGIC 0xACEF0001
#endif
