SE050 Driver
API reference
Loading...
Searching...
No Matches
Classes | Namespaces | Functions | Variables
se050_t1_session.hpp File Reference

ISO/IEC 7816-3 T=1 block protocol for NXP SE050 T=1 over I²C (EDC = CRC-16). More...

#include "se050_atr.hpp"
#include "se050_crc.hpp"
#include "se050_types.hpp"
#include <algorithm>
#include <cstddef>
#include <cstdint>
#include <cstring>

Go to the source code of this file.

Classes

class  se050::T1Session< TransportT >
 Stateful T=1 session bound to a concrete I²C transport. More...
 

Namespaces

namespace  se050
 
namespace  se050::t1
 T=1 constants and small helpers for SE050 on I²C.
 

Functions

constexpr bool se050::t1::IsIBlock (std::uint8_t pcb) noexcept
 
constexpr bool se050::t1::IsRBlock (std::uint8_t pcb) noexcept
 
constexpr bool se050::t1::IsSBlock (std::uint8_t pcb) noexcept
 
constexpr bool se050::t1::IBlockMore (std::uint8_t pcb) noexcept
 
constexpr std::uint8_t se050::t1::IBlockPcb (std::uint8_t ns_bit, bool more) noexcept
 
constexpr std::uint8_t se050::t1::RBlockAckPcb (std::uint8_t nr_bit) noexcept
 
constexpr std::uint8_t se050::t1::IBlockSeqFromPcb (std::uint8_t pcb) noexcept
 
constexpr std::uint8_t se050::t1::RBlockNrFromPcb (std::uint8_t pcb) noexcept
 N(R) of an R-block: the sequence number of the I-block its sender expects next.
 
constexpr std::uint8_t se050::t1::RBlockNackPcb (std::uint8_t nr_bit, std::uint8_t err) noexcept
 R-block asking for the block with sequence number nr again, with error code err.
 

Variables

constexpr std::uint8_t se050::t1::kNadHostToSe = 0x5AU
 NAD value used by the host for command blocks.
 
constexpr std::uint8_t se050::t1::kNadSeToHost = 0xA5U
 NAD value returned by the SE in response blocks.
 
constexpr std::size_t se050::t1::kMaxInformationField = 254U
 Maximum information field size per block (ISO 7816-3 typical upper bound).
 
constexpr std::size_t se050::t1::kMaxRawBlockBytes = 3U + kMaxInformationField + 2U
 Raw block buffer high water: prologue + INF + EDC.
 
constexpr std::uint8_t se050::t1::kPcbSWarmReset = 0xC6U
 S-block PCB used by NXP stacks for a 7816-style warm reset request (LEN = 0 INF).
 
constexpr std::uint8_t se050::t1::kPcbSGetAtr = 0xC7U
 S-block PCB used by NXP stacks for GET ATR / card profile read (LEN = 0 INF).
 
constexpr std::uint8_t se050::t1::kPcbSResyncReq = 0xC0U
 S-block request/response pair for resynchronization.
 
constexpr std::uint8_t se050::t1::kPcbSResyncResp = 0xE0U
 
constexpr std::uint8_t se050::t1::kPcbSWtxReq = 0xC3U
 S-block request/response pair for waiting-time extension.
 
constexpr std::uint8_t se050::t1::kPcbSWtxResp = 0xE3U
 
constexpr std::uint8_t se050::t1::kRBlockErrEdc = 0x01U
 R-block error code: EDC error (ISO/IEC 7816-3 11.4.3).
 
constexpr std::uint8_t se050::t1::kRBlockErrOther = 0x02U
 R-block error code: other error (ISO/IEC 7816-3 11.4.3).
 
constexpr std::uint8_t se050::t1::kDefaultMaxRetransmissions = 3U
 Default number of times one block is sent again before an exchange fails.
 

Detailed Description

ISO/IEC 7816-3 T=1 block protocol for NXP SE050 T=1 over I²C (EDC = CRC-16).

This layer sits on top of I2cTransceiveInterface and implements:

Note
Field firmware may require tuning SetInterFrameDelayMs. Align behaviour with NXP UM11225 / UM1225 and validate on-target (logic analyser / golden traces).