#include <nrf51_i2c_master.hpp>
|
| 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)> |
| |
template<unsigned TTWIIndex, typename TSclPin, typename TSdaPin>
class nRF51i2cMaster_Blocking< TTWIIndex, TSclPin, TSdaPin >
- Template Parameters
-
| TTWIIndex | The instance of the TWI to use. Can be 0 or 1. |
| TSclPin | A class representing the SCL pin. This is designed for use with nRFPinID<>: |
| TSdaPin | A class representing the SDA pin. This is designed for use with nRFPinID<>: |
◆ cb_t
Represents the type of the callback operation.
◆ sweep_cb_t
◆ sweep_list_t
◆ ~nRFi2cMaster_Blocking()
template<unsigned TTWIIndex, typename TSclPin , typename TSdaPin >
◆ baudrate_()
template<unsigned TTWIIndex, typename TSclPin , typename TSdaPin >
|
|
inlinefinalprivatevirtualnoexcept |
◆ configure()
|
|
inlinevirtualnoexceptinherited |
◆ configure_()
template<unsigned TTWIIndex, typename TSclPin , typename TSdaPin >
|
|
inlinefinalprivatevirtualnoexcept |
Configure the I2C bus for operation.
This function is implemented by the derived class. It is responsible for configuring the target hardware for operation.
- Parameters
-
| pullups | The target pull-up configuration. |
Implements embvm::i2c::master.
◆ DriverType()
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.
- Returns
- the registered driver type as a embvm::DriverType_t value
References embvm::DriverBase::type_.
◆ name()
| constexpr const std::string_view& embvm::DriverBase::name |
( |
| ) |
const |
|
inlinenoexceptinherited |
Provides a string_view reference of the driver name.
- Returns
std::string_view ref containing the driver name.
References embvm::DriverBase::name_.
◆ name_cstr()
| constexpr const char* embvm::DriverBase::name_cstr |
( |
| ) |
const |
|
inlinenoexceptinherited |
Provides a c-string version of the driver name.
- Returns
- c-string containing the driver name
References embvm::DriverBase::name_.
◆ nRFi2cMaster_Blocking() [1/2]
template<unsigned TTWIIndex, typename TSclPin , typename TSdaPin >
◆ nRFi2cMaster_Blocking() [2/2]
template<unsigned TTWIIndex, typename TSclPin , typename TSdaPin >
◆ operator++()
| virtual DriverBase& embvm::DriverBase::operator++ |
( |
| ) |
|
|
inlinevirtualnoexceptinherited |
Increment operator is a no-op, but is used for iterator compatibility.
◆ pullups() [1/2]
| i2c::pullups embvm::i2c::master::pullups |
( |
i2c::pullups |
pullups | ) |
|
|
inlinenoexceptinherited |
◆ pullups() [2/2]
| i2c::pullups embvm::i2c::master::pullups |
( |
| ) |
const |
|
inlinenoexceptinherited |
◆ restart()
| void embvm::DriverBase::restart |
( |
| ) |
|
|
inlinenoexceptinherited |
◆ setPullups_()
template<unsigned TTWIIndex, typename TSclPin , typename TSdaPin >
|
|
inlinefinalprivatevirtualnoexcept |
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.
- Parameters
-
| pullups | The target pull-up setting. |
- Returns
- The configured pull-up setting.
Implements embvm::i2c::master.
References embvm::i2c::master::pullups().
◆ start()
| void embvm::DriverBase::start |
( |
| ) |
|
|
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().
◆ start_()
template<unsigned TTWIIndex, typename TSclPin , typename TSdaPin >
|
|
inlinefinalprivatevirtualnoexcept |
◆ started()
| type_safe::boolean embvm::DriverBase::started |
( |
| ) |
const |
|
inlinenoexceptinherited |
◆ state()
| i2c::state embvm::i2c::master::state |
( |
| ) |
const |
|
inlinenoexceptinherited |
◆ stop()
| void embvm::DriverBase::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().
◆ stop_()
template<unsigned TTWIIndex, typename TSclPin , typename TSdaPin >
|
|
inlinefinalprivatevirtualnoexcept |
◆ sweep()
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.
- Parameters
-
| [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.
◆ transfer_()
template<unsigned TTWIIndex, typename TSclPin , typename TSdaPin >
|
|
inlinefinalprivatevirtualnoexcept |
Implements embvm::i2c::master.
References embvm::i2c::continueWriteNoStop, embvm::i2c::continueWriteStop, nRFTWITranslator::NO_STOP, embvm::i2c::ok, embvm::i2c::ping, embvm::i2c::read, embvm::i2c::restart, nRFTWITranslator::set_transfer_address(), nRFTWITranslator::STOP, embvm::i2c::stop, nRFTWITranslator::stop_condition(), embvm::i2c::write, embvm::i2c::writeNoStop, and embvm::i2c::writeRead.
◆ type()
|
|
inlinestaticnoexceptinherited |
I2C Driver Type ID.
- Returns
- I2C type ID.
References embvm::I2C.
◆ name_
| const std::string_view embvm::DriverBase::name_ |
|
protectedinherited |
◆ pullups_
| i2c::pullups embvm::i2c::master::pullups_ = i2c::pullups::external |
|
protectedinherited |
◆ started_
| type_safe::boolean embvm::DriverBase::started_ = false |
|
protectedinherited |
◆ state_
◆ type_
The documentation for this class was generated from the following file: