BeRTOS
Data Structures | Defines
sd.h File Reference

Function library for secure digital memory. More...

#include "cfg/cfg_sd.h"
#include <io/kfile.h>
#include <io/kblock.h>
#include <fs/fatfs/diskio.h>

Go to the source code of this file.

Data Structures

struct  Sd
 SD Card context structure. More...

Defines

#define SD_UNBUFFERED   BV(0)
 Open SD memory disabling page caching, no modification and partial write are allowed.
#define sd_init(sd, ch, buffered)   ((buffered & SD_UNBUFFERED) ? sd_initUnbuf((sd), (ch)) : sd_initBuf((sd), (ch)))
 Initializes the SD driver.

Detailed Description

Function library for secure digital memory.

Author:
Francesco Sacchi <batt@develer.com>

Definition in file sd.h.


Define Documentation

#define sd_init (   sd,
  ch,
  buffered 
)    ((buffered & SD_UNBUFFERED) ? sd_initUnbuf((sd), (ch)) : sd_initBuf((sd), (ch)))

Initializes the SD driver.

Parameters:
sdThe SD KBlock context.
chA pointer to a SPI channel where the SD will read/write to.
bufferedSet to true if you want the KBlock to be buffered, to false otherwise. The FatFs module does not require the device to be buffered because it has an internal cache. This will save 512 bytes of RAM in this case.
Returns:
true if initialization succeds, false otherwise.

Definition at line 105 of file sd.h.