text
stringlengths
0
234
end if;
end Response_R1_Error;
-----------------------
-- Response_R2_Error --
-----------------------
function Response_R2_Error
(Controller : in out SDMMC_Controller) return SD_Error
is
begin
while not Controller.Periph.STA.CCRCFAIL
and then not Controller.Periph.STA.CMDREND
and then not Controller.Periph.STA.CTIMEOUT
loop
null;
end loop;
if Controller.Periph.STA.CTIMEOUT then
-- Card is not v2.0 compliant or card does not support the set
-- voltage range
Controller.Periph.ICR.CTIMEOUTC := True;
return Timeout_Error;
elsif Controller.Periph.STA.CCRCFAIL then
Controller.Periph.ICR.CCRCFAILC := True;
return CRC_Check_Fail;
end if;
Clear_Static_Flags (Controller);
return OK;
end Response_R2_Error;
-----------------------
-- Response_R3_Error --
-----------------------
function Response_R3_Error
(Controller : in out SDMMC_Controller) return SD_Error
is
begin
while not Controller.Periph.STA.CCRCFAIL
and then not Controller.Periph.STA.CMDREND
and then not Controller.Periph.STA.CTIMEOUT
loop
null;
end loop;
if Controller.Periph.STA.CTIMEOUT then
-- Card is not v2.0 compliant or card does not support the set
-- voltage range
Controller.Periph.ICR.CTIMEOUTC := True;
return Timeout_Error;
end if;
Clear_Static_Flags (Controller);
return OK;
end Response_R3_Error;
-----------------------
-- Response_R6_Error --
-----------------------
function Response_R6_Error
(Controller : in out SDMMC_Controller;
Command_Index : SD_Command;
RCA : out UInt32) return SD_Error
is
Response : UInt32;
begin
while not Controller.Periph.STA.CCRCFAIL
and then not Controller.Periph.STA.CMDREND
and then not Controller.Periph.STA.CTIMEOUT
loop
null;
end loop;
if Controller.Periph.STA.CTIMEOUT then
-- Card is not v2.0 compliant or card does not support the set
-- voltage range
Controller.Periph.ICR.CTIMEOUTC := True;
return Timeout_Error;
elsif Controller.Periph.STA.CCRCFAIL then
Controller.Periph.ICR.CCRCFAILC := True;
return CRC_Check_Fail;
end if;
if SD_Command (Controller.Periph.RESPCMD.RESPCMD) /=
Command_Index
then
return Illegal_Cmd;
end if;