uTL
micro Template library
|
A virtual base class implementation. More...
#include <spi.h>
Public Types | |
using | type = spi_i< virtual_tag > |
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... | |
Private Member Functions | |
Implementation requirements | |
virtual uint32_t | _clock () const =0 |
Read the clock frequency of the bus. More... | |
virtual void | _clock (uint32_t)=0 |
Set the clock frequency of the bus. More... | |
virtual byte_t | _tx_data (byte_t)=0 |
Object lifetime | |
spi_i ()=default | |
Allow constructor from derived only. More... | |
spi_i (const type &)=delete | |
No copies. More... | |
type & | operator= (const type &)=delete |
virtual | ~spi_i ()=default |
A virtual base class implementation.
none |
using utl::spi_i< virtual_tag >::type = spi_i<virtual_tag> |
|
protecteddefault |
Allow constructor from derived only.
|
protecteddelete |
No copies.
|
virtualdefault |
Virtual default destructor
|
privatepure virtual |
Read the clock frequency of the bus.
Implemented in utl::spi_bb_i< virtual_tag, CPOL, CPHA, BitOrder >.
|
privatepure virtual |
Set the clock frequency of the bus.
Implemented in utl::spi_bb_i< virtual_tag, CPOL, CPHA, BitOrder >.
|
privatepure virtual |
Transmit a byte on the bus and return the response
Implemented in utl::spi_bb_i< virtual_tag, CPOL, CPHA, BitOrder >.
|
inline |
|
inline |
|
protecteddelete |
|
inline |
size_t utl::spi_i< virtual_tag >::rx_data | ( | byte_t * | in, |
size_t | n | ||
) |
|
inline |
size_t utl::spi_i< virtual_tag >::tx_data | ( | const byte_t * | out, |
byte_t * | in, | ||
size_t | n | ||
) |