![]() |
SyterKit 0.4.0.x
SyterKit is a bare-metal framework
|
#include <barrier.h>#include <io.h>#include <stdarg.h>#include <stdbool.h>#include <stddef.h>#include <stdint.h>#include <types.h>#include <log.h>#include <timer.h>#include <sys-clk.h>#include <sys-gpio.h>#include <mmc/sys-sdcard.h>
Functions | |
| int | sdmmc_init (sdmmc_pdata_t *data, sunxi_sdhci_t *hci) |
| Initialize the SD/MMC interface. | |
| uint32_t | sdmmc_blk_read (sdmmc_pdata_t *data, uint8_t *buf, uint32_t blkno, uint32_t blkcnt) |
| Read blocks from the SD/MMC device. | |
| uint32_t | sdmmc_blk_write (sdmmc_pdata_t *data, uint8_t *buf, uint32_t blkno, uint32_t blkcnt) |
| Writes blocks of data to the SD/MMC device using the specified SDHCI instance. | |
Variables | |
| sdmmc_pdata_t | card0 |
| External declaration of the 'card0' SDMMC platform data structure. | |
| uint32_t sdmmc_blk_read | ( | sdmmc_pdata_t * | data, |
| uint8_t * | buf, | ||
| uint32_t | blkno, | ||
| uint32_t | blkcnt | ||
| ) |
Read blocks from the SD/MMC device.
Reads a specified number of blocks from the SD/MMC device using the provided platform data structure, destination buffer, block number, and block count. It calls the underlying function for reading blocks from the Sunxi MMC block device and returns the result.
| data | Pointer to the SD/MMC platform data structure |
| buf | Pointer to the destination buffer where the read data will be stored |
| blkno | The starting block number to read from |
| blkcnt | The number of blocks to read |
| uint32_t sdmmc_blk_write | ( | sdmmc_pdata_t * | data, |
| uint8_t * | buf, | ||
| uint32_t | blkno, | ||
| uint32_t | blkcnt | ||
| ) |
Writes blocks of data to the SD/MMC device using the specified SDHCI instance.
This function writes a specified number of blocks to the SD/MMC (Secure Digital/MultiMediaCard) device associated with the given SDHCI (SD Host Controller Interface) instance. It serves as a wrapper around the sunxi_mmc_blk_write function, providing a simplified interface for block data write operations.
| [in] | data | A pointer to the SD/MMC platform data structure. |
| [in] | buf | A pointer to the source buffer from which data will be written to the SD/MMC device. |
| [in] | blkno | The starting block number where the data writing begins. |
| [in] | blkcnt | The number of blocks to write. |
| int sdmmc_init | ( | sdmmc_pdata_t * | data, |
| sunxi_sdhci_t * | hci | ||
| ) |
Initialize the SD/MMC interface.
Initializes the SD/MMC interface using the provided data structure and SD Host Controller instance. It sets the SD Host Controller instance and the online status in the data structure, and then initializes the MMC device. If the initialization is successful, it prints a message indicating the type of card detected and returns 0; otherwise, it returns -1.
| data | Pointer to the SD/MMC platform data structure |
| hci | Pointer to the Sunxi SD Host Controller instance |
| sdmmc_pdata_t card0 |
External declaration of the 'card0' SDMMC platform data structure.