Embedded Artistry Framework
Embedded Systems C++ Framework
Public Member Functions | Static Public Member Functions | Private Types | Private Attributes | List of all members
NRF52DongleHWPlatform Class Reference

#include <nrf52_dongle_hw_platform.hpp>

Inheritance diagram for NRF52DongleHWPlatform:
Inheritance graph

Public Member Functions

 NRF52DongleHWPlatform ()
 Default constructor. More...
 
 ~NRF52DongleHWPlatform ()
 Default destructor. More...
 
void init_ () noexcept
 
void initProcessor_ () noexcept
 
void soft_reset_ () noexcept
 
void hard_reset_ () noexcept
 
void leds_off () noexcept
 
void startBlink () noexcept
 
constexpr const std::string_view & name () const noexcept
 Returns the Virtual HW Platform's name. More...
 
constexpr const char * name_cstr () const noexcept
 Returns the platform name as a cstring for C API compatibility. More...
 
void initProcessor () noexcept
 Initialize the processor. More...
 
void init () noexcept
 Initialize the hardware platform. More...
 
void soft_reset () noexcept
 Perform a soft reset of the system (chip reset) More...
 
void hard_reset () noexcept
 Perform a hard reset of the system (power cycle) More...
 
void shutdown () noexcept
 Shutdown the system. More...
 

Static Public Member Functions

static void earlyInitHook_ () noexcept
 
static void earlyInitHook () noexcept
 Perform any special initialization steps. More...
 

Private Types

using PlatformBase = embvm::VirtualHwPlatformBase< NRF52DongleHWPlatform >
 

Private Attributes

nRF52840 processor
 
nRFGPIOOutput< 0, 6 > led1_g_pin {}
 
nRFGPIOOutput< 0, 8 > led2_r_pin {}
 
nRFGPIOOutput< 1, 9 > led2_g_pin {}
 
nRFGPIOOutput< 0, 12 > led2_b_pin {}
 
embvm::led::gpioActiveLow led1 {led1_g_pin, "led1"}
 
embvm::led::gpioActiveLow led2_r {led2_r_pin, "led2r"}
 
embvm::led::gpioActiveLow led2_g {led2_g_pin, "led2g"}
 
embvm::led::gpioActiveLow led2_b {led2_b_pin, "led2b"}
 

Member Typedef Documentation

◆ PlatformBase

Constructor & Destructor Documentation

◆ NRF52DongleHWPlatform()

NRF52DongleHWPlatform::NRF52DongleHWPlatform ( )
inline

Default constructor.

◆ ~NRF52DongleHWPlatform()

NRF52DongleHWPlatform::~NRF52DongleHWPlatform ( )
noexcept

Default destructor.

Member Function Documentation

◆ earlyInitHook()

static void embvm::VirtualHwPlatformBase< NRF52DongleHWPlatform >::earlyInitHook ( )
inlinestaticnoexceptinherited

Perform any special initialization steps.

The earlyInitHook_() function must be implemented by the derived class as a static function.

These functions run before the C Run-time setup functions are called, and normal functionality (e.g. OS concepts) are not available.

Early initialization steps represent any super early code that needs to execute. For example, DRAM might need to be initialized before the boot process can relocate memory to its proper location in memory.

These functions are declared static to prevent you from easily using drivers within their confines

◆ earlyInitHook_()

void NRF52DongleHWPlatform::earlyInitHook_ ( )
staticnoexcept

◆ hard_reset()

void embvm::VirtualHwPlatformBase< NRF52DongleHWPlatform >::hard_reset ( )
inlinenoexceptinherited

Perform a hard reset of the system (power cycle)

The hard_reset_() function must be implemented by the derived class.

A hard reset is intended to perform a full power cycle of the system.

Platforms which do not support a hard reset should default to calling soft_reset().

◆ hard_reset_()

void NRF52DongleHWPlatform::hard_reset_ ( )
inlinenoexcept

References soft_reset_().

◆ init()

void embvm::VirtualHwPlatformBase< NRF52DongleHWPlatform >::init ( )
inlinenoexceptinherited

Initialize the hardware platform.

