@@ -28,22 +28,33 @@ typedef struct {
28
28
extern sdmmc_pdata_t card0 ;
29
29
30
30
/**
31
- * Initialize the SDMMC controller with the specified platform data and SDHCI driver.
31
+ * @brief Initialize the SD/MMC interface
32
32
*
33
- * @param data Pointer to the SDMMC platform data structure.
34
- * @param hci Pointer to the SDHCI driver instance.
35
- * @return 0 if successful, or an error code if failed.
33
+ * Initializes the SD/MMC interface using the provided data structure and SD Host Controller instance.
34
+ * It sets the SD Host Controller instance and the online status in the data structure, and then initializes
35
+ * the MMC device. If the initialization is successful, it prints a message indicating the type of card detected
36
+ * and returns 0; otherwise, it returns -1.
37
+ *
38
+ * @param data Pointer to the SD/MMC platform data structure
39
+ * @param hci Pointer to the Sunxi SD Host Controller instance
40
+ *
41
+ * @return Returns 0 on success, or -1 if the initialization fails
36
42
*/
37
43
int sdmmc_init (sdmmc_pdata_t * data , sunxi_sdhci_t * hci );
38
44
39
45
/**
40
- * Read data from the SDMMC card into the provided buffer.
46
+ * @brief Read blocks from the SD/MMC device
47
+ *
48
+ * Reads a specified number of blocks from the SD/MMC device using the provided platform data structure,
49
+ * destination buffer, block number, and block count. It calls the underlying function for reading blocks
50
+ * from the Sunxi MMC block device and returns the result.
51
+ *
52
+ * @param data Pointer to the SD/MMC platform data structure
53
+ * @param buf Pointer to the destination buffer where the read data will be stored
54
+ * @param blkno The starting block number to read from
55
+ * @param blkcnt The number of blocks to read
41
56
*
42
- * @param data Pointer to the SDMMC platform data structure.
43
- * @param buf Pointer to the destination buffer to store the read data.
44
- * @param blkno The starting block number to read from.
45
- * @param blkcnt The number of blocks to read.
46
- * @return The total number of bytes read, or an error code if failed.
57
+ * @return Returns 0 on success, or an error code if the operation fails
47
58
*/
48
59
uint32_t sdmmc_blk_read (sdmmc_pdata_t * data , uint8_t * buf , uint32_t blkno , uint32_t blkcnt );
49
60
0 commit comments