theCore C++ embedded framework
|
Data Structures | |
struct | ecl::skel::spi_cfg< ch > |
Base template class for the SPI configuration. More... | |
class | ecl::skel::spi< ch > |
Driver implementation for SPI. More... | |
Enumerations | |
enum | ecl::skel::spi_channel { ecl::skel::spi_channel::ch1, ecl::skel::spi_channel::ch2, ecl::skel::spi_channel::ch3 } |
List of avaliable SPI channels. More... | |
enum | ecl::skel::spi_type { ecl::skel::spi_type::master } |
SPI master/slave selection. More... | |
enum | ecl::skel::spi_cpol { ecl::skel::spi_cpol::low, ecl::skel::spi_cpol::high } |
SPI clock polarity. More... | |
enum | ecl::skel::spi_cpha { ecl::skel::spi_cpha::low, ecl::skel::spi_cpha::high } |
SPI clock phase. More... | |
Functions | |
static ecl::err | ecl::skel::spi< ch >::init () |
Lazy initialization. More... | |
static void | ecl::skel::spi< ch >::set_rx (uint8_t *rx, size_t size) |
Sets rx buffer with given size. More... | |
static void | ecl::skel::spi< ch >::set_tx (size_t size, uint8_t fill_byte=0xff) |
Sets tx buffer made-up from sequence of similar bytes. More... | |
static void | ecl::skel::spi< ch >::set_tx (const uint8_t *tx, size_t size) |
Sets tx buffer with given size. More... | |
static void | ecl::skel::spi< ch >::set_handler (const handler_fn &handler) |
Sets event handler. More... | |
static void | ecl::skel::spi< ch >::reset_buffers () |
Reset xfer buffers. More... | |
static void | ecl::skel::spi< ch >::reset_handler () |
Resets previously set handler. More... | |
static ecl::err | ecl::skel::spi< ch >::do_xfer () |
Executes xfer, using buffers previously set. More... | |
static void | ecl::skel::spi< ch >::enable_circular_mode () |
Enables circular mode for the bus. More... | |
static void | ecl::skel::spi< ch >::disable_circular_mode () |
Disables circular mode for the bus. More... | |
static bool | ecl::skel::spi< ch >::is_circular_mode () |
Returns the circular mode state. More... | |
static void | ecl::skel::spi< ch >::irq_handler () |
SPI interrupt handler. More... | |
|
strong |
|
strong |
|
strong |
|
strong |
|
static |
Lazy initialization.
|
static |
Sets rx buffer with given size.
[in,out] | rx | Buffer to write data to. Optional. |
[in] | size | Size |
|
static |
Sets tx buffer made-up from sequence of similar bytes.
[in] | size | Size of sequence |
[in] | fill_byte | Byte to fill a sequence. Optional. |
|
static |
Sets tx buffer with given size.
[in] | tx | Buffer to transmit. Optional. |
[in] | size | Buffer size. |
|
static |
Sets event handler.
Handler will be used by the bus, until reset_handler() will be called.
[in] | handler | Handler itself. |
|
static |
|
static |
Resets previously set handler.
|
static |
Executes xfer, using buffers previously set.
When xfer is done, handler will be invoked.
|
static |
Enables circular mode for the bus.
In circular mode when xfer is finished, the new xfer is started automatically without interruption. The same buffer is used. The process continues until circular mode is disabled. This method must not be called during xfer().
|
static |
Disables circular mode for the bus.
This method allows to stop xfer() that was started with circular mode. It is recommended to call this method in event handler during processing of the HT or TC event. The xfer is always stopped after TC. If circular mode is disabled during processing of the TC (or between HT and TC), the xfer will be stopped immediately after current TC will be processed. If circular mode is disabled during processing of the HT (or between TC and HT), the xfer will be finished after next TC will be processed. This method also can be called when xfer() is not active.
|
static |
Returns the circular mode state.
|
staticprotected |
SPI interrupt handler.
Receives interrupt from IRQ subsystem.