proximity16 2.1.0.0
proximity16.h File Reference

This file contains API for Proximity 16 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  proximity16_t
 Proximity 16 Click context object. More...
 
struct  proximity16_cfg_t
 Proximity 16 Click configuration object. More...
 
struct  proximity16_results_data_t
 Proximity 16 Click results data structure. More...
 
union  proximity16_block_header_t
 Proximity 16 Click block header union data definition. More...
 

Macros

#define PROXIMITY16_DCI_ZONE_CONFIG   0x5450
 Proximity 16 DCI registers list.
 
#define PROXIMITY16_DCI_FREQ_HZ   0x5458
 
#define PROXIMITY16_DCI_INT_TIME   0x545C
 
#define PROXIMITY16_DCI_FW_NB_TARGET   0x5478
 
#define PROXIMITY16_DCI_RANGING_MODE   0xAD30
 
#define PROXIMITY16_DCI_DSS_CONFIG   0xAD38
 
#define PROXIMITY16_DCI_TARGET_ORDER   0xAE64
 
#define PROXIMITY16_DCI_SHARPENER   0xAED8
 
#define PROXIMITY16_DCI_INTERNAL_CP   0xB39C
 
#define PROXIMITY16_DCI_MOTION_DETECTOR_CFG   0xBFAC
 
#define PROXIMITY16_DCI_SINGLE_RANGE   0xCD5C
 
#define PROXIMITY16_DCI_OUTPUT_CONFIG   0xCD60
 
#define PROXIMITY16_DCI_OUTPUT_ENABLES   0xCD68
 
#define PROXIMITY16_DCI_OUTPUT_LIST   0xCD78
 
#define PROXIMITY16_DCI_PIPE_CONTROL   0xCF78
 
#define PROXIMITY16_UI_CMD_STATUS   0x2C00
 Proximity 16 UI commands list.
 
#define PROXIMITY16_UI_CMD_START   0x2C04
 
#define PROXIMITY16_UI_CMD_END   0x2FFF
 
#define PROXIMITY16_TEMP_BUFFER_SIZE   1024
 Proximity 16 buffers size setting.
 
#define PROXIMITY16_NVM_DATA_SIZE   492
 
#define PROXIMITY16_OFFSET_BUFFER_SIZE   488
 
#define PROXIMITY16_XTALK_BUFFER_SIZE   776
 
#define PROXIMITY16_RESOLUTION_4X4   16
 Proximity 16 resolution setting.
 
#define PROXIMITY16_RESOLUTION_8X8   64
 
#define PROXIMITY16_RANGING_MODE_CONTINUOUS   1
 Proximity 16 ranging mode setting.
 
#define PROXIMITY16_RANGING_MODE_AUTONOMOUS   3
 
#define PROXIMITY16_START_BH   0x0000000Dul
 Proximity 16 range results block headers setting.
 
#define PROXIMITY16_METADATA_BH   0x54B400C0ul
 
#define PROXIMITY16_COMMONDATA_BH   0x54C00040ul
 
#define PROXIMITY16_AMBIENT_RATE_BH   0x54D00104ul
 
#define PROXIMITY16_SPAD_COUNT_BH   0x55D00404ul
 
#define PROXIMITY16_NB_TARGET_DETECTED_BH   0xCF7C0401ul
 
#define PROXIMITY16_SIGNAL_RATE_BH   0xCFBC0404ul
 
#define PROXIMITY16_RANGE_SIGMA_MM_BH   0xD2BC0402ul
 
#define PROXIMITY16_DISTANCE_BH   0xD33C0402ul
 
#define PROXIMITY16_REFLECTANCE_BH   0xD43C0401ul
 
#define PROXIMITY16_TARGET_STATUS_BH   0xD47C0401ul
 
#define PROXIMITY16_MOTION_DETECT_BH   0xCC5008C0ul
 
#define PROXIMITY16_METADATA_IDX   0x54B4
 
#define PROXIMITY16_SPAD_COUNT_IDX   0x55D0
 
#define PROXIMITY16_AMBIENT_RATE_IDX   0x54D0
 
#define PROXIMITY16_NB_TARGET_DETECTED_IDX   0xCF7C
 
#define PROXIMITY16_SIGNAL_RATE_IDX   0xCFBC
 
#define PROXIMITY16_RANGE_SIGMA_MM_IDX   0xD2BC
 
#define PROXIMITY16_DISTANCE_IDX   0xD33C
 
#define PROXIMITY16_REFLECTANCE_EST_PC_IDX   0xD43C
 
#define PROXIMITY16_TARGET_STATUS_IDX   0xD47C
 
#define PROXIMITY16_MOTION_DETEC_IDX   0xCC50
 
#define PROXIMITY16_DEF_RESOLUTION   PROXIMITY16_RESOLUTION_8X8
 Proximity 16 default settings.
 
