text
stringlengths
0
234
---------------------
-- Reference_Value --
---------------------
function Reference_Value (This : Three_Axis_Gyroscope) return UInt8 is
Result : UInt8;
begin
Read (This, Reference, Result);
return Result;
end Reference_Value;
-------------------
-- Set_Reference --
-------------------
procedure Set_Reference (This : in out Three_Axis_Gyroscope; Value : UInt8) is
begin
Write (This, Reference, Value);
end Set_Reference;
-----------------
-- Data_Status --
-----------------
function Data_Status (This : Three_Axis_Gyroscope) return Gyro_Data_Status is
Result : UInt8;
function As_Gyro_Data_Status is
new Ada.Unchecked_Conversion (Source => UInt8,
Target => Gyro_Data_Status);
begin
Read (This, Status, Result);
return As_Gyro_Data_Status (Result);
end Data_Status;
---------------
-- Device_Id --
---------------
function Device_Id (This : Three_Axis_Gyroscope) return UInt8 is
Result : UInt8;
begin
Read (This, Who_Am_I, Result);
return Result;
end Device_Id;
-----------------
-- Temperature --
-----------------
function Temperature (This : Three_Axis_Gyroscope) return UInt8 is
Result : UInt8;
begin
Read (This, OUT_Temp, Result);
return Result;
end Temperature;
------------
-- Reboot --
------------
procedure Reboot (This : Three_Axis_Gyroscope) is
Ctrl5 : UInt8;
begin
Read (This, CTRL_REG5, Ctrl5);
-- set the boot bit
Ctrl5 := Ctrl5 or Boot_Bit;
Write (This, CTRL_REG5, Ctrl5);
end Reboot;
----------------------------
-- Full_Scale_Sensitivity --
----------------------------
function Full_Scale_Sensitivity (This : Three_Axis_Gyroscope) return Float is
Ctrl4 : UInt8;
Result : Float;
Fullscale_Selection : UInt8;
begin
Read (This, CTRL_REG4, Ctrl4);
Fullscale_Selection := Ctrl4 and Fullscale_Selection_Bits;
if Fullscale_Selection = L3GD20_Fullscale_250'Enum_Rep then
Result := Sensitivity_250dps;
elsif Fullscale_Selection = L3GD20_Fullscale_500'Enum_Rep then
Result := Sensitivity_500dps;
else
Result := Sensitivity_2000dps;
end if;
return Result;
end Full_Scale_Sensitivity;
-------------------------
-- Get_Raw_Angle_Rates --
-------------------------
procedure Get_Raw_Angle_Rates
(This : Three_Axis_Gyroscope;