#ifndef DRV_SD_H
#define DRV_SD_H
+#include "cfg/cfg_sd.h"
+
#include <io/kfile.h>
#include <io/kblock.h>
#include <fs/fatfs/diskio.h>
-#include "cfg/cfg_sd.h"
+
+#define SD_UNBUFFERED BV(0) ///< Open SD memory disabling page caching, no modification and partial write are allowed.
/**
* SD Card context structure.
*
* \note This API is deprecated, disable CONFIG_SD_OLD_INIT and
* use the new one instead.
+ *
+ * \see CONFIG_SD_OLD_INIT.
*/
#define sd_init(ch) {static struct Sd sd; sd_initUnbuf(&sd, (ch));}
*
* \return true if initialization succeds, false otherwise.
*/
- #define sd_init(sd, ch, buffered) ((buffered) ? sd_initBuf((sd), (ch)) : sd_initUnbuf((sd), (ch)))
+ #define sd_init(sd, ch, buffered) ((buffered & SD_UNBUFFERED) ? sd_initUnbuf((sd), (ch)) : sd_initBuf((sd), (ch)))
#endif