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

#pragma once
#include <fu-input-stream.h>
/**
 * FuParadeUsbhubDeviceRequest:
 */
typedef enum {
    /**
     * FU_PARADE_USBHUB_DEVICE_REQUEST_READ:
     */
    FU_PARADE_USBHUB_DEVICE_REQUEST_READ = 0x40,
    /**
     * FU_PARADE_USBHUB_DEVICE_REQUEST_WRITE:
     */
    FU_PARADE_USBHUB_DEVICE_REQUEST_WRITE = 0x41,
}  FuParadeUsbhubDeviceRequest;
/**
 * FuParadeUsbhubDeviceAddr:
 */
typedef enum {
    /**
     * FU_PARADE_USBHUB_DEVICE_ADDR_STATUS:
     */
    FU_PARADE_USBHUB_DEVICE_ADDR_STATUS = 0x5000,
    /**
     * FU_PARADE_USBHUB_DEVICE_ADDR_DATA:
     *
     * u32
     */
    FU_PARADE_USBHUB_DEVICE_ADDR_DATA = 0x5001,
    /**
     * FU_PARADE_USBHUB_DEVICE_ADDR_SPI_ADDR:
     *
     * u24
     */
    FU_PARADE_USBHUB_DEVICE_ADDR_SPI_ADDR = 0x5005,
    /**
     * FU_PARADE_USBHUB_DEVICE_ADDR_SRAM_ADDR:
     *
     * u16
     */
    FU_PARADE_USBHUB_DEVICE_ADDR_SRAM_ADDR = 0x5008,
    /**
     * FU_PARADE_USBHUB_DEVICE_ADDR_DMA_SIZE:
     */
    FU_PARADE_USBHUB_DEVICE_ADDR_DMA_SIZE = 0x500C,
    /**
     * FU_PARADE_USBHUB_DEVICE_ADDR_READ_SIZE:
     */
    FU_PARADE_USBHUB_DEVICE_ADDR_READ_SIZE = 0x500D,
    /**
     * FU_PARADE_USBHUB_DEVICE_ADDR_DBI_TIMEOUT:
     */
    FU_PARADE_USBHUB_DEVICE_ADDR_DBI_TIMEOUT = 0x5819,
    /**
     * FU_PARADE_USBHUB_DEVICE_ADDR_UFP_DISCONNECT:
     */
    FU_PARADE_USBHUB_DEVICE_ADDR_UFP_DISCONNECT = 0x584B,
    /**
     * FU_PARADE_USBHUB_DEVICE_ADDR_SPI_MASTER_ACQUIRE:
     */
    FU_PARADE_USBHUB_DEVICE_ADDR_SPI_MASTER_ACQUIRE = 0x5824,
    /**
     * FU_PARADE_USBHUB_DEVICE_ADDR_SPI_MASTER:
     */
    FU_PARADE_USBHUB_DEVICE_ADDR_SPI_MASTER = 0x5826,
    /**
     * FU_PARADE_USBHUB_DEVICE_ADDR_GPIO_CONTROL_ENABLE:
     */
    FU_PARADE_USBHUB_DEVICE_ADDR_GPIO_CONTROL_ENABLE = 0x582D,
    /**
     * FU_PARADE_USBHUB_DEVICE_ADDR_SRAM_PAGE:
     */
    FU_PARADE_USBHUB_DEVICE_ADDR_SRAM_PAGE = 0x5879,
    /**
     * FU_PARADE_USBHUB_DEVICE_ADDR_VERSION_A:
     */
    FU_PARADE_USBHUB_DEVICE_ADDR_VERSION_A = 0x5C0E,
    /**
     * FU_PARADE_USBHUB_DEVICE_ADDR_VERSION_B:
     */
    FU_PARADE_USBHUB_DEVICE_ADDR_VERSION_B = 0x5C0F,
    /**
     * FU_PARADE_USBHUB_DEVICE_ADDR_VERSION_C:
     */
    FU_PARADE_USBHUB_DEVICE_ADDR_VERSION_C = 0x5C11,
    /**
     * FU_PARADE_USBHUB_DEVICE_ADDR_VERSION_D:
     */
    FU_PARADE_USBHUB_DEVICE_ADDR_VERSION_D = 0x5C12,
    /**
     * FU_PARADE_USBHUB_DEVICE_ADDR_SPI_MASTER_ACQUIRE2:
     *
     * for PS188
     */
    FU_PARADE_USBHUB_DEVICE_ADDR_SPI_MASTER_ACQUIRE2 = 0xE2B3,
}  FuParadeUsbhubDeviceAddr;
/**
 * FuParadeUsbhubDeviceStatusFlags:
 */
typedef enum {
    /**
     * FU_PARADE_USBHUB_DEVICE_STATUS_FLAG_WRITE:
     */
    FU_PARADE_USBHUB_DEVICE_STATUS_FLAG_WRITE = 0x1,
    /**
     * FU_PARADE_USBHUB_DEVICE_STATUS_FLAG_TRIGGER_SPI:
     */
    FU_PARADE_USBHUB_DEVICE_STATUS_FLAG_TRIGGER_SPI = 0x2,
    /**
     * FU_PARADE_USBHUB_DEVICE_STATUS_FLAG_TRIGGER_DBI:
     */
    FU_PARADE_USBHUB_DEVICE_STATUS_FLAG_TRIGGER_DBI = 0x4,
    /**
     * FU_PARADE_USBHUB_DEVICE_STATUS_FLAG_CHECKSUM:
     */
    FU_PARADE_USBHUB_DEVICE_STATUS_FLAG_CHECKSUM = 0x8,
    /**
     * FU_PARADE_USBHUB_DEVICE_STATUS_FLAG_SPI_DONE:
     */
    FU_PARADE_USBHUB_DEVICE_STATUS_FLAG_SPI_DONE = 0x80,
}  FuParadeUsbhubDeviceStatusFlags;
/**
 * FuParadeUsbhubChip:
 */
typedef enum {
    /**
     * FU_PARADE_USBHUB_CHIP_UNKNOWN:
     */
    FU_PARADE_USBHUB_CHIP_UNKNOWN,
    /**
     * FU_PARADE_USBHUB_CHIP_PS5512:
     */
    FU_PARADE_USBHUB_CHIP_PS5512,
    /**
     * FU_PARADE_USBHUB_CHIP_PS188:
     */
    FU_PARADE_USBHUB_CHIP_PS188,
}  FuParadeUsbhubChip;
#define FU_PARADE_USBHUB_CHIP_LAST 3
const gchar *fu_parade_usbhub_chip_to_string(FuParadeUsbhubChip val) G_GNUC_CONST;
FuParadeUsbhubChip fu_parade_usbhub_chip_from_string(const gchar *val) G_GNUC_CONST G_GNUC_NON_NULL(1);
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructParadeUsbhubHdr;

FuStructParadeUsbhubHdr *fu_struct_parade_usbhub_hdr_ref(FuStructParadeUsbhubHdr *st) G_GNUC_NON_NULL(1);
void fu_struct_parade_usbhub_hdr_unref(FuStructParadeUsbhubHdr *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructParadeUsbhubHdr, fu_struct_parade_usbhub_hdr_unref)
gboolean fu_struct_parade_usbhub_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_PARADE_USBHUB_HDR_OFFSET_SIGNATURE 0x0
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_PARADE_USBHUB_HDR_SIZE 0x2
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_PARADE_USBHUB_HDR_DEFAULT_SIGNATURE 0x55AA
#endif
