DEKI/ENGINE docs
Deki 0.19.0
Modular C++ 2D engine for embedded displays and desktop
Loading...
Searching...
No Matches
Deki::IPackage Class Referenceabstract

What a hardware peripheral package (SD card, GPS, WiFi, ...) implements. More...

#include <deki/providers/IPackage.h>

Public Member Functions

virtual ~IPackage ()=default
virtual const char * GetPackageId () const =0
 Unique id, such as "sd_card", "gps" or "wifi".
virtual const char * GetPackageName () const =0
 Display name, such as "SD Card".
virtual const char * GetPackageCategory () const =0
 Category for grouping in the UI, such as "storage" or "sensors".
virtual void Configure (const PackageConfig &config)=0
 Receives the platform's pins and settings before Initialize(); keep them for it.
virtual bool Initialize ()=0
 Sets up the hardware and resources, after Configure().
virtual void Shutdown ()=0
 Releases all hardware resources, on engine shutdown or when the package is disabled.
virtual void Update (float deltaTime)=0
 Called every frame with the seconds since the last one.
virtual PackageState GetState () const =0
virtual const char * GetLastError () const =0
 The last error message, or "" when there was none.

Detailed Description

What a hardware peripheral package (SD card, GPS, WiFi, ...) implements.

Packages are found through plugin exports and configured in the editor's platform configuration.

Lifecycle:

  1. created by a factory
  2. Configure() with the pins and settings
  3. Initialize() sets up the hardware
  4. Update() every frame
  5. Shutdown() on engine shutdown

Constructor & Destructor Documentation

◆ ~IPackage()

virtual Deki::IPackage::~IPackage ( )
virtualdefault

Member Function Documentation

◆ GetPackageId()

virtual const char * Deki::IPackage::GetPackageId ( ) const
pure virtual

Unique id, such as "sd_card", "gps" or "wifi".

◆ GetPackageName()

virtual const char * Deki::IPackage::GetPackageName ( ) const
pure virtual

Display name, such as "SD Card".

◆ GetPackageCategory()

virtual const char * Deki::IPackage::GetPackageCategory ( ) const
pure virtual

Category for grouping in the UI, such as "storage" or "sensors".

◆ Configure()

virtual void Deki::IPackage::Configure ( const PackageConfig & config)
pure virtual

Receives the platform's pins and settings before Initialize(); keep them for it.

◆ Initialize()

virtual bool Deki::IPackage::Initialize ( )
pure virtual

Sets up the hardware and resources, after Configure().

Returns false on failure.

◆ Shutdown()

virtual void Deki::IPackage::Shutdown ( )
pure virtual

Releases all hardware resources, on engine shutdown or when the package is disabled.

◆ Update()

virtual void Deki::IPackage::Update ( float deltaTime)
pure virtual

Called every frame with the seconds since the last one.

Polling packages (such as GPS) read their data here; event-driven ones may do nothing.

◆ GetState()

virtual PackageState Deki::IPackage::GetState ( ) const
pure virtual

◆ GetLastError()

virtual const char * Deki::IPackage::GetLastError ( ) const
pure virtual

The last error message, or "" when there was none.


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