https://bitbucket.org/daniel_fort/magic-lantern
Raw File
Tip revision: 18664ed7323abc731254b9a92f955ebbb2d4b0df authored by g3gg0 on 20 November 2016, 00:05:25 UTC
added URL for decoding QR code
Tip revision: 18664ed
sd_direct.h

#ifndef _SD_DIRECT_H_
#define _SD_DIRECT_H_


enum sd_error
{
    SD_ERROR_RESPONSE_TIMEOUT = 0x03,
    SD_ERROR_RESPONSE_CRC_ERROR = 0x04,
    SD_ERROR_RESPONSE_COMPARE_ERROR = 0x05
};


struct sd_ctx
{
    uint32_t sd_port;
    uint32_t dma_port;
};

uint32_t sd_read(struct sd_ctx *ctx, uint32_t sector, uint32_t count, uint8_t *buffer);
uint32_t sd_write(struct sd_ctx *ctx, uint32_t sector, uint32_t count, uint8_t *buffer);
uint32_t sd_init(struct sd_ctx *ctx);

#endif
back to top