proximity17 2.0.0.0
proximity17.h File Reference

This file contains API for Proximity 17 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  proximity17_t
 Proximity 17 Click context object. More...
 
struct  proximity17_cfg_t
 Proximity 17 Click configuration object. More...
 

Macros

#define PROXIMITY17_REG_ENABLE   0x80
 Proximity 17 register list.
 
#define PROXIMITY17_REG_PRATE   0x82
 
#define PROXIMITY17_REG_PILTL   0x88
 
#define PROXIMITY17_REG_PILTH   0x89
 
#define PROXIMITY17_REG_PIHTL   0x8A
 
#define PROXIMITY17_REG_PIHTH   0x8B
 
#define PROXIMITY17_REG_PERS   0x8C
 
#define PROXIMITY17_REG_CFG0   0x8D
 
#define PROXIMITY17_REG_PCFG0   0x8E
 
#define PROXIMITY17_REG_PCFG1   0x8F
 
#define PROXIMITY17_REG_REVID   0x91
 
#define PROXIMITY17_REG_ID   0x92
 
#define PROXIMITY17_REG_STATUS   0x9B
 
#define PROXIMITY17_REG_PDATAL   0x9C
 
#define PROXIMITY17_REG_PDATAH   0x9D
 
#define PROXIMITY17_REG_REVID2   0xA6
 
#define PROXIMITY17_REG_SOFTRST   0xA8
 
#define PROXIMITY17_REG_PWTIME   0xA9
 
#define PROXIMITY17_REG_CFG8   0xAA
 
#define PROXIMITY17_REG_CFG3   0xAB
 
#define PROXIMITY17_REG_CFG6   0xAE
 
#define PROXIMITY17_REG_PFILTER   0xB3
 
#define PROXIMITY17_REG_POFFSETL   0xC0
 
#define PROXIMITY17_REG_POFFSETH   0xC1
 
#define PROXIMITY17_REG_CALIB   0xD7
 
#define PROXIMITY17_REG_CALIBCFG   0xD9
 
#define PROXIMITY17_REG_CALIBSTAT   0xDC
 
#define PROXIMITY17_REG_INTENAB   0xDD
 
#define PROXIMITY17_REG_FAC_L   0xE5
 
#define PROXIMITY17_REG_FAC_H   0xE6
 
#define PROXIMITY17_REG_TEST9   0xF9
 
#define PROXIMITY17_ENABLE_PWEN   0x10
 Proximity 17 ENABLE register setting.
 
#define PROXIMITY17_ENABLE_PEN   0x04
 
#define PROXIMITY17_ENABLE_PON   0x01
 
#define PROXIMITY17_SOFT_RESET   0x01
 Proximity 17 SOFTRST register setting.
 
#define PROXIMITY17_PGAIN_1X   0x00
 Proximity 17 PCFG0 register setting.
 
#define PROXIMITY17_PGAIN_2X   0x40
 
#define PROXIMITY17_PGAIN_4X   0x80
 
#define PROXIMITY17_PGAIN_8X   0xC0
 
#define PROXIMITY17_PPULSE_MIN   0x00
 
#define PROXIMITY17_PPULSE_DEFAULT   0x0F
 
#define PROXIMITY17_PPULSE_MAX   0x3F
 
#define PROXIMITY17_PPULSE_LEN_1US   0x00
 Proximity 17 PCFG1 register setting.
 
#define PROXIMITY17_PPULSE_LEN_2US   0x20
 
#define PROXIMITY17_PPULSE_LEN_4US   0x40
 
#define PROXIMITY17_PPULSE_LEN_8US   0x60
 
#define PROXIMITY17_PPULSE_LEN_12US   0x80
 
#define PROXIMITY17_PPULSE_LEN_16US   0xA0
 
#define PROXIMITY17_PPULSE_LEN_24US   0xC0
 
#define PROXIMITY17_PPULSE_LEN_32US   0xE0
 
#define PROXIMITY17_PLDRIVE_2mA   0x00
 
#define PROXIMITY17_PLDRIVE_3mA   0x01
 
#define PROXIMITY17_PLDRIVE_4mA   0x02
 
#define PROXIMITY17_PLDRIVE_5mA   0x03
 
#define PROXIMITY17_PLDRIVE_6mA   0x04
 
#define PROXIMITY17_PLDRIVE_7mA   0x05
 
#define PROXIMITY17_PLDRIVE_8mA   0x06
 
#define PROXIMITY17_PLDRIVE_9mA   0x07
 
#define PROXIMITY17_PLDRIVE_10mA   0x08
 
#define PROXIMITY17_PDSELECT_NO_PDIODE   0x00
 Proximity 17 CFG8 register setting.
 
#define PROXIMITY17_PDSELECT_FAR_PDIODE   0x01
 
#define PROXIMITY17_PDSELECT_NEAR_PDIODE   0x02
 
#define PROXIMITY17_PDSELECT_BOTH_PDIODE   0x03
 
#define PROXIMITY17_STATUS_PHIGH   0x80
 Proximity 17 STATUS register setting.
 
#define PROXIMITY17_STATUS_PLOW   0x40
 
