PropWare
3.0.0.229
C++ objects and CMake build system for Parallax Propeller
|
#include <libpropeller/libpropeller/sd/sdsafespi.h>
Public Member Functions | |
int | Start (const int basepin) |
int | Start (const int pin_do, const int pin_clk, const int pin_di, const int pin_cs) |
void | ReadBlock (const int block_index, char *buffer_address) |
void | WriteBlock (const int block_index, char *buffer_address) |
void | ReleaseCard (void) |
void | Stop (void) |
bool | HasError (void) const |
void | ClearError (void) |
int | GetError (void) const |
SPI interface routines for SD & SDHC & MMC cards
C++ conversion by SRLM, based on sdsafespi.spin version 0.3.0 by Jonathan "lonesock" Dummer.
This uses multiblock SPI mode exclusively.
This is the "SAFE" version...uses
Notes:
It appears that negative Spi_command is never used in the assembly code. This looks like an old error possibility that is no longer used. Can we take it out?
Definition at line 43 of file sdsafespi.h.
void libpropeller::SDSafeSPI::ClearError | ( | void | ) |
Resets the error flag to kNoError.
Definition at line 325 of file sdsafespi.h.
bool libpropeller::SDSafeSPI::HasError | ( | void | ) | const |
If there was an error in the SD routines then this function will return an error code.
Definition at line 319 of file sdsafespi.h.
void libpropeller::SDSafeSPI::ReleaseCard | ( | void | ) |
Release the SPI bus and allow other devices to use it. The SPI bus is re-acquired the next time a block is transfered.
Definition at line 290 of file sdsafespi.h.
int libpropeller::SDSafeSPI::Start | ( | const int | basepin | ) |
Start a new cog with the SPI driver.
Definition at line 72 of file sdsafespi.h.
int libpropeller::SDSafeSPI::Start | ( | const int | pin_do, |
const int | pin_clk, | ||
const int | pin_di, | ||
const int | pin_cs | ||
) |
Start a new cog with the SPI driver.
pin_do | |
pin_clk | |
pin_di | |
pin_cs |
Definition at line 84 of file sdsafespi.h.
void libpropeller::SDSafeSPI::Stop | ( | void | ) |
Kill the assembly driver cog.
Definition at line 306 of file sdsafespi.h.