text stringlengths 0 234 |
|---|
VCSel_Pulse_Period_Pclk := |
VCSel_Pulse_Period (This, Final_Range); |
Timeout_Mclks := Timeout_Mclks + To_Timeout_Mclks |
(Final_Range_Timing_Budget_us, |
VCSel_Pulse_Period_Pclk); |
Write (This, REG_FINAL_RANGE_CONFIG_TIMEOUT_MACROP_HI, |
Encode_Timeout (Timeout_Mclks), Status); |
Function Definition: function To_U32 is new Ada.Unchecked_Conversion |
Function Body: (Fix_Point_16_16, UInt32); |
Val : UInt16; |
Status : Boolean; |
begin |
-- Expecting Fixed Point 9.7 |
Val := UInt16 (Shift_Right (To_U32 (Limit_Mcps), 9) and 16#FF_FF#); |
Write (This, |
REG_FINAL_RANGE_CONFIG_MIN_COUNT_RATE_RTN_LIMIT, |
Val, |
Status); |
return Status; |
end Set_Signal_Rate_Limit; |
--------------- |
-- SPAD_Info -- |
--------------- |
function SPAD_Info |
(This : VL53L0X_Ranging_Sensor; |
SPAD_Count : out HAL.UInt8; |
Is_Aperture : out Boolean) return Boolean |
is |
Status : Boolean; |
Tmp : UInt8; |
begin |
Write (This, 16#80#, UInt8'(16#01#), Status); |
if Status then |
Write (This, 16#FF#, UInt8'(16#01#), Status); |
end if; |
if Status then |
Write (This, 16#00#, UInt8'(16#00#), Status); |
end if; |
if Status then |
Write (This, 16#FF#, UInt8'(16#06#), Status); |
end if; |
if Status then |
Read (This, 16#83#, Tmp, Status); |
end if; |
if Status then |
Write (This, 16#83#, Tmp or 16#04#, Status); |
end if; |
if Status then |
Write (This, 16#FF#, UInt8'(16#07#), Status); |
end if; |
if Status then |
Write (This, 16#81#, UInt8'(16#01#), Status); |
end if; |
if Status then |
Write (This, 16#80#, UInt8'(16#01#), Status); |
end if; |
if Status then |
Write (This, 16#94#, UInt8'(16#6B#), Status); |
end if; |
if Status then |
Write (This, 16#83#, UInt8'(16#00#), Status); |
end if; |
loop |
exit when not Status; |
Read (This, 16#83#, Tmp, Status); |
exit when Tmp /= 0; |
end loop; |
if Status then |
Write (This, 16#83#, UInt8'(16#01#), Status); |
end if; |
if Status then |
Read (This, 16#92#, Tmp, Status); |
end if; |
if Status then |
SPAD_Count := Tmp and 16#7F#; |
Is_Aperture := (Tmp and 16#80#) /= 0; |
Write (This, 16#81#, UInt8'(16#00#), Status); |
end if; |
if Status then |
Write (This, 16#FF#, UInt8'(16#06#), Status); |
end if; |
if Status then |
Read (This, 16#83#, Tmp, Status); |
end if; |
if Status then |
Write (This, 16#83#, Tmp and not 16#04#, Status); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.