uTL
micro Template library
|
A bit banking implementation of spi bus inherited from spi_i base class. More...
#include <spi_bb.h>
Public Types | |
using | type = spi_bb_i< impl_t, CPOL, CPHA, BitOrder > |
Export type as identity meta-function. More... | |
Public Types inherited from utl::spi_i< spi_bb_i< impl_t, CPOL, CPHA, BitOrder > > | |
using | type = spi_i< spi_bb_i< impl_t, CPOL, CPHA, BitOrder > > |
Export type as identity meta-function. More... | |
Protected Member Functions | |
Object lifetime | |
~spi_bb_i ()=default | |
spi_bb_i (uint32_t clk) noexcept | |
A default constructor. More... | |
Protected Member Functions inherited from utl::spi_i< spi_bb_i< impl_t, CPOL, CPHA, BitOrder > > | |
spi_i ()=default | |
Allow constructor from derived only. More... | |
spi_i (const type &)=delete | |
No copies. More... | |
~spi_i ()=default | |
Allow destructor from derived only. More... | |
type & | operator= (const type &)=delete |
Private Member Functions | |
_CRTP_IMPL (impl_t) | |
Implementation requirements | |
}
| |
void | MOSI (bool st) |
Implementers's MOSI pin function. More... | |
bool | MISO () |
Implementers's MISO pin function. More... | |
void | SCLK (bool st) |
Implementers's SCLK pin function. More... | |
void | delay (uint32_t nsec) |
Implementation of base requirements | |
uint32_t | _clock () const |
void | _clock (uint32_t c) |
byte_t | _tx_data (byte_t out) |
template<spi::cpha C = CPHA> | |
meta::enable_if_t<(C==spi::cpha::LOW), byte_t > | _tx_data_impl (byte_t out) |
_tx_data implementation for CPHA == LOW Out at preceding clock trailing edge, In at leading clock edge More... | |
template<spi::cpha C = CPHA> | |
meta::enable_if_t<(C==spi::cpha::HIGH), byte_t > | _tx_data_impl (byte_t out) |
_tx_data implementation CPHA == HIGH Out at leading clock edge, In at trailing clock edge More... | |
Private Attributes | |
friend | spi_i< spi_bb_i< impl_t, CPOL, CPHA, BitOrder > > |
Syntactic sugar to CRTP casting. More... | |
uint32_t | nsec_ |
SPI implementation specific functions | |
static constexpr bool | clkH_ {clkHigh()} |
static constexpr bool | clkL_ {clkLow()} |
template<spi::bitOrder B = BitOrder> | |
constexpr meta::enable_if_t<(B==spi::bitOrder::LSB_First), void > | shift (byte_t &b) |
template<spi::bitOrder B = BitOrder> | |
constexpr meta::enable_if_t<(B==spi::bitOrder::MSB_First), void > | shift (byte_t &b) |
template<spi::cpol C = CPOL> | |
static constexpr bool | clkHigh () |
template<spi::cpol C = CPOL> | |
static constexpr bool | clkLow () |
Additional Inherited Members | |
Public Member Functions inherited from utl::spi_i< spi_bb_i< impl_t, CPOL, CPHA, BitOrder > > | |
uint32_t | clock () const |
void | clock (uint32_t c) |
set clock frequency of the bus More... | |
byte_t | tx_data (byte_t out) |
size_t | tx_data (const byte_t *out, byte_t *in, size_t n) |
Transmit a number of bytes to the spi bus and read the response. More... | |
byte_t | rx_data () |
size_t | rx_data (byte_t *in, size_t n) |
Receive a number of bytes from the spi bus while transmitting 0xFFs. More... | |
A bit banking implementation of spi bus inherited from spi_i base class.
SPI bit banking interface template class using CRTP. Using the private interface we provide the interface from spi_i<impl_t>
impl_t | The CRTP type (the derived/implementation class typename). |
CPOL | Clock polarity |
CPHA | Clock phase |
BitOrder | Data transfer bit order |
using utl::spi_bb_i< impl_t, CPOL, CPHA, BitOrder >::type = spi_bb_i<impl_t, CPOL, CPHA, BitOrder> |
|
protecteddefault |
A default destructor, allow destructor from derived only
|
inlineprotectednoexcept |
|
inlineprivate |
|
inlineprivate |
|
private |
|
inlineprivate |
|
private |
|
private |
|
inlinestaticprivate |
|
inlinestaticprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
staticprivate |
|
staticprivate |
|
private |
|
private |