uTL
micro Template library
|
#include <spi.h>
Public Types | |
using | type = spi_i< impl_t > |
Export type as identity meta-function. More... | |
Public Member Functions | |
Get/Set functions provided by the interface | |
uint32_t | clock () const |
void | clock (uint32_t c) |
set clock frequency of the bus More... | |
I/O functions provided by the interface | |
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... | |
Protected Member Functions | |
Object lifetime | |
spi_i ()=default | |
Allow constructor from derived only. More... | |
~spi_i ()=default | |
Allow destructor from derived only. More... | |
spi_i (const type &)=delete | |
No copies. More... | |
type & | operator= (const type &)=delete |
Private Member Functions | |
_CRTP_IMPL (impl_t) | |
Implementation requirements | |
| |
uint32_t | _clock () const |
clock frequency of the bus [Hz] More... | |
void | _clock (uint32_t c) |
set clock frequency of the bus [Hz] More... | |
byte_t | _tx_data (byte_t b) |
Template base class for SPI communication interface using CRTP This class force a common interface for SPI communication protocol implementations.
impl_t | The CRTP type (the derived/implementation class typename). |
using utl::spi_i< impl_t >::type = spi_i<impl_t> |
|
protecteddefault |
Allow constructor from derived only.
|
protecteddefault |
Allow destructor from derived only.
|
protecteddelete |
No copies.
|
inlineprivate |
|
inlineprivate |
|
private |
|
inlineprivate |
|
inline |
|
inline |
|
protecteddelete |
|
inline |
size_t utl::spi_i< _I >::rx_data | ( | byte_t * | in, |
size_t | n | ||
) |
|
inline |
size_t utl::spi_i< _I >::tx_data | ( | const byte_t * | out, |
byte_t * | in, | ||
size_t | n | ||
) |