text
stringlengths 0
234
|
|---|
if Status then
|
Read (This, 16#83#, Tmp, Status);
|
end if;
|
if Status then
|
Write (This, 16#83#, Tmp and not 16#04#, Status);
|
end if;
|
if Status then
|
Write (This, 16#FF#, UInt8'(16#01#), Status);
|
end if;
|
if Status then
|
Write (This, 16#00#, UInt8'(16#01#), Status);
|
end if;
|
if Status then
|
Write (This, 16#FF#, UInt8'(16#00#), Status);
|
end if;
|
if Status then
|
Write (This, 16#80#, UInt8'(16#00#), Status);
|
end if;
|
return Status;
|
end SPAD_Info;
|
---------------------------
|
-- Set_Signal_Rate_Limit --
|
---------------------------
|
procedure Set_Signal_Rate_Limit
|
(This : VL53L0X_Ranging_Sensor;
|
Rate_Limit : Fix_Point_16_16)
|
is
|
function To_U32 is new Ada.Unchecked_Conversion
|
(Fix_Point_16_16, UInt32);
|
Reg : UInt16;
|
Status : Boolean with Unreferenced;
|
begin
|
-- Encoded as Fixed Point 9.7. Let's translate.
|
Reg := UInt16 (Shift_Right (To_U32 (Rate_Limit), 9) and 16#FFFF#);
|
Write (This, REG_FINAL_RANGE_CONFIG_MIN_COUNT_RATE_RTN_LIMIT,
|
Reg, Status);
|
end Set_Signal_Rate_Limit;
|
--------------------------------------
|
-- Set_Vcsel_Pulse_Period_Pre_Range --
|
--------------------------------------
|
procedure Set_VCSEL_Pulse_Period_Pre_Range
|
(This : VL53L0X_Ranging_Sensor;
|
Period : UInt8;
|
Status : out Boolean)
|
is
|
begin
|
Set_VCSel_Pulse_Period (This, Period, Pre_Range, Status);
|
end Set_VCSEL_Pulse_Period_Pre_Range;
|
----------------------------------------
|
-- Set_Vcsel_Pulse_Period_Final_Range --
|
----------------------------------------
|
procedure Set_VCSEL_Pulse_Period_Final_Range
|
(This : VL53L0X_Ranging_Sensor;
|
Period : UInt8;
|
Status : out Boolean)
|
is
|
begin
|
Set_VCSel_Pulse_Period (This, Period, Final_Range, Status);
|
end Set_VCSEL_Pulse_Period_Final_Range;
|
----------------------------
|
-- Set_VCSel_Pulse_Period --
|
----------------------------
|
procedure Set_VCSel_Pulse_Period
|
(This : VL53L0X_Ranging_Sensor;
|
Period : UInt8;
|
Sequence : VL53L0x_Sequence_Step;
|
Status : out Boolean)
|
is
|
Encoded : constant UInt8 := Shift_Right (Period, 1) - 1;
|
Phase_High : UInt8;
|
Pre_Timeout : UInt32;
|
Final_Timeout : UInt32;
|
Msrc_Timeout : UInt32;
|
Timeout_Mclks : UInt32;
|
Steps_Enabled : constant VL53L0x_Sequence_Step_Enabled :=
|
Sequence_Step_Enabled (This);
|
Budget : UInt32;
|
Sequence_Cfg : UInt8;
|
begin
|
-- Save the measurement timing budget
|
Budget := Measurement_Timing_Budget (This);
|
case Sequence is
|
when Pre_Range =>
|
Pre_Timeout := Sequence_Step_Timeout (This, Pre_Range);
|
Msrc_Timeout := Sequence_Step_Timeout (This, MSRC);
|
case Period is
|
when 12 =>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.