SD开在初始化的时候进行了如下设置
uSdHandle.Instance = SDMMC1;
uSdHandle.Init.ClockDiv = 2;
uSdHandle.Init.ClockPowerSave = SDMMC_CLOCK_POWER_SAVE_DISABLE;
uSdHandle.Init.ClockEdge = SDMMC_CLOCK_EDGE_RISING;
uSdHandle.Init.HardwareFlowControl = SDMMC_HARDWARE_FLOW_CONTROL_DISABLE;
uSdHandle.Init.BusWide = SDMMC_BUS_WIDE_4B;复制代码然后调用了
if(HAL_SD_Init(&uSdHandle) != HAL_OK)复制代码继续调用
/* Initialize the Card parameters */
if (HAL_SD_InitCard(hsd) != HAL_OK)复制代码在HAL_SD_InitCard中对最前面的结构体成员又进行了一次赋值
HAL_StatusTypeDef HAL_SD_InitCard(SD_HandleTypeDef *hsd)
{
uint32_t errorstate;
HAL_StatusTypeDef status;
SD_InitTypeDef Init;
/* Default SDMMC peripheral configuration for SD card initialization */
Init.ClockEdge = SDMMC_CLOCK_EDGE_RISING;
Init.ClockPowerSave = SDMMC_CLOCK_POWER_SAVE_DISABLE;
Init.BusWide = SDMMC_BUS_WIDE_1B;
Init.HardwareFlowControl = SDMMC_HARDWARE_FLOW_CONTROL_DISABLE;
Init.ClockDiv = SDMMC_INIT_CLK_DIV;复制代码
请问这里如何理解。 |