text
stringlengths
0
234
CMD_Reg.WAITINT := False;
CMD_Reg.CPSMEN := True;
This.Periph.CMD := CMD_Reg;
case Cmd.Rsp is
when Rsp_No =>
Status := This.Command_Error;
when Rsp_R1 | Rsp_R1B =>
Status := This.Response_R1_Error (Cmd.Cmd);
when Rsp_R2 =>
Status := This.Response_R2_Error;
when Rsp_R3 =>
Status := This.Response_R3_Error;
when Rsp_R6 =>
declare
RCA : UInt32;
begin
Status := This.Response_R6_Error (Cmd.Cmd, RCA);
This.RCA := UInt16 (Shift_Right (RCA, 16));
Function Definition: procedure Disable_Data
Function Body: (This : in out SDMMC_Controller)
is
begin
This.Periph.DCTRL := (others => <>);
end Disable_Data;
--------------------------
-- Enable_DMA_Transfers --
--------------------------
procedure Enable_DMA_Transfers
(This : in out SDMMC_Controller;
RX_Int : not null STM32.DMA.Interrupts.DMA_Interrupt_Controller_Access;
TX_Int : not null STM32.DMA.Interrupts.DMA_Interrupt_Controller_Access;
SD_Int : not null STM32.SDMMC_Interrupt.SDMMC_Interrupt_Handler_Access)
is
begin
This.TX_DMA_Int := TX_Int;
This.RX_DMA_Int := RX_Int;
This.SD_Int := SD_Int;
end Enable_DMA_Transfers;
--------------------------
-- Has_Card_Information --
--------------------------
function Has_Card_Information
(This : SDMMC_Controller)
return Boolean
is (This.Has_Info);
----------------------
-- Card_Information --
----------------------
function Card_Information
(This : SDMMC_Controller)
return HAL.SDMMC.Card_Information
is
begin
return This.Info;
end Card_Information;
----------------------------
-- Clear_Card_Information --
----------------------------
procedure Clear_Card_Information
(This : in out SDMMC_Controller)
is
begin
This.Has_Info := False;
end Clear_Card_Information;
---------------
-- Read_FIFO --
---------------
function Read_FIFO
(Controller : in out SDMMC_Controller) return UInt32
is
begin
return Controller.Periph.FIFO;
end Read_FIFO;
-------------------
-- Command_Error --
-------------------
function Command_Error
(Controller : in out SDMMC_Controller) return SD_Error
is
Start : constant Time := Clock;
begin
while not Controller.Periph.STA.CMDSENT loop