PowerBlocks SDK
 
Loading...
Searching...
No Matches
sd.c File Reference

Implementation of FatFF's disk io. More...

#include "sd.h"
#include "powerblocks/core/ios/sdio.h"
#include "powerblocks/core/utils/log.h"
#include "FreeRTOS.h"
#include "task.h"
#include <stdbool.h>

Macros

#define SD_ERROR_LOGGING
 
#define SD_LOG_ERROR(fmt, ...)
 
#define SD_LOG_INFO(fmt, ...)
 
#define SD_LOG_DEBUG(fmt, ...)
 

Functions

int sd_initialize ()
 Initializes the sd card system.
 
void sd_close ()
 Closes it out.
 
DSTATUS sd_disk_status ()
 FatFS disk_status implementation.
 
DSTATUS sd_disk_initialize ()
 FatFS disk_initialize implementation.
 
DRESULT sd_disk_read (BYTE *buff, LBA_t sector, UINT count)
 FatFS disk_read implementation.
 
DRESULT sd_disk_write (const BYTE *buff, LBA_t sector, UINT count)
 FatFS disk_read implementation.
 
DRESULT sd_disk_ioctl (BYTE cmd, void *buff)
 FatFS disk_ioctl implementation.
 

Detailed Description

Implementation of FatFF's disk io.

SD Card System.

Implementation of FatFF's disk io.

Author
Samuel Fitzsimons (rainbain)
Date
2025 @license MIT (see LICENSE file)

Implements the Wii's SD Card Slot

Author
Samuel Fitzsimons (rainbain)
Date
2025 @license MIT (see LICENSE file)

Macro Definition Documentation

◆ SD_LOG_ERROR

#define SD_LOG_ERROR ( fmt,
... )
Value:
LOG_ERROR(TAG, fmt, ##__VA_ARGS__)

Function Documentation

◆ sd_disk_initialize()

DSTATUS sd_disk_initialize ( )

FatFS disk_initialize implementation.

Called on mount after successful status reading.

◆ sd_initialize()

int sd_initialize ( )

Initializes the sd card system.

Initializes the SD card system for use in the file system. Must be called before mounting the file system,

but called only ever once, even if the sd card is removed.

Returns
Negative if error.