Vijayaraghavan Narayanan / VLX6180X_API
Embed: (wiki syntax)

« Back to documentation index

ranging_driver.h File Reference

ranging_driver.h File Reference

Application-level functions used for configuration and operation during ranging. More...

Go to the source code of this file.

Data Structures

struct  sensor_RangeData
 This data type defines range measurement data. More...

Functions

sensor_error range_set_dynamic_config (uint8_t device_base_address)
 Device setup, for Ranging operations, with parameters that require the system mode to be STARTed before being applied.
sensor_error range_set_systemMode (uint8_t device_base_address, int32_t mode)
 Set Mode and Operation commands in the sysrange_start register.
uint8_t range_get_systemMode (uint8_t device_base_address)
 Report status of Range mode-select and Stop/Start.
uint8_t range_get_result (uint8_t device_base_address)
 Report basic result from last ranging operation.
uint32_t range_get_signal_rate (uint8_t device_base_address)
 Report signal rate from last ranging operation. Reads the RESULT_RANGE_SIGNAL_RATE register.
sensor_error range_get_full_result (uint8_t device_base_address)
 Report all results from last ranging operation.
sensor_error Range_Set_Thresholds (uint8_t device_base_address, int32_t low_threshold, int32_t high_threshold)
 Set min/max range thresholds (1 to 254mm) in SYSRANGE_THRESH_LOW & SYSRANGE_THRESH_HIGH registers.
sensor_error range_set_high_threshold (uint8_t device_base_address, uint8_t threshold)
 Set ranging high threshold in the SYSRANGE_THRESH_HIGH register.
uint8_t range_get_high_threshold (uint8_t device_base_address)
 Report ranging high threshold from the SYSRANGE_THRESH_HIGH register.
sensor_error range_set_low_threshold (uint8_t device_base_address, uint8_t threshold)
 Set ranging low threshold in the SYSRANGE_THRESH_LOW register.
uint8_t range_get_low_threshold (uint8_t device_base_address)
 Report ranging low threshold from the SYSRANGE_THRESH_LOW register.
sensor_error range_set_interMeasurement_period (uint8_t device_base_address, uint16_t intermeasurement_period)
 Set ranging intermeasurement period in the SYSRANGE_INTERMEASUREMENT_PERIOD register.
uint16_t range_get_interMeasurement_period (uint8_t device_base_address)
 Report ranging intermeasurement period from the SYSRANGE_INTERMEASUREMENT_PERIOD register.
sensor_error range_set_max_convergence_time (uint8_t device_base_address, int32_t max_convergence_time)
 Set ranging maximum convergence time in the SYSRANGE_MAX_CONVERGENCE_TIME register.
uint8_t range_get_max_convergence_time (uint8_t device_base_address)
 Report ranging maximum convergence time from the SYSRANGE_MAX_CONVERGENCE_TIME register.
sensor_error range_set_crosstalk_compensation_rate (uint8_t device_base_address, int32_t crosstalk_compensation_rate)
 Set ranging crosstalk compensation rate in the SYSRANGE_CROSSTALK_COMPENSATION_RATE register.
int32_t range_get_crosstalk_compensation_rate (uint8_t device_base_address)
 Report ranging crosstalk compensation rate (MHz) from the SYSRANGE_CROSSTALK_COMPENSATION_RATE register.
sensor_error range_set_crosstalk_compensation_range (uint8_t device_base_address, int32_t crosstalk_compensation_range)
 Set ranging crosstalk compensation range in the SYSRANGE_CROSSTALK_COMPENSATION_RANGE register.
uint8_t range_get_crosstalk_compensation_range (uint8_t device_base_address)
 Report ranging crosstalk compensation range (mm) from the SYSRANGE_CROSSTALK_COMPENSATION_RANGE register.
sensor_error range_set_crosstalk_valid_height (uint8_t device_base_address, int32_t crosstalk_valid_height)
 Set ranging crosstalk valid height in the SYSRANGE_CROSSTALK_VALID_HEIGHT register.
uint8_t range_get_crosstalk_valid_height (uint8_t device_base_address)
 Report ranging crosstalk valid height from the SYSRANGE_CROSSTALK_VALID_HEIGHT register.
sensor_error range_set_early_convergence_estimate_threshold (uint8_t device_base_address)
 Set ranging ECE (early convergence estimate) Threshold in the SYSRANGE_EARLY_CONVERGENCE_ESTIMATE' register.
uint8_t range_get_early_convergence_estimate_threshold (uint8_t device_base_address)
 Report ranging early convergence estimate from the SYSRANGE_EARLY_CONVERGENCE_ESTIMATE register.
uint32_t range_get_converg_ctrl_rtn_thresh_fine (uint8_t device_base_address)
 read convergence count threshold from USER_CONV_CTRL_RETURN_THRESHOLD_FINE register.
sensor_error range_set_ignore_valid_height (uint8_t device_base_address, int32_t ignore_valid_height)
 Set Ranging Ignore Valid Height threshold in the SYSRANGE_RANGE_IGNORE_VALID_HEIGHT register.
uint8_t range_get_ignore_valid_height (uint8_t device_base_address)
 Report ranging ignore valid height threshold from the SYSRANGE_RANGE_IGNORE_VALID_HEIGHT register.
sensor_error range_set_range_ignore_threshold (uint8_t device_base_address, uint32_t range_ignore_threshold)
 Set Range Ignore Threshold in the SYSRANGE_RANGE_IGNORE_THRESHOLD register.
uint32_t range_get_range_ignore_threshold (uint8_t device_base_address)
 Report Range Ignore Threshold from the SYSRANGE_RANGE_IGNORE_THRESHOLD register. in Mcps 9.7 format.
sensor_error range_set_emitter_block_threshold (uint8_t device_base_address, int32_t emitter_block_threshold)
 Set Emitter Block Threshold in the SYSRANGE_EMITTER_BLOCK_THRESHOLD register.
uint8_t range_get_emitter_block_threshold (uint8_t device_base_address)
 Report Emitter Block Threshold from the SYSRANGE_EMITTER_BLOCK_THRESHOLD register.
sensor_error range_set_snr_thresh (uint8_t device_base_address, float_t snrThresh)
 Function to set the SNR threshold.
float_t range_get_snr_thresh (uint8_t device_base_address)
 Function to get the SNR threshold.
sensor_error range_set_range_check_enables (uint8_t device_base_address, int32_t range_check_enables)
 Set Range Check Enables in the SYSRANGE_RANGE_CHECK_ENABLES register.
uint8_t range_get_range_check_enables (uint8_t device_base_address)
 Report Range Check Enables from the SYSRANGE_RANGE_CHECK_ENABLES register.
sensor_error range_set_vhv_recalibrate (uint8_t device_base_address, int32_t VHV_Recalibrate)
 Set Range Check Enables in the SYSRANGE_VHV_RECALIBRATE register.
uint8_t range_get_vhv_recalibrate (uint8_t device_base_address)
 Report Range Check Enables from the SYSRANGE_VHV_RECALIBRATE register.
sensor_error range_set_vhv_repeat_rate (uint8_t device_base_address, int32_t VHV_repeat_rate)
 Set VHV Repeat Rate.
uint8_t range_get_vhv_repeat_rate (uint8_t device_base_address)
 Report VHV Repeat Rate.
int32_t range_get_result_status (uint8_t device_base_address)
 Report contents of the RESULT_RANGE_STATUS register.
bool_t range_get_device_ready (uint8_t device_base_address)
 Report result_range_device_ready status in the RESULT_RANGE_STATUS register.
uint8_t range_get_result_error_codes (uint8_t device_base_address)
 Report result_range_error_codes status.
sensor_error range_set_ece_factor (uint8_t device_base_address, uint32_t ECE_Factor_M, uint32_t ECE_Factor_D)
 Set the ECE Factor Molecular and Demoninator.
sensor_error range_get_ece_factor (uint32_t *pece_factor_m, uint32_t *pece_factor_d)
 Store the ECE Margin Molecular and Demoninator to provided variables.
sensor_error range_set_system_interrupt_config_gpio (uint8_t device_base_address, uint8_t Ranging_GPIO_interrupt_config)
 Set System Interrupt Config GPIO for Ranging operations.
uint8_t range_get_system_interrupt_config_gpio (uint8_t device_base_address)
 Report System Interrupt Config GPIO Ranging.
sensor_error range_set_system_interrupt_clear (uint8_t device_base_address)
 Clear Ranging System Interrupt.
uint8_t range_get_result_interrupt_status_gpio (uint8_t device_base_address)
 Report GPIO Interrupt Result Status for a Ranging operation.
sensor_error range_set_history_buffer_mode_enable (uint8_t device_base_address)
 Set history buffer to range mode and enable.
