proximity11  2.0.0.0
Functions

Functions

void proximity11_cfg_setup (proximity11_cfg_t *cfg)
 Config Object Initialization function. More...
 
PROXIMITY11_RETVAL proximity11_init (proximity11_t *ctx, proximity11_cfg_t *cfg)
 Initialization function. More...
 
uint8_t proximity11_default_cfg (proximity11_t *ctx)
 Click Default Configuration function. More...
 
void proximity11_generic_write (proximity11_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function. More...
 
void proximity11_generic_read (proximity11_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function. More...
 
uint8_t proximity11_int_get (proximity11_t *ctx)
 Int pin get functuin. More...
 
uint8_t proximity11_get (proximity11_t *ctx, uint8_t register_address, uint8_t *output_buffer, uint8_t n_bytes)
 Proximity value get function. More...
 
uint8_t proximity11_set (proximity11_t *ctx, uint8_t register_address, uint8_t *input_buffer, uint8_t n_bytes)
 Proximity value set function. More...
 
void proximity11_update (proximity11_t *ctx)
 Updating data for Lux calculation. More...
 
float proximity11_convert_lx (proximity11_t *ctx, uint16_t *input_data)
 Converting raw data to Lux. More...
 
void proximity11_get_raw_ps_als_values (proximity11_t *ctx, uint8_t *data_buffer)
 Getting raw ALS and PS data. More...
 
void proximity11_get_ps_als_values (proximity11_t *ctx, uint16_t *ps_value, float *als_value)
 Getting ALS and PS values. More...
 
uint8_t proximity11_set_ps_threshold_high (proximity11_t *ctx, uint16_t threshold_value)
 Setting High PS threshold value. More...
 
uint8_t proximity11_set_ps_threshold_low (proximity11_t *ctx, uint16_t threshold_value)
 Setting Low PS threshold value. More...
 
void proximity11_set_als_threshold_high (proximity11_t *ctx, uint16_t threshold_value)
 Setting High Als threshold value. More...
 
void proximity11_set_als_threshold_low (proximity11_t *ctx, uint16_t threshold_value)
 Setting Low Als threshold value. More...
 
uint8_t proximity11_set_ps_offset (proximity11_t *ctx, uint16_t offset_value)
 Setting PS offset value. More...
 

Detailed Description

Function Documentation

◆ proximity11_cfg_setup()

void proximity11_cfg_setup ( proximity11_cfg_t cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ proximity11_convert_lx()

float proximity11_convert_lx ( proximity11_t ctx,
uint16_t *  input_data 
)

Converting raw data to Lux.

Parameters
ctxClick object.
input_databuffer that holds ALS data0 and ALS data1
Returns
Lux data

This function takes ALS data 0 and ALS data 1 values and converts them to Lux value

◆ proximity11_default_cfg()

uint8_t proximity11_default_cfg ( proximity11_t ctx)

Click Default Configuration function.

Parameters
ctxClick object.

This function executes default configuration for Proximity11 click.

◆ proximity11_generic_read()

void proximity11_generic_read ( proximity11_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

This function reads data from the desired register.

◆ proximity11_generic_write()

void proximity11_generic_write ( proximity11_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.

This function writes data to the desired register.

◆ proximity11_get()

uint8_t proximity11_get ( proximity11_t ctx,
uint8_t  register_address,
uint8_t *  output_buffer,
uint8_t  n_bytes 
)

Proximity value get function.

Parameters
ctxClick object.
register_addressRegister address.
output_bufferOutput data buf
n_bytesNumber of the bytes to be read

This function reads proximity values from the desired registers.

◆ proximity11_get_ps_als_values()

void proximity11_get_ps_als_values ( proximity11_t ctx,
uint16_t *  ps_value,
float *  als_value 
)

Getting ALS and PS values.

Parameters
ctxClick object.
ps_valuePS value
als_valueALS value

This function gets raw ALS and PS data and converts raw ALS data to Lux value

◆ proximity11_get_raw_ps_als_values()

void proximity11_get_raw_ps_als_values ( proximity11_t ctx,
uint8_t *  data_buffer 
)

Getting raw ALS and PS data.

Parameters
ctxClick object.
data_bufferdata buffer

This function gets raw ALS and PS data and stores them into data buffer

◆ proximity11_init()

PROXIMITY11_RETVAL proximity11_init ( proximity11_t ctx,
proximity11_cfg_t cfg 
)

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

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

◆ proximity11_int_get()

uint8_t proximity11_int_get ( proximity11_t ctx)

Int pin get functuin.

Parameters
ctxClick object.
Returns
int_pin state.

This function reads and returns int_pin state.

◆ proximity11_set()

uint8_t proximity11_set ( proximity11_t ctx,
uint8_t  register_address,
uint8_t *  input_buffer,
uint8_t  n_bytes 
)

Proximity value set function.

Parameters
ctxClick object.
register_addressRegister address.
input_bufferOutput data buf
n_bytesNumber of the bytes to be written

This function writes proximity values to the desired registers.

◆ proximity11_set_als_threshold_high()

void proximity11_set_als_threshold_high ( proximity11_t ctx,
uint16_t  threshold_value 
)

Setting High Als threshold value.

Parameters
ctxClick object.
threshold_valuethreshold value

This function sets High ALS threshold value

◆ proximity11_set_als_threshold_low()

void proximity11_set_als_threshold_low ( proximity11_t ctx,
uint16_t  threshold_value 
)

Setting Low Als threshold value.

Parameters
ctxClick object.
threshold_valuethreshold value

This function sets Low ALS threshold value

◆ proximity11_set_ps_offset()

uint8_t proximity11_set_ps_offset ( proximity11_t ctx,
uint16_t  offset_value 
)

Setting PS offset value.

Parameters
ctxClick object.
offset_valueoffset value
Returns
0 for correct threshold value (i.e. if threshold value does not exceed 1023)
1 for incorrect threshold value (i.e. if threshold value exceeds 1023)

This function sets PS offset value

◆ proximity11_set_ps_threshold_high()

uint8_t proximity11_set_ps_threshold_high ( proximity11_t ctx,
uint16_t  threshold_value 
)

Setting High PS threshold value.

Parameters
ctxClick object.
threshold_valuethreshold value
Returns
0 for correct threshold value (i.e. if threshold value does not exceed 4095)
1 for incorrect threshold value (i.e. if threshold value exceeds 4095)

This function sets High PS threshold value

◆ proximity11_set_ps_threshold_low()

uint8_t proximity11_set_ps_threshold_low ( proximity11_t ctx,
uint16_t  threshold_value 
)

Setting Low PS threshold value.

Parameters
ctxClick object.
threshold_valuethreshold value
Returns
0 for correct threshold value (i.e. if threshold value does not exceed 4095)
1 for incorrect threshold value (i.e. if threshold value exceeds 4095)

This function sets Low PS threshold value

◆ proximity11_update()

void proximity11_update ( proximity11_t ctx)

Updating data for Lux calculation.

Parameters
ctxClick object.

This function updates data used to calculate Lux. This function should be called if changing als measurement time and als gain.