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

#pragma once
#include <fu-input-stream.h>
/**
 * FuNovatekTsMemMapReg:
 *
 * device register addresses
 */
typedef enum {
    /**
     * FU_NOVATEK_TS_MEM_MAP_REG_CHIP_VER_TRIM_ADDR:
     */
    FU_NOVATEK_TS_MEM_MAP_REG_CHIP_VER_TRIM_ADDR = 0x1FB104,
    /**
     * FU_NOVATEK_TS_MEM_MAP_REG_SWRST_SIF_ADDR:
     */
    FU_NOVATEK_TS_MEM_MAP_REG_SWRST_SIF_ADDR = 0x1FB43E,
    /**
     * FU_NOVATEK_TS_MEM_MAP_REG_EVENT_BUF_CMD_ADDR:
     */
    FU_NOVATEK_TS_MEM_MAP_REG_EVENT_BUF_CMD_ADDR = 0x130950,
    /**
     * FU_NOVATEK_TS_MEM_MAP_REG_EVENT_BUF_HS_SUB_CMD_ADDR:
     */
    FU_NOVATEK_TS_MEM_MAP_REG_EVENT_BUF_HS_SUB_CMD_ADDR = 0x130951,
    /**
     * FU_NOVATEK_TS_MEM_MAP_REG_EVENT_BUF_RESET_STATE_ADDR:
     */
    FU_NOVATEK_TS_MEM_MAP_REG_EVENT_BUF_RESET_STATE_ADDR = 0x130960,
    /**
     * FU_NOVATEK_TS_MEM_MAP_REG_EVENT_MAP_FWINFO_ADDR:
     */
    FU_NOVATEK_TS_MEM_MAP_REG_EVENT_MAP_FWINFO_ADDR = 0x130978,
    /**
     * FU_NOVATEK_TS_MEM_MAP_REG_READ_FLASH_CHECKSUM_ADDR:
     */
    FU_NOVATEK_TS_MEM_MAP_REG_READ_FLASH_CHECKSUM_ADDR = 0x100000,
    /**
     * FU_NOVATEK_TS_MEM_MAP_REG_RW_FLASH_DATA_ADDR:
     */
    FU_NOVATEK_TS_MEM_MAP_REG_RW_FLASH_DATA_ADDR = 0x100002,
    /**
     * FU_NOVATEK_TS_MEM_MAP_REG_ENB_CASC_ADDR:
     */
    FU_NOVATEK_TS_MEM_MAP_REG_ENB_CASC_ADDR = 0x1FB12C,
    /**
     * FU_NOVATEK_TS_MEM_MAP_REG_HID_I2C_ENG_ADDR:
     */
    FU_NOVATEK_TS_MEM_MAP_REG_HID_I2C_ENG_ADDR = 0x1FB468,
    /**
     * FU_NOVATEK_TS_MEM_MAP_REG_GCM_CODE_ADDR:
     */
    FU_NOVATEK_TS_MEM_MAP_REG_GCM_CODE_ADDR = 0x1FB540,
    /**
     * FU_NOVATEK_TS_MEM_MAP_REG_GCM_FLAG_ADDR:
     */
    FU_NOVATEK_TS_MEM_MAP_REG_GCM_FLAG_ADDR = 0x1FB553,
    /**
     * FU_NOVATEK_TS_MEM_MAP_REG_FLASH_CMD_ADDR:
     */
    FU_NOVATEK_TS_MEM_MAP_REG_FLASH_CMD_ADDR = 0x1FB543,
    /**
     * FU_NOVATEK_TS_MEM_MAP_REG_FLASH_CMD_ISSUE_ADDR:
     */
    FU_NOVATEK_TS_MEM_MAP_REG_FLASH_CMD_ISSUE_ADDR = 0x1FB54E,
    /**
     * FU_NOVATEK_TS_MEM_MAP_REG_FLASH_CKSUM_STATUS_ADDR:
     */
    FU_NOVATEK_TS_MEM_MAP_REG_FLASH_CKSUM_STATUS_ADDR = 0x1FB54F,
    /**
     * FU_NOVATEK_TS_MEM_MAP_REG_BLD_SPE_PUPS_ADDR:
     */
    FU_NOVATEK_TS_MEM_MAP_REG_BLD_SPE_PUPS_ADDR = 0x1FB535,
}  FuNovatekTsMemMapReg;
/**
 * FuNovatekTsResetState:
 */