uint32_t range_get_upper_limit (uint8_t device_base_address)
 Function to return the Maximum range reported by the sensor.
uint32_t range_get_lower_limit (uint8_t device_base_address)
 Function to return the Minimum range reported by the sensor.

Detailed Description

Application-level functions used for configuration and operation during ranging.

Definition in file ranging_driver.h.


Function Documentation

uint32_t range_get_converg_ctrl_rtn_thresh_fine ( uint8_t  device_base_address )

read convergence count threshold from USER_CONV_CTRL_RETURN_THRESHOLD_FINE register.

Parameters:
[in]device_base_address
Return values:
Integer.Returns the formated reading of the USER_CONV_CTRL_RETURN_THRESHOLD_FINE register.

Definition at line 369 of file ranging_driver.cpp.

uint8_t range_get_crosstalk_compensation_range ( uint8_t  device_base_address )

Report ranging crosstalk compensation range (mm) from the SYSRANGE_CROSSTALK_COMPENSATION_RANGE register.

Parameters:
[in]device_base_address
Return values:
Integer.Returns the contents of the SYSRANGE_CROSSTALK_COMPENSATION_RANGE register.

Definition at line 281 of file ranging_driver.cpp.

int32_t range_get_crosstalk_compensation_rate ( uint8_t  device_base_address )

Report ranging crosstalk compensation rate (MHz) from the SYSRANGE_CROSSTALK_COMPENSATION_RATE register.

Parameters:
[in]device_base_address
Return values:
Integer.Returns the contents of the SYSRANGE_CROSSTALK_COMPENSATION_RATE register.

Definition at line 260 of file ranging_driver.cpp.

uint8_t range_get_crosstalk_valid_height ( uint8_t  device_base_address )

Report ranging crosstalk valid height from the SYSRANGE_CROSSTALK_VALID_HEIGHT register.

Parameters:
[in]device_base_address
Return values:
Integer.Returns the contents of the SYSRANGE_CROSSTALK_VALID_HEIGHT register.

Definition at line 303 of file ranging_driver.cpp.

bool_t range_get_device_ready ( uint8_t  device_base_address )

Report result_range_device_ready status in the RESULT_RANGE_STATUS register.

Parameters:
[in]device_base_address
Return values:
Boolean.Return True if the result_range_device_ready bit in the RESULT_RANGE_STATUS register is set, otherwise False.

Definition at line 542 of file ranging_driver.cpp.

uint8_t range_get_early_convergence_estimate_threshold ( uint8_t  device_base_address )

Report ranging early convergence estimate from the SYSRANGE_EARLY_CONVERGENCE_ESTIMATE register.

Parameters:
[in]device_base_address
Return values:
Integer.Returns the contents of the SYSRANGE_EARLY_CONVERGENCE_ESTIMATE register.

Definition at line 332 of file ranging_driver.cpp.

sensor_error range_get_ece_factor ( uint32_t pece_factor_m,
uint32_t pece_factor_d 
)

Store the ECE Margin Molecular and Demoninator to provided variables.

(< 1.00 for maximum detection, > 1.00 for minimizing red glow)

Parameters:
[in]pece_factor_mpointer to ECE_Factor_M variable
[in]pece_factor_dpointer to ECE_Factor_D variable
Return values:
sensor_error.

Definition at line 571 of file ranging_driver.cpp.

uint8_t range_get_emitter_block_threshold ( uint8_t  device_base_address )

Report Emitter Block Threshold from the SYSRANGE_EMITTER_BLOCK_THRESHOLD register.

MHz, 9.7 format

Parameters:
[in]device_base_address
Return values:
Integer.Returns the contents of the SYSRANGE_EMITTER_BLOCK_THRESHOLD register.

Definition at line 441 of file ranging_driver.cpp.

sensor_error range_get_full_result ( uint8_t  device_base_address )

Report all results from last ranging operation.

Report all results data associated with a ranging operation.

Result_range_val
Result_range_stray
Result_range_raw
Result_range_return_rate
Result_range_reference_rate
Result_range_Return_VCSEL_count
Result_range_Reference_VCSEL_count
Result_range_Return_AMB_count
Result_range_Reference_AMB_count
Result_range_Return_Conv_time
Result_range_Reference_Conv_time

Parameters:
[in]device_base_address
Return values:
List.Returns a list of all the results data, from the last successfully completed ranging operation.