The init_() function must be implemented by the derived class.

Perform any hardware platform initialization steps, such as preparing peripherals for use, setting up callbacks, etc.

◆ init_()

void NRF52DongleHWPlatform::init_ ( )
noexcept

◆ initProcessor()

void embvm::VirtualHwPlatformBase< NRF52DongleHWPlatform >::initProcessor ( )
inlinenoexceptinherited

Initialize the processor.

The initProcessor_() function must be implemented by the derived class.

Perform any steps necessary for initializing the processor & processor peripheral devices for use.

Note that this is only intended to be processor initialization. Platform initialization nis handled by the init() function.

This function will likely invoke the VirtualProcessor::init() function, but the order and actual initialization process is left to the derived class.

◆ initProcessor_()

void NRF52DongleHWPlatform::initProcessor_ ( )
inlinenoexcept

◆ leds_off()

void NRF52DongleHWPlatform::leds_off ( )
inlinenoexcept

◆ name()

constexpr const std::string_view& embvm::VirtualHwPlatformBase< NRF52DongleHWPlatform >::name ( ) const
inlinenoexceptinherited

Returns the Virtual HW Platform's name.

◆ name_cstr()

constexpr const char* embvm::VirtualHwPlatformBase< NRF52DongleHWPlatform >::name_cstr ( ) const
inlinenoexceptinherited

Returns the platform name as a cstring for C API compatibility.

◆ shutdown()

void embvm::VirtualHwPlatformBase< NRF52DongleHWPlatform >::shutdown ( )
inlinenoexceptinherited

Shutdown the system.

The shutdown_() function must be implemented by the derived class.

If your platform supports shutdown capability, take the proper steps to initiate a shutdown.

If the platform does not support shutdown capability, implement your shutdown_() function as an assert to notify users trying to call this API. You could also leave the shutdown_() function undefined. Anyone who calls the shutdown() function on a platform with an undefined shutdown_() function will encounter a compiler error.

The shutdown function is not expected to return.

◆ soft_reset()

void embvm::VirtualHwPlatformBase< NRF52DongleHWPlatform >::soft_reset ( )
inlinenoexceptinherited

Perform a soft reset of the system (chip reset)

The soft_reset_() function must be implemnted by the derived class.

A soft reset is intended to reset the program to the beginning without performing a full power cycle.

A good strategy is to just call virtual processor's reset() function, if one is provided.

◆ soft_reset_()

void NRF52DongleHWPlatform::soft_reset_ ( )
inlinenoexcept

Referenced by hard_reset_().

◆ startBlink()

void NRF52DongleHWPlatform::startBlink ( )
inlinenoexcept

Member Data Documentation

◆ led1

embvm::led::gpioActiveLow NRF52DongleHWPlatform::led1 {led1_g_pin, "led1"}
private

Referenced by init_(), leds_off(), and startBlink().

◆ led1_g_pin

nRFGPIOOutput<0, 6> NRF52DongleHWPlatform::led1_g_pin {}
private

◆ led2_b

embvm::led::gpioActiveLow NRF52DongleHWPlatform::led2_b {led2_b_pin, "led2b"}
private

Referenced by init_(), leds_off(), and startBlink().

◆ led2_b_pin

nRFGPIOOutput<0, 12> NRF52DongleHWPlatform::led2_b_pin {}
private

◆ led2_g

embvm::led::gpioActiveLow NRF52DongleHWPlatform::led2_g {led2_g_pin, "led2g"}
private

Referenced by init_(), leds_off(), and startBlink().

◆ led2_g_pin

nRFGPIOOutput<1, 9> NRF52DongleHWPlatform::led2_g_pin {}
private

◆ led2_r

embvm::led::gpioActiveLow NRF52DongleHWPlatform::led2_r {led2_r_pin, "led2r"}
private

Referenced by init_(), leds_off(), and startBlink().

◆ led2_r_pin

nRFGPIOOutput<0, 8> NRF52DongleHWPlatform::led2_r_pin {}
private

◆ processor

nRF52840 NRF52DongleHWPlatform::processor
private

Referenced by init_(), and startBlink().


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