DEKI/ENGINE docs
manual api reference
Deki 0.40.1
Modular C++ engine with a visual editor, for 2D and 3D
Loading...
Searching...
No Matches
Deki::PackageConfig Struct Reference

Runtime configuration of one hardware package on a board: pin assignments (GPIO numbers) and string settings, loaded from the platform JSON. More...

#include <deki/PackageConfig.h>

Public Member Functions

bool GetBool (const std::string &name, bool defaultVal=false) const
 The setting name as a bool ("true", "1" or "yes" are true), or defaultVal when it is missing.
int GetInt (const std::string &name, int defaultVal=0) const
 The setting name parsed as a decimal integer, or defaultVal when it is missing or not a number.
int GetPin (const std::string &name, int defaultVal=-1) const
 GPIO number of the pin name (such as "MOSI" or "CS"), or defaultVal.
std::string GetString (const std::string &name, const std::string &defaultVal="") const
 The setting name (such as "mode" or "mount_point"), or defaultVal.

Public Attributes

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

Detailed Description

Runtime configuration of one hardware package on a board: pin assignments (GPIO numbers) and string settings, loaded from the platform JSON.

The editor's JSON-backed form is PackageConfigEntry (PlatformConfig.h).

Unrelated to installable packages (the deki-* DLLs in deki-packages.json).

Member Function Documentation

◆ GetBool()

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

The setting name as a bool ("true", "1" or "yes" are true), or defaultVal when it is missing.

◆ GetInt()

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

The setting name parsed as a decimal integer, or defaultVal when it is missing or not a number.

◆ GetPin()

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

GPIO number of the pin name (such as "MOSI" or "CS"), or defaultVal.

◆ GetString()

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

The setting name (such as "mode" or "mount_point"), or defaultVal.

Member Data Documentation

◆ enabled

bool Deki::PackageConfig::enabled = false

◆ packageId

std::string Deki::PackageConfig::packageId

◆ pins

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

◆ settings

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

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