Definition at line 112 of file ranging_driver.cpp.

uint8_t range_get_high_threshold ( uint8_t  device_base_address )

Report ranging high threshold from the SYSRANGE_THRESH_HIGH register.

Range : 0-255 mm

Parameters:
[in]device_base_address
Return values:
Integer.Returns the contents of the SYSRANGE_THRESH_HIGH register.

Definition at line 171 of file ranging_driver.cpp.

uint8_t range_get_ignore_valid_height ( uint8_t  device_base_address )

Report ranging ignore valid height threshold from the SYSRANGE_RANGE_IGNORE_VALID_HEIGHT register.

Parameters:
[in]device_base_address
Return values:
Integer.Returns the contents of the SYSRANGE_RANGE_IGNORE_VALID_HEIGHT register.

Definition at line 398 of file ranging_driver.cpp.

uint16_t range_get_interMeasurement_period ( uint8_t  device_base_address )

Report ranging intermeasurement period from the SYSRANGE_INTERMEASUREMENT_PERIOD register.

Range 10ms-2.55s, 1 code = 10 ms, code 0 = 10ms.

Parameters:
[in]device_base_address
Return values:
Integer.Returns the range inter measurement period in ms.

Definition at line 221 of file ranging_driver.cpp.

uint8_t range_get_low_threshold ( uint8_t  device_base_address )

Report ranging low threshold from the SYSRANGE_THRESH_LOW register.

Range : 0-255 mm

Parameters:
[in]device_base_address
Return values:
Integer.Returns the contents of the SYSRANGE_THRESH_LOW register.

Definition at line 193 of file ranging_driver.cpp.

uint32_t range_get_lower_limit ( uint8_t  device_base_address )

Function to return the Minimum range reported by the sensor.

Definition at line 677 of file ranging_driver.cpp.

uint8_t range_get_max_convergence_time ( uint8_t  device_base_address )

Report ranging maximum convergence time from the SYSRANGE_MAX_CONVERGENCE_TIME register.

Range 0-50ms, 1 code = 1 ms

Parameters:
[in]device_base_address
Return values:
Integer.Returns the contents of the SYSRANGE_MAX_CONVERGENCE_TIME register.

Definition at line 244 of file ranging_driver.cpp.

uint8_t range_get_range_check_enables ( uint8_t  device_base_address )

Report Range Check Enables from the SYSRANGE_RANGE_CHECK_ENABLES register.

Parameters:
[in]device_base_address
Return values:
Integer.Returns the contents of the SYSRANGE_RANGE_CHECK_ENABLES register.

Definition at line 498 of file ranging_driver.cpp.

uint32_t range_get_range_ignore_threshold ( uint8_t  device_base_address )

Report Range Ignore Threshold from the SYSRANGE_RANGE_IGNORE_THRESHOLD register. in Mcps 9.7 format.

Parameters:
[in]device_base_address
Return values:
Integer.Returns the contents of the SYSRANGE_RANGE_IGNORE_THRESHOLD register.

Definition at line 424 of file ranging_driver.cpp.

uint8_t range_get_result ( uint8_t  device_base_address )

Report basic result from last ranging operation.

Accessing Result_Range_Val register

Parameters:
[in]device_base_address
Return values:
8-bitInteger. Returns the result of the last successfully completed ranging operation, by reading the RESULT_RANGE_VAL register.

Definition at line 100 of file ranging_driver.cpp.

uint8_t range_get_result_error_codes ( uint8_t  device_base_address )

Report result_range_error_codes status.

Parameters:
[in]device_base_address
Return values:
Integer.Return True if the result_range_error_codes bit in the RESULT_RANGE_STATUS register is set, otherwise False.

Definition at line 551 of file ranging_driver.cpp.

uint8_t range_get_result_interrupt_status_gpio ( uint8_t  device_base_address )

Report GPIO Interrupt Result Status for a Ranging operation.

Returns the Ranging-only portion of the RESULT_INTERRUPT_STATUS_GPIO register.
Possible returns are :
0: No threshold events reported
1: Level Low threshold event
2: Level High threshold event
3: Out Of Window threshold event
4: New Sample Ready threshold event

Parameters:
[in]device_base_address
Return values:
Integer

Definition at line 633 of file ranging_driver.cpp.

int32_t range_get_result_status ( uint8_t  device_base_address )

Report contents of the RESULT_RANGE_STATUS register.

Parameters:
[in]device_base_address
Return values:
Integer

