int mmc_sdio_init_card(struct mmc_host *host, u32 ocr, struct mmc_card *oldcard, int powered_resume) { 如果host支持uhs模式,则switch信号电压为1.8v if (mmc_host_uhs(host)) ocr |= R4_18V_PRESENT; 设置card支持的电压为ocr,这个电压是mmc_sdio_init_card传入的rocr if (!powered_resume) {...
< Configure SD_SPI_DETECT_PIN pin: SD Card detect pin */// 如果你想用SPI来操作SD卡? // GPIO_InitStructure.GPIO_Pin = SD_DETECT_PIN; // GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN; // GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP; // GPIO_Init(SD_DETECT_GPIO_PORT, &GPIO_InitStruc...
/*MMC drivers should call this when they detect a card has been inserted or removed.检测sd卡是否插上或移除*/ —->mmc_detect_change(host, 0); /*Schedule delayed work in the MMC work queue.调度延时工作队列*/ mmc_schedule_delayed_work(&host->detect, delay); 搜索host->detected得到以下信息...
然后,有时候我们在设计 SD Card硬件接口时,不一定都加上 SD Card硬件检测功能(即是否接上 SD Card检测引脚),那么,我们就修改一下它的 SD Card库里的函数,对应的是 SD_Detect();函数,我们只需加个宏来作决定就好了,更改如下: uint8_t SD_Detect(void) { #if _SD_SPECCY __IO uint8_t status = SD_...
有置nonremovable,将会跑进detect,而进去就会detect出了card removed, 进而进行了移除操作。 void mmc_rescan(struct work_struct *work) { struct mmc_host *host = container_of(work, struct mmc_host, detect.work); bool extend_wakelock = false; ...
WHILE((STATUS == SD_OK) && (UWSDCARDOPERATION != SD_OPERATION_END) && (SD_DETECT()== SD_PRESENT)) { SWITCH(UWSDCARDOPERATION) { /*--- SD ERASE TEST --- */ CASE (SD_OPERATION_ERASE): { SD_ERASETEST(); UWSDCARDOPERATION = SD...
host->card = RT_NULL; } mmcsd_host_unlock(host); /* 释放锁 */ rt_mb_send(&mmcsd_hotpluge_mb, (rt_uint32_t)host); } } } } 在mmcsd_detect() 函数内完成SD卡的初步识别之后,之后将调用sd.c文件内的init_sd() 函数完成 sd 卡的完整识别过程/...
//request_irq(cd_irq,luther_detect_int,IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,"MMC card detect", data); //这样将中断注册到了物理硬件系统 当GPIO8检测到电平变化,将触发pxamci_detect_irq()中断处理函数, 该函数会继续调用mmc_detect_change()->mmc_schedule_delayed_work(&host->detect,delay);...
static unsigned long sdcard_detect_gpio_cfg = MFP_CFG_X(RFCTL11, AF3, DS1, F_PULL_UP,S_PULL_NONE, IO_Z); static void sprd_config_sdio_pins(void) { sprd_mfp_config(sdio_func_cfg, ARRAY_SIZE(sdio_func_cfg)); sprd_mfp_config(&sdcard_detect_gpio_cfg, 1); ...
/*!< Configure SD_SPI_DETECT_PIN pin: SD Card detect pin */ /*GPIO_InitStructure.GPIO_Pin = SD_DETECT_PIN; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN; GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP; GPIO_Init(SD_DETECT_GPIO_PORT, &GPIO_InitStructure);*/ ...