|
Embedded Artistry Framework
Embedded Systems C++ Framework
|
#include <platform.hpp>

Public Member Functions | |
| void | init_ () noexcept |
| void | initProcessor_ () noexcept |
| void | initHWPlatform_ () noexcept |
| void | startBlink () noexcept |
| void | echoLogBufferToConsole () noexcept |
| nRF52DK_FrameworkDemoPlatform () noexcept | |
| Default constructor supplies a default name for the simulator platform. More... | |
| ~nRF52DK_FrameworkDemoPlatform ()=default | |
| void | init () noexcept |
| Initialize the platform. More... | |
| void | initProcessor () noexcept |
| Initialize the processor. More... | |
| void | initHWPlatform () noexcept |
| Initialize the hardware platform. More... | |
| constexpr const std::string_view & | name () const noexcept |
| Access the platform's name. More... | |
| constexpr const char * | name_cstr () const noexcept |
| Access the platform name as a cstring for C API compatibility. More... | |
| auto | findDriver (const std::string_view &name) noexcept |
| Access a device driver in the registry by name. More... | |
| auto | findDriver (embvm::DriverType_t type) noexcept |
| Access a device driver in the registry by type. More... | |
| auto | findDriver () noexcept |
| Access a device driver in the registry by type, cast as the appropriate base class. More... | |
| auto | findDriver (const std::string_view &name) noexcept |
| Access a device driver in the registry by name, cast as the appropriate base class. More... | |
| auto | findAllDrivers (embvm::DriverType_t type) noexcept |
| Get a list of all device drivers in the registry by type. More... | |
| auto | findAllDrivers () noexcept |
| Get a list of all device drivers in the registry by type, cast as the appropriate base class. More... | |
| size_t | driverCount () const noexcept |
| Get the count of drivers registered with the platform. More... | |
Static Public Member Functions | |
| static void | earlyInitHook_ () noexcept |
| static void | initOS_ (void(*main_thread)()) noexcept |
| static nRF52DK_FrameworkDemoPlatform & | inst () noexcept |
| Get the global platform instance. More... | |
| static void | earlyInitHook () noexcept |
| Call early-initialization code. More... | |
| static void | initOS () noexcept |
| Initialize the OS. More... | |
| static void | initOS (void(*main_thread)()) noexcept |
| Initialize the with a function to use as the main thread. More... | |
| static void | registerDriver (const std::string_view &name, embvm::DriverBase *driver) noexcept |
| Platform-level API for registering a new device driver. More... | |
| static void | unregisterDriver (const std::string_view &name, embvm::DriverBase *driver) noexcept |
| Platform-level API for unregistering a new device driver. More... | |
Protected Attributes | |
| const std::string_view | name_ |
Private Types | |
| using | PlatformBase = embvm::VirtualPlatformBase< nRF52DK_FrameworkDemoPlatform, PlatformDriverRegistry > |
Private Member Functions | |
| void | led_blink_thread_ () noexcept |
Private Attributes | |
| NRF52DKHWPlatform | hw_platform_ |
| embvm::VirtualThread * | led_thread_ = nullptr |
| Thread handle for the created-during-runtime LED thread. More... | |
|
private |
|
inlinenoexcept |
Default constructor supplies a default name for the simulator platform.
|
default |
|
inlinenoexceptinherited |
Get the count of drivers registered with the platform.
returns Number of drivers currently registered with the platform DriverRegistry.
|
inlinestaticnoexceptinherited |
Call early-initialization code.
Call early initialization code, which is to be run before C runtime initialization, memory relocations, OS initialization, etc. This call is used to handle early setup code that the rest of the initialization process might depend on, such as DRAM initialization.
This function forwards the call to the derived class for the actual implementation.
|
staticnoexcept |
References __HeapBase, __HeapLimit, and malloc_addblock().
|
noexcept |
References embvm::PlatformLogger_t< TLogger >::inst().
|
inlinenoexceptinherited |
Get a list of all device drivers in the registry by type.
The type will be returned as the appropriate base class (instead of embvm::DriverBase).
This call forwards the information to the DriverRegistry instance.
| type | The type of driver being requested (embvm::i2c::master, SystemClock). |
|
inlinenoexceptinherited |
Get a list of all device drivers in the registry by type, cast as the appropriate base class.
The type will be returned as the appropriate base class (instead of embvm::DriverBase).
This call forwards the information to the DriverRegistry instance.
| TDriverClass | The class of driver being requested (embvm::i2c::master, SystemClock). |
|
inlinenoexceptinherited |
Access a device driver in the registry by name.
Find a driver by name.
This call forwards the information to the DriverRegistry instance.
|
inlinenoexceptinherited |
Access a device driver in the registry by type.
Find a driver by type. If multiple drivers are found for a type, the first one found will be returned.
This call forwards the information to the DriverRegistry instance.
|
inlinenoexceptinherited |
Access a device driver in the registry by type, cast as the appropriate base class.
If multiple drivers are found for a type, the first one found will be returned. The type will be returned as the appropriate base class (instead of embvm::DriverBase).
This call forwards the information to the DriverRegistry instance.
| TDriverClass | The class of driver being requested (embvm::i2c::master, SystemClock). |
|
inlinenoexceptinherited |
Access a device driver in the registry by name, cast as the appropriate base class.
The type will be returned as the appropriate base class (instead of embvm::DriverBase).
This call forwards the information to the DriverRegistry instance.
| TDriverClass | The class of driver being requested (embvm::i2c::master, SystemClock). |
|
inlinenoexceptinherited |
Initialize the platform.
This function is responsible for initializing the platform.
This function forwards the call to the derived class for the actual implementation.
|
noexcept |
References embvm::PlatformLogger_t< TLogger >::inst(), and logdebug.
|
inlinenoexceptinherited |
Initialize the hardware platform.
Performs steps necessary to initialize the hardware platform for use by the platform. In many cases, this call should just invoke the hardware platform's init() function. Control of this function is placed in the platform layer to allow for platform-specific customization & initialization of the hardware platform in situations where non-default values are used.
This function forwards the call to the derived class for the actual implementation.
|
noexcept |
|
inlinestaticnoexceptinherited |
Initialize the OS.
Performs steps necessary to initialize the OS for use by the platform. Control of this function is placed in the platform layer to allow for platform-specific customization & initialization of the OS, since each OS has different startup requirements
This function forwards the call to the derived class for the actual implementation.
|
inlinestaticnoexceptinherited |
Initialize the with a function to use as the main thread.
Performs steps necessary to initialize the OS for use by the platform. Control of this function is placed in the platform layer to allow for platform-specific customization & initialization of the OS, since each OS has different startup requirements
This function forwards the call to the derived class for the actual implementation.
| main_thread | a function pointer to use as the main thread routine. This version of initOS should be used for OSes such as FreeRTOS which kill execution of the current thread when the scheduler is started. |
|
staticnoexcept |
|
inlinenoexceptinherited |
Initialize the processor.
Performs steps necessary to initialize the processor for use by the platform. In many cases, this call should just invoke the processor's init() function. Control of this function is placed in the platform layer to allow for platform-specific customization & initialization of the processor in situations where non-default values are used.
This function forwards the call to the derived class for the actual implementation.
|
noexcept |
References hw_platform_, and embvm::VirtualHwPlatformBase< THWPlatform >::initProcessor().
|
inlinestaticnoexceptinherited |
Get the global platform instance.
Static declaration of the VirtualPlatformBase instance. We use this function to avoid the static initializatio order 'fiasco'. See more: https://isocpp.org/wiki/faq/ctors#static-init-order
|
privatenoexcept |
References NRF52DKHWPlatform::getLEDInstances(), hw_platform_, and embvm::this_thread::sleep_for().
Referenced by startBlink().
|
inlinenoexceptinherited |
Access the platform's name.
|
inlinenoexceptinherited |
Access the platform name as a cstring for C API compatibility.
|
inlinestaticnoexceptinherited |
Platform-level API for registering a new device driver.
Register a device driver with the platform's driver registry.
This call forwards the information to the DriverRegistry instance.
| name | The name (used as a key) the driver will be registered under. |
| driver | Pointer to the embvm::DriverBase object. A pointer is used because there are any number of potential derived classes which will be tracked. To prevent slicing, a pointer to the base class is stored. |
|
noexcept |
|
inlinestaticnoexceptinherited |
Platform-level API for unregistering a new device driver.
Unregister a device driver with the platform's driver registry.
This call forwards the information to the DriverRegistry instance.
| name | The name of the driver to remove. |
| driver | Pointer to the embvm::DriverBase object being removed. |
|
private |
Referenced by initHWPlatform_(), initProcessor_(), and led_blink_thread_().
|
private |
Thread handle for the created-during-runtime LED thread.
We defer initialization of the LED thread so that we can can start the blinking process at a time of our choosing, rather than during the construction process.
This is just one approach at handling startBlink() for this platform. Another approach would be to create the thread statically and use a variable to wake the thread when we are ready for blinking to start.
Referenced by startBlink().
|
protectedinherited |
1.8.15