Definition at line 537 of file ranging_driver.cpp.

uint32_t range_get_signal_rate ( uint8_t  device_base_address )

Report signal rate from last ranging operation. Reads the RESULT_RANGE_SIGNAL_RATE register.

Parameters:
[in]device_base_address
Return values:
auint32_t in 9.7 format.

Definition at line 105 of file ranging_driver.cpp.

float_t range_get_snr_thresh ( uint8_t  device_base_address )

Function to get the SNR threshold.

Parameters:
[in]device_base_address
Return values:
Float.Returns the SNR threshold.

Definition at line 474 of file ranging_driver.cpp.

uint8_t range_get_system_interrupt_config_gpio ( uint8_t  device_base_address )

Report System Interrupt Config GPIO Ranging.

Returns the ranging-only portion of the SYSTEM_INTERRUPT_CONFIG_GPIO register.
Possible returns are :
CONFIG_GPIO_INTERRUPT_DISABLED = 0x00
CONFIG_GPIO_INTERRUPT_LEVEL_LOW = 0x01
CONFIG_GPIO_INTERRUPT_LEVEL_HIGH = 0x02
CONFIG_GPIO_INTERRUPT_OUT_OF_WINDOW = 0x03
CONFIG_GPIO_INTERRUPT_NEW_SAMPLE_READY = 0x04

Parameters:
[in]device_base_address
Return values:
Integer

Definition at line 607 of file ranging_driver.cpp.

uint8_t range_get_systemMode ( uint8_t  device_base_address )

Report status of Range mode-select and Stop/Start.

Range_Start_Singleshot
Range_Start_Continuous
Range_Stop

Parameters:
[in]device_base_address
Return values:
Integer.Returns the contents of the SYSRANGE_START register.

Definition at line 89 of file ranging_driver.cpp.

uint32_t range_get_upper_limit ( uint8_t  device_base_address )

Function to return the Maximum range reported by the sensor.

Definition at line 664 of file ranging_driver.cpp.

uint8_t range_get_vhv_recalibrate ( uint8_t  device_base_address )

Report Range Check Enables from the SYSRANGE_VHV_RECALIBRATE register.

Parameters:
[in]device_base_address
Return values:
Integer.

Definition at line 515 of file ranging_driver.cpp.

uint8_t range_get_vhv_repeat_rate ( uint8_t  device_base_address )

Report VHV Repeat Rate.

Parameters:
[in]device_base_address
Return values:
Integer.Repeat rate of autoVHV task, in measurements. 0 = off, 255 = after every 255 measurements.

Definition at line 532 of file ranging_driver.cpp.

sensor_error range_set_crosstalk_compensation_range ( uint8_t  device_base_address,
int32_t  crosstalk_compensation_range 
)

Set ranging crosstalk compensation range in the SYSRANGE_CROSSTALK_COMPENSATION_RANGE register.

User-controlled crosstalk compensation range, in mm.

Parameters:
[in]device_base_address
[in]crosstalk_compensation_rangeUser-controlled crosstalk compensation range, in ranging modes.
Return values:
sensor_error

Definition at line 270 of file ranging_driver.cpp.

sensor_error range_set_crosstalk_compensation_rate ( uint8_t  device_base_address,
int32_t  crosstalk_compensation_rate 
)

Set ranging crosstalk compensation rate in the SYSRANGE_CROSSTALK_COMPENSATION_RATE register.

User-controlled crosstalk compensation rate, in MHz.

Parameters:
[in]device_base_address
[in]crosstalk_compensation_rateUser-controlled crosstalk compensation rate, in ranging modes.
Return values:
sensor_error

Definition at line 249 of file ranging_driver.cpp.

sensor_error range_set_crosstalk_valid_height ( uint8_t  device_base_address,
int32_t  crosstalk_valid_height 
)

Set ranging crosstalk valid height in the SYSRANGE_CROSSTALK_VALID_HEIGHT register.

Minimum range at which to apply crosstalk compensation, in mm.

Parameters:
[in]device_base_address
[in]crosstalk_valid_heightMinimum range at which to apply crosstalk compensation, in ranging modes.
Return values:
sensor_error

Definition at line 292 of file ranging_driver.cpp.

sensor_error range_set_dynamic_config ( uint8_t  device_base_address )

Device setup, for Ranging operations, with parameters that require the system mode to be STARTed before being applied.

Parameters:
[in]device_base_address
Return values:
sensor_error

