ForestHub SDK 0.1.0
C++14 LLM SDK for PC and embedded platforms
Loading...
Searching...
No Matches
foresthub::platform Namespace Reference

Hardware abstraction layer: network, console, time, crypto, and GPIO interfaces. More...

Classes

class  ConsoleInterface
 Abstract interface for console I/O. More...
class  CryptoInterface
 Abstract interface for TLS/crypto operations. More...
class  GpioInterface
 Abstract interface for general-purpose pin I/O. More...
struct  HttpClientConfig
 Call-time configuration for HTTP client creation. More...
struct  NetworkConfig
 Construction-time configuration for the network subsystem. More...
class  NetworkInterface
 Abstract interface for network connectivity. More...
struct  PlatformConfig
 Construction-time configuration passed to CreatePlatform(). More...
class  PlatformContext
 Holds all platform subsystems and provides a factory for HTTP clients. More...
struct  PwmConfig
 Configuration for a PWM output channel. More...
struct  TimeConfig
 Call-time configuration for time synchronization. More...
class  TimeInterface
 Abstract interface for time operations. More...
class  TLSClientWrapper
 Wrapper around a platform-specific TLS client. More...

Typedefs

using PinId = uint32_t
 32-bit pin identifier.

Enumerations

enum class  PinMode : uint8_t { kInput = 0 , kOutput = 1 , kInputPullup = 2 }
 Direction and pull configuration of a pin. More...
enum class  NetworkStatus : uint8_t { kDisconnected , kConnecting , kConnected , kFailed }
 Connection state of the network subsystem. More...

Functions

std::shared_ptr< PlatformContextCreatePlatform (const PlatformConfig &config={})
 Factory function.

Detailed Description

Hardware abstraction layer: network, console, time, crypto, and GPIO interfaces.

Typedef Documentation

◆ PinId

using foresthub::platform::PinId = uint32_t

32-bit pin identifier.

Wide enough for port+pin encoding schemes (e.g. port << 8 | pin) used by various microcontroller families while remaining trivially copyable.

Enumeration Type Documentation

◆ NetworkStatus

enum class foresthub::platform::NetworkStatus : uint8_t
strong

Connection state of the network subsystem.

Enumerator
kDisconnected 

Not connected (clean state or after Disconnect()).

kConnecting 

Connection attempt in progress.

kConnected 

Successfully connected and ready.

kFailed 

Connection attempt failed.

◆ PinMode

enum class foresthub::platform::PinMode : uint8_t
strong

Direction and pull configuration of a pin.

Values are platform-independent; implementations map them to hardware-specific constants at runtime.

Enumerator
kInput 

High-impedance input (floating).

kOutput 

Push-pull output.

kInputPullup 

Input with internal pull-up resistor enabled.

Function Documentation

◆ CreatePlatform()

std::shared_ptr< PlatformContext > foresthub::platform::CreatePlatform ( const PlatformConfig & config = {})

Factory function.

Returns the platform-specific context.

Parameters
configNetwork and connectivity configuration.
Returns
Platform-specific context with all subsystems initialized.