|
Embedded Artistry Framework
Embedded Systems C++ Framework
|
Aardvark Adapter drivers, usable for Simulator applications. More...
|
Classes | |
| class | embdrv::aardvarkAdapter |
| Driver to control the Aardvark Adapter. More... | |
| class | embdrv::aardvarkGPIOInput< TPinID, TPull > |
| Aardvark GPIO Input driver. More... | |
| class | embdrv::aardvarkGPIOOutput< TPinID > |
| Aardvark GPIO Output driver. More... | |
| class | embdrv::aardvarkI2CMaster |
| Create an Aardvark I2C Master Driver. More... | |
| class | embdrv::aardvarkSPIMaster |
| Create an Aardvark SPI Master Driver. More... | |
Enumerations | |
| enum | embdrv::aardvarkMode { embdrv::aardvarkMode::GpioOnly = 0x0, embdrv::aardvarkMode::SpiGpio = 0x01, embdrv::aardvarkMode::GpioI2C = 0x02, embdrv::aardvarkMode::SpiI2C = 0x03, embdrv::aardvarkMode::Query = 0x80 } |
| Aardvark master operational modes. More... | |
Variables | |
| constexpr size_t | embdrv::AARDVARK_IO_COUNT = 6 |
| The number of IO pins supported by the AARDVARK sensor. More... | |
| static constexpr std::array< uint8_t, AARDVARK_IO_COUNT > | embdrv::aardvarkIO |
| aardvark IO pin IDs More... | |
Aardvark Adapter drivers, usable for Simulator applications.
| class embdrv::aardvarkAdapter |
Driver to control the Aardvark Adapter.
This class must always be declared for use with Aardvark drivers. The aardvarkAdapter is used to set the operational mode and configure the device hardware.
The aardvarkAdapter instance is then passed to the aardvark drivers:

Public Member Functions | |
| aardvarkAdapter (aardvarkMode m=aardvarkMode::SpiI2C, uint8_t USBPort=0) noexcept | |
| Create a generic aardvark Adapter. More... | |
| aardvarkAdapter (const char *name, aardvarkMode m=aardvarkMode::SpiI2C, uint8_t USBPort=0) noexcept | |
| Create an aardvarkAdapter with a name. More... | |
| aardvarkAdapter (const std::string &name, aardvarkMode m=aardvarkMode::SpiI2C, uint8_t USBPort=0) noexcept | |
| aardvarkAdapter (const std::string_view &name, aardvarkMode m=aardvarkMode::SpiI2C, uint8_t USBPort=0) noexcept | |
| ~aardvarkAdapter () noexcept override=default | |
| Default destructor. More... | |
| aardvarkMode | mode (aardvarkMode m) noexcept |
| Change the Aardvark Adapter's operational mode. More... | |
| aardvarkMode | mode () const noexcept |
| Get the current mode setting This function does not query the device, it returns the cached mode. More... | |
| int | handle () const noexcept |
| Get the handle for the Aardvark Master The handle is used by related drivers to work with the Aardvark library APIs. More... | |
| void | lock () noexcept |
| Lock the Aardvark master - used by other Aardvark driver types to ensure exclusion. More... | |
| void | unlock () noexcept |
| Unlock the Aardvark Master. More... | |
| bool | i2cPullups () noexcept |
| Query the current i2c pullup setting. More... | |
| bool | i2cPullups (bool en) noexcept |
| Enable/Disable the i2c pullup setting. More... | |
| bool | targetPower () noexcept |
| Query the current 5V target power setting. More... | |
| bool | targetPower (bool en) noexcept |
| Enable/Disable 5V target power output. More... | |
| void | pullup (uint8_t id, bool en) noexcept |
| Set a pullup for GPIO. More... | |
| void | start () noexcept |
| Start the driver. More... | |
| void | stop () noexcept |
| Stop the driver. More... | |
| void | restart () noexcept |
| Restart the driver. More... | |
| type_safe::boolean | started () const noexcept |
| Check if the driver has been started. More... | |
| constexpr embvm::DriverType_t | DriverType () const noexcept |
| Returns the registered type ID of the driver. More... | |
| constexpr const std::string_view & | name () const noexcept |
| Provides a string_view reference of the driver name. More... | |
| constexpr const char * | name_cstr () const noexcept |
| Provides a c-string version of the driver name. More... | |
| virtual DriverBase & | operator++ () noexcept |
| Increment operator is a no-op, but is used for iterator compatibility. More... | |
Protected Attributes | |
| type_safe::boolean | started_ = false |
| Tracks the driver state. More... | |
| const std::string_view | name_ |
| Name of the driver instance. More... | |
| const embvm::DriverType_t | type_ |
| Type ID of the driver instance. More... | |
Private Member Functions | |
| void | start_ () noexcept final |
| Derived classes override the start_ method to control driver-specific startup behavior. More... | |
| void | stop_ () noexcept final |
| Derived classes override the start_ method to control driver-specific startup behavior. More... | |
Private Attributes | |
| std::mutex | lock_ {} |
| The aardvark adapter lock. More... | |
| uint8_t | port_ |
| The USB port the adapter is connected to. More... | |
| uint8_t | pullup_mask_ = 0 |
| Mask representing the pullups currently enabled. More... | |
| int | handle_ = 0 |
| The handle for the aardvark Adapter (provided by the aardvark API). More... | |
| aardvarkMode | mode_ |
| The currently configured Aardvark Adapter mode. More... | |
| std::atomic< int > | started_refcnt_ = 0 |
| Reference count for the number of times this driver has been started. More... | |
|
inlineexplicitnoexcept |
Create a generic aardvark Adapter.
| m | The aardvark adapter mode. |
| USBPort | The id of the USB port the aardvarkAdapter is connected to. |
|
inlineexplicitnoexcept |
Create an aardvarkAdapter with a name.
| name | The name for the aardvarkAdapter driver. |
| m | The aardvark adapter mode. |
| USBPort | The id of the USB port the aardvarkAdapter is connected to. |
|
inlineexplicitnoexcept |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
inlineexplicitnoexcept |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
overridedefaultnoexcept |
Default destructor.
|
inlinenoexceptinherited |
Returns the registered type ID of the driver.
When using DriverBase interfaces, clients can retrieve the registered driver type in order to up-cast to the correct interface.
The type is returned as a embvm::DriverType_t rather than a embvm::DriverType enum to work with custom user-defined types. Enforcing a embvm::DriverType return value would prevent clients from defining and using their own custom types.
References embvm::DriverBase::type_.
|
inlinenoexcept |
Get the handle for the Aardvark Master The handle is used by related drivers to work with the Aardvark library APIs.
References handle_.
Referenced by embdrv::aardvarkSPIMaster::configure_(), embdrv::aardvarkGPIOInput< 4 >::get(), embdrv::aardvarkGPIOOutput< 5 >::set(), and embdrv::aardvarkGPIOOutput< 5 >::start_().
|
noexcept |
Query the current i2c pullup setting.
References aa_i2c_pullup(), AA_I2C_PULLUP_QUERY, handle_, lock(), r, and unlock().
Referenced by embdrv::aardvarkGPIOInput< 4 >::start_().
Enable/Disable the i2c pullup setting.
| en | True enables I2C pullups, false disables them. |
References aa_i2c_pullup(), AA_I2C_PULLUP_BOTH, and AA_I2C_PULLUP_NONE.
|
inlinenoexcept |
Lock the Aardvark master - used by other Aardvark driver types to ensure exclusion.
References lock_.
Referenced by embdrv::aardvarkSPIMaster::configure_(), embdrv::aardvarkGPIOInput< 4 >::get(), i2cPullups(), embdrv::aardvarkGPIOOutput< 5 >::set(), embdrv::aardvarkGPIOOutput< 5 >::start_(), and targetPower().
|
noexcept |
Change the Aardvark Adapter's operational mode.
| m | The desired aardvark operational mode. |
References aa_configure().
Referenced by embdrv::aardvarkGPIOInput< 4 >::start_().
|
inlinenoexcept |
|
inlinenoexceptinherited |
Provides a string_view reference of the driver name.
std::string_view ref containing the driver name. References embvm::DriverBase::name_.
|
inlinenoexceptinherited |
Provides a c-string version of the driver name.
References embvm::DriverBase::name_.
|
inlinevirtualnoexceptinherited |
Increment operator is a no-op, but is used for iterator compatibility.
Set a pullup for GPIO.
| id | The GPIO Id to enable the pullup for |
| en | True enables a pullup, false disables it. |
References aa_gpio_pullup(), AA_OK, embdrv::aardvarkIO, assert, and r.
Referenced by embdrv::aardvarkGPIOInput< 4 >::pull_().
|
inlinenoexceptinherited |
Restart the driver.
Calls stop() and then start() on the driver. If the driver is not started, then it will be started after the start() function is invoked.
References embvm::DriverBase::start(), and embvm::DriverBase::stop().
|
inlinenoexceptinherited |
Start the driver.
If the driver is not started, call the start_() function defined by the derived class. (Template Method Pattern)
References embvm::DriverBase::start_(), and embvm::DriverBase::started_.
Referenced by NRF52DongleHWPlatform::init_(), NRF52DKHWPlatform::init_(), BlinkySimulatorHWPlatform::init_(), FWDemoSimulatorHWPlatform::init_(), FrameworkDemoSimPlatform::initHWPlatform_(), embvm::DriverBase::restart(), embvm::timer::Timer::restart(), embvm::spi::activeMaster< TQueueSize, TLock, TCond >::start_(), embvm::i2c::activeMaster< 128 >::start_(), embdrv::aardvarkSPIMaster::start_(), embdrv::aardvarkI2CMaster::start_(), embdrv::aardvarkGPIOInput< 4 >::start_(), embdrv::vl53l1x::start_(), embdrv::aardvarkGPIOOutput< 5 >::start_(), BlinkySimulatorHWPlatform::startBlink(), and FWDemoSimulatorHWPlatform::startLEDTimer().
|
finalprivatevirtualnoexcept |
Derived classes override the start_ method to control driver-specific startup behavior.
(Template Method Pattern)
Implements embvm::DriverBase.
References aa_open(), assert, handle_, mode(), mode_, port_, embvm::DriverBase::started(), and started_refcnt_.
|
inlinenoexceptinherited |
Check if the driver has been started.
true if the driver is running (started), false if not running (stopped). References embvm::DriverBase::started_.
Referenced by embdrv::aardvarkSPIMaster::configure_(), embdrv::aardvarkGPIOInput< 4 >::get(), embdrv::aardvarkGPIOOutput< 5 >::set(), embdrv::vl53l1x::start_(), start_(), and stop_().
|
inlinenoexceptinherited |
Stop the driver.
If the driver has been started, call the stop_() function defined by the derived class. (Template Method Pattern)
References embvm::DriverBase::started_, and embvm::DriverBase::stop_().
Referenced by embvm::DriverBase::restart(), embvm::timer::Timer::restart(), embvm::spi::activeMaster< TQueueSize, TLock, TCond >::stop_(), embvm::i2c::activeMaster< 128 >::stop_(), embdrv::aardvarkSPIMaster::stop_(), embdrv::aardvarkI2CMaster::stop_(), embdrv::aardvarkGPIOInput< 4 >::stop_(), embdrv::aardvarkGPIOOutput< 5 >::stop_(), FWDemoSimulatorHWPlatform::~FWDemoSimulatorHWPlatform(), and embdrv::SimulatorTimer::~SimulatorTimer().
|
finalprivatevirtualnoexcept |
Derived classes override the start_ method to control driver-specific startup behavior.
(Template Method Pattern)
Implements embvm::DriverBase.
References aa_close(), handle_, embvm::DriverBase::started(), and started_refcnt_.
|
noexcept |
Query the current 5V target power setting.
References aa_target_power(), AA_TARGET_POWER_QUERY, handle_, lock(), r, and unlock().
Enable/Disable 5V target power output.
| en | True enables 5V target power output, false disables it. |
References aa_i2c_pullup(), AA_TARGET_POWER_BOTH, and AA_TARGET_POWER_NONE.
|
inlinenoexcept |
Unlock the Aardvark Master.
References lock_.
Referenced by embdrv::aardvarkSPIMaster::configure_(), embdrv::aardvarkGPIOInput< 4 >::get(), i2cPullups(), embdrv::aardvarkGPIOOutput< 5 >::set(), embdrv::aardvarkGPIOOutput< 5 >::start_(), and targetPower().
|
private |
The handle for the aardvark Adapter (provided by the aardvark API).
Referenced by handle(), i2cPullups(), start_(), stop_(), and targetPower().
|
private |
|
private |
|
protectedinherited |
Name of the driver instance.
Referenced by embvm::DriverBase::name(), and embvm::DriverBase::name_cstr().
|
private |
The USB port the adapter is connected to.
Referenced by start_().
|
private |
Mask representing the pullups currently enabled.
|
protectedinherited |
Tracks the driver state.
True if the driver has been started, false if it has been stopped or not yet started.
Referenced by embvm::DriverBase::start(), embvm::DriverBase::started(), and embvm::DriverBase::stop().
|
private |
Reference count for the number of times this driver has been started.
Since multiple client drivers can be created, we don't want to stop the aardvarkAdapter base until all client drivers have been stopped.
|
protectedinherited |
Type ID of the driver instance.
Referenced by embvm::DriverBase::DriverType().
| class embdrv::aardvarkGPIOInput |
Aardvark GPIO Input driver.
Create a GPIO input driver using the Aardvark adapter.
This driver requires an aardvarkAdapter to work. The aardvark adapter must be configured with aardvarkMode::GpioI2C, aardvarkMode::SpiGpio, or aardvarkMode::GpioOnly.
| TPinID | The aardvark pin ID to use as a GPIO Input. Must be less than AARDVARK_IO_COUNT. |
| TPull | The pull setting to use with this GPIO. |

Public Member Functions | |
| aardvarkGPIOInput (aardvarkAdapter &master) noexcept | |
| Construct a generic GPIO input. More... | |
| aardvarkGPIOInput (aardvarkAdapter &master, const char *name) noexcept | |
| Construct a named GPIO Input. More... | |
| ~aardvarkGPIOInput () noexcept final=default | |
| Default Destructor. More... | |
| bool | get () noexcept final |
| Get the current GPIO pin state. More... | |
| gpio::pull | pull () const noexcept |
| Get the current pull configuration. More... | |
| gpio::direction | direction () const noexcept |
| Check the direction of the GPIO pin. More... | |
| void | start () noexcept |
| Start the driver. More... | |
| void | stop () noexcept |
| Stop the driver. More... | |
| void | restart () noexcept |
| Restart the driver. More... | |
| type_safe::boolean | started () const noexcept |
| Check if the driver has been started. More... | |
| constexpr embvm::DriverType_t | DriverType () const noexcept |
| Returns the registered type ID of the driver. More... | |
| constexpr const std::string_view & | name () const noexcept |
| Provides a string_view reference of the driver name. More... | |
| constexpr const char * | name_cstr () const noexcept |
| Provides a c-string version of the driver name. More... | |
| virtual DriverBase & | operator++ () noexcept |
| Increment operator is a no-op, but is used for iterator compatibility. More... | |
Static Public Member Functions | |
| static constexpr embvm::DriverType | type () noexcept |
| GPIO Driver Type ID. More... | |
Protected Attributes | |
| type_safe::boolean | started_ = false |
| Tracks the driver state. More... | |
| const std::string_view | name_ |
| Name of the driver instance. More... | |
| const embvm::DriverType_t | type_ |
| Type ID of the driver instance. More... | |
Private Member Functions | |
| void | start_ () noexcept final |
| Derived classes override the start_ method to control driver-specific startup behavior. More... | |
| void | stop_ () noexcept final |
| Derived classes override the start_ method to control driver-specific startup behavior. More... | |
| embvm::gpio::pull | pull_ (embvm::gpio::pull p) noexcept final |
| Set the pull configuration in hardware. More... | |
Private Attributes | |
| aardvarkAdapter & | master_ |
| The aardvarkAdapter instance associated with this GPIO input. More... | |
|
inlineexplicitnoexcept |
Construct a generic GPIO input.
| master | The aardvarkAdapter instance associated with this GPIO pin. |
|
inlineexplicitnoexcept |
Construct a named GPIO Input.
| master | The aardvarkAdapter instance associated with this GPIO pin. |
| name | The name of the GPIO pin |
|
finaldefaultnoexcept |
Default Destructor.
|
inlinenoexceptinherited |
Check the direction of the GPIO pin.
|
inlinenoexceptinherited |
Returns the registered type ID of the driver.
When using DriverBase interfaces, clients can retrieve the registered driver type in order to up-cast to the correct interface.
The type is returned as a embvm::DriverType_t rather than a embvm::DriverType enum to work with custom user-defined types. Enforcing a embvm::DriverType return value would prevent clients from defining and using their own custom types.
References embvm::DriverBase::type_.
|
inlinefinalvirtualnoexcept |
Get the current GPIO pin state.
Derived classes must implement the get() function.
Implements embvm::gpio::input< TPull >.
Referenced by FWDemoSimulatorHWPlatform::readAndSetToFMode().
|
inlinenoexceptinherited |
Provides a string_view reference of the driver name.
std::string_view ref containing the driver name. References embvm::DriverBase::name_.
|
inlinenoexceptinherited |
Provides a c-string version of the driver name.
References embvm::DriverBase::name_.
|
inlinevirtualnoexceptinherited |
Increment operator is a no-op, but is used for iterator compatibility.
|
inlinenoexceptinherited |
Get the current pull configuration.
|
inlinefinalprivatevirtualnoexcept |
Set the pull configuration in hardware.
Derived classes must implement the pull_(gpio::pull p) function.
Implements embvm::gpio::input< TPull >.
Referenced by embdrv::aardvarkGPIOInput< 4 >::start_().
|
inlinenoexceptinherited |
Restart the driver.
Calls stop() and then start() on the driver. If the driver is not started, then it will be started after the start() function is invoked.
References embvm::DriverBase::start(), and embvm::DriverBase::stop().
|
inlinenoexceptinherited |
Start the driver.
If the driver is not started, call the start_() function defined by the derived class. (Template Method Pattern)
References embvm::DriverBase::start_(), and embvm::DriverBase::started_.
Referenced by NRF52DongleHWPlatform::init_(), NRF52DKHWPlatform::init_(), BlinkySimulatorHWPlatform::init_(), FWDemoSimulatorHWPlatform::init_(), FrameworkDemoSimPlatform::initHWPlatform_(), embvm::DriverBase::restart(), embvm::timer::Timer::restart(), embvm::spi::activeMaster< TQueueSize, TLock, TCond >::start_(), embvm::i2c::activeMaster< 128 >::start_(), embdrv::aardvarkSPIMaster::start_(), embdrv::aardvarkI2CMaster::start_(), embdrv::aardvarkGPIOInput< 4 >::start_(), embdrv::vl53l1x::start_(), embdrv::aardvarkGPIOOutput< 5 >::start_(), BlinkySimulatorHWPlatform::startBlink(), and FWDemoSimulatorHWPlatform::startLEDTimer().
|
inlinefinalprivatevirtualnoexcept |
Derived classes override the start_ method to control driver-specific startup behavior.
(Template Method Pattern)
Implements embvm::gpio::input< TPull >.
|
inlinenoexceptinherited |
Check if the driver has been started.
true if the driver is running (started), false if not running (stopped). References embvm::DriverBase::started_.
Referenced by embdrv::aardvarkSPIMaster::configure_(), embdrv::aardvarkGPIOInput< 4 >::get(), embdrv::aardvarkGPIOOutput< 5 >::set(), embdrv::vl53l1x::start_(), embdrv::aardvarkAdapter::start_(), and embdrv::aardvarkAdapter::stop_().
|
inlinenoexceptinherited |
Stop the driver.
If the driver has been started, call the stop_() function defined by the derived class. (Template Method Pattern)
References embvm::DriverBase::started_, and embvm::DriverBase::stop_().
Referenced by embvm::DriverBase::restart(), embvm::timer::Timer::restart(), embvm::spi::activeMaster< TQueueSize, TLock, TCond >::stop_(), embvm::i2c::activeMaster< 128 >::stop_(), embdrv::aardvarkSPIMaster::stop_(), embdrv::aardvarkI2CMaster::stop_(), embdrv::aardvarkGPIOInput< 4 >::stop_(), embdrv::aardvarkGPIOOutput< 5 >::stop_(), FWDemoSimulatorHWPlatform::~FWDemoSimulatorHWPlatform(), and embdrv::SimulatorTimer::~SimulatorTimer().
|
inlinefinalprivatevirtualnoexcept |
Derived classes override the start_ method to control driver-specific startup behavior.
(Template Method Pattern)
Implements embvm::gpio::input< TPull >.
|
inlinestaticnoexceptinherited |
GPIO Driver Type ID.
|
private |
The aardvarkAdapter instance associated with this GPIO input.
Referenced by embdrv::aardvarkGPIOInput< 4 >::get(), embdrv::aardvarkGPIOInput< 4 >::pull_(), embdrv::aardvarkGPIOInput< 4 >::start_(), and embdrv::aardvarkGPIOInput< 4 >::stop_().
|
protectedinherited |
Name of the driver instance.
Referenced by embvm::DriverBase::name(), and embvm::DriverBase::name_cstr().
|
protectedinherited |
Tracks the driver state.
True if the driver has been started, false if it has been stopped or not yet started.
Referenced by embvm::DriverBase::start(), embvm::DriverBase::started(), and embvm::DriverBase::stop().
|
protectedinherited |
Type ID of the driver instance.
Referenced by embvm::DriverBase::DriverType().
| class embdrv::aardvarkGPIOOutput |
Aardvark GPIO Output driver.
Create a GPIO output driver using the Aardvark adapter.
This driver requires an aardvarkAdapter to work. The aardvark adapter must be configured with aardvarkMode::GpioI2C, aardvarkMode::SpiGpio, or aardvarkMode::GpioOnly.
| TPinID | The aardvark pin ID to use as a GPIO output. Must be less than AARDVARK_IO_COUNT. |

