text
stringlengths
0
234
----------------------------
-- Enable_Low_Pass_Filter --
----------------------------
procedure Enable_Low_Pass_Filter (This : in out Three_Axis_Gyroscope) is
Ctrl5 : UInt8;
begin
Read (This, CTRL_REG5, Ctrl5);
Ctrl5 := Ctrl5 or LowPass_Filter_Enable;
Write (This, CTRL_REG5, Ctrl5);
end Enable_Low_Pass_Filter;
-----------------------------
-- Disable_Low_Pass_Filter --
-----------------------------
procedure Disable_Low_Pass_Filter (This : in out Three_Axis_Gyroscope) is
Ctrl5 : UInt8;
begin
Read (This, CTRL_REG5, Ctrl5);
-- clear HPen bit
Ctrl5 := Ctrl5 and (not LowPass_Filter_Enable);
Write (This, CTRL_REG5, Ctrl5);
end Disable_Low_Pass_Filter;
---------------------
-- 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;