Deki 1.3.0
Modular C++ 2D engine for embedded displays and desktop
Loading...
Searching...
No Matches

Configuration for a hardware package instance. More...

#include <PackageConfig.h>

Public Member Functions

int GetPin (const std::string &name, int defaultVal=-1) const
 Get a pin GPIO number by name.
std::string GetString (const std::string &name, const std::string &defaultVal="") const
 Get a string setting by name.
int GetInt (const std::string &name, int defaultVal=0) const
 Get an integer setting by name (parsed from string).
bool GetBool (const std::string &name, bool defaultVal=false) const
 Get a boolean setting by name.

Public Attributes

std::string packageId
bool enabled = false
std::map< std::string, int > pins
std::map< std::string, std::string > settings

Detailed Description

Configuration for a hardware package instance.

Contains the runtime configuration for a hardware package, including:

  • Pin assignments (GPIO numbers)
  • Package-specific settings (strings)

This is the runtime representation loaded from the platform JSON. The editor uses PackageConfigEntry (in PlatformConfig.h) which is serialized to/from JSON.

Note: this struct is unrelated to the installable-package system (the deki-* DLLs listed in deki-packages.json). It exists at the engine src/ root rather than under src/packages/ to make that distinction clear.

Member Function Documentation

◆ GetPin()

int PackageConfig::GetPin ( const std::string & name,
int defaultVal = -1 ) const
inline

Get a pin GPIO number by name.

Parameters
namePin name (e.g., "MOSI", "CS")
defaultValValue to return if pin not found
Returns
GPIO number or default value

◆ GetString()

std::string PackageConfig::GetString ( const std::string & name,
const std::string & defaultVal = "" ) const
inline

Get a string setting by name.

Parameters
nameSetting name (e.g., "mode", "mount_point")
defaultValValue to return if setting not found
Returns
Setting value or default value

◆ GetInt()

int PackageConfig::GetInt ( const std::string & name,
int defaultVal = 0 ) const
inline

Get an integer setting by name (parsed from string).

Parameters
nameSetting name (e.g., "baud_rate", "address")
defaultValValue to return if setting not found or invalid
Returns
Integer value or default value

◆ GetBool()

bool PackageConfig::GetBool ( const std::string & name,
bool defaultVal = false ) const
inline

Get a boolean setting by name.

Parameters
nameSetting name (e.g., "auto_mount", "enabled")
defaultValValue to return if setting not found
Returns
Boolean value or default value

Member Data Documentation

◆ packageId

std::string PackageConfig::packageId

◆ enabled

bool PackageConfig::enabled = false

◆ pins

std::map<std::string, int> PackageConfig::pins

◆ settings

std::map<std::string, std::string> PackageConfig::settings

The documentation for this struct was generated from the following file: