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

Function FSdCtrl_CardDetect

bsp/ft2004/libraries/bsp/ft_sd/ft_sdctrl.c:105–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

103}
104
105bool_t FSdCtrl_CardDetect(FT_INOUT FtsdCtrl_t *pFtsdCtrl)
106{
107 FSdCtrl_Config_t *pConfig;
108 u32 status;
109
110 Ft_assertBool(FT_NULL != pFtsdCtrl);
111 pConfig = &pFtsdCtrl->config;
112 status = Ft_in32(pConfig->baseAddress + STATUS_REG);
113
114 /* check card-detection signal */
115 if (((status)&STATUS_REG_CDSL) == STATUS_REG_CDSL)
116 {
117 pConfig->cardDetect = 0;
118 }
119 else
120 {
121 pConfig->cardDetect = 1;
122 }
123
124 return pConfig->cardDetect;
125}
126
127void FSdCtrl_ResetDma(FT_INOUT FtsdCtrl_t *pFtsdCtrl)
128{

Callers 2

rthw_sdctrl_detectFunction · 0.85
ft2004_card_statusFunction · 0.85

Calls 1

Ft_in32Function · 0.85

Tested by

no test coverage detected