hsw-nbt 1.2.0
OPTIGA Authenticate NBT Host Library for C
ifx-t1prime.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) 2024-2026 Infineon Technologies AG
2// SPDX-License-Identifier: MIT
3
8#ifndef IFX_T1PRIME_H
9#define IFX_T1PRIME_H
10
11#include <stddef.h>
12#include <stdint.h>
13
14#include "infineon/ifx-error.h"
17
52#ifdef IFX_T1PRIME_LOG_ENABLE
53#define IFX_T1PRIME_LOG(logger_object, source_information, logger_level, \
54 formatter, ...) \
55 ifx_logger_log(logger_object, source_information, logger_level, formatter, \
56 ##__VA_ARGS__)
57#define IFX_T1PRIME_LOG_BYTES(logger_object, source_information, logger_level, \
58 delimeter_1, data, data_len, delimeter_2) \
59 ifx_logger_log_bytes(logger_object, source_information, logger_level, \
60 delimeter_1, data, data_len, delimeter_2)
61#else
62#define IFX_T1PRIME_LOG(logger_object, source_information, logger_level, \
63 formatter, ...)
64
65#define IFX_T1PRIME_LOG_BYTES(logger_object, source_information, logger_level, \
66 delimeter_1, data, data_len, delimeter_2)
67#endif
68
69#ifdef __cplusplus
70extern "C" {
71#endif
72
76#define IFX_T1PRIME_LOG_TAG "T=1'"
77
81#define IFX_T1PRIME_IRQ_TRIGGERED IFX_SUCCESS
82
87#define IFX_T1PRIME_IRQ 0x09u
88
93#define IFX_T1PRIME_IRQ_NOT_TRIGGERED 0x01u
94
107 ifx_protocol_t *driver);
108
120ifx_status_t ifx_t1prime_set_ifsd(ifx_protocol_t *self, size_t ifsd);
121
133ifx_status_t ifx_t1prime_get_bwt(ifx_protocol_t *self, uint16_t *bwt_ms_buffer);
134
146ifx_status_t ifx_t1prime_set_bwt(ifx_protocol_t *self, uint16_t bwt_ms);
147
159typedef ifx_status_t (*ifx_t1prime_irq_handler_t)(ifx_protocol_t *self,
160 uint32_t timeout_us);
161
178
191 ifx_t1prime_irq_handler_t *irq_buffer);
192
202ifx_status_t ifx_t1prime_s_por(ifx_protocol_t *self);
203
213ifx_status_t ifx_t1prime_s_swr(ifx_protocol_t *self);
214
215#ifdef __cplusplus
216}
217#endif
218
219#endif // IFX_T1PRIME_H
Infineon specific error code creation and parsing.
uint32_t ifx_status_t
Custom return code type used by all Infineon host software libraries.
Definition ifx-error.h:91
Generic protocol API (ISO/OSI stack).
Provides the module, method and error identifiers of the library.
ifx_status_t ifx_t1prime_s_swr(ifx_protocol_t *self)
Performs Global Platform T=1' software reset (SWR).
ifx_status_t(* ifx_t1prime_irq_handler_t)(ifx_protocol_t *self, uint32_t timeout_us)
Custom function type used to wait for T=1' data interrupt.
ifx_status_t ifx_t1prime_s_por(ifx_protocol_t *self)
Performs Global Platform T=1' power on reset (POR).
ifx_status_t ifx_t1prime_set_ifsd(ifx_protocol_t *self, size_t ifsd)
Sets maximum information field size of the host device (IFSD).
ifx_status_t ifx_t1prime_set_irq_handler(ifx_protocol_t *self, ifx_t1prime_irq_handler_t irq)
Sets T=1' interrupt handler function.
ifx_status_t ifx_t1prime_initialize(ifx_protocol_t *self, ifx_protocol_t *driver)
Initializes Protocol object for Global Platform T=1' protocol.
ifx_status_t ifx_t1prime_get_irq_handler(ifx_protocol_t *self, ifx_t1prime_irq_handler_t *irq_buffer)
Getter for T=1' interrupt handler function.
ifx_status_t ifx_t1prime_get_bwt(ifx_protocol_t *self, uint16_t *bwt_ms_buffer)
Returns current block waiting time (BWT) in [ms].
ifx_status_t ifx_t1prime_set_bwt(ifx_protocol_t *self, uint16_t bwt_ms)
Sets block waiting time (BWT) in [ms].