feat(sd): sd host driver layer driver NG

This commit is contained in:
armando
2025-05-13 10:43:47 +08:00
parent f9765d0316
commit 402bf0ce58
24 changed files with 2980 additions and 36 deletions

View File

@@ -101,11 +101,12 @@ typedef enum {
/**
* @brief Enable the bus clock for SDMMC module
*
* @param hw hardware instance address
* @param en enable / disable
* @param group_id Group ID
* @param en enable / disable
*/
static inline void sdmmc_ll_enable_bus_clock(sdmmc_dev_t *hw, bool en)
static inline void sdmmc_ll_enable_bus_clock(int group_id, bool en)
{
(void)group_id;
SYSTEM.perip_clk_en1.sdio_host_clk_en = en;
}
@@ -116,10 +117,11 @@ static inline void sdmmc_ll_enable_bus_clock(sdmmc_dev_t *hw, bool en)
/**
* @brief Reset the SDMMC module
*
* @param hw hardware instance address
* @param group_id Group ID
*/
static inline void sdmmc_ll_reset_register(sdmmc_dev_t *hw)
static inline void sdmmc_ll_reset_register(int group_id)
{
(void)group_id;
SYSTEM.perip_rst_en1.sdio_host_rst = 1;
SYSTEM.perip_rst_en1.sdio_host_rst = 0;
}
@@ -292,10 +294,8 @@ static inline uint32_t sdmmc_ll_get_card_clock_div(sdmmc_dev_t *hw, uint32_t slo
uint32_t card_div = 0;
if (slot == 0) {
HAL_ASSERT(hw->clksrc.card0 == 0);
card_div = HAL_FORCE_READ_U32_REG_FIELD(hw->clkdiv, div0);
} else if (slot == 1) {
HAL_ASSERT(hw->clksrc.card1 == 1);
card_div = HAL_FORCE_READ_U32_REG_FIELD(hw->clkdiv, div1);
} else {
HAL_ASSERT(false);