lightranger9 2.0.0.0
lightranger9.h File Reference

This file contains API for LightRanger 9 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  lightranger9_t
 LightRanger 9 Click context object. More...
 
struct  lightranger9_cfg_t
 LightRanger 9 Click configuration object. More...
 
struct  lightranger9_meas_result_t
 LightRanger 9 measurement result data object. More...
 
struct  lightranger9_capture_t
 LightRanger 9 capture data object. More...
 

Macros

#define LIGHTRANGER9_REG_APPID   0x00
 LightRanger 9 always available registers list.
 
#define LIGHTRANGER9_REG_MINOR   0x01
 
#define LIGHTRANGER9_REG_ENABLE   0xE0
 
#define LIGHTRANGER9_REG_INT_STATUS   0xE1
 
#define LIGHTRANGER9_REG_INT_ENAB   0xE2
 
#define LIGHTRANGER9_REG_ID   0xE3
 
#define LIGHTRANGER9_REG_REVID   0xE4
 
#define LIGHTRANGER9_REG_PATCH   0x02
 LightRanger 9 main application registers list.
 
#define LIGHTRANGER9_REG_BUILD_TYPE   0x03
 
#define LIGHTRANGER9_REG_APPLICATION_STATUS   0x04
 
#define LIGHTRANGER9_REG_MEASURE_STATUS   0x05
 
#define LIGHTRANGER9_REG_ALGORITHM_STATUS   0x06
 
#define LIGHTRANGER9_REG_CALIBRATION_STATUS   0x07
 
#define LIGHTRANGER9_REG_CMD_STAT   0x08
 
#define LIGHTRANGER9_REG_PREV_CMD   0x09
 
#define LIGHTRANGER9_REG_MODE   0x10
 
#define LIGHTRANGER9_REG_LIVE_BEAT   0x0A
 
#define LIGHTRANGER9_REG_ACTIVE_RANGE   0x19
 
#define LIGHTRANGER9_REG_SERIAL_NUMBER_0   0x1C
 
#define LIGHTRANGER9_REG_SERIAL_NUMBER_1   0x1D
 
#define LIGHTRANGER9_REG_SERIAL_NUMBER_2   0x1E
 
#define LIGHTRANGER9_REG_SERIAL_NUMBER_3   0x1F
 
#define LIGHTRANGER9_REG_CONFIG_RESULT   0x20
 
#define LIGHTRANGER9_REG_TID   0x21
 
#define LIGHTRANGER9_REG_SIZE_LSB   0x22
 
#define LIGHTRANGER9_REG_SIZE_MSB   0x23
 
#define LIGHTRANGER9_REG_BLOCKREAD   0x20
 LightRanger 9 measurements results registers list.
 
#define LIGHTRANGER9_REG_RESULT_NUMBER   0x24
 
#define LIGHTRANGER9_REG_TEMPERATURE   0x25
 
#define LIGHTRANGER9_REG_NUMBER_VALID_RESULTS   0x26
 
#define LIGHTRANGER9_REG_AMBIENT_LIGHT_0   0x28
 
#define LIGHTRANGER9_REG_AMBIENT_LIGHT_1   0x29
 
#define LIGHTRANGER9_REG_AMBIENT_LIGHT_2   0x2A
 
#define LIGHTRANGER9_REG_AMBIENT_LIGHT_3   0x2B
 
#define LIGHTRANGER9_REG_PHOTON_COUNT_0   0x2C
 
#define LIGHTRANGER9_REG_PHOTON_COUNT_1   0x2D
 
#define LIGHTRANGER9_REG_PHOTON_COUNT_2   0x2E
 
#define LIGHTRANGER9_REG_PHOTON_COUNT_3   0x2F
 
#define LIGHTRANGER9_REG_REFERENCE_COUNT_0   0x30
 
#define LIGHTRANGER9_REG_REFERENCE_COUNT_1   0x31
 
