proxfusion2 2.0.0.0

Functions

void proxfusion2_cfg_setup (proxfusion2_cfg_t *cfg)
 Config Object Initialization function.
 
err_t proxfusion2_init (proxfusion2_t *ctx, proxfusion2_cfg_t *cfg)
 Initialization function.
 
err_t proxfusion2_default_cfg (proxfusion2_t *ctx)
 Click Default Configuration function.
 
void proxfusion2_write_byte (proxfusion2_t *ctx, uint8_t reg, uint8_t d_data)
 Function for writing one byte into the register.
 
uint8_t proxfusion2_read_byte (proxfusion2_t *ctx, uint8_t reg)
 Function for reads one byte from register.
 
uint16_t proxfusion2_read_data (proxfusion2_t *ctx, uint8_t reg)
 Function for reads two byte from register.
 
err_t proxfusion2_check_communication (proxfusion2_t *ctx)
 Function for check communication by reading the device ID registers.
 
uint8_t proxfusion2_detect_touch (proxfusion2_t *ctx)
 Function for detect Touch.
 
uint8_t proxfusion2_detect_dark_light (proxfusion2_t *ctx, uint8_t *als_range)
 Function for read ambient light.
 
uint8_t proxfusion2_detect_hall (proxfusion2_t *ctx)
 Function for read Hall-effect.
 

Detailed Description

Function Documentation

◆ proxfusion2_cfg_setup()

void proxfusion2_cfg_setup ( proxfusion2_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.

◆ proxfusion2_check_communication()

err_t proxfusion2_check_communication ( proxfusion2_t * ctx)

Function for check communication by reading the device ID registers.

Parameters
ctxClick object.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.

◆ proxfusion2_default_cfg()

err_t proxfusion2_default_cfg ( proxfusion2_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 ProxFusion2 click.

◆ proxfusion2_detect_dark_light()

uint8_t proxfusion2_detect_dark_light ( proxfusion2_t * ctx,
uint8_t * als_range )

Function for read ambient light.

Parameters
ctxClick object.
als_rangeALS range (0-10)
Returns
1 - DARK or 0 - LIGHT

◆ proxfusion2_detect_hall()

uint8_t proxfusion2_detect_hall ( proxfusion2_t * ctx)

Function for read Hall-effect.

Parameters
ctxClick object.
Returns
0 - NORTH, 1 - SOUTH or 2 - UNKNOWN

◆ proxfusion2_detect_touch()

uint8_t proxfusion2_detect_touch ( proxfusion2_t * ctx)

Function for detect Touch.

Parameters
ctxClick object.
Returns
1 - TOUCH DETECTED or 0 - TOUCH NOT DETECTED

◆ proxfusion2_init()

err_t proxfusion2_init ( proxfusion2_t * ctx,
proxfusion2_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.

◆ proxfusion2_read_byte()

uint8_t proxfusion2_read_byte ( proxfusion2_t * ctx,
uint8_t reg )

Function for reads one byte from register.

Parameters
ctxClick object.
regRegister from which the data is read
Returns
Data that is read.

◆ proxfusion2_read_data()

uint16_t proxfusion2_read_data ( proxfusion2_t * ctx,
uint8_t reg )

Function for reads two byte from register.

Parameters
ctxClick object.
regRegister from which the data is read
Returns
Data that is read.

◆ proxfusion2_write_byte()

void proxfusion2_write_byte ( proxfusion2_t * ctx,
uint8_t reg,
uint8_t d_data )

Function for writing one byte into the register.

Parameters
ctxClick object.
regRegister in which the data will be written
d_dataData which be written in register