current3 2.0.0.0
Public function

Functions

void current3_cfg_setup (current3_cfg_t *cfg)
 Config Object Initialization function.
 
err_t current3_init (current3_t *ctx, current3_cfg_t *cfg)
 Initialization function.
 
void current3_default_cfg (current3_t *ctx, current3_sense_cfg_data_t sense_cfg_data)
 Click Default Configuration function.
 
err_t current3_generic_write (current3_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 Generic write function.
 
err_t current3_generic_read (current3_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 Generic read function.
 
float current3_get_temperature (current3_t *ctx, uint8_t temp_sel)
 Get temperature function.
 
void current3_get_status (current3_t *ctx, current3_status_data_t *status_cfg)
 Get status function.
 
void current3_set_configuration (current3_t *ctx, current3_cfg_data_t cfg_data)
 Set configuration function.
 
void current3_get_configuration (current3_t *ctx, current3_cfg_data_t *cfg_data)
 Get configuration function.
 
void current3_set_voltage_sampling_config (current3_t *ctx, current3_voltage_cfg_data_t vtg_cfg_data)
 Set voltage sampling configuration function.
 
void current3_get_voltage_sampling_config (current3_t *ctx, current3_voltage_cfg_data_t *vtg_cfg_data)
 Get voltage sampling configuration function.
 
void current3_set_sense_sampling_config (current3_t *ctx, current3_sense_cfg_data_t sense_cfg_data)
 Set sense sampling configuration function.
 
void current3_get_sense_sampling_config (current3_t *ctx, current3_sense_cfg_data_t *sense_cfg_data)
 Get sense sampling configuration function.
 
int16_t current3_get_sense_voltage (current3_t *ctx)
 Get sense voltage function.
 
float current3_get_source_voltage (current3_t *ctx)
 Get source voltage function.
 
float current3_get_current (current3_t *ctx)
 Get current measurement function.
 
uint8_t current3_check_therm (current3_t *ctx)
 Check therm ststus function.
 
uint8_t current3_check_alert (current3_t *ctx)
 Check alert ststus function.
 

Detailed Description

Function Documentation

◆ current3_cfg_setup()

void current3_cfg_setup ( current3_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.

◆ current3_check_alert()

uint8_t current3_check_alert ( current3_t * ctx)

Check alert ststus function.

Parameters
ctxClick object.
Returns
ALERT state: 0 - No active; 1 - Active.

Function check alert stauts of the High-Side Current-Sense and Dual 1�C Temperature Monitor on Current 3 Click board.

Note
When the ALERT pin is configured to operate in Comparator mode, it will be asserted if any of the measured temperatures meets or exceeds the respective high limit.

◆ current3_check_therm()

uint8_t current3_check_therm ( current3_t * ctx)

Check therm ststus function.

Parameters
ctxClick object.
Returns
THERM state: 0 - No active; 1 - Active.

Function check therm stauts by detecting temperatures drops below the Tcrit Limit of the High-Side Current-Sense and Dual 1�C Temperature Monitor on Current 3 Click board.

◆ current3_default_cfg()

void current3_default_cfg ( current3_t * ctx,
current3_sense_cfg_data_t sense_cfg_data )

Click Default Configuration function.

Parameters
ctxClick object.

This function executes default configuration for Current3 click.

◆ current3_generic_read()

err_t current3_generic_read ( current3_t * ctx,
uint8_t reg,
uint8_t * data_out,
uint8_t len )

Generic read function.

Parameters
ctxClick object.
regRegister address.
data_outOutput 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.

◆ current3_generic_write()

err_t current3_generic_write ( current3_t * ctx,
uint8_t reg,
uint8_t * data_in,
uint8_t len )

Generic write function.

Parameters
ctxClick object.
regRegister address.
data_inData 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.

◆ current3_get_configuration()

void current3_get_configuration ( current3_t * ctx,
current3_cfg_data_t * cfg_data )

Get configuration function.

Parameters
ctxClick object.
cfg_dataPointer to the memory location where data be stored.

The function get the configuration by read data byte from a register of the High-Side Current-Sense and Dual 1�C Temperature Monitor on Current 3 Click board.

◆ current3_get_current()

float current3_get_current ( current3_t * ctx)

Get current measurement function.

Parameters
ctxClick object.
Returns
Isource Float measured current.

The function current measurement measure the direction of current flow ( from SENSE+ to SENSE- or from SENSE- to SENSE+ ) of the High-Side Current-Sense and Dual 1�C Temperature Monitor on Current 3 Click board.

◆ current3_get_sense_sampling_config()

void current3_get_sense_sampling_config ( current3_t * ctx,
current3_sense_cfg_data_t * sense_cfg_data )

Get sense sampling configuration function.

Parameters
ctxClick object.
sense_cfg_dataPointer to the memory location where data be stored.

The function get sense sampling configurationby read data byte from a register of the High-Side Current-Sense and Dual 1�C Temperature Monitor on Current 3 Click board.

◆ current3_get_sense_voltage()

int16_t current3_get_sense_voltage ( current3_t * ctx)

Get sense voltage function.

Parameters
ctxClick object.
Returns
Vsense 12-bit ( signed ) measured VSENSE voltage.

The function measured Vsense voltage across the sense resistor ( Rsense ) placed between the SENSE+ and SENSE- pins of the High-Side Current-Sense and Dual 1�C Temperature Monitor on Current 3 Click board.

Note
The bit weighting values are for representation of the voltage relative to full scale. There 
is no internal scaling of data and all normal binary bit weightings still apply.

◆ current3_get_source_voltage()

float current3_get_source_voltage ( current3_t * ctx)

Get source voltage function.

Parameters
ctxClick object.
Returns
Vsource Float measured source voltage.

The function source voltage registers store the voltage measured at the SENSE+ pin of the High-Side Current-Sense and Dual 1�C Temperature Monitor on Current 3 Click board.

◆ current3_get_status()

void current3_get_status ( current3_t * ctx,
current3_status_data_t * status_cfg )

Get status function.

Parameters
ctxClick object.
status_cfgStructure where data be stored.

The function get status by read data byte from a register of the High-Side Current-Sense and Dual 1�C Temperature Monitor on Current 3 Click board.

◆ current3_get_temperature()

float current3_get_temperature ( current3_t * ctx,
uint8_t temp_sel )

Get temperature function.

Parameters
ctxClick object.
temp_sel
- 0x00 ( CURRENT3_TEMP_INTERNAL_DIODE ) : Internal Diode.
- 0x01 ( CURRENT3_TEMP_EXTERNAL_DIODE ) : External Diode.
Returns
float temperature data [ degree Celsius ].

The function get the temperature by read multiple data bytes from a group of contiguous registers of the High-Side Current-Sense and Dual 1�C Temperature Monitor on Current 3 Click board.

◆ current3_get_voltage_sampling_config()

void current3_get_voltage_sampling_config ( current3_t * ctx,
current3_voltage_cfg_data_t * vtg_cfg_data )

Get voltage sampling configuration function.

Parameters
ctxClick object.
vtg_cfg_dataPointer to the memory location where data be stored.

The function get voltage sampling configuration by read data byte from a register of the High-Side Current-Sense and Dual 1�C Temperature Monitor on Current 3 Click board.

◆ current3_init()

err_t current3_init ( current3_t * ctx,
current3_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.

◆ current3_set_configuration()

void current3_set_configuration ( current3_t * ctx,
current3_cfg_data_t cfg_data )

Set configuration function.

Parameters
ctxClick object.
cfg_dataStructure where data be stored.

The function set the configuration by write data byte to the register of the High-Side Current-Sense and Dual 1�C Temperature Monitor on Current 3 Click board.

◆ current3_set_sense_sampling_config()

void current3_set_sense_sampling_config ( current3_t * ctx,
current3_sense_cfg_data_t sense_cfg_data )

Set sense sampling configuration function.

Parameters
ctxClick object.
sense_cfg_dataStructure where data be stored.

The function set sense sampling configuration by write data byte from a register of the High-Side Current-Sense and Dual 1�C Temperature Monitor on Current 3 Click board.

◆ current3_set_voltage_sampling_config()

void current3_set_voltage_sampling_config ( current3_t * ctx,
current3_voltage_cfg_data_t vtg_cfg_data )

Set voltage sampling configuration function.

Parameters
ctxClick object.
vtg_cfg_dataStructure where data be stored.

The function set voltage sampling configuration by write data byte from a register of the High-Side Current-Sense and Dual 1�C Temperature Monitor on Current 3 Click board.