Increase read/write performances; add some comments.
[bertos.git] / bertos / drv / sd.h
index 368e0d4fff975d6d375257004ed01c1f2f3e4fca..9845fcb4fcb489bb6a90835ba7cb692b93a0f8ef 100644 (file)
  *
  * \brief Function library for secure digital memory.
  *
- * Right now, the interface for these function is the one defined in diskio.h from
- * the FatFS module.
  *
  * \author Francesco Sacchi <batt@develer.com>
  *
  * $WIZ$ module_name = "sd"
- * $WIZ$ module_depends = "kfile", "timer"
+ * $WIZ$ module_depends = "kfile", "timer", "kblock"
  * $WIZ$ module_hw = "bertos/hw/hw_sd.h"
  * $WIZ$ module_configuration = "bertos/cfg/cfg_sd.h"
  */
 
 #include "cfg/cfg_sd.h"
 
-
+/**
+ * SD Card context structure.
+ */
 typedef struct Sd
 {
-       KBlock b;
+       KBlock b;   ///< KBlock base class
        KFile *ch;  ///< SPI communication channel
-       uint16_t r1;
+       uint16_t r1;  ///< Last status data received from SD
+       uint16_t tranfer_len; ///< Lenght for the read/write commands, cached in order to increase speed.
 } Sd;
 
 bool sd_initUnbuf(Sd *sd, KFile *ch);