proximity5 2.0.0.0

Functions

void proximity5_cfg_setup (proximity5_cfg_t *cfg)
 Config Object Initialization function.
 
PROXIMITY5_RETVAL proximity5_init (proximity5_t *ctx, proximity5_cfg_t *cfg)
 Initialization function.
 
void proximity5_default_cfg (proximity5_t *ctx)
 Click Default Configuration function.
 
void proximity5_generic_write (proximity5_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void proximity5_generic_read (proximity5_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
uint16_t proximity5_read_reg (proximity5_t *ctx, uint8_t addr)
 16bit read function.
 
uint16_t proximity5_get_id (proximity5_t *ctx)
 16bit read function.
 
void proximity5_get_values (proximity5_t *ctx, uint16_t *prox_val)
 Proximity value get function.
 

Detailed Description

Function Documentation

◆ proximity5_cfg_setup()

void proximity5_cfg_setup ( proximity5_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.

◆ proximity5_default_cfg()

void proximity5_default_cfg ( proximity5_t * ctx)

Click Default Configuration function.

Parameters
ctxClick object.

@description This function executes default configuration for Proximity5 click.

◆ proximity5_generic_read()

void proximity5_generic_read ( proximity5_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.

◆ proximity5_generic_write()

void proximity5_generic_write ( proximity5_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.

◆ proximity5_get_id()

uint16_t proximity5_get_id ( proximity5_t * ctx)

16bit read function.

Parameters
ctxClick object.
addrRegister address.
Returns
16bit value from the register.

@description Read the ID from the ID register of the sensor.

◆ proximity5_get_values()

void proximity5_get_values ( proximity5_t * ctx,
uint16_t * prox_val )

Proximity value get function.

Parameters
ctxClick object.
prox_valProximity data buffer.

@description Starts the conversion and waits for the interrupt to finish. After the interrupt finishes the proximity data from the proximity registers is returned to a 3 member uint16_t array.

◆ proximity5_init()

PROXIMITY5_RETVAL proximity5_init ( proximity5_t * ctx,
proximity5_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

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

◆ proximity5_read_reg()

uint16_t proximity5_read_reg ( proximity5_t * ctx,
uint8_t addr )

16bit read function.

Parameters
ctxClick object.
addrRegister address.
Returns
16bit value from the register.

@description Generic function for reading both high and low register value and returns those combined values to a 16bit variable.