proximity6 2.0.0.0

Functions

void proximity6_cfg_setup (proximity6_cfg_t *cfg)
 Config Object Initialization function.
 
err_t proximity6_init (proximity6_t *ctx, proximity6_cfg_t *cfg)
 Initialization function.
 
err_t proximity6_default_cfg (proximity6_t *ctx)
 Click Default Configuration function.
 
err_t proximity6_generic_write (proximity6_t *ctx, uint8_t reg, uint16_t *data_buf, uint8_t len)
 Generic write function.
 
err_t proximity6_generic_read (proximity6_t *ctx, uint8_t reg, uint16_t *data_out, uint8_t len)
 Generic read function.
 
err_t proximity6_set_mode (proximity6_t *ctx, uint8_t select_mode)
 Mode Set function.
 
err_t proximity6_read_data (proximity6_t *ctx, proximity6_data_t *axis_out)
 Data Read function.
 
uint8_t proximity6_check_interrupt (proximity6_t *ctx)
 Interrupt Check function.
 

Detailed Description

Function Documentation

◆ proximity6_cfg_setup()

void proximity6_cfg_setup ( proximity6_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.

◆ proximity6_check_interrupt()

uint8_t proximity6_check_interrupt ( proximity6_t * ctx)

Interrupt Check function.

Parameters
ctxClick object.
Returns
State of INT pin

Function checks is interrupt occurred and returns the state of the INT pin. INT pin can be configured to show are data registers updated with the new values or not.

◆ proximity6_default_cfg()

err_t proximity6_default_cfg ( proximity6_t * ctx)

Click Default Configuration function.

Parameters
ctxClick object.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
This function executes default configuration for Proximity6 click and sets the registers in default state.

◆ proximity6_generic_read()

err_t proximity6_generic_read ( proximity6_t * ctx,
uint8_t reg,
uint16_t * data_out,
uint8_t len )

Generic read function.

Parameters
ctxClick object.
regRegister address.
data_bufOutput data buf
lenNumber of the bytes to be read
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
This function reads data from the desired register.

◆ proximity6_generic_write()

err_t proximity6_generic_write ( proximity6_t * ctx,
uint8_t reg,
uint16_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.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
This function writes data to the desired register.

◆ proximity6_init()

err_t proximity6_init ( proximity6_t * ctx,
proximity6_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
This function initializes all necessary pins and peripherals used for this click.

◆ proximity6_read_data()

err_t proximity6_read_data ( proximity6_t * ctx,
proximity6_data_t * axis_out )

Data Read function.

Parameters
ctxClick object.
axis_outStructure object where data will be stored
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Function reads proximity data when one or more data register is updated.

◆ proximity6_set_mode()

err_t proximity6_set_mode ( proximity6_t * ctx,
uint8_t select_mode )

Mode Set function.

Parameters
ctxClick object.
select_mode0 - Standby Mode, 1 - Proximity Mode, 2 - Sample Mode, 3 - Idle Mode
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Function puts the device in the desired operating mode.