hsw-nbt 1.2.0
OPTIGA Authenticate NBT Host Library for C
Macros | Enumerations | Functions
nbt-cmd-config.h File Reference

Collection of the NBT configuration commands. More...

#include "infineon/ifx-apdu-protocol.h"
#include "infineon/ifx-protocol.h"
#include "infineon/ifx-utils.h"
#include "infineon/nbt-apdu-lib.h"
#include "infineon/nbt-apdu.h"

Go to the source code of this file.

Macros

#define NBT_GET_CONFIGURATION   UINT8_C(0x01)
 Identifier for command get configuration.
 
#define NBT_SET_CONFIGURATION   UINT8_C(0x02)
 Identifier for command set configuration.
 
#define NBT_SELECT_CONFIGURATOR   UINT8_C(0x03)
 Identifier for command select configurator.
 

Enumerations

enum  nbt_tag_configurations {
  NBT_TAG_PRODUCT_SHORT_NAME , NBT_TAG_PRODUCT_LIFE_CYCLE , NBT_TAG_SW_VERSION_INFO , NBT_TAG_FLASH_LOADER = UINT16_C(0xC02F) ,
  NBT_TAG_GPIO_FUNCTION = UINT16_C(0xC030) , NBT_TAG_GPIO_ASSERT_LEVEL , NBT_TAG_GPIO_OUTPUT_TYPE , NBT_TAG_GPIO_PULL_TYPE = UINT16_C(0xC033) ,
  NBT_TAG_I2C_IDLE_TIMEOUT , NBT_TAG_I2C_DRIVE_STRENGTH , NBT_TAG_I2C_SPEED = UINT16_C(0xC042) , NBT_TAG_NFC_IRQ_EVENT_TYPE ,
  NBT_TAG_NFC_ATS_CONFIG , NBT_TAG_NFC_WTX_MODE = UINT16_C(0xC051) , NBT_TAG_NFC_RF_HW_CONFIG , NBT_TAG_NFC_UID_TYPE_FOR_ANTI_COLLISION ,
  NBT_TAG_COMMUNICATION_INTERFACE_ENABLE , NBT_TAG_PM_CURRENT_LIMIT_ENABLE , NBT_TAG_PM_CURRENT_LIMIT_CONFIG =
}
 Enumeration defines the list of tags available for configuration option. More...
 
enum  nbt_product_life_cycle_tags { NBT_PRODUCT_LIFE_CYCLE_OPERATIONAL , NBT_PRODUCT_LIFE_CYCLE_PERSONALIZATION }
 Enumeration defines the tag values of product life cycle. More...
 
enum  nbt_flash_loader_tags { NBT_FLASH_LOADER_ENABLE , NBT_FLASH_LOADER_DISABLE = }
 Enumeration defines the tag values of Flash Loader. More...
 
enum  nbt_gpio_function_tags { NBT_GPIO_FUNCTION_DISABLED , NBT_GPIO_FUNCTION_NFC_IRQ_OUTPUT , NBT_GPIO_FUNCTION_I2C_DATA_READY_IRQ_OUTPUT , NBT_GPIO_FUNCTION_NFC_I2C_PASS_THROUGH_IRQ_OUTPUT = }
 Enumeration defines the tag values of GPIO function. More...
 
enum  nbt_gpio_assert_tags { NBT_GPIO_ASSERT_LOW_LEVEL_ACTIVE , NBT_GPIO_ASSERT_HIGH_LEVEL_ACTIVE }
 Enumeration defines the tag values of GPIO assert level. More...
 
enum  nbt_gpio_output_tags { NBT_GPIO_OUTPUT_TYPE_PUSH_PULL , NBT_GPIO_OUTPUT_TYPE_OPEN_DRAIN }
 Enumeration defines the tag values of GPIO output type. More...
 
enum  nbt_gpio_pull_tags { NBT_GPIO_NO_PULL , NBT_GPIO_PULL_UP , NBT_GPIO_PULL_DOWN = }
 Enumeration defines the tag values of GPIO pull type. More...
 
enum  nbt_nfc_irq_event_tags { NBT_NFC_IRQ_EVENT_SIGNAL_FIELD_PRESENCE , NBT_NFC_IRQ_EVENT_SIGNAL_LAYER_4_ENTRY , NBT_NFC_IRQ_EVENT_SIGNAL_APDU_PROCESSING_STAGE = }
 Enumeration defines the tag values of NFC IRQ event. More...
 
enum  nbt_i2c_drive_strength_tags { NBT_I2C_DRIVE_STRENGTH_WEAK , NBT_I2C_DRIVE_STRENGTH_STRONG = }
 Enumeration defines the tag values of I2C drive strength. More...
 
enum  nbt_i2c_speed_tags { NBT_I2C_SPEED_400_KHZ , NBT_I2C_SPEED_1000_KHZ = }
 Enumeration defines the tag values of I2C speed. More...
 
enum  nbt_nfc_uid_type_for_anti_collision_tags { NBT_NFC_UID_UNIQUE_DEV_SPECIFIC_7_BYTE , NBT_NFC_UID_RANDOM_4_BYTE = UINT8_C(0x01) }
 Enumeration defines the tag values of NFC UID type for anti collision. More...
 
enum  nbt_communication_interface_tags { NBT_COMM_INTF_NFC_DISABLED_I2C_ENABLED , NBT_COMM_INTF_NFC_ENABLED_I2C_DISABLED , NBT_COMM_INTF_NFC_ENABLED_I2C_ENABLED = }
 Enumeration defines the tag values of communication interface. More...
 

Functions

ifx_status_t nbt_select_configurator_application (nbt_cmd_t *self)
 Selects the NBT configurator application.
 
ifx_status_t nbt_set_configuration_bytes (nbt_cmd_t *self, uint16_t config_tag, const ifx_blob_t *config_value)
 Issues the set configuration command with configuration data as byte array.
 
ifx_status_t nbt_set_configuration (nbt_cmd_t *self, uint16_t config_tag, uint8_t config_value)
 Issues the set configuration command with configuration data as byte.
 
ifx_status_t nbt_get_configuration (nbt_cmd_t *self, uint16_t config_tag)
 Issues the get configuration command.
 

Detailed Description

Collection of the NBT configuration commands.

Definition in file nbt-cmd-config.h.

Macro Definition Documentation

◆ NBT_GET_CONFIGURATION

#define NBT_GET_CONFIGURATION   UINT8_C(0x01)

Identifier for command get configuration.

Definition at line 26 of file nbt-cmd-config.h.

◆ NBT_SELECT_CONFIGURATOR

#define NBT_SELECT_CONFIGURATOR   UINT8_C(0x03)

Identifier for command select configurator.

Definition at line 36 of file nbt-cmd-config.h.

◆ NBT_SET_CONFIGURATION

#define NBT_SET_CONFIGURATION   UINT8_C(0x02)

Identifier for command set configuration.

Definition at line 31 of file nbt-cmd-config.h.

Enumeration Type Documentation

◆ nbt_communication_interface_tags

Enumeration defines the tag values of communication interface.

Enumerator
NBT_COMM_INTF_NFC_DISABLED_I2C_ENABLED 

Tag value for communication interface - NFC disabled, I2C enabled

NBT_COMM_INTF_NFC_ENABLED_I2C_DISABLED 

Tag value for communication interface - NFC enabled, I2C disabled

NBT_COMM_INTF_NFC_ENABLED_I2C_ENABLED 

Tag value for communication interface - NFC enabled, I2C enabled

Definition at line 240 of file nbt-cmd-config.h.