#define LIGHTRANGER9_REG_REFERENCE_COUNT_2   0x32
 
#define LIGHTRANGER9_REG_REFERENCE_COUNT_3   0x33
 
#define LIGHTRANGER9_REG_SYS_TICK_0   0x34
 
#define LIGHTRANGER9_REG_SYS_TICK_1   0x35
 
#define LIGHTRANGER9_REG_SYS_TICK_2   0x36
 
#define LIGHTRANGER9_REG_SYS_TICK_3   0x37
 
#define LIGHTRANGER9_REG_RES_CONFIDENCE_0   0x38
 
#define LIGHTRANGER9_REG_RES_DISTANCE_0_LSB   0x39
 
#define LIGHTRANGER9_REG_RES_DISTANCE_0_MSB   0x3A
 
#define LIGHTRANGER9_REG_RES_CONFIDENCE_1   0x3B
 
#define LIGHTRANGER9_REG_RES_DISTANCE_1_LSB   0x3C
 
#define LIGHTRANGER9_REG_RES_DISTANCE_1_MSB   0x3D
 
#define LIGHTRANGER9_REG_RES_CONFIDENCE_2   0x3E
 
#define LIGHTRANGER9_REG_RES_DISTANCE_2_LSB   0x3F
 
#define LIGHTRANGER9_REG_RES_DISTANCE_2_MSB   0x40
 
#define LIGHTRANGER9_REG_RES_CONFIDENCE_3   0x41
 
#define LIGHTRANGER9_REG_RES_DISTANCE_3_LSB   0x42
 
#define LIGHTRANGER9_REG_RES_DISTANCE_3_MSB   0x43
 
#define LIGHTRANGER9_REG_RES_CONFIDENCE_4   0x44
 
#define LIGHTRANGER9_REG_RES_DISTANCE_4_LSB   0x45
 
#define LIGHTRANGER9_REG_RES_DISTANCE_4_MSB   0x46
 
#define LIGHTRANGER9_REG_RES_CONFIDENCE_5   0x47
 
#define LIGHTRANGER9_REG_RES_DISTANCE_5_LSB   0x48
 
#define LIGHTRANGER9_REG_RES_DISTANCE_5_MSB   0x49
 
#define LIGHTRANGER9_REG_RES_CONFIDENCE_6   0x4A
 
#define LIGHTRANGER9_REG_RES_DISTANCE_6_LSB   0x4B
 
#define LIGHTRANGER9_REG_RES_DISTANCE_6_MSB   0x4C
 
#define LIGHTRANGER9_REG_RES_CONFIDENCE_7   0x4D
 
#define LIGHTRANGER9_REG_RES_DISTANCE_7_LSB   0x4E
 
#define LIGHTRANGER9_REG_RES_DISTANCE_7_MSB   0x4F
 
#define LIGHTRANGER9_REG_RES_CONFIDENCE_8   0x50
 
#define LIGHTRANGER9_REG_RES_DISTANCE_8_LSB   0x51
 
#define LIGHTRANGER9_REG_RES_DISTANCE_8_MSB   0x52
 
#define LIGHTRANGER9_REG_RES_CONFIDENCE_9   0x53
 
#define LIGHTRANGER9_REG_RES_DISTANCE_9_LSB   0x54
 
#define LIGHTRANGER9_REG_RES_DISTANCE_9_MSB   0x55
 
#define LIGHTRANGER9_REG_RES_CONFIDENCE_10   0x56
 
#define LIGHTRANGER9_REG_RES_DISTANCE_10_LSB   0x57
 
#define LIGHTRANGER9_REG_RES_DISTANCE_10_MSB   0x58
 
#define LIGHTRANGER9_REG_RES_CONFIDENCE_11   0x59
 
#define LIGHTRANGER9_REG_RES_DISTANCE_11_LSB   0x5A
 