Definition at line 48 of file ranging_driver.cpp.

sensor_error range_set_early_convergence_estimate_threshold ( uint8_t  device_base_address )

Set ranging ECE (early convergence estimate) Threshold in the SYSRANGE_EARLY_CONVERGENCE_ESTIMATE' register.

User-set limit below which a ranging operation is aborted.
An estimate of convergence time is performed 1ms into a ranging operation. If the return rate is below this user-set limit, the ranging operation is aborted to save power.

Parameters:
[in]device_base_address
Return values:
sensor_error

Definition at line 313 of file ranging_driver.cpp.

sensor_error range_set_ece_factor ( uint8_t  device_base_address,
uint32_t  ECE_Factor_M,
uint32_t  ECE_Factor_D 
)

Set the ECE Factor Molecular and Demoninator.

(< 1.00 for maximum detection, > 1.00 for minimizing red glow)

Parameters:
[in]device_base_address
[in]ECE_Factor_M
[in]ECE_Factor_D
Return values:
sensor_error

Definition at line 556 of file ranging_driver.cpp.

sensor_error range_set_emitter_block_threshold ( uint8_t  device_base_address,
int32_t  emitter_block_threshold 
)

Set Emitter Block Threshold in the SYSRANGE_EMITTER_BLOCK_THRESHOLD register.

Maximum Reference Array VCSEL returns allowed before reporting that the emitter is blocked.
MHz, 9.7 format

Parameters:
[in]device_base_address
[in]emitter_block_thresholdMinimum acceptable count rate of VCSEL counts on the return array.
Return values:
sensor_error

Definition at line 430 of file ranging_driver.cpp.

sensor_error range_set_high_threshold ( uint8_t  device_base_address,
uint8_t  threshold 
)

Set ranging high threshold in the SYSRANGE_THRESH_HIGH register.

Range : 0-255 mm

Parameters:
[in]device_base_address
[in]thresholdRanging high threshold to be written to the SYSRANGE_THRESH_HIGH register(0-255mm).
Return values:
sensor_error

Definition at line 161 of file ranging_driver.cpp.

sensor_error range_set_history_buffer_mode_enable ( uint8_t  device_base_address )

Set history buffer to range mode and enable.

Parameters:
[in]device_base_address
Return values:
sensor_error
sensor_error range_set_ignore_valid_height ( uint8_t  device_base_address,
int32_t  ignore_valid_height 
)

Set Ranging Ignore Valid Height threshold in the SYSRANGE_RANGE_IGNORE_VALID_HEIGHT register.

Default : 256

Parameters:
[in]device_base_address
[in]ignore_valid_heightUser-set limit
Return values:
sensor_error

Definition at line 386 of file ranging_driver.cpp.

sensor_error range_set_interMeasurement_period ( uint8_t  device_base_address,
uint16_t  intermeasurement_period 
)

Set ranging intermeasurement period in the SYSRANGE_INTERMEASUREMENT_PERIOD register.

Time delay between measurements in continuous ranging mode. Range 10ms - 2.55secs (1 code = 10ms. Code 0 = 10ms.).
Min (default) value stored in NVM.

Parameters:
[in]device_base_address
[in]intermeasurement_periodTime delay in ms between measurements in continuous-ranging mode. <0-2550ms>
Return values:
sensor_error

Definition at line 204 of file ranging_driver.cpp.

sensor_error range_set_low_threshold ( uint8_t  device_base_address,
uint8_t  threshold 
)

Set ranging low threshold in the SYSRANGE_THRESH_LOW register.

Range : 0-255 mm

Parameters:
[in]device_base_address
[in]thresholdRanging low threshold to be written to the SYSRANGE_THRESH_LOW register.
Return values:
sensor_error

Definition at line 182 of file ranging_driver.cpp.

sensor_error range_set_max_convergence_time ( uint8_t  device_base_address,
int32_t  max_convergence_time 
)

Set ranging maximum convergence time in the SYSRANGE_MAX_CONVERGENCE_TIME register.

Maximum time to run measurements in ranging modes.

Range 0-50ms, 1 code = 1 ms

Parameters:
[in]device_base_address
[in]max_convergence_timeMaximum time to run measurements in ranging modes (max = 50ms).
Return values:
sensor_error

Definition at line 233 of file ranging_driver.cpp.

sensor_error range_set_range_check_enables ( uint8_t  device_base_address,
int32_t  range_check_enables 
)

