theCore C++ embedded framework
ecl::sdspi< spi_dev, gpio_cs > Class Template Reference

SDSPI driver class. More...

#include </home/travis/build/forGGe/theCore/dev/sdspi/export/dev/sdspi.hpp>

Public Types

enum  seekdir { seekdir::beg = 0, seekdir::cur = 1, seekdir::end = 2 }
 Seek flags. More...
 

Static Public Member Functions

static err init ()
 Initializes SDSPI driver and SD card. More...
 
static err deinit ()
 De-initializes SDSPI driver and SD card. More...
 
static err write (const uint8_t *data, size_t &count)
 Writes given data to SD card from current offset. More...
 
static err read (uint8_t *data, size_t &count)
 Reads data from SD card from current offset to given buffer. More...
 
static err flush ()
 Flushes cached data. More...
 
static err seek (off_t offt)
 Seeks to the given position, in bytes. More...
 
static err tell (off_t &offt)
 Tells current position. More...
 
static err get_info (sdspi_card_info &info)
 Gets card info. More...
 
static const sdspi_stateget_state ()
 Gets state of the driver, resulted from last API call. More...
 
static constexpr size_t get_block_length ()
 Returns a length of a block. More...
 

Detailed Description

template<class spi_dev, class gpio_cs>
class ecl::sdspi< spi_dev, gpio_cs >

SDSPI driver class.

Template Parameters
spi_devSPI bus driver
gpio_csChip-select GPIO
Todo:
mention about 8 additional clocks before each command!!!

Driver follows SDSPI specification that can be obtained here: https://www.sdcard.org/downloads/pls/

Member Enumeration Documentation

◆ seekdir

template<class spi_dev, class gpio_cs>
enum ecl::sdspi::seekdir
strong

Seek flags.

Enumerator
beg 
cur 

Seek relative to the beginning.

end 

Seek relative to the current position.


The documentation for this class was generated from the following file: