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

Function rthw_sdctrl_docmd

bsp/ft2004/drivers/drv_sdctrl.c:171–203  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

169}
170
171static void rthw_sdctrl_docmd(ft_sdctrl_class_t *class_p, struct mmcsd_pkg *pkg)
172{
173 struct rt_mmcsd_cmd *cmd;
174 u32 rasp;
175 FtsdCtrl_t *ft_sdctrl_p;
176
177 if ((RT_NULL == class_p))
178 {
179 LOG_E("rthw_sdctrl_docmd invalid class_p");
180 return;
181 }
182
183 ft_sdctrl_p = &class_p->ft_sdctrl;
184
185 if ((RT_NULL == pkg))
186 {
187 LOG_E("rthw_sdctrl_docmd invalid args");
188 return;
189 }
190
191 cmd = pkg->cmd;
192 rasp = resp_type(pkg->cmd);
193 rasp = rthw_sdctrl_rasp2type(rasp);
194 FSdCtrl_DoCmd(ft_sdctrl_p, pkg->cmd->cmd_code, rasp, cmd->arg);
195 cmd->err = FSdCtrl_WaitCmdEnd(ft_sdctrl_p, (pFtsdCtrl_delayTimer_t)rthw_sdctrl_delay, rasp, cmd->resp);
196
197#ifdef BSP_SDC_DEBUG_PRINT
198 for (int i = 0; i < 4; i++)
199 {
200 rt_kprintf("cmdRsp[%d] %x \r\n", i, cmd->resp[i]);
201 }
202#endif
203}
204
205static void rthw_sdctrl_send_command(ft_sdctrl_class_t *class_p, struct mmcsd_pkg *pkg)
206{

Callers 1

rthw_sdctrl_send_commandFunction · 0.85

Calls 4

rthw_sdctrl_rasp2typeFunction · 0.85
FSdCtrl_DoCmdFunction · 0.85
FSdCtrl_WaitCmdEndFunction · 0.85
rt_kprintfFunction · 0.85

Tested by

no test coverage detected