software/liblitesdcard: remove read_block prototype, minor cleanup.
This commit is contained in:
parent
fe9b42facf
commit
96fc96eccd
|
@ -108,8 +108,6 @@ int sdcard_sddatawriter_wait(void);
|
||||||
int sdcard_sddatareader_wait(void);
|
int sdcard_sddatareader_wait(void);
|
||||||
int sdcard_test(unsigned int blocks);
|
int sdcard_test(unsigned int blocks);
|
||||||
|
|
||||||
uint8_t sdcard_read_block(uint32_t addr, uint8_t *buf);
|
|
||||||
|
|
||||||
#endif /* CSR_SDCORE_BASE */
|
#endif /* CSR_SDCORE_BASE */
|
||||||
|
|
||||||
#endif /* __SDCARD_H */
|
#endif /* __SDCARD_H */
|
||||||
|
|
|
@ -60,7 +60,7 @@ static uint8_t spi_xfer(uint8_t byte) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/*-----------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------*/
|
||||||
/* SDCard Select/Deselect functions */
|
/* SPI SDCard Select/Deselect functions */
|
||||||
/*-----------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------*/
|
||||||
|
|
||||||
static void spisdcard_deselect(void) {
|
static void spisdcard_deselect(void) {
|
||||||
|
@ -95,7 +95,7 @@ static int spisdcard_select(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/*-----------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------*/
|
||||||
/* SDCard bytes Xfer functions */
|
/* SPI SDCard bytes Xfer functions */
|
||||||
/*-----------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------*/
|
||||||
|
|
||||||
static void spisdcardwrite_bytes(uint8_t* buf, uint16_t n) {
|
static void spisdcardwrite_bytes(uint8_t* buf, uint16_t n) {
|
||||||
|
@ -111,7 +111,7 @@ static void spisdcardread_bytes(uint8_t* buf, uint16_t n) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/*-----------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------*/
|
||||||
/* SDCard block Xfer functions */
|
/* SPI SDCard blocks Xfer functions */
|
||||||
/*-----------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------*/
|
||||||
|
|
||||||
static uint8_t spisdcardreceive_block(uint8_t *buf) {
|
static uint8_t spisdcardreceive_block(uint8_t *buf) {
|
||||||
|
@ -139,7 +139,7 @@ static uint8_t spisdcardreceive_block(uint8_t *buf) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/*-----------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------*/
|
||||||
/* SDCard Command functions */
|
/* SPI SDCard Command functions */
|
||||||
/*-----------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------*/
|
||||||
|
|
||||||
static uint8_t spisdcardsend_cmd(uint8_t cmd, uint32_t arg)
|
static uint8_t spisdcardsend_cmd(uint8_t cmd, uint32_t arg)
|
||||||
|
@ -192,7 +192,7 @@ static uint8_t spisdcardsend_cmd(uint8_t cmd, uint32_t arg)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*-----------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------*/
|
||||||
/* SDCard Initialization functions */
|
/* SPI SDCard Initialization functions */
|
||||||
/*-----------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------*/
|
||||||
|
|
||||||
uint8_t spisdcard_init(void) {
|
uint8_t spisdcard_init(void) {
|
||||||
|
@ -243,7 +243,7 @@ uint8_t spisdcard_init(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/*-----------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------*/
|
||||||
/* SDCard FatFs disk functions */
|
/* SPI SDCard FatFs functions */
|
||||||
/*-----------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------*/
|
||||||
|
|
||||||
static DSTATUS spisdcardstatus = STA_NOINIT;
|
static DSTATUS spisdcardstatus = STA_NOINIT;
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
#define SPI_LENGTH (1 << 8)
|
#define SPI_LENGTH (1 << 8)
|
||||||
|
|
||||||
/*-----------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------*/
|
||||||
/* SDCard SPI Commands */
|
/* SPI SDCard Commands */
|
||||||
/*-----------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------*/
|
||||||
|
|
||||||
#define CMD0 (0) /* GO_IDLE_STATE */
|
#define CMD0 (0) /* GO_IDLE_STATE */
|
||||||
|
@ -45,10 +45,11 @@
|
||||||
#define CMD55 (55) /* APP_CMD */
|
#define CMD55 (55) /* APP_CMD */
|
||||||
#define CMD58 (58) /* READ_OCR */
|
#define CMD58 (58) /* READ_OCR */
|
||||||
|
|
||||||
|
/*-----------------------------------------------------------------------*/
|
||||||
|
/* SPI SDCard User functions */
|
||||||
|
/*-----------------------------------------------------------------------*/
|
||||||
|
|
||||||
uint8_t spisdcard_init(void);
|
uint8_t spisdcard_init(void);
|
||||||
uint8_t spisdcard_read_block(uint32_t addr, uint8_t *buf);
|
|
||||||
|
|
||||||
#endif /* CSR_SPISDCARD_BASE */
|
#endif /* CSR_SPISDCARD_BASE */
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue