proximity2 2.0.0.0

Functions

void proximity2_cfg_setup (proximity2_cfg_t *cfg)
 Config Object Initialization function.
 
PROXIMITY2_RETVAL proximity2_init (proximity2_t *ctx, proximity2_cfg_t *cfg)
 Initialization function.
 
void proximity2_default_cfg (proximity2_t *ctx)
 Click Default Configuration function.
 
void proximity2_generic_write (proximity2_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void proximity2_generic_read (proximity2_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
uint8_t proximity2_read_prox (proximity2_t *ctx)
 Read PROX Data Register function.
 
uint16_t proximity2_read_als (proximity2_t *ctx)
 Read ALS Data Registers function.
 
uint8_t proximity2_get_int_pin_status (proximity2_t *ctx)
 Get int pin status.
 

Detailed Description

Function Documentation

◆ proximity2_cfg_setup()

void proximity2_cfg_setup ( proximity2_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.

◆ proximity2_default_cfg()

void proximity2_default_cfg ( proximity2_t * ctx)

Click Default Configuration function.

Parameters
ctxClick object.

@description This function executes default configuration for Proximity2 click.

Note

Click default configuration:

   reg    : PROXIMITY2_REG_MAIN_CONFIG
-------------------------------------------------
   tx_buf : PROXIMITY2_MAIN_CONFIG_DEFAULT

reg : PROXIMITY2_REG_RECEIVE_CONFIG

   tx_buf : PROXIMITY2_RECE_CONFIG_DEFAULT
   reg    : PROXIMITY2_REG_TRANSMIT_CONFIG
-------------------------------------------------
   tx_buf : PROXIMITY2_LED_DRV_CURRENT_110_MA

◆ proximity2_generic_read()

void proximity2_generic_read ( proximity2_t * ctx,
uint8_t reg,
uint8_t * data_buf,
uint8_t len )

Generic read function.

Parameters
ctxClick object.
regRegister address.
data_bufOutput data buf
lenNumber of the bytes to be read

@description This function reads data from the desired register.

◆ proximity2_generic_write()

void proximity2_generic_write ( proximity2_t * ctx,
uint8_t reg,
uint8_t * data_buf,
uint8_t len )

Generic write function.

Parameters
ctxClick object.
regRegister address.
data_bufData buf to be written.
lenNumber of the bytes in data buf.

@description This function writes data to the desired register.

◆ proximity2_get_int_pin_status()

uint8_t proximity2_get_int_pin_status ( proximity2_t * ctx)

Get int pin status.

Parameters
ctxClick object.
Returns
status [ 0 = Active / 1 = Inactive ]

@description This function is used to read interrupt pin status.

◆ proximity2_init()

PROXIMITY2_RETVAL proximity2_init ( proximity2_t * ctx,
proximity2_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

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

◆ proximity2_read_als()

uint16_t proximity2_read_als ( proximity2_t * ctx)

Read ALS Data Registers function.

Parameters
ctxClick object.
Returns
result combined values from ADC High Byte and ADC Low Byte registers

@description This function is used to read both ADC High Byte and ADC Low Byte registers.

Note
The result is always right justified in the two registers and the unused high bits are zero.

◆ proximity2_read_prox()

uint8_t proximity2_read_prox ( proximity2_t * ctx)

Read PROX Data Register function.

Parameters
ctxClick object.
Returns
result 8-bit value that represents measurement made by sensor

@description This function is used to read prox data register in order to get data on distance from sensor to an object.