uTL
micro Template library
|
A virtual base class interface specialization. Using the private virtual interface we provide the interface from i2c_i<virtual_tag> More...
#include <i2c_bb.h>
Public Types | |
enum | SDAMode { SDAMode::INPUT =0, SDAMode::OUTPUT } |
SDA pin direction enumerator. More... | |
using | type = i2c_bb_i< virtual_tag > |
Export type as identity meta-function. More... | |
using | Sequence = typename i2c_i< virtual_tag >::Sequence |
![]() | |
enum | Sequence { Sequence::BYTE =0, Sequence::ACK, Sequence::BYTEnACK } |
I2C transmit/receive sequence. More... | |
using | type = i2c_i< virtual_tag > |
Export type as identity meta-function. More... | |
Protected Member Functions | |
Object lifetime | |
i2c_bb_i (uint32_t clk) noexcept | |
Constructor. More... | |
virtual | ~i2c_bb_i () noexcept=default |
Virtual destructor. More... | |
![]() | |
i2c_i ()=default | |
Allow constructor from derived only. More... | |
i2c_i (const type &)=delete | |
No copies. More... | |
type & | operator= (const type &)=delete |
Private Member Functions | |
Implementation requirements | |
virtual bool | SDA (SDAMode mode, bool st)=0 |
virtual void | SCL (bool st)=0 |
Implementers's scl pin function. More... | |
virtual void | delay (uint32_t usec)=0 |
Implementation of base requirements | |
uint32_t | usec_ |
half period of I2C bus More... | |
uint32_t | _clock () const final |
void | _clock (uint32_t c) final |
set clock frequency of the bus [Hz] More... | |
void | _start () final |
Send a START bit to the bus. More... | |
void | _stop () final |
Send a START bit to the bus. More... | |
byte_t | _rx_data (bool ack, Sequence seq) final |
Receive a byte from the i2c bus. More... | |
bool | _tx_data (byte_t byte, Sequence seq) final |
Transmit a byte to the i2c bus. More... | |
Additional Inherited Members | |
![]() | |
uint32_t | clock () const |
void | clock (uint32_t c) |
set clock frequency of the bus [Hz] More... | |
void | start () |
void | stop () |
byte_t | rx_data (bool ack, Sequence seq=Sequence::BYTEnACK) |
Receive a byte from the i2c bus. More... | |
bool | tx_data (byte_t byte, Sequence seq=Sequence::BYTEnACK) |
Transmit a byte to the i2c bus. More... | |
virtual | ~i2c_i ()=default |
A virtual base class interface specialization. Using the private virtual interface we provide the interface from i2c_i<virtual_tag>
impl_t | = virtual_tag |
using utl::i2c_bb_i< virtual_tag >::Sequence = typename i2c_i<virtual_tag>::Sequence |
using utl::i2c_bb_i< virtual_tag >::type = i2c_bb_i<virtual_tag> |
|
strong |
|
inlineprotectednoexcept |
|
protectedvirtualdefaultnoexcept |
Virtual destructor.
|
inlinefinalprivatevirtual |
Implements utl::i2c_i< virtual_tag >.
|
inlinefinalprivatevirtual |
set clock frequency of the bus [Hz]
Implements utl::i2c_i< virtual_tag >.
|
finalprivatevirtual |
Receive a byte from the i2c bus.
ack | Optional ack bit.
|
seq | The operation sequence to execute
|
Implements utl::i2c_i< virtual_tag >.
|
finalprivatevirtual |
|
finalprivatevirtual |
|
finalprivatevirtual |
Transmit a byte to the i2c bus.
byte | The byte to send. |
seq | The operation sequence to execute
|
Implements utl::i2c_i< virtual_tag >.
|
privatepure virtual |
Implementers's usec delay function
|
privatepure virtual |
Implementers's scl pin function.
|
privatepure virtual |
Implementers's sda pin function
st | In SDA_OUTPUT mode, selects the pin output state |
|
private |