#define LIGHTRANGER9_REG_RES_DISTANCE_11_MSB   0x5B
 
#define LIGHTRANGER9_REG_RES_CONFIDENCE_12   0x5C
 
#define LIGHTRANGER9_REG_RES_DISTANCE_12_LSB   0x5D
 
#define LIGHTRANGER9_REG_RES_DISTANCE_12_MSB   0x5E
 
#define LIGHTRANGER9_REG_RES_CONFIDENCE_13   0x5F
 
#define LIGHTRANGER9_REG_RES_DISTANCE_13_LSB   0x60
 
#define LIGHTRANGER9_REG_RES_DISTANCE_13_MSB   0x61
 
#define LIGHTRANGER9_REG_RES_CONFIDENCE_14   0x62
 
#define LIGHTRANGER9_REG_RES_DISTANCE_14_LSB   0x63
 
#define LIGHTRANGER9_REG_RES_DISTANCE_14_MSB   0x64
 
#define LIGHTRANGER9_REG_RES_CONFIDENCE_15   0x65
 
#define LIGHTRANGER9_REG_RES_DISTANCE_15_LSB   0x66
 
#define LIGHTRANGER9_REG_RES_DISTANCE_15_MSB   0x67
 
#define LIGHTRANGER9_REG_RES_CONFIDENCE_16   0x68
 
#define LIGHTRANGER9_REG_RES_DISTANCE_16_LSB   0x69
 
#define LIGHTRANGER9_REG_RES_DISTANCE_16_MSB   0x6A
 
#define LIGHTRANGER9_REG_RES_CONFIDENCE_17   0x6B
 
#define LIGHTRANGER9_REG_RES_DISTANCE_17_LSB   0x6C
 
#define LIGHTRANGER9_REG_RES_DISTANCE_17_MSB   0x6D
 
#define LIGHTRANGER9_REG_RES_CONFIDENCE_18   0x6E
 
#define LIGHTRANGER9_REG_RES_DISTANCE_18_LSB   0x6F
 
#define LIGHTRANGER9_REG_RES_DISTANCE_18_MSB   0x70
 
#define LIGHTRANGER9_REG_RES_CONFIDENCE_19   0x71
 
#define LIGHTRANGER9_REG_RES_DISTANCE_19_LSB   0x72
 
#define LIGHTRANGER9_REG_RES_DISTANCE_19_MSB   0x73
 
#define LIGHTRANGER9_REG_RES_CONFIDENCE_20   0x74
 
#define LIGHTRANGER9_REG_RES_DISTANCE_20_LSB   0x75
 
#define LIGHTRANGER9_REG_RES_DISTANCE_20_MSB   0x76
 
#define LIGHTRANGER9_REG_RES_CONFIDENCE_21   0x77
 
#define LIGHTRANGER9_REG_RES_DISTANCE_21_LSB   0x78
 
#define LIGHTRANGER9_REG_RES_DISTANCE_21_MSB   0x79
 
#define LIGHTRANGER9_REG_RES_CONFIDENCE_22   0x7A
 
#define LIGHTRANGER9_REG_RES_DISTANCE_22_LSB   0x7B
 
#define LIGHTRANGER9_REG_RES_DISTANCE_22_MSB   0x7C
 
#define LIGHTRANGER9_REG_RES_CONFIDENCE_23   0x7D
 
#define LIGHTRANGER9_REG_RES_DISTANCE_23_LSB   0x7E
 
#define LIGHTRANGER9_REG_RES_DISTANCE_23_MSB   0x7F
 
#define LIGHTRANGER9_REG_RES_CONFIDENCE_24   0x80
 
#define LIGHTRANGER9_REG_RES_DISTANCE_24_LSB   0x81
 
#define LIGHTRANGER9_REG_RES_DISTANCE_24_MSB   0x82
 
#define LIGHTRANGER9_REG_RES_CONFIDENCE_25   0x83
 