Set Range Check Enables in the SYSRANGE_RANGE_CHECK_ENABLES register.

Parameters:
[in]device_base_address
[in]range_check_enables
Return values:
sensor_error

Definition at line 486 of file ranging_driver.cpp.

sensor_error range_set_range_ignore_threshold ( uint8_t  device_base_address,
uint32_t  range_ignore_threshold 
)

Set Range Ignore Threshold in the SYSRANGE_RANGE_IGNORE_THRESHOLD register.

Minimum acceptable count rate of VCSEL counts on the return array.

Default : 2.

Parameters:
[in]device_base_address
[in]range_ignore_thresholdMinimum acceptable count rate of VCSEL counts on the return array. in Mcps 9.7 format.
Return values:
sensor_error

Definition at line 410 of file ranging_driver.cpp.

sensor_error range_set_snr_thresh ( uint8_t  device_base_address,
float_t  snrThresh 
)

Function to set the SNR threshold.

Parameters:
[in]device_base_address
[in]snrThresh
Return values:
sensor_error

Definition at line 446 of file ranging_driver.cpp.

sensor_error range_set_system_interrupt_clear ( uint8_t  device_base_address )

Clear Ranging System Interrupt.

Parameters:
[in]device_base_address
Return values:
sensor_error

Definition at line 621 of file ranging_driver.cpp.

sensor_error range_set_system_interrupt_config_gpio ( uint8_t  device_base_address,
uint8_t  Ranging_GPIO_interrupt_config 
)

Set System Interrupt Config GPIO for Ranging operations.

Returns True if a command is successfully applied to the SYSTEM_INTERRUPT_CONFIG_GPIO register, otherwise False.
Possible settings are :
CONFIG_GPIO_INTERRUPT_DISABLED = 0x00
CONFIG_GPIO_INTERRUPT_LEVEL_LOW = 0x01
CONFIG_GPIO_INTERRUPT_LEVEL_HIGH = 0x02
CONFIG_GPIO_INTERRUPT_OUT_OF_WINDOW = 0x03
CONFIG_GPIO_INTERRUPT_NEW_SAMPLE_READY = 0x04

Parameters:
[in]device_base_address
[in]Ranging_GPIO_interrupt_config
Return values:
sensor_error

Definition at line 579 of file ranging_driver.cpp.

sensor_error range_set_systemMode ( uint8_t  device_base_address,
int32_t  mode 
)

Set Mode and Operation commands in the sysrange_start register.

Possible combinations are :

RANGE_START_SINGLESHOT 0x01 # bit 0 set / bit 1 clear
RANGE_START_CONTINUOUS 0x03 # bit 0 set / bit 1 set
RANGE_STOP 0x01 # bit 0 set / bit 1 don't care

Parameters:
[in]device_base_address
[in]modeMode select/operation command to be written to the SYSRANGE_START register.
Return values:
Boolean.Return True if a valid command is applied, otherwise False.

Definition at line 57 of file ranging_driver.cpp.

sensor_error Range_Set_Thresholds ( uint8_t  device_base_address,
int32_t  low_threshold,
int32_t  high_threshold 
)

Set min/max range thresholds (1 to 254mm) in SYSRANGE_THRESH_LOW & SYSRANGE_THRESH_HIGH registers.

Parameters:
[in]device_base_address
[in]low_thresholdRanging low threshold to be written to the SYSRANGE_THRESH_LOW register (default = 0mm.)
[in]high_thresholdRanging high threshold to be written to the SYSRANGE_THRESH_HIGH register (default = 255mm.)
Return values:
sensor_error
sensor_error range_set_vhv_recalibrate ( uint8_t  device_base_address,
int32_t  VHV_Recalibrate 
)

Set Range Check Enables in the SYSRANGE_VHV_RECALIBRATE register.

Parameters:
[in]device_base_address
[in]VHV_Recalibrate
Return values:
sensor_error

Definition at line 503 of file ranging_driver.cpp.

sensor_error range_set_vhv_repeat_rate ( uint8_t  device_base_address,
int32_t  VHV_repeat_rate 
)

Set VHV Repeat Rate.

Repeat rate of autoVHV task
measurements, 0 = off, 255 = after every 255 measurements

Parameters:
[in]device_base_address
[in]VHV_repeat_rateRepeat rate of autoVHV task
Return values:
sensor_error

Definition at line 520 of file ranging_driver.cpp.