text stringlengths 0 234 |
|---|
when STD_Capacity_SD_Card_V1_1 |
| STD_Capacity_SD_Card_v2_0 |
| High_Capacity_SD_Card => |
Send_ACmd (This, SD_App_Set_Bus_Width, Info.RCA, 2, Status); |
if Status /= OK then |
return; |
else |
Set_Bus_Size (This, Wide_Bus_4B); |
end if; |
when others => |
null; |
end case; |
if (Info.SD_CSD.Card_Command_Class and 2**10) /= 0 then |
-- Class 10 supported. |
declare |
subtype Switch_Status_Type is UInt32_Array (1 .. 16); |
Switch_Status : Switch_Status_Type; |
begin |
-- CMD6 |
Read_Cmd (This, Cmd_Desc (Switch_Func), 16#00_fffff0#, |
Switch_Status, Status); |
if Status /= OK then |
return; |
end if; |
-- Handle endianness |
for I in Switch_Status'Range loop |
Switch_Status (I) := BE32_To_Host (Switch_Status (I)); |
end loop; |
-- Switch tp 50Mhz if possible. |
if (Switch_Status (4) and 2**(16 + 1)) /= 0 then |
Read_Cmd (This, Cmd_Desc (Switch_Func), 16#80_fffff1#, |
Switch_Status, Status); |
if Status /= OK then |
return; |
end if; |
-- Switch to 50Mhz |
Set_Clock (This, 50_000_000); |
end if; |
Function Definition: function Convert is new Ada.Unchecked_Conversion (HALFS.Status_Code, Status_Code); |
Function Body: function Convert is new Ada.Unchecked_Conversion (File_Mode, HALFS.File_Mode); |
function Convert is new Ada.Unchecked_Conversion (File_Size, HALFS.File_Size); |
function Convert is new Ada.Unchecked_Conversion (HALFS.File_Size, File_Size); |
function Convert is new Ada.Unchecked_Conversion (Seek_Mode, HALFS.Seek_Mode); |
type Mount_Record is record |
Is_Free : Boolean := True; |
Name : String (1 .. Max_Mount_Name_Length); |
Name_Len : Positive; |
FS : Any_Filesystem_Driver; |
end record; |
subtype Mount_Index is Integer range 0 .. Max_Mount_Points; |
subtype Valid_Mount_Index is Mount_Index range 1 .. Max_Mount_Points; |
type Mount_Array is array (Valid_Mount_Index) of Mount_Record; |
type VFS_Directory_Handle is new Directory_Handle with record |
Is_Free : Boolean := True; |
Mount_Id : Mount_Index; |
end record; |
overriding function Get_FS |
(Dir : VFS_Directory_Handle) return Any_Filesystem_Driver; |
-- Return the filesystem the handle belongs to. |
overriding function Read |
(Dir : in out VFS_Directory_Handle; |
Handle : out Any_Node_Handle) return HALFS.Status_Code; |
-- Reads the next directory entry. If no such entry is there, an error |
-- code is returned in Status. |
overriding procedure Reset (Dir : in out VFS_Directory_Handle); |
-- Resets the handle to the first node |
overriding procedure Close (Dir : in out VFS_Directory_Handle); |
-- Closes the handle, and free the associated resources. |
function Open |
(Path : String; |
Handle : out Any_Directory_Handle) |
return Status_Code; |
function Open |
(Path : String; |
Mode : File_Mode; |
Handle : out Any_File_Handle) |
return Status_Code; |
Mount_Points : Mount_Array; |
Handles : array (1 .. 2) of aliased VFS_Directory_Handle; |
function Name (Point : Mount_Record) return Mount_Path; |
procedure Set_Name (Point : in out Mount_Record; |
Path : Mount_Path); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.