proximity10 2.0.0.0

Functions

void proximity10_cfg_setup (proximity10_cfg_t *cfg)
 Config Object Initialization function.
 
PROXIMITY10_RETVAL proximity10_init (proximity10_t *ctx, proximity10_cfg_t *cfg)
 Initialization function.
 
void proximity10_default_cfg (proximity10_t *ctx)
 Click Default Configuration function.
 
uint8_t proximity10_generic_write (proximity10_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
uint8_t proximity10_generic_read (proximity10_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
uint8_t proximity10_check_int_status (proximity10_t *ctx, uint8_t bit_mask, uint8_t clear_en)
 Check INT Flags function.
 
uint8_t proximity10_check_chip_status (proximity10_t *ctx, uint8_t bit_mask)
 Check Chip Status function.
 
uint8_t proximity10_check_int_pin (proximity10_t *ctx)
 Check INT Pin function.
 
uint8_t proximity10_send_command (proximity10_t *ctx, uint8_t prox_command)
 Command Send function.
 
uint8_t proximity10_param_query (proximity10_t *ctx, uint8_t param_addr)
 Parameter Query function.
 
uint8_t proximity10_param_set (proximity10_t *ctx, uint8_t param_addr, uint8_t param_value)
 Parameter Set function.
 
uint8_t proximity10_param_and (proximity10_t *ctx, uint8_t param_addr, uint8_t param_value)
 Parameter AND function.
 
uint8_t proximity10_param_or (proximity10_t *ctx, uint8_t param_addr, uint8_t param_value)
 Parameter OR function.
 

Detailed Description

Function Documentation

◆ proximity10_cfg_setup()

void proximity10_cfg_setup ( proximity10_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.

◆ proximity10_check_chip_status()

uint8_t proximity10_check_chip_status ( proximity10_t * ctx,
uint8_t bit_mask )

Check Chip Status function.

Parameters
ctxClick object.
bitMaskSelects a flags to be checked
Returns
Chip status flags

@description This function checks the desired chip status flags.

◆ proximity10_check_int_pin()

uint8_t proximity10_check_int_pin ( proximity10_t * ctx)

Check INT Pin function.

Parameters
ctxClick object.
Returns
0 or 1

@description This function checks the INT pin status.

◆ proximity10_check_int_status()

uint8_t proximity10_check_int_status ( proximity10_t * ctx,
uint8_t bit_mask,
uint8_t clear_en )

Check INT Flags function.

Parameters
ctxClick object.
bitMaskSelects a flags to be checked
clearEn0 - Disable, 1 - Enable a interrupt clearing by the host
Returns
Interrupt flags status

@description This function checks the desired interrupt flags status.

◆ proximity10_default_cfg()

void proximity10_default_cfg ( proximity10_t * ctx)

Click Default Configuration function.

Parameters
ctxClick object.

@description This function executes default configuration for Proximity10 click.

◆ proximity10_generic_read()

uint8_t proximity10_generic_read ( proximity10_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.

◆ proximity10_generic_write()

uint8_t proximity10_generic_write ( proximity10_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.

◆ proximity10_init()

PROXIMITY10_RETVAL proximity10_init ( proximity10_t * ctx,
proximity10_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

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

◆ proximity10_param_and()

uint8_t proximity10_param_and ( proximity10_t * ctx,
uint8_t param_addr,
uint8_t param_value )

Parameter AND function.

Parameters
ctxClick object.
paramAddrAddress of the desired parameter to be modified
Returns
0 - OK, 2 - Invalid parameter address, or returns a response error code

@descritpion This function performs a bit-wise AND operation between selected parameter and entered value, and checks the response.

Note
If error is detected in the response, the Reset command will be executed.

◆ proximity10_param_or()

uint8_t proximity10_param_or ( proximity10_t * ctx,
uint8_t param_addr,
uint8_t param_value )

Parameter OR function.

Parameters
ctxClick object.
paramAddrAddress of the desired parameter to be modified
Returns
0 - OK, 2 - Invalid parameter address, or returns a response error code

@description This function performs a bit-wise OR operation between selected parameter and entered value, and checks the response.

Note
If error is detected in the response, the Reset command will be executed.

◆ proximity10_param_query()

uint8_t proximity10_param_query ( proximity10_t * ctx,
uint8_t param_addr )

Parameter Query function.

Parameters
ctxClick object.
paramAddrAddress of the desired parameter to be read
Returns
0 - OK, 2 - Invalid parameter address, or returns a response error code

@descritpion This function reads the selected parameter and writes value to PARAM_RD register, and checks the response.

Note
If error is detected in the response, the Reset command will be executed.

◆ proximity10_param_set()

uint8_t proximity10_param_set ( proximity10_t * ctx,
uint8_t param_addr,
uint8_t param_value )

Parameter Set function.

Parameters
ctxClick object.
paramAddrAddress of the desired parameter to be set
Returns
0 - OK, 2 - Invalid parameter address, or returns a response error code

@description This function sets the selected parameter to the desired value, and checks the response.

Note
If error is detected in the response, the Reset command will be executed.

◆ proximity10_send_command()

uint8_t proximity10_send_command ( proximity10_t * ctx,
uint8_t prox_command )

Command Send function.

Parameters
ctxClick object.
prox_commandSelects a desired command to be sent
Returns
0 - OK, 3 - Invalid command, or returns a response error code

@description This function allows user to execute a desired command and checks the response.

Note
If error is detected in the response, the Reset command will be executed.