theCore C++ embedded framework
|
Data Structures | |
struct | ecl::sdspi_state |
Struct to hold SDSPI driver state, resulting from SDSPI API calls. More... | |
struct | ecl::sdspi_card_info |
SDSPI card information struct. More... | |
class | ecl::sdspi< spi_dev, gpio_cs > |
SDSPI driver class. More... | |
Functions | |
static err | ecl::sdspi< spi_dev, gpio_cs >::init () |
Initializes SDSPI driver and SD card. More... | |
static err | ecl::sdspi< spi_dev, gpio_cs >::deinit () |
De-initializes SDSPI driver and SD card. More... | |
static err | ecl::sdspi< spi_dev, gpio_cs >::write (const uint8_t *data, size_t &count) |
Writes given data to SD card from current offset. More... | |
static err | ecl::sdspi< spi_dev, gpio_cs >::read (uint8_t *data, size_t &count) |
Reads data from SD card from current offset to given buffer. More... | |
static err | ecl::sdspi< spi_dev, gpio_cs >::flush () |
Flushes cached data. More... | |
static err | ecl::sdspi< spi_dev, gpio_cs >::seek (off_t offt) |
Seeks to the given position, in bytes. More... | |
static err | ecl::sdspi< spi_dev, gpio_cs >::tell (off_t &offt) |
Tells current position. More... | |
static constexpr size_t | ecl::sdspi< spi_dev, gpio_cs >::get_block_length () |
Returns a length of a block. More... | |
static err | ecl::sdspi< spi_dev, gpio_cs >::get_info (sdspi_card_info &info) |
Gets card info. More... | |
static const sdspi_state & | ecl::sdspi< spi_dev, gpio_cs >::get_state () |
Gets state of the driver, resulted from last API call. More... | |
|
static |
Initializes SDSPI driver and SD card.
err::io | I/O error on SPI. |
err::generic | Operation failed. Use get_state() to get more information. |
err::ok | Operation succeed. |
|
static |
De-initializes SDSPI driver and SD card.
err::io | I/O error on SPI. |
err::generic | Operation failed. Use get_state() to get more information. |
err::ok | Operation succeed. |
|
static |
Writes given data to SD card from current offset.
Data written may be a subject to caching. Use flush() call to make sure that all data is written to SD card.
[in] | data | Data to write. |
[in,out] | count | Data size in bytes to write on entry. Data bytes actually written on exit. |
err::io | I/O error on SPI. |
err::generic | Operation failed. Use get_state() to get more information. |
err::ok | Operation succeed. |
|
static |
Reads data from SD card from current offset to given buffer.
[out] | data | Buffer to store data into. |
[in,out] | count | Data size in bytes to read on entry. Data bytes actually read on exit. |
err::io | I/O error on SPI. |
err::generic | Operation failed. Use get_state() to get more information. |
err::ok | Operation succeed. |
|
static |
Flushes cached data.
err::io | I/O error on SPI. |
err::generic | Operation failed. Use get_state() to get more information. |
err::ok | Operation succeed. |
|
static |
Seeks to the given position, in bytes.
extend it with seekdir::cur and seekdir::end
how to catch end-of-space on SD card?
[in] | offt | New offset in bytes. |
err::io | I/O error on SPI. |
err::generic | Operation failed. Use get_state() to get more information. |
err::ok | Operation succeed. |
|
static |
Tells current position.
[out] | offt | Current offset. |
err::io | I/O error on SPI. |
err::generic | Operation failed. Use get_state() to get more information. |
err::ok | Operation succeed. |
|
static |
Returns a length of a block.
|
static |
Gets card info.
[out] | info | Card info. |
err::io | I/O error on SPI. |
err::generic | Operation failed. Use get_state() to get more information. |
err::ok | Operation succeed. |
|
static |
Gets state of the driver, resulted from last API call.