typedef enum {
    /**
     * FU_NOVATEK_TS_RESET_STATE_RESET_STATE_INIT:
     */
    FU_NOVATEK_TS_RESET_STATE_RESET_STATE_INIT = 0xA0,
    /**
     * FU_NOVATEK_TS_RESET_STATE_RESET_STATE_REK_BASELINE:
     */
    FU_NOVATEK_TS_RESET_STATE_RESET_STATE_REK_BASELINE = 0xA1,
    /**
     * FU_NOVATEK_TS_RESET_STATE_RESET_STATE_REK_FINISH:
     */
    FU_NOVATEK_TS_RESET_STATE_RESET_STATE_REK_FINISH = 0xA2,
    /**
     * FU_NOVATEK_TS_RESET_STATE_RESET_STATE_NORMAL_RUN:
     */
    FU_NOVATEK_TS_RESET_STATE_RESET_STATE_NORMAL_RUN = 0xA3,
    /**
     * FU_NOVATEK_TS_RESET_STATE_RESET_STATE_MAX:
     */
    FU_NOVATEK_TS_RESET_STATE_RESET_STATE_MAX = 0xAF,
}  FuNovatekTsResetState;
/**
 * FuNovatekTsCmd:
 */
typedef enum {
    /**
     * FU_NOVATEK_TS_CMD_BOOT_RESET:
     */
    FU_NOVATEK_TS_CMD_BOOT_RESET = 0x69,
    /**
     * FU_NOVATEK_TS_CMD_SW_RESET:
     */
    FU_NOVATEK_TS_CMD_SW_RESET = 0xAA,
    /**
     * FU_NOVATEK_TS_CMD_STOP_CRC:
     */
    FU_NOVATEK_TS_CMD_STOP_CRC = 0xA5,
}  FuNovatekTsCmd;
/**
 * FuNovatekTsChecksumStatus:
 */
typedef enum {
    /**
     * FU_NOVATEK_TS_CHECKSUM_STATUS_READY:
     */
    FU_NOVATEK_TS_CHECKSUM_STATUS_READY = 0xAA,
    /**
     * FU_NOVATEK_TS_CHECKSUM_STATUS_ERROR:
     */
    FU_NOVATEK_TS_CHECKSUM_STATUS_ERROR = 0xEA,
}  FuNovatekTsChecksumStatus;
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructNovatekTsHidReadReq;

FuStructNovatekTsHidReadReq *fu_struct_novatek_ts_hid_read_req_ref(FuStructNovatekTsHidReadReq *st) G_GNUC_NON_NULL(1);
void fu_struct_novatek_ts_hid_read_req_unref(FuStructNovatekTsHidReadReq *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructNovatekTsHidReadReq, fu_struct_novatek_ts_hid_read_req_unref)
FuStructNovatekTsHidReadReq *fu_struct_novatek_ts_hid_read_req_new(void) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_novatek_ts_hid_read_req_get_i2c_hid_eng_report_id(const FuStructNovatekTsHidReadReq *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_novatek_ts_hid_read_req_get_i2c_eng_addr(const FuStructNovatekTsHidReadReq *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_novatek_ts_hid_read_req_get_target_addr(const FuStructNovatekTsHidReadReq *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_novatek_ts_hid_read_req_get_len(const FuStructNovatekTsHidReadReq *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
void fu_struct_novatek_ts_hid_read_req_set_i2c_hid_eng_report_id(FuStructNovatekTsHidReadReq *st, guint8 value) G_GNUC_NON_NULL(1);
void fu_struct_novatek_ts_hid_read_req_set_i2c_eng_addr(FuStructNovatekTsHidReadReq *st, guint32 value) G_GNUC_NON_NULL(1);
void fu_struct_novatek_ts_hid_read_req_set_target_addr(FuStructNovatekTsHidReadReq *st, guint32 value) G_GNUC_NON_NULL(1);
void fu_struct_novatek_ts_hid_read_req_set_len(FuStructNovatekTsHidReadReq *st, guint16 value) G_GNUC_NON_NULL(1);

#ifndef __GI_SCANNER__
#define FU_STRUCT_NOVATEK_TS_HID_READ_REQ_OFFSET_I2C_HID_ENG_REPORT_ID 0x0
#define FU_STRUCT_NOVATEK_TS_HID_READ_REQ_OFFSET_WRITE_LEN 0x1
#define FU_STRUCT_NOVATEK_TS_HID_READ_REQ_OFFSET_I2C_ENG_ADDR 0x3
#define FU_STRUCT_NOVATEK_TS_HID_READ_REQ_OFFSET_TARGET_ADDR 0x6
#define FU_STRUCT_NOVATEK_TS_HID_READ_REQ_OFFSET_LEN 0xA
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_NOVATEK_TS_HID_READ_REQ_SIZE 0xC
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_NOVATEK_TS_HID_READ_REQ_DEFAULT_WRITE_LEN 0x000B
#endif
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructNovatekTsHidWriteHdr;

FuStructNovatekTsHidWriteHdr *fu_struct_novatek_ts_hid_write_hdr_ref(FuStructNovatekTsHidWriteHdr *st) G_GNUC_NON_NULL(1);
void fu_struct_novatek_ts_hid_write_hdr_unref(FuStructNovatekTsHidWriteHdr *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructNovatekTsHidWriteHdr, fu_struct_novatek_ts_hid_write_hdr_unref)
FuStructNovatekTsHidWriteHdr *fu_struct_novatek_ts_hid_write_hdr_new(void) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_novatek_ts_hid_write_hdr_get_i2c_hid_eng_report_id(const FuStructNovatekTsHidWriteHdr *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_novatek_ts_hid_write_hdr_get_write_len(const FuStructNovatekTsHidWriteHdr *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_novatek_ts_hid_write_hdr_get_target_addr(const FuStructNovatekTsHidWriteHdr *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
void fu_struct_novatek_ts_hid_write_hdr_set_i2c_hid_eng_report_id(FuStructNovatekTsHidWriteHdr *st, guint8 value) G_GNUC_NON_NULL(1);
void fu_struct_novatek_ts_hid_write_hdr_set_write_len(FuStructNovatekTsHidWriteHdr *st, guint16 value) G_GNUC_NON_NULL(1);
void fu_struct_novatek_ts_hid_write_hdr_set_target_addr(FuStructNovatekTsHidWriteHdr *st, guint32 value) G_GNUC_NON_NULL(1);

#ifndef __GI_SCANNER__
#define FU_STRUCT_NOVATEK_TS_HID_WRITE_HDR_OFFSET_I2C_HID_ENG_REPORT_ID 0x0
#define FU_STRUCT_NOVATEK_TS_HID_WRITE_HDR_OFFSET_WRITE_LEN 0x1
#define FU_STRUCT_NOVATEK_TS_HID_WRITE_HDR_OFFSET_TARGET_ADDR 0x3
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_NOVATEK_TS_HID_WRITE_HDR_SIZE 0x6
#endif

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

FuStructNovatekTsGcmCmd *fu_struct_novatek_ts_gcm_cmd_ref(FuStructNovatekTsGcmCmd *st) G_GNUC_NON_NULL(1);
void fu_struct_novatek_ts_gcm_cmd_unref(FuStructNovatekTsGcmCmd *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructNovatekTsGcmCmd, fu_struct_novatek_ts_gcm_cmd_unref)
FuStructNovatekTsGcmCmd *fu_struct_novatek_ts_gcm_cmd_new(void) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_novatek_ts_gcm_cmd_get_flash_cmd(const FuStructNovatekTsGcmCmd *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_novatek_ts_gcm_cmd_get_flash_addr(const FuStructNovatekTsGcmCmd *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_novatek_ts_gcm_cmd_get_write_len(const FuStructNovatekTsGcmCmd *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_novatek_ts_gcm_cmd_get_read_len(const FuStructNovatekTsGcmCmd *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_novatek_ts_gcm_cmd_get_flash_checksum(const FuStructNovatekTsGcmCmd *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
void fu_struct_novatek_ts_gcm_cmd_set_flash_cmd(FuStructNovatekTsGcmCmd *st, guint8 value) G_GNUC_NON_NULL(1);
void fu_struct_novatek_ts_gcm_cmd_set_flash_addr(FuStructNovatekTsGcmCmd *st, guint32 value) G_GNUC_NON_NULL(1);
void fu_struct_novatek_ts_gcm_cmd_set_write_len(FuStructNovatekTsGcmCmd *st, guint16 value) G_GNUC_NON_NULL(1);
void fu_struct_novatek_ts_gcm_cmd_set_read_len(FuStructNovatekTsGcmCmd *st, guint16 value) G_GNUC_NON_NULL(1);
void fu_struct_novatek_ts_gcm_cmd_set_flash_checksum(FuStructNovatekTsGcmCmd *st, guint16 value) G_GNUC_NON_NULL(1);

#ifndef __GI_SCANNER__
#define FU_STRUCT_NOVATEK_TS_GCM_CMD_OFFSET_FLASH_CMD 0x0
#define FU_STRUCT_NOVATEK_TS_GCM_CMD_OFFSET_FLASH_ADDR 0x1
#define FU_STRUCT_NOVATEK_TS_GCM_CMD_OFFSET_WRITE_LEN 0x5
#define FU_STRUCT_NOVATEK_TS_GCM_CMD_OFFSET_READ_LEN 0x7
#define FU_STRUCT_NOVATEK_TS_GCM_CMD_OFFSET_FLASH_CHECKSUM 0x9
#define FU_STRUCT_NOVATEK_TS_GCM_CMD_OFFSET_MAGIC 0xB
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_NOVATEK_TS_GCM_CMD_SIZE 0xC
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_NOVATEK_TS_GCM_CMD_DEFAULT_MAGIC 0xC2
#endif
