uTL
micro Template library
|
A bit banking implementation of i2c bus inherited from i2c_i base class. More...
#include <i2c_bb.h>
Public Types | |
enum | SDAMode { SDAMode::INPUT =0, SDAMode::OUTPUT } |
SDA pin direction enumerator. More... | |
using | type = i2c_bb_i< impl_t > |
Export type as identity meta-function. More... | |
using | Sequence = typename i2c_i< type >::Sequence |
Public Types inherited from utl::i2c_i< i2c_bb_i< impl_t > > | |
enum | Sequence |
I2C transmit/receive sequence. More... | |
using | type = i2c_i< i2c_bb_i< impl_t > > |
Protected Member Functions | |
Object lifetime | |
~i2c_bb_i () noexcept=default | |
A default destructor, allow destructor from derived only. More... | |
i2c_bb_i (uint32_t clk) noexcept | |
A default constructor. More... | |
Protected Member Functions inherited from utl::i2c_i< i2c_bb_i< impl_t > > | |
i2c_i ()=default | |
Allow constructor from derived only. More... | |
i2c_i (const type &)=delete | |
No copies. More... | |
~i2c_i ()=default | |
Allow destructor from derived only. More... | |
type & | operator= (const type &)=delete |
Private Member Functions | |
_CRTP_IMPL (impl_t) | |
Implementation requirements | |
| |
bool | SDA (SDAMode mode, bool st) |
void | SCL (uint8_t st) |
Implementers's scl pin function. More... | |
void | delay (uint32_t usec) |
Private Attributes | |
friend | i2c_i< i2c_bb_i< impl_t > > |
Implementation of base requirements | |
uint32_t | usec_ |
uint32_t | _clock () const |
void | _clock (uint32_t c) |
void | _start () |
Send start functionality. More... | |
void | _stop () |
Send stop functionality. More... | |
byte_t | _rx_data (bool ack, Sequence seq) |
Receive a byte from the i2c bus. More... | |
bool | _tx_data (byte_t byte, Sequence seq) |
Transmit a byte to the i2c bus. More... | |
Additional Inherited Members | |
Public Member Functions inherited from utl::i2c_i< i2c_bb_i< impl_t > > | |
uint32_t | clock () const |
void | clock (uint32_t f) |
set clock frequency of the bus More... | |
void | start () |
Send start functionality. More... | |
void | stop () |
Send stop functionality. More... | |
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... | |
A bit banking implementation of i2c bus inherited from i2c_i base class.
I2C bit banking interface template class providing an I2C using bit banking using CRTP.
impl_t | The CRTP type (the derived/implementation class typename). |
using utl::i2c_bb_i< impl_t >::Sequence = typename i2c_i<type>::Sequence |
using utl::i2c_bb_i< impl_t >::type = i2c_bb_i<impl_t> |
|
strong |
|
protecteddefaultnoexcept |
A default destructor, allow destructor from derived only.
|
inlineprotectednoexcept |
|
inlineprivate |
|
inlineprivate |
|
private |
|
private |
Receive a byte from the i2c bus.
ack | Optional ack bit.
|
seq | The operation sequence to execute
|
|
private |
|
private |
|
private |
Transmit a byte to the i2c bus.
byte | The byte to send. |
seq | The operation sequence to execute
|
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
private |
|
private |