proximity9 2.0.0.0

Functions

void proximity9_cfg_setup (proximity9_cfg_t *cfg)
 Config Object Initialization function.
 
PROXIMITY9_RETVAL proximity9_init (proximity9_t *ctx, proximity9_cfg_t *cfg)
 Initialization function.
 
void proximity9_default_cfg (proximity9_t *ctx)
 Click Default Configuration function.
 
void proximity9_generic_write (proximity9_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void proximity9_generic_read (proximity9_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
PROXIMITY9_RETVAL proximity9_read_register (proximity9_t *ctx, uint8_t reg_addr, uint16_t *data_out)
 Generic Read function.
 
PROXIMITY9_RETVAL proximity9_write_register (proximity9_t *ctx, uint8_t reg_addr, uint16_t data_in)
 Generic Write function.
 
uint8_t proximity9_check_int_pin (proximity9_t *ctx)
 INT Pin Check function.
 
uint8_t proximity9_check_int_flag (proximity9_t *ctx, uint8_t bit_mask)
 INT Flag Check function.
 
float proximity9_get_als_lux (proximity9_t *ctx)
 ALS Get function.
 

Detailed Description

Function Documentation

◆ proximity9_cfg_setup()

void proximity9_cfg_setup ( proximity9_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.

◆ proximity9_check_int_flag()

uint8_t proximity9_check_int_flag ( proximity9_t * ctx,
uint8_t bit_mask )

INT Flag Check function.

Parameters
ctxClick object.
bit_maskSelects the flags to be checked
Returns
Flags status

@description This function allows user to check a desired interrupt flags.

◆ proximity9_check_int_pin()

uint8_t proximity9_check_int_pin ( proximity9_t * ctx)

INT Pin Check function.

Parameters
ctxClick object.
Returns
0 or 1

@description This function returns the state of the INT pin.

◆ proximity9_default_cfg()

void proximity9_default_cfg ( proximity9_t * ctx)

Click Default Configuration function.

Parameters
ctxClick object.
Note
PROXIMITY9_ALS_CONF_REG:
     set: PROXIMITY9_ALS_IT_320_MS;
PROXIMITY9_PS_CONF_REG:
     set: PROXIMITY9_PS_OUTPUT_16BIT | 
          PROXIMITY9_PS_INT_TRIGGER_BOTH | 
          PROXIMITY9_PS_IR_ON_1_OFF_80 | 
          PROXIMITY9_PS_IT_8T;
PROXIMITY9_PS_MS_REG:
     set: PROXIMITY9_PS_NORMAL_OP_MODE | 
          PROXIMITY9_LED_I_160_MA;
PROXIMITY9_PS_THRSHD_L_REG:
     set: 30;
PROXIMITY9_PS_THRSHD_H_REG:
     set: 2000;

@description This function executes default configuration for Proximity9 click.

◆ proximity9_generic_read()

void proximity9_generic_read ( proximity9_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.

◆ proximity9_generic_write()

void proximity9_generic_write ( proximity9_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.

◆ proximity9_get_als_lux()

float proximity9_get_als_lux ( proximity9_t * ctx)

ALS Get function.

Parameters
ctxClick object.
Returns
The real ALS value in lux unit

@description This function allows user to get the ALS value calculated to lux.

◆ proximity9_init()

PROXIMITY9_RETVAL proximity9_init ( proximity9_t * ctx,
proximity9_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

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

◆ proximity9_read_register()

PROXIMITY9_RETVAL proximity9_read_register ( proximity9_t * ctx,
uint8_t reg_addr,
uint16_t * data_out )

Generic Read function.

Parameters
ctxClick object.
reg_addrAddress which from data be read
data_outMemory location where data be stored
Returns
0 - OK, 1 - Invalid register address

@description This function reads a 16bit data from the desired register.

◆ proximity9_write_register()

PROXIMITY9_RETVAL proximity9_write_register ( proximity9_t * ctx,
uint8_t reg_addr,
uint16_t data_in )

Generic Write function.

Parameters
ctxClick object.
reg_addrAddress where data be written
data_inData to be written
Returns
0 - OK, 1 - Invalid register address

@description This function writes a 16bit data to the desired register.