#define LIGHTRANGER9_REG_RES_DISTANCE_25_LSB   0x84
 
#define LIGHTRANGER9_REG_RES_DISTANCE_25_MSB   0x85
 
#define LIGHTRANGER9_REG_RES_CONFIDENCE_26   0x86
 
#define LIGHTRANGER9_REG_RES_DISTANCE_26_LSB   0x87
 
#define LIGHTRANGER9_REG_RES_DISTANCE_26_MSB   0x88
 
#define LIGHTRANGER9_REG_RES_CONFIDENCE_27   0x89
 
#define LIGHTRANGER9_REG_RES_DISTANCE_27_LSB   0x8A
 
#define LIGHTRANGER9_REG_RES_DISTANCE_27_MSB   0x8B
 
#define LIGHTRANGER9_REG_RES_CONFIDENCE_28   0x8C
 
#define LIGHTRANGER9_REG_RES_DISTANCE_28_LSB   0x8D
 
#define LIGHTRANGER9_REG_RES_DISTANCE_28_MSB   0x8E
 
#define LIGHTRANGER9_REG_RES_CONFIDENCE_29   0x8F
 
#define LIGHTRANGER9_REG_RES_DISTANCE_29_LSB   0x90
 
#define LIGHTRANGER9_REG_RES_DISTANCE_29_MSB   0x91
 
#define LIGHTRANGER9_REG_RES_CONFIDENCE_30   0x92
 
#define LIGHTRANGER9_REG_RES_DISTANCE_30_LSB   0x93
 
#define LIGHTRANGER9_REG_RES_DISTANCE_30_MSB   0x94
 
#define LIGHTRANGER9_REG_RES_CONFIDENCE_31   0x95
 
#define LIGHTRANGER9_REG_RES_DISTANCE_31_LSB   0x96
 
#define LIGHTRANGER9_REG_RES_DISTANCE_31_MSB   0x97
 
#define LIGHTRANGER9_REG_RES_CONFIDENCE_32   0x98
 
#define LIGHTRANGER9_REG_RES_DISTANCE_32_LSB   0x99
 
#define LIGHTRANGER9_REG_RES_DISTANCE_32_MSB   0x9A
 
#define LIGHTRANGER9_REG_RES_CONFIDENCE_33   0x9B
 
#define LIGHTRANGER9_REG_RES_DISTANCE_33_LSB   0x9C
 
#define LIGHTRANGER9_REG_RES_DISTANCE_33_MSB   0x9D
 
#define LIGHTRANGER9_REG_RES_CONFIDENCE_34   0x9E
 
#define LIGHTRANGER9_REG_RES_DISTANCE_34_LSB   0x9F
 
#define LIGHTRANGER9_REG_RES_DISTANCE_34_MSB   0xA0
 
#define LIGHTRANGER9_REG_RES_CONFIDENCE_35   0xA1
 
#define LIGHTRANGER9_REG_RES_DISTANCE_35_LSB   0xA2
 
#define LIGHTRANGER9_REG_RES_DISTANCE_35_MSB   0xA3
 
#define LIGHTRANGER9_REG_PERIOD_MS_LSB   0x24
 LightRanger 9 configuration page registers list.
 
#define LIGHTRANGER9_REG_PERIOD_MS_MSB   0x25
 
#define LIGHTRANGER9_REG_KILO_ITERATIONS_LSB   0x26
 
#define LIGHTRANGER9_REG_KILO_ITERATIONS_MSB   0x27
 
#define LIGHTRANGER9_REG_INT_THRESHOLD_LOW_LSB   0x28
 
#define LIGHTRANGER9_REG_INT_THRESHOLD_LOW_MSB   0x29
 
#define LIGHTRANGER9_REG_INT_THRESHOLD_HIGH_LSB   0x2A
 
#define LIGHTRANGER9_REG_INT_THRESHOLD_HIGH_MSB   0x2B
 
#define LIGHTRANGER9_REG_INT_ZONE_MASK_0   0x2C
 
#define LIGHTRANGER9_REG_INT_ZONE_MASK_1   0x2D
 
#define LIGHTRANGER9_REG_INT_ZONE_MASK_2   0x2E
 
#define LIGHTRANGER9_REG_INT_PERSISTANCE   0x2F
 
#define LIGHTRANGER9_REG_CONFIDENCE_THRESHOLD   0x30
 
#define LIGHTRANGER9_REG_GPIO_0   0x31
 
#define LIGHTRANGER9_REG_GPIO_1   0x32
 
#define LIGHTRANGER9_REG_POWER_CFG   0x33
 
#define LIGHTRANGER9_REG_SPAD_MAP_ID   0x34
 
#define LIGHTRANGER9_REG_ALG_SETTING_0   0x35
 
#define LIGHTRANGER9_REG_HIST_DUMP   0x39
 
#define LIGHTRANGER9_REG_SPREAD_SPECTRUM   0x3A
 
#define LIGHTRANGER9_REG_I2C_SLAVE_ADDRESS   0x3B
 
#define LIGHTRANGER9_REG_OSC_TRIM_VALUE_LSB   0x3C
 
#define LIGHTRANGER9_REG_OSC_TRIM_VALUE_MSB   0x3D
 
#define LIGHTRANGER9_REG_I2C_ADDR_CHANGE   0x3E
 
#define LIGHTRANGER9_REG_SPAD_ENABLE_FIRST   0x24
 LightRanger 9 user defined SPAD configuration registers list.
 
#define LIGHTRANGER9_REG_SPAD_ENABLE_LAST   0x41
 
#define LIGHTRANGER9_REG_SPAD_TDC_FIRST   0x42
 
#define LIGHTRANGER9_REG_SPAD_TDC_LAST   0x8C
 
#define LIGHTRANGER9_REG_SPAD_X_OFFSET_2   0x8D
 
#define LIGHTRANGER9_REG_SPAD_Y_OFFSET_2   0x8E
 
#define LIGHTRANGER9_REG_SPAD_X_SIZE   0x8F
 
#define LIGHTRANGER9_REG_SPAD_Y_SIZE   0x90
 
#define LIGHTRANGER9_REG_FACTORY_CALIBRATION_FIRST   0x24
 LightRanger 9 factory calibration registers list.
 
#define LIGHTRANGER9_REG_CROSSTALK_ZONE1   0x60
 
#define LIGHTRANGER9_REG_CROSSTALK_ZONE2   0x64
 
#define LIGHTRANGER9_REG_CROSSTALK_ZONE3   0x68
 
#define LIGHTRANGER9_REG_CROSSTALK_ZONE4   0x6C
 
#define LIGHTRANGER9_REG_CROSSTALK_ZONE5   0x70
 
#define LIGHTRANGER9_REG_CROSSTALK_ZONE6   0x74
 
#define LIGHTRANGER9_REG_CROSSTALK_ZONE7   0x78
 
#define LIGHTRANGER9_REG_CROSSTALK_ZONE8   0x7C
 
#define LIGHTRANGER9_REG_CROSSTALK_ZONE9   0x80
 
#define LIGHTRANGER9_REG_CROSSTALK_ZONE1_TMUX   0xB8
 
#define LIGHTRANGER9_REG_CROSSTALK_ZONE2_TMUX   0xBC
 
#define LIGHTRANGER9_REG_CROSSTALK_ZONE3_TMUX   0xC0
 
#define LIGHTRANGER9_REG_CROSSTALK_ZONE4_TMUX   0xC4
 
#define LIGHTRANGER9_REG_CROSSTALK_ZONE5_TMUX   0xC8
 
#define LIGHTRANGER9_REG_CROSSTALK_ZONE6_TMUX   0xCC
 