Public Member Functions | |
| aardvarkGPIOOutput (aardvarkAdapter &master) noexcept | |
| Construct a generic GPIO output. More... | |
| aardvarkGPIOOutput (aardvarkAdapter &master, const char *name) noexcept | |
| Construct a named GPIO output. More... | |
| ~aardvarkGPIOOutput () noexcept final=default | |
| Default destructor. More... | |
| void | set (bool v) noexcept final |
| Set the current GPIO pin state. More... | |
| gpio::direction | direction () const noexcept |
| Check the direction of the GPIO pin. More... | |
| void | start () noexcept |
| Start the driver. More... | |
| void | stop () noexcept |
| Stop the driver. More... | |
| void | restart () noexcept |
| Restart the driver. More... | |
| type_safe::boolean | started () const noexcept |
| Check if the driver has been started. More... | |
| constexpr embvm::DriverType_t | DriverType () const noexcept |
| Returns the registered type ID of the driver. More... | |
| constexpr const std::string_view & | name () const noexcept |
| Provides a string_view reference of the driver name. More... | |
| constexpr const char * | name_cstr () const noexcept |
| Provides a c-string version of the driver name. More... | |
| virtual DriverBase & | operator++ () noexcept |
| Increment operator is a no-op, but is used for iterator compatibility. More... | |
Static Public Member Functions | |
| static constexpr embvm::DriverType | type () noexcept |
| GPIO Driver Type ID. More... | |
Protected Attributes | |
| type_safe::boolean | started_ = false |
| Tracks the driver state. More... | |
| const std::string_view | name_ |
| Name of the driver instance. More... | |
| const embvm::DriverType_t | type_ |
| Type ID of the driver instance. More... | |
Private Member Functions | |
| void | start_ () noexcept final |
| Derived classes override the start_ method to control driver-specific startup behavior. More... | |
| void | stop_ () noexcept final |
| Derived classes override the start_ method to control driver-specific startup behavior. More... | |
Private Attributes | |
| aardvarkAdapter & | master_ |
| The aardvarkAdapter instance associated with this GPIO output. More... | |
|
inlineexplicitnoexcept |
Construct a generic GPIO output.
| master | The aardvarkAdapter instance associated with this GPIO pin. |
|
inlineexplicitnoexcept |
Construct a named GPIO output.
| master | The aardvarkAdapter instance associated with this GPIO pin. |
| name | The name of the GPIO pin |
|
finaldefaultnoexcept |
Default destructor.
|
inlinenoexceptinherited |
Check the direction of the GPIO pin.
|
inlinenoexceptinherited |
Returns the registered type ID of the driver.
When using DriverBase interfaces, clients can retrieve the registered driver type in order to up-cast to the correct interface.
The type is returned as a embvm::DriverType_t rather than a embvm::DriverType enum to work with custom user-defined types. Enforcing a embvm::DriverType return value would prevent clients from defining and using their own custom types.
References embvm::DriverBase::type_.
|
inlinenoexceptinherited |
Provides a string_view reference of the driver name.
std::string_view ref containing the driver name. References embvm::DriverBase::name_.
|
inlinenoexceptinherited |
Provides a c-string version of the driver name.
References embvm::DriverBase::name_.
|
inlinevirtualnoexceptinherited |
Increment operator is a no-op, but is used for iterator compatibility.
|
inlinenoexceptinherited |
Restart the driver.
Calls stop() and then start() on the driver. If the driver is not started, then it will be started after the start() function is invoked.
References embvm::DriverBase::start(), and embvm::DriverBase::stop().
|
inlinefinalvirtualnoexcept |
Set the current GPIO pin state.
Derived classes must implement the set() function.
| v | The desired GPIO state. True for logic 1, false for logic 0. |
Implements embvm::gpio::output.
|
inlinenoexceptinherited |
Start the driver.
If the driver is not started, call the start_() function defined by the derived class. (Template Method Pattern)
References embvm::DriverBase::start_(), and embvm::DriverBase::started_.
Referenced by NRF52DongleHWPlatform::init_(), NRF52DKHWPlatform::init_(), BlinkySimulatorHWPlatform::init_(), FWDemoSimulatorHWPlatform::init_(), FrameworkDemoSimPlatform::initHWPlatform_(), embvm::DriverBase::restart(), embvm::timer::Timer::restart(), embvm::spi::activeMaster< TQueueSize, TLock, TCond >::start_(), embvm::i2c::activeMaster< 128 >::start_(), embdrv::aardvarkSPIMaster::start_(), embdrv::aardvarkI2CMaster::start_(), embdrv::aardvarkGPIOInput< 4 >::start_(), embdrv::vl53l1x::start_(), embdrv::aardvarkGPIOOutput< 5 >::start_(), BlinkySimulatorHWPlatform::startBlink(), and FWDemoSimulatorHWPlatform::startLEDTimer().
|
inlinefinalprivatevirtualnoexcept |
Derived classes override the start_ method to control driver-specific startup behavior.
(Template Method Pattern)
Implements embvm::gpio::output.
|
inlinenoexceptinherited |
Check if the driver has been started.
true if the driver is running (started), false if not running (stopped). References embvm::DriverBase::started_.
Referenced by embdrv::aardvarkSPIMaster::configure_(), embdrv::aardvarkGPIOInput< 4 >::get(), embdrv::aardvarkGPIOOutput< 5 >::set(), embdrv::vl53l1x::start_(), embdrv::aardvarkAdapter::start_(), and embdrv::aardvarkAdapter::stop_().
|
inlinenoexceptinherited |
Stop the driver.
If the driver has been started, call the stop_() function defined by the derived class. (Template Method Pattern)
References embvm::DriverBase::started_, and embvm::DriverBase::stop_().
Referenced by embvm::DriverBase::restart(), embvm::timer::Timer::restart(), embvm::spi::activeMaster< TQueueSize, TLock, TCond >::stop_(), embvm::i2c::activeMaster< 128 >::stop_(), embdrv::aardvarkSPIMaster::stop_(), embdrv::aardvarkI2CMaster::stop_(), embdrv::aardvarkGPIOInput< 4 >::stop_(), embdrv::aardvarkGPIOOutput< 5 >::stop_(), FWDemoSimulatorHWPlatform::~FWDemoSimulatorHWPlatform(), and embdrv::SimulatorTimer::~SimulatorTimer().
|
inlinefinalprivatevirtualnoexcept |
Derived classes override the start_ method to control driver-specific startup behavior.
(Template Method Pattern)
Implements embvm::gpio::output.
|
inlinestaticnoexceptinherited |
GPIO Driver Type ID.
|
private |
The aardvarkAdapter instance associated with this GPIO output.
Referenced by embdrv::aardvarkGPIOOutput< 5 >::set(), embdrv::aardvarkGPIOOutput< 5 >::start_(), and embdrv::aardvarkGPIOOutput< 5 >::stop_().
|
protectedinherited |
Name of the driver instance.
Referenced by embvm::DriverBase::name(), and embvm::DriverBase::name_cstr().
|
protectedinherited |
Tracks the driver state.
True if the driver has been started, false if it has been stopped or not yet started.
Referenced by embvm::DriverBase::start(), embvm::DriverBase::started(), and embvm::DriverBase::stop().
|
protectedinherited |
Type ID of the driver instance.
Referenced by embvm::DriverBase::DriverType().
| class embdrv::aardvarkI2CMaster |
Create an Aardvark I2C Master Driver.
This driver requires an aardvarkAdapter to work. The aardvark adapter must be configured with aardvarkMode::GpioI2C or aardvarkMode::SpiI2C.
This is an active object: it has its own thread of control.

