This Platform serves as a base class that the specific framework demo applications Can derive from.
More...
#include <blinky_platform.hpp>
|
| const std::string_view | name_ |
| |
template<class THWPlatform, class TDriverRegistry>
class BlinkyDemoPlatform< THWPlatform, TDriverRegistry >
This Platform serves as a base class that the specific framework demo applications Can derive from.
This class takes a hardware platform as a template. Clients should implement specific instances of this platform as follows:
◆ VirtualPlatform
template<class THWPlatform , class TDriverRegistry >
◆ BlinkyDemoPlatform() [1/2]
template<class THWPlatform , class TDriverRegistry >
Default constructor supplies a default name for the simulator platform.
◆ BlinkyDemoPlatform() [2/2]
template<class THWPlatform , class TDriverRegistry >
Child classes can override the simulator platform name using the std::string_view constructor.
◆ ~BlinkyDemoPlatform()
template<class THWPlatform , class TDriverRegistry >
◆ driverCount()
Get the count of drivers registered with the platform.
returns Number of drivers currently registered with the platform DriverRegistry.
◆ earlyInitHook()
|
|
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.
◆ earlyInitHook_()
template<class THWPlatform , class TDriverRegistry >
◆ findAllDrivers() [1/2]
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.
- Parameters
-
- Returns
- A list of embvm::DriverBase instances. If no matching types are found, an empty list will be returned. The caller must cast to the appropriate type.
◆ findAllDrivers() [2/2]
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.
- Template Parameters
-
- Returns
- A list of driver instances cast as TDriverClass types. If no matching types are found, an empty list will be returned.
◆ findDriver() [1/4]
Access a device driver in the registry by name.
Find a driver by name.
This call forwards the information to the DriverRegistry instance.
- Returns
- An optional_ref to the embvm::DriverBase instance. If no instance is found, the optional reference will be invalid. The caller must cast to the appropriate type.
◆ findDriver() [2/4]
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.
- Returns
- An optional_ref to the embvm::DriverBase instance. If no instance is found, the optional reference will be invalid. The caller must cast to the appropriate type.
◆ findDriver() [3/4]
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.
- Template Parameters
-
- Returns
- an type_safe::optional_ref cast to the TDriverClass type. If the driver was not found, the optional_ref will be empty.
◆ findDriver() [4/4]
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.
- Template Parameters
-
- Returns
- an type_safe::optional_ref cast to the TDriverClass type. If the driver was not found, the optional_ref will be empty.
◆ init()
Initialize the platform.
This function is responsible for initializing the platform.
This function forwards the call to the derived class for the actual implementation.
◆ init_()
template<class THWPlatform , class TDriverRegistry >
◆ initHWPlatform()
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.
◆ initHWPlatform_()
template<class THWPlatform , class TDriverRegistry >
◆ initOS() [1/2]
|
|
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.
◆ initOS() [2/2]
|
|
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.
- Parameters
-
| 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. |
◆ initOS_()
template<class THWPlatform , class TDriverRegistry >
◆ initProcessor()
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.
◆ initProcessor_()
template<class THWPlatform , class TDriverRegistry >
◆ inst()
|
|
inlinestaticnoexceptinherited |
◆ name()
Access the platform's name.
- Returns
- Platform name std::string_view reference.
◆ name_cstr()
Access the platform name as a cstring for C API compatibility.
- Returns
- Platform name as a C-string.
◆ registerDriver()
|
|
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.
- Parameters
-
| 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. |
◆ startBlink()
template<class THWPlatform , class TDriverRegistry >
◆ unregisterDriver()
|
|
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.
- Parameters
-
| name | The name of the driver to remove. |
| driver | Pointer to the embvm::DriverBase object being removed. |
◆ hw_platform_
template<class THWPlatform , class TDriverRegistry >
◆ name_
The documentation for this class was generated from the following file: