lightranger11 2.1.0.0
lightranger11.h File Reference

This file contains API for LightRanger 11 Click Driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_i2c_master.h"

Go to the source code of this file.

Data Structures

struct  lightranger11_t
 LightRanger 11 Click context object. More...
 
struct  lightranger11_cfg_t
 LightRanger 11 Click configuration object. More...
 
struct  lightranger11_results_data_t
 LightRanger 11 Click block header union data definition. More...
 
union  lightranger11_block_header_t
 LightRanger 11 Click block header union data definition. More...
 

Macros

#define LIGHTRANGER11_DCI_ZONE_CONFIG   0x5450
 LightRanger 11 description register.
 
#define LIGHTRANGER11_DCI_FREQ_HZ   0x5458
 
#define LIGHTRANGER11_DCI_INT_TIME   0x545C
 
#define LIGHTRANGER11_DCI_FW_NB_TARGET   0x5478
 
#define LIGHTRANGER11_DCI_RANGING_MODE   0xAD30
 
#define LIGHTRANGER11_DCI_DSS_CONFIG   0xAD38
 
#define LIGHTRANGER11_DCI_TARGET_ORDER   0xAE64
 
#define LIGHTRANGER11_DCI_SHARPENER   0xAED8
 
#define LIGHTRANGER11_DCI_INTERNAL_CP   0xB39C
 
#define LIGHTRANGER11_DCI_MOTION_DETECTOR_CFG   0xBFAC
 
#define LIGHTRANGER11_DCI_SINGLE_RANGE   0xCD5C
 
#define LIGHTRANGER11_DCI_OUTPUT_CONFIG   0xCD60
 
#define LIGHTRANGER11_DCI_OUTPUT_ENABLES   0xCD68
 
#define LIGHTRANGER11_DCI_OUTPUT_LIST   0xCD78
 
#define LIGHTRANGER11_DCI_PIPE_CONTROL   0xCF78
 
#define LIGHTRANGER11_UI_CMD_STATUS   0x2C00
 LightRanger 11 UI commands list.
 
#define LIGHTRANGER11_UI_CMD_START   0x2C04
 
#define LIGHTRANGER11_UI_CMD_END   0x2FFF
 
#define LIGHTRANGER11_TEMP_BUFFER_SIZE   1024
 LightRanger 11 buffers size setting.
 
#define LIGHTRANGER11_NVM_DATA_SIZE   492
 
#define LIGHTRANGER11_OFFSET_BUFFER_SIZE   488
 
#define LIGHTRANGER11_XTALK_BUFFER_SIZE   776
 
#define LIGHTRANGER11_RESOLUTION_4X4   16
 LightRanger 11 resolution setting.
 
#define LIGHTRANGER11_RESOLUTION_8X8   64
 
#define LIGHTRANGER11_RANGING_MODE_CONTINUOUS   1
 LightRanger 11 ranging mode setting.
 
#define LIGHTRANGER11_RANGING_MODE_AUTONOMOUS   3
 
#define LIGHTRANGER11_START_BH   0x0000000Dul
 LightRanger 11 range results block headers setting.
 
#define LIGHTRANGER11_METADATA_BH   0x54B400C0ul
 
#define LIGHTRANGER11_COMMONDATA_BH   0x54C00040ul
 
#define LIGHTRANGER11_AMBIENT_RATE_BH   0x54D00104ul
 
#define LIGHTRANGER11_SPAD_COUNT_BH   0x55D00404ul
 
#define LIGHTRANGER11_NB_TARGET_DETECTED_BH   0xCF7C0401ul
 
#define LIGHTRANGER11_SIGNAL_RATE_BH   0xCFBC0404ul
 
#define LIGHTRANGER11_RANGE_SIGMA_MM_BH   0xD2BC0402ul
 
#define LIGHTRANGER11_DISTANCE_BH   0xD33C0402ul
 
#define LIGHTRANGER11_REFLECTANCE_BH   0xD43C0401ul
 
#define LIGHTRANGER11_TARGET_STATUS_BH   0xD47C0401ul
 
#define LIGHTRANGER11_MOTION_DETECT_BH   0xCC5008C0ul
 
#define LIGHTRANGER11_METADATA_IDX   0x54B4
 
#define LIGHTRANGER11_SPAD_COUNT_IDX   0x55D0
 
#define LIGHTRANGER11_AMBIENT_RATE_IDX   0x54D0
 
#define LIGHTRANGER11_NB_TARGET_DETECTED_IDX   0xCF7C
 
#define LIGHTRANGER11_SIGNAL_RATE_IDX   0xCFBC
 
#define LIGHTRANGER11_RANGE_SIGMA_MM_IDX   0xD2BC
 
#define LIGHTRANGER11_DISTANCE_IDX   0xD33C
 
#define LIGHTRANGER11_REFLECTANCE_EST_PC_IDX   0xD43C
 
#define LIGHTRANGER11_TARGET_STATUS_IDX   0xD47C
 
#define LIGHTRANGER11_MOTION_DETEC_IDX   0xCC50
 
#define LIGHTRANGER11_DEF_RESOLUTION   LIGHTRANGER11_RESOLUTION_8X8
 LightRanger 11 default settings.
 
#define LIGHTRANGER11_DEF_RANGING_FREQ_HZ   2
 
#define LIGHTRANGER11_DEF_RANGING_MODE   LIGHTRANGER11_RANGING_MODE_AUTONOMOUS
 
#define LIGHTRANGER11_DEF_INTEGRATION_TIME_MS   20
 
#define LIGHTRANGER11_DEVICE_ADDRESS   0x29
 LightRanger 11 device address setting.
 
#define LIGHTRANGER11_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  lightranger11_return_value_t { LIGHTRANGER11_OK = 0 , LIGHTRANGER11_ERROR = -1 }
 LightRanger 11 Click return value data. More...
 

Functions

void lightranger11_cfg_setup (lightranger11_cfg_t *cfg)
 LightRanger 11 configuration object setup function.
 
err_t lightranger11_init (lightranger11_t *ctx, lightranger11_cfg_t *cfg)
 LightRanger 11 initialization function.
 
err_t lightranger11_default_cfg (lightranger11_t *ctx)
 LightRanger 11 default configuration function.
 
err_t lightranger11_write_multi (lightranger11_t *ctx, uint16_t reg, uint8_t *data_in, uint8_t len)
 LightRanger 11 write multi function.
 
err_t lightranger11_read_multi (lightranger11_t *ctx, uint16_t reg, uint8_t *data_out, uint16_t len)
 LightRanger 11 read multi function.
 
err_t lightranger11_write_byte (lightranger11_t *ctx, uint16_t reg, uint8_t data_in)
 LightRanger 11 write byte function.
 
err_t lightranger11_read_byte (lightranger11_t *ctx, uint16_t reg, uint8_t *data_out)
 LightRanger 11 read byte function.
 
err_t lightranger11_write_data (lightranger11_t *ctx, uint8_t *data_in, uint16_t len)
 LightRanger 11 write data function.
 
err_t lightranger11_check_comm (lightranger11_t *ctx)
 LightRanger 11 check communication function.
 
uint8_t lightranger11_get_int_pin (lightranger11_t *ctx)
 LightRanger 11 get int pin function.
 
void lightranger11_set_i2c_rst_pin (lightranger11_t *ctx, uint8_t state)
 LightRanger 11 set i2c rst function.
 
void lightranger11_set_lpn_pin (lightranger11_t *ctx, uint8_t state)
 LightRanger 11 set lpn function.
 
void lightranger11_reset_i2c (lightranger11_t *ctx)
 LightRanger 11 reset i2c function.
 
err_t lightranger11_sensor_init (lightranger11_t *ctx)
 LightRanger 11 sensor init function.
 
err_t lightranger11_dci_write_data (lightranger11_t *ctx, uint16_t index, uint8_t *data_in, uint16_t data_size)
 LightRanger 11 dci write data function.
 
err_t lightranger11_dci_read_data (lightranger11_t *ctx, uint16_t index, uint8_t *data_out, uint16_t data_size)
 LightRanger 11 dci read data function.
 
err_t lightranger11_dci_replace_data (lightranger11_t *ctx, uint16_t index, uint8_t *data_in, uint16_t data_size, uint8_t *new_data, uint16_t new_data_size, uint16_t new_data_pos)
 LightRanger 11 dci replace data function.
 
err_t lightranger11_set_resolution (lightranger11_t *ctx, uint8_t resolution)
 LightRanger 11 set resolution function.
 
err_t lightranger11_get_resolution (lightranger11_t *ctx, uint8_t *resolution)
 LightRanger 11 get resolution function.
 
err_t lightranger11_set_rang_freq_hz (lightranger11_t *ctx, uint8_t frequency_hz)
 LightRanger 11 set ranging frequency hz function.
 
err_t lightranger11_get_rang_freq_hz (lightranger11_t *ctx, uint8_t *frequency_hz)
 LightRanger 11 get ranging frequency hz function.
 
err_t lightranger11_set_integ_time_ms (lightranger11_t *ctx, uint32_t integration_time_ms)
 LightRanger 11 set integration time ms function.
 
err_t lightranger11_get_integ_time_ms (lightranger11_t *ctx, uint32_t *integration_time_ms)
 LightRanger 11 get integration time ms function.
 
err_t lightranger11_set_ranging_mode (lightranger11_t *ctx, uint8_t ranging_mode)
 LightRanger 11 set ranging mode function.
 
err_t lightranger11_get_ranging_mode (lightranger11_t *ctx, uint8_t *ranging_mode)
 LightRanger 11 get ranging mode function.
 
err_t lightranger11_start_ranging (lightranger11_t *ctx)
 LightRanger 11 start ranging function.
 
err_t lightranger11_stop_ranging (lightranger11_t *ctx)
 LightRanger 11 stop ranging function.
 
err_t lightranger11_get_ranging_data (lightranger11_t *ctx, lightranger11_results_data_t *results)
 LightRanger 11 get ranging data function.
 

Detailed Description

This file contains API for LightRanger 11 Click Driver.

Enumeration Type Documentation

◆ lightranger11_return_value_t

LightRanger 11 Click return value data.

Predefined enum values for driver return values.

Enumerator
LIGHTRANGER11_OK 
LIGHTRANGER11_ERROR