lightranger2 2.0.0.0

Functions

void lightranger2_cfg_setup (lightranger2_cfg_t *cfg)
 Config Object Initialization function.
 
LIGHTRANGER2_RETVAL lightranger2_init (lightranger2_t *ctx, lightranger2_cfg_t *cfg)
 Initialization function.
 
LIGHTRANGER2_RETVAL lightranger2_default_cfg (lightranger2_t *ctx)
 Click Default Configuration function.
 
void lightranger2_write_byte (lightranger2_t *ctx, uint8_t reg_address, uint8_t write_data)
 Click Default Configuration function.
 
uint8_t lightranger2_read_byte (lightranger2_t *ctx, uint8_t reg_address)
 Click Default Configuration function.
 
void lightranger2_write_data (lightranger2_t *ctx, uint8_t reg_address, uint16_t write_data)
 Click Default Configuration function.
 
uint16_t lightranger2_read_data (lightranger2_t *ctx, uint8_t reg_address)
 Click Default Configuration function.
 
void lightranger2_write_bytes (lightranger2_t *ctx, uint8_t reg_address, uint8_t *write_data, uint8_t n_bytes)
 Generic sequential data write function.
 
void lightranger2_read_bytes (lightranger2_t *ctx, uint8_t reg_address, uint8_t *read_data, uint8_t n_bytes)
 Generic sequential data read function.
 
void lightranger2_hw_reset (lightranger2_t *ctx)
 Hardware reset function.
 
void lightranger2_enable (lightranger2_t *ctx)
 Enable function.
 
void lightranger2_disable (lightranger2_t *ctx)
 Disable function.
 
uint8_t lightranger2_get_interrupt (lightranger2_t *ctx)
 Get interrupt state function.
 
void lightranger2_start_continuous (lightranger2_t *ctx, uint32_t period_ms)
 Start continuous ranging measurements function.
 
void lightranger2_stop_continuous (lightranger2_t *ctx)
 Stop continuous measurements function.
 
LIGHTRANGER2_RETVAL lightranger2_set_signal_rate_limit (lightranger2_t *ctx, float limit_mcps)
 Set the signal rate limit check value function.
 
float lightranger2_get_signal_rate_limit (lightranger2_t *ctx)
 Get the signal rate limit check value function.
 
LIGHTRANGER2_RETVAL lightranger2_get_spad_info (lightranger2_t *ctx, uint8_t *count_data, uint8_t *aperture_type)
 Get reference SPAD ( single photon avalanche diode ) function.
 
LIGHTRANGER2_RETVAL lightranger2_single_calibration (lightranger2_t *ctx, uint8_t vhv_init_byte)
 Perform single reference calibration function.
 
uint16_t lightranger2_get_range_continuous (lightranger2_t *ctx)
 Get a range measurement ( continuous mode ) function.
 
uint16_t lightranger2_get_range_single (lightranger2_t *ctx)
 Get a range measurement ( single mode ) function.
 

Detailed Description

Function Documentation

◆ lightranger2_cfg_setup()