Public Types | |
| using | cb_t = stdext::inplace_function< void(i2c::op_t, i2c::status)> |
| Represents the type of the callback operation. More... | |
| using | sweep_list_t = etl::vector< uint8_t, 128 > |
| using | sweep_cb_t = stdext::inplace_function< void(void)> |
Public Member Functions | |
| aardvarkI2CMaster (aardvarkAdapter &master) noexcept | |
| Construct a generic I2C master. More... | |
| aardvarkI2CMaster (aardvarkAdapter &master, const char *name) noexcept | |
| Construct a named I2C master. More... | |
| ~aardvarkI2CMaster () noexcept final | |
| Default destructor. More... | |
| void | process_ (const storagePair_t &op) noexcept |
| Active object process function. More... | |
| virtual void | configure (i2c::baud baud, i2c::pullups pull=i2c::pullups::external) noexcept |
| Configure the I2C bus. More... | |
| i2c::state | state () const noexcept |
| Check the I2C bus status. More... | |
| i2c::pullups | pullups (i2c::pullups pullups) noexcept |
| Configure pull-ups. More... | |
| i2c::pullups | pullups () const noexcept |
| Check the pull-up configuration. More... | |
| void | sweep (sweep_list_t &found_list, const sweep_cb_t &cb) noexcept |
| Perform an I2C bus sweep to identify active devices. More... | |
| void | start () noexcept |
| Start the driver. More... | |
| void | stop () noexcept |
| Stop the driver. More... | |
| void | restart () noexcept |
| Restart the driver. More... | |
| type_safe::boolean | started () const noexcept |
| Check if the driver has been started. More... | |
| constexpr embvm::DriverType_t | DriverType () const noexcept |
| Returns the registered type ID of the driver. More... | |
| constexpr const std::string_view & | name () const noexcept |
| Provides a string_view reference of the driver name. More... | |
| constexpr const char * | name_cstr () const noexcept |
| Provides a c-string version of the driver name. More... | |
| virtual DriverBase & | operator++ () noexcept |
| Increment operator is a no-op, but is used for iterator compatibility. More... | |
| size_t | queuedCount () const noexcept |
| Get the number of operations in the queue. More... | |
| bool | enqueue (std::pair< embvm::i2c::op_t, const embvm::i2c::master::cb_t > t) noexcept |
| Add an operation to the queue. More... | |
| void | shutdown () noexcept |
| Shutdown the active object. More... | |
Static Public Member Functions | |
| static constexpr embvm::DriverType | type () noexcept |
| I2C Driver Type ID. More... | |
Protected Attributes | |
| i2c::pullups | pullups_ = i2c::pullups::external |
| Tracks the active pull-up configuration. More... | |
| i2c::state | state_ = i2c::state::idle |
| Tracks the status of the I2C bus. More... | |
| type_safe::boolean | started_ = false |
| Tracks the driver state. More... | |
| const std::string_view | name_ |
| Name of the driver instance. More... | |
| const embvm::DriverType_t | type_ |
| Type ID of the driver instance. More... | |
Private Types | |
| using | storagePair_t = std::pair< embvm::i2c::op_t, const embvm::i2c::master::cb_t > |
| The storage type that the active object stores. More... | |
Private Member Functions | |
| void | configure_ (embvm::i2c::pullups pullup) noexcept final |
| Configure the I2C bus for operation. More... | |
| embvm::i2c::status | transfer_ (const embvm::i2c::op_t &op, const embvm::i2c::master::cb_t &cb) noexcept final |
| embvm::i2c::baud | baudrate_ (embvm::i2c::baud baud) noexcept final |
| embvm::i2c::pullups | setPullups_ (embvm::i2c::pullups pullups) noexcept final |
| Configure pull-ups. More... | |
| void | start_ () noexcept final |
| Derived classes override the start_ method to control driver-specific startup behavior. More... | |
| void | stop_ () noexcept final |
| Derived classes override the start_ method to control driver-specific startup behavior. More... | |
Private Attributes | |
| aardvarkAdapter & | master_ |
| The aardvarkAdapter instance associated with this driver. More... | |
|
inherited |
Represents the type of the callback operation.
|
private |
The storage type that the active object stores.
|
inherited |
|
inherited |
|
inlineexplicitnoexcept |
Construct a generic I2C master.
| master | The aardvarkAdapter instance associated with this driver. |
|
inlineexplicitnoexcept |
Construct a named I2C master.
| master | The aardvarkAdapter instance associated with this driver. |
| name | The name of the driver. |
|
finaldefaultnoexcept |
Default destructor.
|
finalprivatevirtualnoexcept |
Implements embvm::i2c::master.
References aa_i2c_bitrate(), assert, and INPUT_BAUDRATE_TO_AARDVARK_CONV_FACTOR.
|
inlinevirtualnoexceptinherited |
Configure the I2C bus.
Configures the I2C bus for operation and sets the target baud rate and pull-ups.
Derived classes must implement the configure_() function to set up the target hardware.
| baud | The target baudrate (as an i2c::baud enumeration rather than integral Hz). TODO: Tolerance - allowed relative tolerance for the resulting baudrate |
| pull | The pullup setting, which defaults to external pull-ups (in hardware). |
References embvm::i2c::master::configure_(), and embvm::i2c::master::pullups().
Referenced by embvm::i2c::activeMaster< 128 >::configure_(), and FWDemoSimulatorHWPlatform::init_().
|
finalprivatevirtualnoexcept |
Configure the I2C bus for operation.
This function is implemented by the derived class. It is responsible for configuring the target hardware for operation.
| pullups | The target pull-up configuration. |
Implements embvm::i2c::master.
References aa_i2c_bus_timeout(), assert, and bus_timeout_ms.
|
inlinenoexceptinherited |
Returns the registered type ID of the driver.
When using DriverBase interfaces, clients can retrieve the registered driver type in order to up-cast to the correct interface.
The type is returned as a embvm::DriverType_t rather than a embvm::DriverType enum to work with custom user-defined types. Enforcing a embvm::DriverType return value would prevent clients from defining and using their own custom types.
References embvm::DriverBase::type_.
|
inlinenoexceptinherited |
Add an operation to the queue.
This function can be called directly, or by functions internal to the activeObject. For example, the "transfer" API enqueues transfer operations.
This function is marked noexcept because we want the program to terminate if an exception results from this call. For example, the underlying queue may throw on push.
| t | The operation data object to enqueue for later processing. |
|
inlinenoexceptinherited |
Provides a string_view reference of the driver name.
std::string_view ref containing the driver name. References embvm::DriverBase::name_.
|
inlinenoexceptinherited |
Provides a c-string version of the driver name.
References embvm::DriverBase::name_.
|
inlinevirtualnoexceptinherited |
Increment operator is a no-op, but is used for iterator compatibility.
|
noexcept |
Active object process function.
References aa_i2c_free_bus(), AA_I2C_NO_FLAGS, AA_I2C_NO_STOP, aa_i2c_read_ext(), AA_I2C_WRITE_ERROR, aa_i2c_write_ext(), aa_i2c_write_read(), AA_OK, assert, embvm::i2c::continueWriteNoStop, embvm::i2c::continueWriteStop, convertI2CTransactionErrorCode(), embvm::i2c::ping, r, embvm::i2c::read, embvm::i2c::restart, embvm::i2c::stop, embvm::i2c::write, embvm::i2c::writeNoStop, and embvm::i2c::writeRead.
|
inlinenoexceptinherited |
Configure pull-ups.
| pullups | The target pull-up setting. |
References embvm::i2c::master::pullups_, and embvm::i2c::master::setPullups_().
Referenced by embvm::i2c::activeMaster< 128 >::setPullups_().
|
inlinenoexceptinherited |
Check the pull-up configuration.
References embvm::i2c::master::pullups_.
Referenced by embvm::i2c::master::configure(), nRF51i2cMaster_Blocking< TTWIIndex, TSclPin, TSdaPin >::setPullups_(), and nRFi2cMaster< NordicTWIM0, nRFPinID< 0, 27 >, nRFPinID< 0, 26 > >::setPullups_().
|
inlinenoexceptinherited |
Get the number of operations in the queue.
|
inlinenoexceptinherited |
Restart the driver.
Calls stop() and then start() on the driver. If the driver is not started, then it will be started after the start() function is invoked.
References embvm::DriverBase::start(), and embvm::DriverBase::stop().
|
finalprivatevirtualnoexcept |
Configure pull-ups.
This function is implemented by the derived class. It is responsible for configuring the target hardware to use the requested pullup setting.
| pullups | The target pull-up setting. |
Implements embvm::i2c::master.
References assert, and embvm::i2c::external.
|
inlinenoexceptinherited |
Shutdown the active object.
Call this function in the parent class destructor to stop the AO thread operation before destroying the parent class. This will prevent memory access problems due to race conidtions during destruction.
This function is marked noexcept because we want the program to terminate if an exception results from this call.
The shutdown process is permanent and cannot be reversed without recreating the object.
|
inlinenoexceptinherited |
Start the driver.
If the driver is not started, call the start_() function defined by the derived class. (Template Method Pattern)
References embvm::DriverBase::start_(), and embvm::DriverBase::started_.
Referenced by NRF52DongleHWPlatform::init_(), NRF52DKHWPlatform::init_(), BlinkySimulatorHWPlatform::init_(), FWDemoSimulatorHWPlatform::init_(), FrameworkDemoSimPlatform::initHWPlatform_(), embvm::DriverBase::restart(), embvm::timer::Timer::restart(), embvm::spi::activeMaster< TQueueSize, TLock, TCond >::start_(), embvm::i2c::activeMaster< 128 >::start_(), embdrv::aardvarkSPIMaster::start_(), start_(), embdrv::aardvarkGPIOInput< 4 >::start_(), embdrv::vl53l1x::start_(), embdrv::aardvarkGPIOOutput< 5 >::start_(), BlinkySimulatorHWPlatform::startBlink(), and FWDemoSimulatorHWPlatform::startLEDTimer().
|
finalprivatevirtualnoexcept |
Derived classes override the start_ method to control driver-specific startup behavior.
(Template Method Pattern)
Implements embvm::i2c::master.
References embvm::DriverBase::start().
|
inlinenoexceptinherited |
Check if the driver has been started.
true if the driver is running (started), false if not running (stopped). References embvm::DriverBase::started_.
Referenced by embdrv::aardvarkSPIMaster::configure_(), embdrv::aardvarkGPIOInput< 4 >::get(), embdrv::aardvarkGPIOOutput< 5 >::set(), embdrv::vl53l1x::start_(), embdrv::aardvarkAdapter::start_(), and embdrv::aardvarkAdapter::stop_().
|
inlinenoexceptinherited |
Check the I2C bus status.
References embvm::i2c::master::state_.
|
inlinenoexceptinherited |
Stop the driver.
If the driver has been started, call the stop_() function defined by the derived class. (Template Method Pattern)
References embvm::DriverBase::started_, and embvm::DriverBase::stop_().
Referenced by embvm::DriverBase::restart(), embvm::timer::Timer::restart(), embvm::spi::activeMaster< TQueueSize, TLock, TCond >::stop_(), embvm::i2c::activeMaster< 128 >::stop_(), embdrv::aardvarkSPIMaster::stop_(), stop_(), embdrv::aardvarkGPIOInput< 4 >::stop_(), embdrv::aardvarkGPIOOutput< 5 >::stop_(), FWDemoSimulatorHWPlatform::~FWDemoSimulatorHWPlatform(), and embdrv::SimulatorTimer::~SimulatorTimer().
|
finalprivatevirtualnoexcept |
Derived classes override the start_ method to control driver-specific startup behavior.
(Template Method Pattern)
Implements embvm::i2c::master.
References master_, and embvm::DriverBase::stop().
|
noexceptinherited |
Perform an I2C bus sweep to identify active devices.
The sweep function pings all I2C addresses. Devices which ACK are stored in a list and returned via callback.
| [in,out] | found_list | Caller's memory which will contain the successfully found ping addresses |
| [in] | cb | The callback which will be called to indicate that the sweep is complete. After the cb is called, found_list is valid and can be used by the caller. |
References embvm::i2c::op_t::address, embvm::i2c::busy, I2C_ADDR_MAX, and embvm::i2c::op_t::op.
|
finalprivatevirtualnoexcept |
Implements embvm::i2c::master.
References embvm::i2c::enqueued.
|
inlinestaticnoexceptinherited |
|
private |
The aardvarkAdapter instance associated with this driver.
Referenced by stop_().
|
protectedinherited |
Name of the driver instance.
Referenced by embvm::DriverBase::name(), and embvm::DriverBase::name_cstr().
|
protectedinherited |
Tracks the active pull-up configuration.
Referenced by embvm::i2c::master::pullups().
|
protectedinherited |
Tracks the driver state.
True if the driver has been started, false if it has been stopped or not yet started.
Referenced by embvm::DriverBase::start(), embvm::DriverBase::started(), and embvm::DriverBase::stop().
|
protectedinherited |
Tracks the status of the I2C bus.
Referenced by embvm::i2c::master::state().
|
protectedinherited |
Type ID of the driver instance.
Referenced by embvm::DriverBase::DriverType().
| class embdrv::aardvarkSPIMaster |
Create an Aardvark SPI Master Driver.
This driver requires an aardvarkAdapter to work. The aardvark adapter must be configured with aardvarkMode::SpiGpio or aardvarkMode::SpiI2C.
This is an active object: it has its own thread of control.

