HardFOC Core
API reference
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
Se050Handler Class Reference

Thread-safe façade around se050::Device<HalI2cSe050Comm>. More...

#include <Se050Handler.h>

Public Types

using DeviceType = se050::Device< HalI2cSe050Comm >
 

Public Member Functions

 Se050Handler (BaseI2c &i2c, const Se050HandlerConfig &config=Se050HandlerConfig{}, BaseGpio *reset_gpio=nullptr, RtosMutex *bus_mutex=nullptr) noexcept
 
 Se050Handler (const Se050Handler &)=delete
 
Se050Handler & operator= (const Se050Handler &)=delete
 
 Se050Handler (Se050Handler &&)=delete
 
Se050Handler & operator= (Se050Handler &&)=delete
 
const Se050HandlerConfig & Config () const noexcept
 
bool EnsureInitialized () noexcept
 Initialize I²C, pulse optional reset GPIO, run T=1 warm reset, SELECT applet, and verify with GetVersion.
 
bool IsPresent () const noexcept
 
DeviceType & GetDevice () noexcept
 Direct access to the full se050::Device API (lock externally if needed).
 
const DeviceType & GetDevice () const noexcept
 

Private Member Functions

bool EnsureInitializedLocked () noexcept
 

Private Attributes

Se050HandlerConfig config_
 
HalI2cSe050Comm comm_
 
DeviceType device_
 
std::atomic< bool > initialized_ {false}
 
RtosMutex private_mutex_ {}
 
RtosMutex * bus_mutex_
 

Detailed Description

Thread-safe façade around se050::Device<HalI2cSe050Comm>.

Typical flow:

BaseI2c& se_i2c = *bus.GetDeviceByAddress(0x48);
Se050Handler se(se_i2c, Se050HandlerConfig{}, nullptr);
if (!se.EnsureInitialized()) { ... }
se050::cmd::VersionInfo v{};
(void)se.GetDevice().GetVersion(&v, se.Config().apdu_timeout_ms);
Thread-safe façade around se050::Device<HalI2cSe050Comm>.
Definition Se050Handler.h:144
DeviceType & GetDevice() noexcept
Direct access to the full se050::Device API (lock externally if needed).
Definition Se050Handler.h:175
Runtime tuning for one SE050 instance on a BaseI2c device.
Definition Se050Handler.h:117

Member Typedef Documentation

◆ DeviceType

using Se050Handler::DeviceType = se050::Device<HalI2cSe050Comm>

Constructor & Destructor Documentation

◆ Se050Handler() [1/3]

Se050Handler::Se050Handler ( BaseI2c &  i2c,
const Se050HandlerConfig &  config = Se050HandlerConfig{},
BaseGpio *  reset_gpio = nullptr,
RtosMutex *  bus_mutex = nullptr 
)
explicitnoexcept
Parameters
i2cI²C device whose 7-bit address matches the SE050 (usually 0x48).
configTimeouts and T=1 tuning.
reset_gpioOptional SE_RESET / power-style reset line (nullptr if unused).
bus_mutexOptional shared mutex when multiple devices share the bus.

◆ Se050Handler() [2/3]

Se050Handler::Se050Handler ( const Se050Handler &  )
delete

◆ Se050Handler() [3/3]

Se050Handler::Se050Handler ( Se050Handler &&  )
delete

Member Function Documentation

◆ Config()

const Se050HandlerConfig & Se050Handler::Config ( ) const
inlinenoexcept

◆ EnsureInitialized()

bool Se050Handler::EnsureInitialized ( )
noexcept

Initialize I²C, pulse optional reset GPIO, run T=1 warm reset, SELECT applet, and verify with GetVersion.

◆ EnsureInitializedLocked()

bool Se050Handler::EnsureInitializedLocked ( )
privatenoexcept

◆ GetDevice() [1/2]

const DeviceType & Se050Handler::GetDevice ( ) const
inlinenoexcept

◆ GetDevice() [2/2]

DeviceType & Se050Handler::GetDevice ( )
inlinenoexcept

Direct access to the full se050::Device API (lock externally if needed).

◆ IsPresent()

bool Se050Handler::IsPresent ( ) const
inlinenoexcept

◆ operator=() [1/2]

Se050Handler & Se050Handler::operator= ( const Se050Handler &  )
delete

◆ operator=() [2/2]

Se050Handler & Se050Handler::operator= ( Se050Handler &&  )
delete

Member Data Documentation

◆ bus_mutex_

RtosMutex* Se050Handler::bus_mutex_
private

◆ comm_

HalI2cSe050Comm Se050Handler::comm_
private

◆ config_

Se050HandlerConfig Se050Handler::config_
private

◆ device_

DeviceType Se050Handler::device_
private

◆ initialized_

std::atomic<bool> Se050Handler::initialized_ {false}
private

◆ private_mutex_

RtosMutex Se050Handler::private_mutex_ {}
private

The documentation for this class was generated from the following files: