hsw-nbt 1.2.0
OPTIGA Authenticate NBT Host Library for C
Macros | Typedefs | Functions
ifx-t1prime.h File Reference

Global Platform T=1' protocol. More...

#include <stddef.h>
#include <stdint.h>
#include "infineon/ifx-error.h"
#include "infineon/ifx-protocol.h"
#include "infineon/ifx-t1prime-lib.h"

Go to the source code of this file.

Macros

#define IFX_T1PRIME_LOG(logger_object, source_information, logger_level, formatter, ...)
 T1PRIME library data log macro.
 
#define IFX_T1PRIME_LOG_BYTES(logger_object, source_information, logger_level, delimeter_1, data, data_len, delimeter_2)
 T1PRIME library array of bytes data log macro.
 
#define IFX_T1PRIME_LOG_TAG   "T=1'"
 String used as source information for logging.
 
#define IFX_T1PRIME_IRQ_TRIGGERED   IFX_SUCCESS
 Return code for successful calls to ifx_t1prime_irq_handler_t.
 
#define IFX_T1PRIME_IRQ   0x09u
 IFX error encoding function identifier for ifx_t1prime_irq_handler_t.
 
#define IFX_T1PRIME_IRQ_NOT_TRIGGERED   0x01u
 Error reason if interrupt did not trigger in time during ifx_t1prime_irq_handler_t.
 

Typedefs

typedef 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.
 

Functions

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_s_swr (ifx_protocol_t *self)
 Performs Global Platform T=1' software reset (SWR).
 

Detailed Description

Global Platform T=1' protocol.

Definition in file ifx-t1prime.h.

Macro Definition Documentation

◆ IFX_T1PRIME_IRQ

#define IFX_T1PRIME_IRQ   0x09u

IFX error encoding function identifier for ifx_t1prime_irq_handler_t.

Definition at line 87 of file ifx-t1prime.h.

◆ IFX_T1PRIME_IRQ_NOT_TRIGGERED

#define IFX_T1PRIME_IRQ_NOT_TRIGGERED   0x01u

Error reason if interrupt did not trigger in time during ifx_t1prime_irq_handler_t.

Definition at line 93 of file ifx-t1prime.h.

◆ IFX_T1PRIME_IRQ_TRIGGERED

#define IFX_T1PRIME_IRQ_TRIGGERED   IFX_SUCCESS

Return code for successful calls to ifx_t1prime_irq_handler_t.

Definition at line 81 of file ifx-t1prime.h.

◆ IFX_T1PRIME_LOG

#define IFX_T1PRIME_LOG ( logger_object,
source_information,
logger_level,
formatter,
... )

T1PRIME library data log macro.

Parameters
[in]logger_objectLogger object in which logging to be done.
[in]source_informationSource information from where logs are originated.
[in]logger_levelLog level
[in]formatterString with formatter for data passed as variable argument

It maps to the ifx_logger_log function if IFX_T1PRIME_LOG_ENABLE macro is defined other wise it defines IFX_SUCCESS.

Definition at line 62 of file ifx-t1prime.h.

◆ IFX_T1PRIME_LOG_BYTES

#define IFX_T1PRIME_LOG_BYTES ( logger_object,
source_information,
logger_level,
delimeter_1,
data,
data_len,
delimeter_2 )

T1PRIME library array of bytes data log macro.

Parameters
[in]logger_objectLogger object in which logging to be done.
[in]source_informationSource information from where logs are originated.
[in]logger_levelLog level
[in]delimeter_1Delimeter to differentiate log information and data.
[in]dataData to be log.
[in]data_lenLength of the data
[in]delimeter_2Delimeter to differentiate each data byte

It maps to the ifx_logger_log_bytes function if IFX_T1PRIME_LOG_ENABLE macro is defined other wise it defines IFX_SUCCESS.

Definition at line 65 of file ifx-t1prime.h.

◆ IFX_T1PRIME_LOG_TAG

#define IFX_T1PRIME_LOG_TAG   "T=1'"

String used as source information for logging.

Definition at line 76 of file ifx-t1prime.h.

Typedef Documentation

◆ ifx_t1prime_irq_handler_t

typedef 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.

Set using ifx_t1prime_set_irq_handler() to enable IRQ mode.

Parameters
[in]selfT=1' protocol stack waiting for data interrupt.
[in]timeout_usTimeout until interrupt has to have triggered (in [us]).
Returns
ifx_status_t IFX_T1PRIME_IRQ_TRIGGERED if successful, any other value in case of error.

Definition at line 159 of file ifx-t1prime.h.

Function Documentation

◆ ifx_t1prime_s_por()

ifx_status_t ifx_t1prime_s_por ( ifx_protocol_t * self)

Performs Global Platform T=1' power on reset (POR).

Sends S(POR request).

Parameters
[in]selfProtocol stack for performing necessary operations.
Returns
ifx_status_t IFX_SUCCESS if successful, any other value in case of error.

◆ ifx_t1prime_s_swr()

ifx_status_t ifx_t1prime_s_swr ( ifx_protocol_t * self)

Performs Global Platform T=1' software reset (SWR).

Sends S(SWR request) and expects S(SWR response).

Parameters
[in]selfProtocol stack for performing necessary operations.
Returns
ifx_status_t IFX_SUCCESS if successful, any other value in case of error.