#define LIGHTRANGER9_REG_CROSSTALK_ZONE7_TMUX   0xD0
 
#define LIGHTRANGER9_REG_CROSSTALK_ZONE8_TMUX   0xD4
 
#define LIGHTRANGER9_REG_CROSSTALK_ZONE9_TMUX   0xD8
 
#define LIGHTRANGER9_REG_CALIBRATION_STATUS_FC   0xDC
 
#define LIGHTRANGER9_REG_FACTORY_CALIBRATION_LAST   0xDF
 
#define LIGHTRANGER9_REG_SUBPACKET_NUMBER   0x24
 LightRanger 9 raw data histograms registers list.
 
#define LIGHTRANGER9_REG_SUBPACKET_PAYLOAD   0x25
 
#define LIGHTRANGER9_REG_SUBPACKET_CONFIG   0x26
 
#define LIGHTRANGER9_REG_SUBPACKET_DATA0   0x27
 
#define LIGHTRANGER9_REG_SUBPACKET_DATA127   0xA6
 
#define LIGHTRANGER9_REG_BL_CMD_STAT   0x08
 LightRanger 9 bootloader registers list.
 
#define LIGHTRANGER9_REG_BL_SIZE   0x09
 
#define LIGHTRANGER9_REG_BL_DATA   0x0A
 
#define LIGHTRANGER9_TIMEOUT   5000
 LightRanger 9 timeout value.
 
#define LIGHTRANGER9_ENABLE_CPU_READY   0x40
 LightRanger 9 enable register settings.
 
#define LIGHTRANGER9_ENABLE_POWERUP_BL   0x00
 
#define LIGHTRANGER9_ENABLE_POWERUP_BL_NO_SLP   0x10
 
#define LIGHTRANGER9_ENABLE_POWERUP_RAM   0x20
 
#define LIGHTRANGER9_ENABLE_PON   0x01
 
#define LIGHTRANGER9_INT_ENAB_REG_STATUS   0x40
 LightRanger 9 int enable register settings.
 
#define LIGHTRANGER9_INT_ENAB_COMMAND   0x20
 
#define LIGHTRANGER9_INT_ENAB_HIST_READY   0x08
 
#define LIGHTRANGER9_INT_ENAB_MEAS_READY   0x02
 
#define LIGHTRANGER9_INT_STATUS_REG_STATUS   0x40
 LightRanger 9 int status register settings.
 
#define LIGHTRANGER9_INT_STATUS_COMMAND   0x20
 
#define LIGHTRANGER9_INT_STATUS_HIST_READY   0x08
 
#define LIGHTRANGER9_INT_STATUS_MEAS_READY   0x02
 
#define LIGHTRANGER9_CMD_STAT_MEASURE   0x10
 LightRanger 9 cmd stat register write settings.
 
#define LIGHTRANGER9_CMD_STAT_CLEAR_STATUS   0x11
 
#define LIGHTRANGER9_CMD_STAT_GPIO   0x12
 
#define LIGHTRANGER9_CMD_STAT_WRITE_CFG_PAGE   0x15
 
#define LIGHTRANGER9_CMD_STAT_LOAD_CFG_PAGE_COMMON   0x16
 
#define LIGHTRANGER9_CMD_STAT_LOAD_CFG_PAGE_SPAD_1   0x17
 
#define LIGHTRANGER9_CMD_STAT_LOAD_CFG_PAGE_SPAD_2   0x18
 
#define LIGHTRANGER9_CMD_STAT_LOAD_CFG_PAGE_F_Y_CAL   0x19
 
#define LIGHTRANGER9_CMD_STAT_FACTORY_CALIBRATION   0x20
 
#define LIGHTRANGER9_CMD_STAT_I2C_SLAVE_ADDRESS   0x21
 
#define LIGHTRANGER9_CMD_STAT_FORCE_TMF8820   0x65
 
