theCore C++ embedded framework
|
Data Structures | |
struct | ecl::spi_i2s_cfg< dev > |
Base template class for the SPI/I2S configuration. More... | |
class | ecl::spi_i2s_bus< dev > |
Driver implementation for SPI and I2S. More... | |
Enumerations | |
enum | ecl::spi_bus_type { ecl::spi_bus_type::spi, ecl::spi_bus_type::i2s } |
Defines type of the bus. More... | |
Functions | |
static ecl::err | ecl::spi_i2s_bus< dev >::init () |
Lazy initialization. More... | |
static void | ecl::spi_i2s_bus< dev >::set_rx (uint8_t *rx, size_t size) |
Sets rx buffer with given size. More... | |
static void | ecl::spi_i2s_bus< dev >::set_tx (size_t size, uint8_t fill_byte=0xff) |
Sets tx buffer made-up from sequence of similar bytes. More... | |
static void | ecl::spi_i2s_bus< dev >::set_tx (const uint8_t *tx, size_t size) |
Sets tx buffer with given size. More... | |
static void | ecl::spi_i2s_bus< dev >::set_handler (const handler_fn &handler) |
Sets event handler. More... | |
static void | ecl::spi_i2s_bus< dev >::reset_buffers () |
Reset xfer buffers. More... | |
static void | ecl::spi_i2s_bus< dev >::reset_handler () |
Resets previously set handler. More... | |
static ecl::err | ecl::spi_i2s_bus< dev >::do_xfer () |
Executes xfer, using buffers previously set. More... | |
template<ecl::i2s::audio_frequency frequency, class Iface_cfg = config> | |
static std::enable_if_t< Iface_cfg::bus_type==spi_bus_type::i2s, ecl::err > | ecl::spi_i2s_bus< dev >::i2s_set_audio_frequency () |
Sets audio frequency for I2S mode. More... | |
template<ecl::i2s::data_format format, class Iface_cfg = config> | |
static std::enable_if_t< Iface_cfg::bus_type==spi_bus_type::i2s, ecl::err > | ecl::spi_i2s_bus< dev >::i2s_set_data_format () |
Sets data format for I2S mode. More... | |
static void | ecl::spi_i2s_bus< dev >::enable_circular_mode () |
Enables circular mode for the bus. More... | |
static void | ecl::spi_i2s_bus< dev >::disable_circular_mode () |
Disables circular mode for the bus. More... | |
static bool | ecl::spi_i2s_bus< dev >::is_circular_mode () |
Returns the circular mode state. More... | |
|
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 it will be done, handler will be invoked.
|
static |
Sets audio frequency for I2S mode.
Is not used in SPI mode.
frequency | Can be a type of ecl::i2s::audio_frequency |
Iface_cfg | Used for correct enable_if mechanism. Must not be passed by user. |
|
static |
Sets data format for I2S mode.
Is not used in SPI mode.
format | Can be a type of ecl::i2s::data_format |
Iface_cfg | Used for correct enable_if mechanism. Must not be passed by user. |
|
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.