Skip to content

Commit

Permalink
SDIO with DiskIODriver
Browse files Browse the repository at this point in the history
  • Loading branch information
rhapsodyv committed Mar 13, 2021
1 parent 1c22473 commit c0fcd10
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Marlin/src/lcd/extui/lib/mks_ui/draw_media_select.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
*/
#include "../../../../inc/MarlinConfigPre.h"

#if HAS_TFT_LVGL_UI
#if BOTH(HAS_TFT_LVGL_UI, MULTI_VOLUME)

#include "draw_ui.h"
#include <lv_conf.h>
Expand Down
12 changes: 11 additions & 1 deletion Marlin/src/sd/Sd2Card_sdio.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

#if ENABLED(SDIO_SUPPORT)

#include "SdInfo.h"
#include "disk_io_driver.h"

bool SDIO_Init();
Expand All @@ -33,9 +34,18 @@ bool SDIO_WriteBlock(uint32_t block, const uint8_t *src);

class SDIO_DiskIODriver : public DiskIODriver {
public:
bool init(uint8_t sckRateID = 0, uint8_t chipSelectPin = 0) { return SDIO_Init(); }
bool init(const uint8_t sckRateID = 0, const pin_t chipSelectPin = 0) { return SDIO_Init(); }
bool readBlock(uint32_t block, uint8_t *dst) { return SDIO_ReadBlock(block, dst); }
bool writeBlock(uint32_t block, const uint8_t *src) { return SDIO_WriteBlock(block, src); }
bool readStart(const uint32_t block) { return false; }
bool readData(uint8_t* dst) { return false; }
bool readStop() { return false; }
bool writeStart(const uint32_t block, const uint32_t) { return false; }
bool writeData(const uint8_t* src) { return false; }
bool writeStop() { return false; }
bool readCSD(csd_t* csd) { return false; }
uint32_t cardSize() { return 0; };
bool isReady() { return true; };
};

#endif // SDIO_SUPPORT

0 comments on commit c0fcd10

Please sign in to comment.