#define LIGHTRANGER9_CMD_STAT_FORCE_TMF8828   0x6C
 
#define LIGHTRANGER9_CMD_STAT_RESET   0xFE
 
#define LIGHTRANGER9_CMD_STAT_STOP   0xFF
 
#define LIGHTRANGER9_CMD_STAT_OK   0x00
 LightRanger 9 cmd stat register read settings.
 
#define LIGHTRANGER9_CMD_STAT_ACCEPTED   0x01
 
#define LIGHTRANGER9_CMD_ERR_CONFIG   0x02
 
#define LIGHTRANGER9_CMD_ERR_APPLICATION   0x03
 
#define LIGHTRANGER9_CMD_ERR_WAKEUP_TIMED   0x04
 
#define LIGHTRANGER9_CMD_ERR_RESET_UNEXPECTED   0x05
 
#define LIGHTRANGER9_CMD_ERR_UNKNOWN_CMD   0x06
 
#define LIGHTRANGER9_CMD_ERR_NO_REF_SPAD   0x07
 
#define LIGHTRANGER9_CMD_ERR_UNKNOWN_CID   0x09
 
#define LIGHTRANGER9_CMD_WARNING_CFG_SPAD_1   0x0A
 
#define LIGHTRANGER9_CMD_WARNING_CFG_SPAD_2   0x0B
 
#define LIGHTRANGER9_CMD_WARNING_OSC_TRIP   0x0C
 
#define LIGHTRANGER9_CMD_WARNING_I2C_ADDRESS   0x0D
 
#define LIGHTRANGER9_CMD_ERR_UNKNOWN_MODE   0x0E
 
#define LIGHTRANGER9_CONFIG_RESULT_MEAS   0x10
 LightRanger 9 config result register settings.
 
#define LIGHTRANGER9_CONFIG_RESULT_COMMON_CID   0x16
 
#define LIGHTRANGER9_CONFIG_RESULT_SPAD_1_CID   0x17
 
#define LIGHTRANGER9_CONFIG_RESULT_SPAD_2_CID   0x18
 
#define LIGHTRANGER9_CONFIG_RESULT_FAC_CALIB_CID   0x19
 
#define LIGHTRANGER9_CONFIG_RESULT_HIST_RAW_CID   0x81
 
#define LIGHTRANGER9_BL_CMD_RAMREMAP_RESET   0x11
 LightRanger 9 bootloader commands list.
 
#define LIGHTRANGER9_BL_CMD_DOWNLOAD_INIT   0x14
 
#define LIGHTRANGER9_BL_CMD_RAM_BIST   0x2A
 
#define LIGHTRANGER9_BL_CMD_I2C_BIST   0x2C
 
#define LIGHTRANGER9_BL_CMD_W_RAM   0x41
 
#define LIGHTRANGER9_BL_CMD_ADDR_RAM   0x43
 
#define LIGHTRANGER9_BL_CMD_STAT_READY   0x00
 LightRanger 9 bootloader commands status list.
 
#define LIGHTRANGER9_BL_CMD_STAT_ERR_SIZE   0x01
 
#define LIGHTRANGER9_BL_CMD_STAT_ERR_CSUM   0x02
 
#define LIGHTRANGER9_BL_CMD_STAT_ERR_RANGE   0x03
 
#define LIGHTRANGER9_BL_CMD_STAT_ERR_MORE   0x04
 
#define LIGHTRANGER9_APP_ID_BOOTLOADER   0x80
 LightRanger 9 app id settings.
 
#define LIGHTRANGER9_APP_ID_MEASUREMENT   0x03
 
#define LIGHTRANGER9_BLOCKREAD_SIZE   132
 LightRanger 9 capture settings.
 
#define LIGHTRANGER9_MAX_MEAS_RESULTS   36
 
#define LIGHTRANGER9_SUBCAPTURE_0   0
 
#define LIGHTRANGER9_SUBCAPTURE_1   1
 