241{
243 UINT8_C(0x01),
247 UINT8_C(0x10),
251 UINT8_C(0x11)
nbt_communication_interface_tags
Enumeration defines the tag values of communication interface.
@ NBT_COMM_INTF_NFC_DISABLED_I2C_ENABLED
@ NBT_COMM_INTF_NFC_ENABLED_I2C_ENABLED
@ NBT_COMM_INTF_NFC_ENABLED_I2C_DISABLED

◆ nbt_flash_loader_tags

Enumeration defines the tag values of Flash Loader.

Note
Use this tag value setting cautiously as this makes device go into Flash Loader mode. Reverting to application mode is possible only in engineering samples and not in any other samples.
Enumerator
NBT_FLASH_LOADER_ENABLE 

Tag value of Flash Loader - Enable

NBT_FLASH_LOADER_DISABLE 

Tag value of Flash Loader - Disable

Definition at line 117 of file nbt-cmd-config.h.

118{
120 UINT16_C(0xAC95),
123 UINT16_C(0xFFFF)
nbt_flash_loader_tags
Enumeration defines the tag values of Flash Loader.
@ NBT_FLASH_LOADER_ENABLE
@ NBT_FLASH_LOADER_DISABLE

◆ nbt_gpio_assert_tags

Enumeration defines the tag values of GPIO assert level.

Enumerator
NBT_GPIO_ASSERT_LOW_LEVEL_ACTIVE 

Tag value for GPIO assert level - Low active

NBT_GPIO_ASSERT_HIGH_LEVEL_ACTIVE 

Tag value for GPIO assert level - High active

Definition at line 148 of file nbt-cmd-config.h.

149{
151 UINT8_C(0x01),
154 UINT8_C(0x02),
nbt_gpio_assert_tags
Enumeration defines the tag values of GPIO assert level.
@ NBT_GPIO_ASSERT_HIGH_LEVEL_ACTIVE
@ NBT_GPIO_ASSERT_LOW_LEVEL_ACTIVE

◆ nbt_gpio_function_tags

Enumeration defines the tag values of GPIO function.

Enumerator
NBT_GPIO_FUNCTION_DISABLED 

Tag value for GPIO function - Disabled

NBT_GPIO_FUNCTION_NFC_IRQ_OUTPUT 

Tag value for GPIO function - NFC IRQ output

NBT_GPIO_FUNCTION_I2C_DATA_READY_IRQ_OUTPUT 

Tag value for GPIO function - I2C Data ready IRQ output

NBT_GPIO_FUNCTION_NFC_I2C_PASS_THROUGH_IRQ_OUTPUT 

Tag value for GPIO function - NFC I2C pass-through IRQ output

Definition at line 129 of file nbt-cmd-config.h.

130{
132 UINT8_C(0x01),
135 UINT8_C(0x02),
138 0x03),
141 UINT8_C(0x04)
nbt_gpio_function_tags
Enumeration defines the tag values of GPIO function.
@ NBT_GPIO_FUNCTION_I2C_DATA_READY_IRQ_OUTPUT
@ NBT_GPIO_FUNCTION_NFC_I2C_PASS_THROUGH_IRQ_OUTPUT
@ NBT_GPIO_FUNCTION_NFC_IRQ_OUTPUT
@ NBT_GPIO_FUNCTION_DISABLED

◆ nbt_gpio_output_tags

Enumeration defines the tag values of GPIO output type.

Enumerator
NBT_GPIO_OUTPUT_TYPE_PUSH_PULL 

Tag value for GPIO output type - Push pull

NBT_GPIO_OUTPUT_TYPE_OPEN_DRAIN 

Tag value for GPIO output type - Open drain

Definition at line 160 of file nbt-cmd-config.h.

161{
163 UINT8_C(0x01),
166 UINT8_C(0x02),
nbt_gpio_output_tags
Enumeration defines the tag values of GPIO output type.
@ NBT_GPIO_OUTPUT_TYPE_OPEN_DRAIN
@ NBT_GPIO_OUTPUT_TYPE_PUSH_PULL

◆ nbt_gpio_pull_tags

Enumeration defines the tag values of GPIO pull type.

Enumerator
NBT_GPIO_NO_PULL 

Tag value for GPIO pull type - No pull

NBT_GPIO_PULL_UP 

Tag value for GPIO pull type - Pull up

NBT_GPIO_PULL_DOWN 

Tag value for GPIO pull type - Pull down

Definition at line 172 of file nbt-cmd-config.h.

173{
175 UINT8_C(0x01),
178 UINT8_C(0x02),
181 UINT8_C(0x03)
nbt_gpio_pull_tags
Enumeration defines the tag values of GPIO pull type.
@ NBT_GPIO_PULL_UP
@ NBT_GPIO_PULL_DOWN
@ NBT_GPIO_NO_PULL

◆ nbt_i2c_drive_strength_tags

Enumeration defines the tag values of I2C drive strength.

Enumerator
NBT_I2C_DRIVE_STRENGTH_WEAK 

Tag value for I2C drive strength - Weak

NBT_I2C_DRIVE_STRENGTH_STRONG 

Tag value for I2C drive strength - Strong

Definition at line 203 of file nbt-cmd-config.h.

204{
206 UINT8_C(0x01),
209 UINT8_C(0x02)
nbt_i2c_drive_strength_tags
Enumeration defines the tag values of I2C drive strength.
@ NBT_I2C_DRIVE_STRENGTH_STRONG
@ NBT_I2C_DRIVE_STRENGTH_WEAK

◆ nbt_i2c_speed_tags

Enumeration defines the tag values of I2C speed.

Enumerator
NBT_I2C_SPEED_400_KHZ 

Tag value for I2C speed - 400kHz

NBT_I2C_SPEED_1000_KHZ 

Tag value for I2C speed - 1000kHz

Definition at line 215 of file nbt-cmd-config.h.

216{
218 UINT8_C(0x01),
221 UINT8_C(0x02)
nbt_i2c_speed_tags
Enumeration defines the tag values of I2C speed.
@ NBT_I2C_SPEED_400_KHZ
@ NBT_I2C_SPEED_1000_KHZ

◆ nbt_nfc_irq_event_tags

Enumeration defines the tag values of NFC IRQ event.

Enumerator
NBT_NFC_IRQ_EVENT_SIGNAL_FIELD_PRESENCE 

Tag value for NFC IRQ event type - Signal field presence

NBT_NFC_IRQ_EVENT_SIGNAL_LAYER_4_ENTRY 

Tag value for NFC IRQ event type - Signal layer 4 entry

NBT_NFC_IRQ_EVENT_SIGNAL_APDU_PROCESSING_STAGE 

Tag value for NFC IRQ event type - Signal APDU processing stage

Definition at line 187 of file nbt-cmd-config.h.

188{
190 0x01),
193 0x02),
196 UINT8_C(0x03)
nbt_nfc_irq_event_tags
Enumeration defines the tag values of NFC IRQ event.
@ NBT_NFC_IRQ_EVENT_SIGNAL_FIELD_PRESENCE
@ NBT_NFC_IRQ_EVENT_SIGNAL_LAYER_4_ENTRY
@ NBT_NFC_IRQ_EVENT_SIGNAL_APDU_PROCESSING_STAGE

◆ nbt_nfc_uid_type_for_anti_collision_tags

Enumeration defines the tag values of NFC UID type for anti collision.

Enumerator
NBT_NFC_UID_UNIQUE_DEV_SPECIFIC_7_BYTE 

Tag value for unique 7-byte device specific NFC UID type for anti collision

NBT_NFC_UID_RANDOM_4_BYTE 

Tag value for random 4-byte NFC UID type for anti collision

Definition at line 227 of file nbt-cmd-config.h.

228{
230 UINT8_C(0x00),
233 NBT_NFC_UID_RANDOM_4_BYTE = UINT8_C(0x01),
nbt_nfc_uid_type_for_anti_collision_tags
Enumeration defines the tag values of NFC UID type for anti collision.
@ NBT_NFC_UID_RANDOM_4_BYTE
@ NBT_NFC_UID_UNIQUE_DEV_SPECIFIC_7_BYTE

◆ nbt_product_life_cycle_tags

Enumeration defines the tag values of product life cycle.

Enumerator
NBT_PRODUCT_LIFE_CYCLE_OPERATIONAL 

Tag value of product life cycle - Operational

NBT_PRODUCT_LIFE_CYCLE_PERSONALIZATION 

Tag value of product life cycle - Personalization

Definition at line 101 of file nbt-cmd-config.h.

102{
104 UINT16_C(0xC33C),
107 0x5AA5)
nbt_product_life_cycle_tags
Enumeration defines the tag values of product life cycle.
@ NBT_PRODUCT_LIFE_CYCLE_PERSONALIZATION
@ NBT_PRODUCT_LIFE_CYCLE_OPERATIONAL

◆ nbt_tag_configurations

Enumeration defines the list of tags available for configuration option.

Enumerator
NBT_TAG_PRODUCT_SHORT_NAME 

Tag ID for product short name

NBT_TAG_PRODUCT_LIFE_CYCLE 

Tag ID for product Life Cycle

NBT_TAG_SW_VERSION_INFO 

Tag ID for software version information

NBT_TAG_FLASH_LOADER 

Tag ID for Flash Loader

NBT_TAG_GPIO_FUNCTION 

Tag ID for GPIO function

NBT_TAG_GPIO_ASSERT_LEVEL 

Tag ID for GPIO assert level

NBT_TAG_GPIO_OUTPUT_TYPE 

Tag ID for GPIO output type

NBT_TAG_GPIO_PULL_TYPE 

Tag ID for GPIO pull type

NBT_TAG_I2C_IDLE_TIMEOUT 

Tag ID for I2C idle timeout

NBT_TAG_I2C_DRIVE_STRENGTH 

Tag ID for I2C drive strength

NBT_TAG_I2C_SPEED 

Tag ID for I2C speed

NBT_TAG_NFC_IRQ_EVENT_TYPE 

Tag ID for NFC IRQ event type

NBT_TAG_NFC_ATS_CONFIG 

Tag ID for NFC ATS configuration

NBT_TAG_NFC_WTX_MODE 

Tag ID for NFC WTX mode

NBT_TAG_NFC_RF_HW_CONFIG 

Tag ID for NFC RF hardware configuration

NBT_TAG_NFC_UID_TYPE_FOR_ANTI_COLLISION 

Tag ID for NFC UID type for anti collision

NBT_TAG_COMMUNICATION_INTERFACE_ENABLE 

Tag ID for communication interface

NBT_TAG_PM_CURRENT_LIMIT_ENABLE 

Tag ID for power management clock scaling (current limitation) enable

NBT_TAG_PM_CURRENT_LIMIT_CONFIG 

Tag ID for power management clock scaling

Definition at line 42 of file nbt-cmd-config.h.

43{
45 UINT16_C(0xC020),
48 UINT16_C(0xC021),
51 UINT16_C(0xC022),
53 NBT_TAG_FLASH_LOADER = UINT16_C(0xC02F),
55 NBT_TAG_GPIO_FUNCTION = UINT16_C(0xC030),
58 UINT16_C(0xC031),
61 UINT16_C(0xC032),
63 NBT_TAG_GPIO_PULL_TYPE = UINT16_C(0xC033),
66 UINT16_C(0xC040),
69 UINT16_C(0xC041),
71 NBT_TAG_I2C_SPEED = UINT16_C(0xC042),
74 UINT16_C(0xC034),
77 UINT16_C(0xC050),
79 NBT_TAG_NFC_WTX_MODE = UINT16_C(0xC051),
82 UINT16_C(0xC052),
85 UINT16_C(0xC053),
88 UINT16_C(0xC060),
91 UINT16_C(0xC061),
95 UINT16_C(0xC062)
nbt_tag_configurations
Enumeration defines the list of tags available for configuration option.
@ NBT_TAG_I2C_IDLE_TIMEOUT
@ NBT_TAG_NFC_UID_TYPE_FOR_ANTI_COLLISION
@ NBT_TAG_NFC_RF_HW_CONFIG
@ NBT_TAG_GPIO_PULL_TYPE
@ NBT_TAG_NFC_WTX_MODE
@ NBT_TAG_NFC_IRQ_EVENT_TYPE
@ NBT_TAG_GPIO_OUTPUT_TYPE
@ NBT_TAG_FLASH_LOADER
@ NBT_TAG_GPIO_ASSERT_LEVEL
@ NBT_TAG_PRODUCT_LIFE_CYCLE
@ NBT_TAG_GPIO_FUNCTION
@ NBT_TAG_I2C_SPEED
@ NBT_TAG_PM_CURRENT_LIMIT_CONFIG
@ NBT_TAG_PRODUCT_SHORT_NAME
@ NBT_TAG_NFC_ATS_CONFIG
@ NBT_TAG_I2C_DRIVE_STRENGTH
@ NBT_TAG_PM_CURRENT_LIMIT_ENABLE
@ NBT_TAG_SW_VERSION_INFO
@ NBT_TAG_COMMUNICATION_INTERFACE_ENABLE

Function Documentation

◆ nbt_get_configuration()

ifx_status_t nbt_get_configuration ( nbt_cmd_t * self,
uint16_t config_tag )

Issues the get configuration command.

This command can be used to get a specific product configuration data.

Parameters
[in,out]selfCommand set with communication protocol and response.
[in]config_tagTag value of the configuration field to be read.
Returns
ifx_status_t
Return values
IFX_SUCCESS: If API operation is successful
IFX_ILLEGAL_ARGUMENT: If invalid/NULL parameter is passed to function
IFX_OUT_OF_MEMORY: If memory allocation fails

◆ nbt_select_configurator_application()

ifx_status_t nbt_select_configurator_application ( nbt_cmd_t * self)

Selects the NBT configurator application.

Parameters
[out]selfCommand set with communication protocol and response.
Returns
ifx_status_t
Return values
IFX_SUCCESS: If API operation is successful
IFX_ILLEGAL_ARGUMENT: If invalid/NULL parameter is passed to function
IFX_OUT_OF_MEMORY: If memory allocation fails

◆ nbt_set_configuration()

ifx_status_t nbt_set_configuration ( nbt_cmd_t * self,
uint16_t config_tag,
uint8_t config_value )

Issues the set configuration command with configuration data as byte.

This command configures the system and lock the configuration by setting product life cycle to operational state.

Parameters
[in,out]selfCommand set with communication protocol and response.
[in]config_tagTag value of the configuration field to be set.
[in]config_valueConfiguration parameters of mentioned tag value that needs to be set as a byte.
Returns
ifx_status_t
Return values
IFX_SUCCESS: If API operation is successful
IFX_ILLEGAL_ARGUMENT: If invalid/NULL parameter is passed to function
IFX_OUT_OF_MEMORY: If memory allocation fails

◆ nbt_set_configuration_bytes()

ifx_status_t nbt_set_configuration_bytes ( nbt_cmd_t * self,
uint16_t config_tag,
const ifx_blob_t * config_value )

Issues the set configuration command with configuration data as byte array.

This command can be used to set a specific product configuration data.

Parameters
[out]selfCommand set with communication protocol and response.
[in]config_tagTag value of the configuration field to be set.
[in]config_valueconfiguration parameters of mentioned Tag value that needs to be set as a byte array
Returns
ifx_status_t
Return values
IFX_SUCCESS: If API operation is successful
IFX_ILLEGAL_ARGUMENT: If invalid/NULL parameter is passed to function
IFX_OUT_OF_MEMORY: If memory allocation fails