#define PROXIMITY16_DEF_RANGING_FREQ_HZ   2
 
#define PROXIMITY16_DEF_RANGING_MODE   PROXIMITY16_RANGING_MODE_AUTONOMOUS
 
#define PROXIMITY16_DEF_INTEGRATION_TIME_MS   20
 
#define PROXIMITY16_DEVICE_ADDRESS   0x29
 Proximity 16 device address setting.
 
#define PROXIMITY16_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  proximity16_return_value_t { PROXIMITY16_OK = 0 , PROXIMITY16_ERROR = -1 }
 Proximity 16 Click return value data. More...
 

Functions

void proximity16_cfg_setup (proximity16_cfg_t *cfg)
 Proximity 16 configuration object setup function.
 
err_t proximity16_init (proximity16_t *ctx, proximity16_cfg_t *cfg)
 Proximity 16 initialization function.
 
err_t proximity16_default_cfg (proximity16_t *ctx)
 Proximity 16 default configuration function.
 
err_t proximity16_write_multi (proximity16_t *ctx, uint16_t reg, uint8_t *data_in, uint8_t len)
 Proximity 16 write multi function.
 
err_t proximity16_read_multi (proximity16_t *ctx, uint16_t reg, uint8_t *data_out, uint16_t len)
 Proximity 16 read multi function.
 
err_t proximity16_write_byte (proximity16_t *ctx, uint16_t reg, uint8_t data_in)
 Proximity 16 write byte function.
 
err_t proximity16_read_byte (proximity16_t *ctx, uint16_t reg, uint8_t *data_out)
 Proximity 16 read byte function.
 
err_t proximity16_write_data (proximity16_t *ctx, uint8_t *data_in, uint16_t len)
 Proximity 16 write data function.
 
err_t proximity16_check_communication (proximity16_t *ctx)
 Proximity 16 check communication function.
 
uint8_t proximity16_get_int_pin (proximity16_t *ctx)
 Proximity 16 get int pin function.
 
void proximity16_set_i2c_rst_pin (proximity16_t *ctx, uint8_t state)
 Proximity 16 set i2c rst function.
 
void proximity16_set_lpn_pin (proximity16_t *ctx, uint8_t state)
 Proximity 16 set lpn function.
 
void proximity16_reset_i2c (proximity16_t *ctx)
 Proximity 16 reset i2c function.
 
err_t proximity16_sensor_init (proximity16_t *ctx)
 Proximity 16 sensor init function.
 
err_t proximity16_dci_write_data (proximity16_t *ctx, uint16_t index, uint8_t *data_in, uint16_t data_size)
 Proximity 16 dci write data function.
 
err_t proximity16_dci_read_data (proximity16_t *ctx, uint16_t index, uint8_t *data_out, uint16_t data_size)
 Proximity 16 dci read data function.
 
err_t proximity16_dci_replace_data (proximity16_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)
 Proximity 16 dci replace data function.
 
err_t proximity16_set_resolution (proximity16_t *ctx, uint8_t resolution)
 Proximity 16 set resolution function.
 
err_t proximity16_get_resolution (proximity16_t *ctx, uint8_t *resolution)
 Proximity 16 get resolution function.
 
err_t proximity16_set_ranging_frequency_hz (proximity16_t *ctx, uint8_t frequency_hz)
 Proximity 16 set ranging frequency hz function.
 
err_t proximity16_get_ranging_frequency_hz (proximity16_t *ctx, uint8_t *frequency_hz)
 Proximity 16 get ranging frequency hz function.
 
err_t proximity16_set_integration_time_ms (proximity16_t *ctx, uint32_t integration_time_ms)
 Proximity 16 set integration time ms function.
 
err_t proximity16_get_integration_time_ms (proximity16_t *ctx, uint32_t *integration_time_ms)
 Proximity 16 get integration time ms function.
 
err_t proximity16_set_ranging_mode (proximity16_t *ctx, uint8_t ranging_mode)
 Proximity 16 set ranging mode function.
 
err_t proximity16_get_ranging_mode (proximity16_t *ctx, uint8_t *ranging_mode)
 Proximity 16 get ranging mode function.
 
err_t proximity16_start_ranging (proximity16_t *ctx)
 Proximity 16 start ranging function.
 
err_t proximity16_stop_ranging (proximity16_t *ctx)
 Proximity 16 stop ranging function.
 
err_t proximity16_get_ranging_data (proximity16_t *ctx, proximity16_results_data_t *results)
 Proximity 16 get ranging data function.
 

Detailed Description

This file contains API for Proximity 16 Click Driver.

Enumeration Type Documentation

◆ proximity16_return_value_t

Proximity 16 Click return value data.

Predefined enum values for driver return values.

Enumerator
PROXIMITY16_OK 
PROXIMITY16_ERROR