#define LIGHTRANGER9_SUBCAPTURE_2   2
 
#define LIGHTRANGER9_SUBCAPTURE_3   3
 
#define LIGHTRANGER9_SUBCAPTURE_MASK   0x03
 
#define LIGHTRANGER9_RESULT_NUMBER_MASK   0x3F
 
#define LIGHTRANGER9_SYS_TICK_TO_SEC   0.0000002
 
#define LIGHTRANGER9_OBJECT_MAP_SIZE   64
 
#define LIGHTRANGER9_DEFAULT_MEASUREMENT_PERIOD_MS   500
 LightRanger 9 default measurement period and confidence threshold.
 
#define LIGHTRANGER9_CONFIDENCE_THRESHOLD   100
 
#define LIGHTRANGER9_DEVICE_ID   0x08
 LightRanger 9 device ID value.
 
#define LIGHTRANGER9_DEVICE_ADDRESS   0x41
 LightRanger 9 device address setting.
 
#define LIGHTRANGER9_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  lightranger9_return_value_t { LIGHTRANGER9_OK = 0 , LIGHTRANGER9_ERROR = -1 }
 LightRanger 9 Click return value data. More...
 

Functions

void lightranger9_cfg_setup (lightranger9_cfg_t *cfg)
 LightRanger 9 configuration object setup function.
 
err_t lightranger9_init (lightranger9_t *ctx, lightranger9_cfg_t *cfg)
 LightRanger 9 initialization function.
 
err_t lightranger9_default_cfg (lightranger9_t *ctx)
 LightRanger 9 default configuration function.
 
err_t lightranger9_generic_write (lightranger9_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 LightRanger 9 I2C writing function.
 
err_t lightranger9_generic_read (lightranger9_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 LightRanger 9 I2C reading function.
 
err_t lightranger9_write_register (lightranger9_t *ctx, uint8_t reg, uint8_t data_in)
 LightRanger 9 write register function.
 
err_t lightranger9_read_register (lightranger9_t *ctx, uint8_t reg, uint8_t *data_out)
 LightRanger 9 read register function.
 
err_t lightranger9_write_bl_cmd (lightranger9_t *ctx, uint8_t cmd, uint8_t *data_in, uint8_t len)
 LightRanger 9 write bl cmd function.
 
err_t lightranger9_read_bl_cmd_status (lightranger9_t *ctx, uint8_t *status)
 LightRanger 9 read bl cmd status function.
 
err_t lightranger9_check_communication (lightranger9_t *ctx)
 LightRanger 9 check communication function.
 
void lightranger9_set_gpio0_pin (lightranger9_t *ctx, uint8_t state)
 LightRanger 9 set gpio0 pin function.
 
void lightranger9_set_gpio1_pin (lightranger9_t *ctx, uint8_t state)
 LightRanger 9 set gpio1 pin function.
 
void lightranger9_enable_device (lightranger9_t *ctx)
 LightRanger 9 enable device function.
 
void lightranger9_disable_device (lightranger9_t *ctx)
 LightRanger 9 disable device function.
 
uint8_t lightranger9_get_int_pin (lightranger9_t *ctx)
 LightRanger 9 get int pin function.
 
err_t lightranger9_download_fw_bin (lightranger9_t *ctx)
 LightRanger 9 download fw bin function.
 
err_t lightranger9_clear_interrupts (lightranger9_t *ctx)
 LightRanger 9 clear interrupts function.
 
err_t lightranger9_get_capture (lightranger9_t *ctx, lightranger9_capture_t *capture)
 LightRanger 9 get capture function.
 

Detailed Description

This file contains API for LightRanger 9 Click Driver.

Enumeration Type Documentation

◆ lightranger9_return_value_t

LightRanger 9 Click return value data.

Predefined enum values for driver return values.

Enumerator
LIGHTRANGER9_OK 
LIGHTRANGER9_ERROR