proximity3 2.0.0.0

Functions

void proximity3_cfg_setup (proximity3_cfg_t *cfg)
 Config Object Initialization function.
 
err_t proximity3_init (proximity3_t *ctx, proximity3_cfg_t *cfg)
 Initialization function.
 
err_t proximity3_default_cfg (proximity3_t *ctx)
 Proximity 3 default configuration function.
 
err_t proximity3_write_16 (proximity3_t *ctx, uint8_t reg_address, uint16_t data_in)
 Generic write function.
 
uint16_t proximity3_read_16 (proximity3_t *ctx, uint8_t reg_address)
 Generic read function.
 
uint16_t proximity3_read_als (proximity3_t *ctx)
 Read ambient light sensor data.
 
uint16_t proximity3_read_proximity (proximity3_t *ctx)
 Read proximity.
 

Detailed Description

Function Documentation

◆ proximity3_cfg_setup()

void proximity3_cfg_setup ( proximity3_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.

◆ proximity3_default_cfg()

err_t proximity3_default_cfg ( proximity3_t * ctx)

Proximity 3 default configuration function.

This function executes a default configuration of Proximity 3 click board.

Parameters
[in]ctx: Click context object. See proximity3_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ proximity3_init()

err_t proximity3_init ( proximity3_t * ctx,
proximity3_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.

◆ proximity3_read_16()

uint16_t proximity3_read_16 ( proximity3_t * ctx,
uint8_t reg_address )

Generic read function.

Parameters
ctxClick object.
regRegister address.
Returns
16-BIT data read from the register.

This function reads data from the desired register.

◆ proximity3_read_als()

uint16_t proximity3_read_als ( proximity3_t * ctx)

Read ambient light sensor data.

Parameters
ctxClick object.
Returns
Ambient light sensor data.

This function gets the data returned by the ambient light sensor.

◆ proximity3_read_proximity()

uint16_t proximity3_read_proximity ( proximity3_t * ctx)

Read proximity.

Parameters
ctxClick object.
Returns
Proximity data.

This function returns the proximity.

◆ proximity3_write_16()

err_t proximity3_write_16 ( proximity3_t * ctx,
uint8_t reg_address,
uint16_t data_in )

Generic write function.

Parameters
ctxClick object.
reg_addressRegister address.
data_in16-BIT data ata to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
This function writes data to the desired register.