void lightranger2_cfg_setup ( lightranger2_cfg_t * cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

@description This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ lightranger2_default_cfg()

LIGHTRANGER2_RETVAL lightranger2_default_cfg ( lightranger2_t * ctx)

Click Default Configuration function.

Parameters
ctxClick object.

@description This function executes default configuration for LightRanger2 click.

◆ lightranger2_disable()

void lightranger2_disable ( lightranger2_t * ctx)

Disable function.

Parameters
ctxClick object.

@description Function disable VL53L0X ranging and gesture detection sensor by cleared to '0' states of RST pin of the LightRanger 2 click board.

◆ lightranger2_enable()

void lightranger2_enable ( lightranger2_t * ctx)

Enable function.

Parameters
ctxClick object.

@description Function enable VL53L0X ranging and gesture detection sensor by sets to '1' states of RST pin of the LightRanger 2 click board.

◆ lightranger2_get_interrupt()

uint8_t lightranger2_get_interrupt ( lightranger2_t * ctx)

Get interrupt state function.

Parameters
ctxClick object.
Returns
interrupt state
  • 0 : not active
  • 1 : active

@description The function gets interrupt state by return status of INT pin of the LightRanger 2 click board.

◆ lightranger2_get_range_continuous()

uint16_t lightranger2_get_range_continuous ( lightranger2_t * ctx)

Get a range measurement ( continuous mode ) function.

Parameters
ctxClick object.
Returns
16-bit range measurement in millimeters value

@description Function gets a range measurement in millimeters when continuous mode is active of the VL53L0X ranging and gesture detection sensor on the LightRanger 2 click board.

◆ lightranger2_get_range_single()

uint16_t lightranger2_get_range_single ( lightranger2_t * ctx)

Get a range measurement ( single mode ) function.

Parameters
ctxClick object.
Returns
16-bit range measurement in millimeters value

@description Function gets a range measurement in millimeters when single mode is active of the VL53L0X ranging and gesture detection sensor on the LightRanger 2 click board.

◆ lightranger2_get_signal_rate_limit()

float lightranger2_get_signal_rate_limit ( lightranger2_t * ctx)

Get the signal rate limit check value function.

Parameters
ctxClick object.
Returns
float signal rate limit check value

@description Function gets the signal rate limit check value of the VL53L0X ranging and gesture detection sensor on the LightRanger 2 click board.

◆ lightranger2_get_spad_info()

LIGHTRANGER2_RETVAL lightranger2_get_spad_info ( lightranger2_t * ctx,
uint8_t * count_data,
uint8_t * aperture_type )

Get reference SPAD ( single photon avalanche diode ) function.

Parameters
ctxClick object.
count_datapointer to the memory location where count data data be stored
aperture_Typepointer to the memory location where aperture type data be stored
Returns
status
  • 0 : ERROR;
  • 1 : OK;

@description Function get reference SPAD ( single photon avalanche diode ) count and type of the VL53L0X ranging and gesture detection sensor on the LightRanger 2 click board.

◆ lightranger2_hw_reset()

void lightranger2_hw_reset ( lightranger2_t * ctx)

Hardware reset function.

Parameters
ctxClick object.

@description Function hardware reset the VL53L0X ranging and gesture detection sensor by cleared to '0' states of RST pin, wait 100 ms, sets to '1' states of RST pin and wait for another 100 ms.

Note
Delay is 200 ms.

◆ lightranger2_init()

LIGHTRANGER2_RETVAL lightranger2_init ( lightranger2_t * ctx,
lightranger2_cfg_t * cfg )

Initialization function.

Parameters
lightranger2Click object.
cfgClick configuration structure.

@description This function initializes all necessary pins and peripherals used for this click.

◆ lightranger2_read_byte()

uint8_t lightranger2_read_byte ( lightranger2_t * ctx,
uint8_t reg_address )

Click Default Configuration function.

Parameters
ctxClick object.
reg_address8-bit register address.
Returns
8-bit read data.

@description Function reads a byte of data from the targeted 8-bit register address of the VL53L0X ranging and gesture detection sensor on the LightRanger 2 click board.

◆ lightranger2_read_bytes()

void lightranger2_read_bytes ( lightranger2_t * ctx,
uint8_t reg_address,
uint8_t * read_data,
uint8_t n_bytes )

Generic sequential data read function.

Parameters
ctxClick object.
reg_address8-bit register address
read_datapointer to the memory location where data be stored
n_bytesnumber of bytes to be written

@description Function read a sequential data starting from the targeted 8-bit register address of the VL53L0X ranging and gesture detection sensor on the LightRanger 2 click board.

◆ lightranger2_read_data()

uint16_t lightranger2_read_data ( lightranger2_t * ctx,
uint8_t reg_address )

Click Default Configuration function.

Parameters
ctxClick object.
reg_address8-bit register address.
Returns
16-bit read data.

@description Function reads the 16-bit data from the targeted 8-bit register address of the VL53L0X ranging and gesture detection sensor on the LightRanger 2 click board.

◆ lightranger2_set_signal_rate_limit()

LIGHTRANGER2_RETVAL lightranger2_set_signal_rate_limit ( lightranger2_t * ctx,
float limit_mcps )

Set the signal rate limit check value function.

Parameters
ctxClick object.
period_msfloat signal rate limit check value
Returns
status
  • 0 : ERROR;
  • 1 : OK;

@description Function sets the limit presumably determines the minimum measurement necessary for the sensor to report a valid reading of the VL53L0X ranging and gesture detection sensor on the LightRanger 2 click board.

◆ lightranger2_single_calibration()

LIGHTRANGER2_RETVAL lightranger2_single_calibration ( lightranger2_t * ctx,
uint8_t vhv_init_byte )

Perform single reference calibration function.

Parameters
ctxClick object.
vhv_init_byte8-bit vhv init byte
Returns
status
  • 0 : ERROR;
  • 1 : OK;

@description Function perform single reference calibration of the VL53L0X ranging and gesture detection sensor on the LightRanger 2 click board.

◆ lightranger2_start_continuous()

void lightranger2_start_continuous ( lightranger2_t * ctx,
uint32_t period_ms )

Start continuous ranging measurements function.

Parameters
ctxClick object.
period_ms32-bit period in ms

@description Function start continuous ranging measurements of the VL53L0X ranging and gesture detection sensor on the LightRanger 2 click board.

◆ lightranger2_stop_continuous()

void lightranger2_stop_continuous ( lightranger2_t * ctx)

Stop continuous measurements function.

Parameters
ctxClick object.

@description Function stop continuous ranging measurements of the VL53L0X ranging and gesture detection sensor on the LightRanger 2 click board.

◆ lightranger2_write_byte()

void lightranger2_write_byte ( lightranger2_t * ctx,
uint8_t reg_address,
uint8_t write_data )

Click Default Configuration function.

Parameters
ctxClick object.
reg_address8-bit register address.
write_data8-bit data to write.

@description This function writes a byte of data to the targeted 8-bit register address of the VL53L0X ranging and gesture detection sensor on the LightRanger 2 click board.

◆ lightranger2_write_bytes()

void lightranger2_write_bytes ( lightranger2_t * ctx,
uint8_t reg_address,
uint8_t * write_data,
uint8_t n_bytes )

Generic sequential data write function.

Parameters
ctxClick object.
reg_address8-bit register address
write_datapointer to the data to be written
n_bytesnumber of bytes to be written

@description Function writes a sequential data starting to the targeted 8-bit register address of the VL53L0X ranging and gesture detection sensor on the LightRanger 2 click board.

◆ lightranger2_write_data()

void lightranger2_write_data ( lightranger2_t * ctx,
uint8_t reg_address,
uint16_t write_data )

Click Default Configuration function.

Parameters
ctxClick object.
reg_address8-bit register address.
write_data16-bit data to write.

@description This function writes the 16-bit data to the targeted 8-bit register address of the VL53L0X ranging and gesture detection sensor on the LightRanger 2 click board.