MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / init_sdio

Function init_sdio

components/drivers/sdio/dev_sdio.c:964–1002  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

962}
963
964rt_int32_t init_sdio(struct rt_mmcsd_host *host, rt_uint32_t ocr)
965{
966 rt_int32_t err;
967 rt_uint32_t current_ocr;
968
969 RT_ASSERT(host != RT_NULL);
970
971 if (ocr & 0x7F)
972 {
973 LOG_W("Card ocr below the defined voltage rang.");
974 ocr &= ~0x7F;
975 }
976
977 if (ocr & VDD_165_195)
978 {
979 LOG_W("Can't support the low voltage SDIO card.");
980 ocr &= ~VDD_165_195;
981 }
982
983 current_ocr = mmcsd_select_voltage(host, ocr);
984
985 if (!current_ocr)
986 {
987 err = -RT_ERROR;
988 goto err;
989 }
990
991 err = sdio_init_card(host, current_ocr);
992 if (err)
993 goto err;
994
995 return 0;
996
997err:
998
999 LOG_E("init SDIO card failed");
1000
1001 return err;
1002}
1003
1004static void sdio_irq_thread(void *param)
1005{

Callers 1

mmcsd_detectFunction · 0.85

Calls 2

mmcsd_select_voltageFunction · 0.85
sdio_init_cardFunction · 0.85

Tested by

no test coverage detected