Public Member Functions | |
| aardvarkSPIMaster (aardvarkAdapter &master) noexcept | |
| Construct a generic SPI master. More... | |
| aardvarkSPIMaster (aardvarkAdapter &master, const char *name) noexcept | |
| Construct a named SPI master. More... | |
| ~aardvarkSPIMaster () noexcept final | |
| Default destructor. More... | |
| void | process_ (const storagePair_t &op) noexcept |
| Active object process function. More... | |
| virtual void | configure (spi::baud_t baud) noexcept |
| Configure the SPI bus. More... | |
| spi::mode | mode () const noexcept |
| Get the current SPI bus mode. More... | |
| spi::mode | mode (spi::mode mode) noexcept |
| Set the SPI bus mode. More... | |
| spi::order | order () const noexcept |
| Get the current SPI bus byte order. More... | |
| spi::order | order (spi::order order) noexcept |
| Set the SPI bus byte order. More... | |
| void | start () noexcept |
| Start the driver. More... | |
| void | stop () noexcept |
| Stop the driver. More... | |
| void | restart () noexcept |
| Restart the driver. More... | |
| type_safe::boolean | started () const noexcept |
| Check if the driver has been started. More... | |
| constexpr embvm::DriverType_t | DriverType () const noexcept |
| Returns the registered type ID of the driver. More... | |
| constexpr const std::string_view & | name () const noexcept |
| Provides a string_view reference of the driver name. More... | |
| constexpr const char * | name_cstr () const noexcept |
| Provides a c-string version of the driver name. More... | |
| virtual DriverBase & | operator++ () noexcept |
| Increment operator is a no-op, but is used for iterator compatibility. More... | |
| size_t | queuedCount () const noexcept |
| Get the number of operations in the queue. More... | |
| bool | enqueue (std::pair< embvm::spi::op_t, const embvm::spi::master::cb_t > t) noexcept |
| Add an operation to the queue. More... | |
| void | shutdown () noexcept |
| Shutdown the active object. More... | |
Static Public Member Functions | |
| static constexpr embvm::DriverType | type () noexcept |
| SPI Driver Type ID. More... | |
Protected Member Functions | |
| embvm::comm::status | transfer_ (const spi::op_t &op, const cb_t &cb) noexcept override=0 |
Protected Attributes | |
| spi::mode | mode_ = spi::mode::mode0 |
| Stores the active SPI mode configuration. More... | |
| spi::order | order_ = spi::order::msbFirst |
| Stores the active SPI byte ordering. More... | |
| type_safe::boolean | started_ = false |
| Tracks the driver state. More... | |
| const std::string_view | name_ |
| Name of the driver instance. More... | |
| const embvm::DriverType_t | type_ |
| Type ID of the driver instance. More... | |
Private Types | |
| using | storagePair_t = std::pair< embvm::spi::op_t, const embvm::spi::master::cb_t > |
| The storage type that the active object stores. More... | |
Private Member Functions | |
| void | start_ () noexcept final |
| Derived classes override the start_ method to control driver-specific startup behavior. More... | |
| void | stop_ () noexcept final |
| Derived classes override the start_ method to control driver-specific startup behavior. More... | |
| void | configure_ () noexcept final |
| Configure the SPI bus for operation. More... | |
| uint32_t | baudrate_ (uint32_t baud) noexcept final |
| embvm::comm::status | transfer_ (const embvm::spi::op_t &op, const embvm::spi::master::cb_t &cb) noexcept final |
| void | setMode_ (embvm::spi::mode mode) noexcept final |
| Set the SPI bus mode. More... | |
| void | setOrder_ (embvm::spi::order order) noexcept final |
| Set the SPI bus byte order. More... | |
Private Attributes | |
| aardvarkAdapter & | master_ |
| The aardvarkAdapter instance associated with this driver. More... | |
|
private |
The storage type that the active object stores.
|
inlineexplicitnoexcept |
Construct a generic SPI master.
| master | The aardvarkAdapter instance associated with this driver. |
|
inlineexplicitnoexcept |
Construct a named SPI master.
| master | The aardvarkAdapter instance associated with this driver. |
| name | The name of the driver. |
|
finaldefaultnoexcept |
Default destructor.
Implements embvm::spi::master.
References aa_spi_bitrate(), assert, and INPUT_BAUDRATE_TO_AARDVARK_CONV_FACTOR.
|
inlinevirtualnoexceptinherited |
Configure the SPI bus.
Configures the SPI bus for operation and sets the target baud rate.
Derived classes must implement the configure_() function to set up the target hardware.
| baud | The target baudrate, in Hz. TODO: Tolerance - allowed relative tolerance for the resulting baudrate |
References embvm::spi::master::configure_().
|
finalprivatevirtualnoexcept |
Configure the SPI bus for operation.
This function is implemented by the derived class. It is responsible for configuring the target hardware for operation.
Implements embvm::spi::master.
References AA_SPI_BITORDER_LSB, AA_SPI_BITORDER_MSB, aa_spi_configure(), embdrv::aardvarkAdapter::handle(), embdrv::aardvarkAdapter::lock(), master_, embvm::spi::master::mode_, embvm::spi::msbFirst, embvm::spi::master::order_, embvm::DriverBase::started(), and embdrv::aardvarkAdapter::unlock().
|
inlinenoexceptinherited |
Returns the registered type ID of the driver.
When using DriverBase interfaces, clients can retrieve the registered driver type in order to up-cast to the correct interface.
The type is returned as a embvm::DriverType_t rather than a embvm::DriverType enum to work with custom user-defined types. Enforcing a embvm::DriverType return value would prevent clients from defining and using their own custom types.
References embvm::DriverBase::type_.
|
inlinenoexceptinherited |
Add an operation to the queue.
This function can be called directly, or by functions internal to the activeObject. For example, the "transfer" API enqueues transfer operations.
This function is marked noexcept because we want the program to terminate if an exception results from this call. For example, the underlying queue may throw on push.
| t | The operation data object to enqueue for later processing. |
|
inlinenoexceptinherited |
Get the current SPI bus mode.
References embvm::spi::master::mode_.
Referenced by embvm::spi::master::mode(), and embvm::spi::activeMaster< TQueueSize, TLock, TCond >::setMode_().
|
inlinenoexceptinherited |
Set the SPI bus mode.
Derived classes must implement the setMode_() function, which is reponsible for configuring the target hardware.
| mode | The desired SPI bus mode. |
References embvm::spi::master::mode(), embvm::spi::master::mode_, and embvm::spi::master::setMode_().
|
inlinenoexceptinherited |
Provides a string_view reference of the driver name.
std::string_view ref containing the driver name. References embvm::DriverBase::name_.
|
inlinenoexceptinherited |
Provides a c-string version of the driver name.
References embvm::DriverBase::name_.
|
inlinevirtualnoexceptinherited |
Increment operator is a no-op, but is used for iterator compatibility.
|
inlinenoexceptinherited |
Get the current SPI bus byte order.
References embvm::spi::master::order_.
Referenced by embvm::spi::master::order(), and embvm::spi::activeMaster< TQueueSize, TLock, TCond >::setOrder_().
|
inlinenoexceptinherited |
Set the SPI bus byte order.
Derived classes must implement the setOrder_() function, which is reponsible for configuring the target hardware.
| order | The desired byte ordering. |
References embvm::spi::master::order(), embvm::spi::master::order_, and embvm::spi::master::setOrder_().
|
noexcept |
Active object process function.
References AA_OK, AA_SPI_DROPPED_EXCESS_BYTES, AA_SPI_NOT_AVAILABLE, AA_SPI_NOT_ENABLED, AA_SPI_SLAVE_READ_ERROR, AA_SPI_SLAVE_TIMEOUT, aa_spi_write(), AA_SPI_WRITE_ERROR, embvm::comm::busy, embvm::comm::error, embvm::comm::ok, r, and embvm::comm::unknown.
|
inlinenoexceptinherited |
Get the number of operations in the queue.
|
inlinenoexceptinherited |
Restart the driver.
Calls stop() and then start() on the driver. If the driver is not started, then it will be started after the start() function is invoked.
References embvm::DriverBase::start(), and embvm::DriverBase::stop().
|
finalprivatevirtualnoexcept |
Set the SPI bus mode.
This function is implemented by the derived class. It is responsible for configuring the target hardware to use the new mode.
| mode | The desired byte ordering. |
Implements embvm::spi::master.
References assert, embvm::spi::mode0, and embvm::spi::mode3.
|
finalprivatevirtualnoexcept |
Set the SPI bus byte order.
This function is implemented by the derived class. It is responsible for configuring the target hardware to use the new byte ordering.
| order | The desired byte ordering. |
Implements embvm::spi::master.
|
inlinenoexceptinherited |
Shutdown the active object.
Call this function in the parent class destructor to stop the AO thread operation before destroying the parent class. This will prevent memory access problems due to race conidtions during destruction.
This function is marked noexcept because we want the program to terminate if an exception results from this call.
The shutdown process is permanent and cannot be reversed without recreating the object.
|
inlinenoexceptinherited |
Start the driver.
If the driver is not started, call the start_() function defined by the derived class. (Template Method Pattern)
References embvm::DriverBase::start_(), and embvm::DriverBase::started_.
Referenced by NRF52DongleHWPlatform::init_(), NRF52DKHWPlatform::init_(), BlinkySimulatorHWPlatform::init_(), FWDemoSimulatorHWPlatform::init_(), FrameworkDemoSimPlatform::initHWPlatform_(), embvm::DriverBase::restart(), embvm::timer::Timer::restart(), embvm::spi::activeMaster< TQueueSize, TLock, TCond >::start_(), embvm::i2c::activeMaster< 128 >::start_(), start_(), embdrv::aardvarkI2CMaster::start_(), embdrv::aardvarkGPIOInput< 4 >::start_(), embdrv::vl53l1x::start_(), embdrv::aardvarkGPIOOutput< 5 >::start_(), BlinkySimulatorHWPlatform::startBlink(), and FWDemoSimulatorHWPlatform::startLEDTimer().
|
finalprivatevirtualnoexcept |
Derived classes override the start_ method to control driver-specific startup behavior.
(Template Method Pattern)
Implements embvm::spi::master.
References embvm::DriverBase::start().
|
inlinenoexceptinherited |
Check if the driver has been started.
true if the driver is running (started), false if not running (stopped). References embvm::DriverBase::started_.
Referenced by configure_(), embdrv::aardvarkGPIOInput< 4 >::get(), embdrv::aardvarkGPIOOutput< 5 >::set(), embdrv::vl53l1x::start_(), embdrv::aardvarkAdapter::start_(), and embdrv::aardvarkAdapter::stop_().
|
inlinenoexceptinherited |
Stop the driver.
If the driver has been started, call the stop_() function defined by the derived class. (Template Method Pattern)
References embvm::DriverBase::started_, and embvm::DriverBase::stop_().
Referenced by embvm::DriverBase::restart(), embvm::timer::Timer::restart(), embvm::spi::activeMaster< TQueueSize, TLock, TCond >::stop_(), embvm::i2c::activeMaster< 128 >::stop_(), stop_(), embdrv::aardvarkI2CMaster::stop_(), embdrv::aardvarkGPIOInput< 4 >::stop_(), embdrv::aardvarkGPIOOutput< 5 >::stop_(), FWDemoSimulatorHWPlatform::~FWDemoSimulatorHWPlatform(), and embdrv::SimulatorTimer::~SimulatorTimer().
|
finalprivatevirtualnoexcept |
Derived classes override the start_ method to control driver-specific startup behavior.
(Template Method Pattern)
Implements embvm::spi::master.
References master_, and embvm::DriverBase::stop().
|
finalprivatenoexcept |
References embvm::comm::enqueued.
|
overrideprotectedpure virtualnoexceptinherited |
|
inlinestaticnoexceptinherited |
|
private |
The aardvarkAdapter instance associated with this driver.
Referenced by configure_(), and stop_().
|
protectedinherited |
Stores the active SPI mode configuration.
Referenced by configure_(), and embvm::spi::master::mode().
|
protectedinherited |
Name of the driver instance.
Referenced by embvm::DriverBase::name(), and embvm::DriverBase::name_cstr().
|
protectedinherited |
Stores the active SPI byte ordering.
Referenced by configure_(), and embvm::spi::master::order().
|
protectedinherited |
Tracks the driver state.
True if the driver has been started, false if it has been stopped or not yet started.
Referenced by embvm::DriverBase::start(), embvm::DriverBase::started(), and embvm::DriverBase::stop().
|
protectedinherited |
Type ID of the driver instance.
Referenced by embvm::DriverBase::DriverType().
|
strong |
Aardvark master operational modes.
|
inline |
The number of IO pins supported by the AARDVARK sensor.
Referenced by embdrv::aardvarkGPIOInput< 4 >::aardvarkGPIOInput(), and embdrv::aardvarkGPIOOutput< 5 >::aardvarkGPIOOutput().
|
inlinestatic |
aardvark IO pin IDs
Referenced by embdrv::aardvarkGPIOInput< 4 >::get(), embdrv::aardvarkAdapter::pullup(), embdrv::aardvarkGPIOOutput< 5 >::set(), and embdrv::aardvarkGPIOOutput< 5 >::start_().
1.8.15