uv4 2.0.0.0
Public function

Functions

void uv4_cfg_setup (uv4_cfg_t *cfg)
 Config Object Initialization function.
 
UV4_RETVAL uv4_init (uv4_t *ctx, uv4_cfg_t *cfg)
 Initialization function.
 
void uv4_default_cfg (uv4_t *ctx)
 Click Default Configuration function.
 
UV4_RETVAL uv4_write_reg (uv4_t *ctx, const uint8_t reg_address, const uint8_t transfer_data)
 Generic write function.
 
UV4_RETVAL uv4_read_reg (uv4_t *ctx, uint8_t reg_address, uint8_t *data_out, uint8_t n_bytes)
 Generic read function.
 
UV4_RETVAL uv4_write_param_data (uv4_t *ctx, uint8_t param_address, uint8_t transfer_data)
 Parameter Data Write Function.
 
UV4_RETVAL uv4_read_param_data (uv4_t *ctx, uint8_t param_address, uint8_t *param_out)
 Parameter Data Read Function.
 
void uv4_read_measurements (uv4_t *ctx, uint32_t *measure_out)
 Measurements Read Function.
 
UV4_RETVAL uv4_check_err_and_ctr (uv4_t *ctx, uint8_t *cnt_data)
 Error And Counter Check function.
 
UV4_RETVAL uv4_check_interr (uv4_t *ctx)
 Error And Counter Check function.
 

Detailed Description

Function Documentation

◆ uv4_cfg_setup()

void uv4_cfg_setup ( uv4_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.

◆ uv4_check_err_and_ctr()

UV4_RETVAL uv4_check_err_and_ctr ( uv4_t * ctx,
uint8_t * cnt_data )

Error And Counter Check function.

Parameters
uv4Click object.
cnt_dataPointer where counter data is stored.
Returns
0 - OK, 1 - Wrong address parameter, 3 - Invalid command, 4 - Invalid location, 5 - Saturation or overflow of accumulation, 6 - Output buffer overflow, 7 - Reset occurred.

@description This function checks if error occurred and if it didn't, reads counter data. Counter increments on every successful command.

◆ uv4_check_interr()

UV4_RETVAL uv4_check_interr ( uv4_t * ctx)

Error And Counter Check function.

Parameters
uv4Click object.
Returns
0x00 - No interrupt, 0xFF - Interrupt occurred.

@description This function checks state on INT pin, if interrupt occurred.

◆ uv4_default_cfg()

void uv4_default_cfg ( uv4_t * ctx)

Click Default Configuration function.

Parameters
ctxClick object.

@description This function executes default configuration for UV4 Click.

◆ uv4_init()

UV4_RETVAL uv4_init ( uv4_t * ctx,
uv4_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

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

◆ uv4_read_measurements()

void uv4_read_measurements ( uv4_t * ctx,
uint32_t * measure_out )

Measurements Read Function.

Parameters
uv4Click object.
measure_outPointer to buffer where measured data is stored.

@description This function reads measured determined data from selected channel/channels, when measurement is completed on selected channel. Measured data can be 16-bit unsigned data, or 24-bit signed data.

◆ uv4_read_param_data()

UV4_RETVAL uv4_read_param_data ( uv4_t * ctx,
uint8_t param_address,
uint8_t * param_out )

Parameter Data Read Function.

Parameters
uv4Click object.
param_addressAddress of parameter data.
param_outPointer to buffer where parameter is stored.
Returns
0 - OK, 1 - Wrong address parameter, 3 - Invalid command, 4 - Invalid location, 5 - Saturation or overflow of accumulation, 6 - Output buffer overflow, 7 - Reset occurred.

@description This function reads one byte of data from parameter table.

◆ uv4_read_reg()

UV4_RETVAL uv4_read_reg ( uv4_t * ctx,
uint8_t reg_address,
uint8_t * data_out,
uint8_t n_bytes )

Generic read function.

Parameters
uv4Click object.
reg_addressAddress to read byte from.
data_outPointer to buffer where data is to be stored.
inc_en0x00 - Enable autoincrement pointer, 0x40 - Disable autoincrement pointer.
Returns
0 - OK, 1 - Wrong address parameter, 2 - Wrong inc_en parameter.

@description This function reads determined number of bytes from given address.

◆ uv4_write_param_data()

UV4_RETVAL uv4_write_param_data ( uv4_t * ctx,
uint8_t param_address,
uint8_t transfer_data )

Parameter Data Write Function.

Parameters
uv4Click object.
param_addressAddress of parameter data.
transfer_dataData to be written.
Returns
0 - OK, 1 - Wrong address parameter, 3 - Invalid command, 4 - Invalid location, 5 - Saturation or overflow of accumulation, 6 - Output buffer overflow, 7 - Reset occurred.

@description This function writes one byte of data in parameter table.

◆ uv4_write_reg()

UV4_RETVAL uv4_write_reg ( uv4_t * ctx,
const uint8_t reg_address,
const uint8_t transfer_data )

Generic write function.

Parameters
uv4Click object.
reg_addressAddress to write byte to.
Returns
0 - OK, 1 - Wrong address parameter.

@description This function write one byte of data to given address.