#define PROXIMITY17_STATUS_PSAT   0x20
 
#define PROXIMITY17_STATUS_PINT   0x10
 
#define PROXIMITY17_STATUS_CINT   0x08
 
#define PROXIMITY17_STATUS_ZINT   0x04
 
#define PROXIMITY17_STATUS_PSAT_REFLECTIVE   0x02
 
#define PROXIMITY17_STATUS_PSAT_AMBIENT   0x01
 
#define PROXIMITY17_STATUS_CLEAR_ALL   0xFF
 
#define PROXIMITY17_INTENAB_PIM   0x20
 Proximity 17 INTENAB register setting.
 
#define PROXIMITY17_INTENAB_PIEN   0x10
 
#define PROXIMITY17_INTENAB_PSIEN   0x08
 
#define PROXIMITY17_INTENAB_CIEN   0x04
 
#define PROXIMITY17_INTENAB_ZIEN   0x02
 
#define PROXIMITY17_INTENAB_DISABLE   0x00
 
#define PROXIMITY17_CALAVG   0x80
 Proximity 17 CALIB register setting.
 
#define PROXIMITY17_ELECTRICAL_CALIB   0x20
 
#define PROXIMITY17_CALPRATE   0x10
 
#define PROXIMITY17_START_OFFSET_CAL   0x01
 
#define PROXIMITY17_BINSRCH_TARGET_3   0x00
 Proximity 17 CALIBCFG register setting.
 
#define PROXIMITY17_BINSRCH_TARGET_7   0x20
 
#define PROXIMITY17_BINSRCH_TARGET_15   0x40
 
#define PROXIMITY17_BINSRCH_TARGET_31   0x60
 
#define PROXIMITY17_BINSRCH_TARGET_63   0x80
 
#define PROXIMITY17_BINSRCH_TARGET_127   0xA0
 
#define PROXIMITY17_BINSRCH_TARGET_255   0xC0
 
#define PROXIMITY17_BINSRCH_TARGET_511   0xE0
 
#define PROXIMITY17_CALIBCFG_RESERVED   0x10
 
#define PROXIMITY17_AUTO_OFFSET_ADJ   0x08
 
#define PROXIMITY17_PROX_AVG_DISABLE   0x00
 
#define PROXIMITY17_PROX_AVG_2   0x01
 
#define PROXIMITY17_PROX_AVG_4   0x02
 
#define PROXIMITY17_PROX_AVG_8   0x03
 
#define PROXIMITY17_PROX_AVG_16   0x04
 
#define PROXIMITY17_PROX_AVG_32   0x05
 
#define PROXIMITY17_PROX_AVG_64   0x06
 
#define PROXIMITY17_PROX_AVG_128   0x07
 
#define PROXIMITY17_OFFSET_ADJUSTED   0x04
 Proximity 17 CALIBSTAT register setting.
 
#define PROXIMITY17_CALIB_FINISHED   0x01
 
#define PROXIMITY17_APC_ENABLE   0x3F
 Proximity 17 CFG6 register setting.
 
#define PROXIMITY17_APC_DISABLE   0x7F
 
#define PROXIMITY17_DEVICE_ID   0x44
 Proximity 17 device ID value.
 
#define PROXIMITY17_DEVICE_ADDRESS   0x39
 Proximity 17 device address setting.
 
#define PROXIMITY17_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  proximity17_return_value_t { PROXIMITY17_OK = 0 , PROXIMITY17_ERROR = -1 }
 Proximity 17 Click return value data. More...
 

Functions

void proximity17_cfg_setup (proximity17_cfg_t *cfg)
 Proximity 17 configuration object setup function.
 
err_t proximity17_init (proximity17_t *ctx, proximity17_cfg_t *cfg)
 Proximity 17 initialization function.
 
err_t proximity17_default_cfg (proximity17_t *ctx)
 Proximity 17 default configuration function.
 
err_t proximity17_generic_write (proximity17_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len)
 Proximity 17 I2C writing function.
 
err_t proximity17_generic_read (proximity17_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len)
 Proximity 17 I2C reading function.
 
err_t proximity17_write_register (proximity17_t *ctx, uint8_t reg, uint8_t data_in)
 Proximity 17 write register function.
 
err_t proximity17_read_register (proximity17_t *ctx, uint8_t reg, uint8_t *data_out)
 Proximity 17 read register function.
 
err_t proximity17_check_communication (proximity17_t *ctx)
 Proximity 17 check communication function.
 
err_t proximity17_soft_reset (proximity17_t *ctx)
 Proximity 17 soft reset function.
 
err_t proximity17_read_proximity (proximity17_t *ctx, uint16_t *prox_data)
 Proximity 17 read proximity function.
 
uint8_t proximity17_get_int_pin (proximity17_t *ctx)
 Proximity 17 get int pin function.
 

Detailed Description

This file contains API for Proximity 17 Click Driver.

Enumeration Type Documentation

◆ proximity17_return_value_t

Proximity 17 Click return value data.

Predefined enum values for driver return values.

Enumerator
PROXIMITY17_OK 
PROXIMITY17_ERROR