current12  2.1.0.0
Modules | Functions
Current 12 Click Driver

API for configuring and manipulating Current 12 Click driver. More...

Modules

 Current 12 Registers List
 List of registers of Current 12 Click driver.
 
 Current 12 Registers Settings
 Settings for registers of Current 12 Click driver.
 
 Current 12 MikroBUS Map
 MikroBUS pin mapping of Current 12 Click driver.
 

Functions

void current12_cfg_setup (current12_cfg_t *cfg)
 Current 12 configuration object setup function. More...
 
err_t current12_init (current12_t *ctx, current12_cfg_t *cfg)
 Current 12 initialization function. More...
 
err_t current12_default_cfg (current12_t *ctx)
 Current 12 default configuration function. More...
 
err_t current12_generic_write (current12_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 Current 12 I2C writing function. More...
 
err_t current12_generic_read (current12_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 Current 12 I2C reading function. More...
 
err_t current12_write_word (current12_t *ctx, uint8_t reg, uint16_t data_in)
 Current 12 word data writing function. More...
 
err_t current12_read_word (current12_t *ctx, uint8_t reg, uint16_t *data_out)
 Current 12 word data reading function. More...
 
err_t current12_set_measure_cfg (current12_t *ctx, current12_measure_cfg_t measure_cfg)
 Current 12 set measurement configuration function. More...
 
err_t current12_get_shunt_voltage (current12_t *ctx, float *shunt_voltage)
 Current 12 get shunt voltage function. More...
 
err_t current12_get_load_voltage (current12_t *ctx, float *load_voltage)
 Current 12 get load voltage function. More...
 
err_t current12_get_dc_power (current12_t *ctx, float *dc_power)
 Current 12 get DC power function. More...
 
err_t current12_get_current (current12_t *ctx, float *current)
 Current 12 get current function. More...
 
err_t current12_get_temperature (current12_t *ctx, float *temperature)
 Current 12 get temperature function. More...
 
err_t current12_set_rshunt (current12_t *ctx, float rshunt_mohm)
 Current 12 set RSHUNT function. More...
 
err_t current12_get_device_id (current12_t *ctx, uint16_t *device_id)
 Current 12 get device ID function. More...
 
uint8_t current12_get_alert (current12_t *ctx)
 Current 12 get interrupt function. More...
 

Detailed Description

API for configuring and manipulating Current 12 Click driver.

Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.

Function Documentation

◆ current12_cfg_setup()

void current12_cfg_setup ( current12_cfg_t cfg)

Current 12 configuration object setup function.

This function initializes Click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See current12_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ current12_default_cfg()

err_t current12_default_cfg ( current12_t ctx)

Current 12 default configuration function.

This function executes a default configuration of Current 12 Click board.

Parameters
[in]ctx: Click context object. See current12_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.

◆ current12_generic_read()

err_t current12_generic_read ( current12_t ctx,
uint8_t  reg,
uint8_t *  data_out,
uint8_t  len 
)

Current 12 I2C reading function.

This function reads a desired number of data bytes starting from the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See current12_t object definition for detailed explanation.
[in]reg: Start register address.
[out]data_out: Output read data.
[in]len: Number of bytes to be read.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ current12_generic_write()

err_t current12_generic_write ( current12_t ctx,
uint8_t  reg,
uint8_t *  data_in,
uint8_t  len 
)

Current 12 I2C writing function.

This function writes a desired number of data bytes starting from the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See current12_t object definition for detailed explanation.
[in]reg: Start register address.
[in]data_in: Data to be written.
[in]len: Number of bytes to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ current12_get_alert()

uint8_t current12_get_alert ( current12_t ctx)

Current 12 get interrupt function.

This function return interrupt signal, states of the INT pin f the TSC1641IQT, 60 V, 16-bit high-precision power monitor with I�C and MIPI I3C interface on the Current 12 Click board.

Parameters
[in]ctx: Click context object. See current12_t object definition for detailed explanation.
Returns
  • 0 - Low state,
  • 1 - High state.
Note
None.

◆ current12_get_current()

err_t current12_get_current ( current12_t ctx,
float *  current 
)

Current 12 get current function.

This function reads the current measurement values [mA] of the TSC1641IQT, 60 V, 16-bit high-precision power monitor with I�C and MIPI I3C interface on the Current 12 Click board.

Parameters
[in]ctx: Click context object. See current12_t object definition for detailed explanation.
[out]current: Current data [mA].
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ current12_get_dc_power()

err_t current12_get_dc_power ( current12_t ctx,
float *  dc_power 
)

Current 12 get DC power function.

This function reads the DC power measurement values [W] of the TSC1641IQT, 60 V, 16-bit high-precision power monitor with I�C and MIPI I3C interface on the Current 12 Click board.

Parameters
[in]ctx: Click context object. See current12_t object definition for detailed explanation.
[out]load_voltage: Load voltage data [W].
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ current12_get_device_id()

err_t current12_get_device_id ( current12_t ctx,
uint16_t *  device_id 
)

Current 12 get device ID function.

This function reads the manufacturing ID data value of the TSC1641IQT, 60 V, 16-bit high-precision power monitor with I�C and MIPI I3C interface on the Current 12 Click board.

Parameters
[in]ctx: Click context object. See current12_t object definition for detailed explanation.
[out]device_id: Manufacturing ID [0x0006].
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ current12_get_load_voltage()

err_t current12_get_load_voltage ( current12_t ctx,
float *  load_voltage 
)

Current 12 get load voltage function.

This function reads the load voltage measurement values [V] of the TSC1641IQT, 60 V, 16-bit high-precision power monitor with I�C and MIPI I3C interface on the Current 12 Click board.

Parameters
[in]ctx: Click context object. See current12_t object definition for detailed explanation.
[out]load_voltage: Load voltage data [V].
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ current12_get_shunt_voltage()

err_t current12_get_shunt_voltage ( current12_t ctx,
float *  shunt_voltage 
)

Current 12 get shunt voltage function.

This function reads the shunt voltage measurement values [mV] of the TSC1641IQT, 60 V, 16-bit high-precision power monitor with I�C and MIPI I3C interface on the Current 12 Click board.

Parameters
[in]ctx: Click context object. See current12_t object definition for detailed explanation.
[out]shunt_voltage: Shunt voltage data [mV].
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ current12_get_temperature()

err_t current12_get_temperature ( current12_t ctx,
float *  temperature 
)

Current 12 get temperature function.

This function reads the temperature measurement values [degC] of the TSC1641IQT, 60 V, 16-bit high-precision power monitor with I�C and MIPI I3C interface on the Current 12 Click board.

Parameters
[in]ctx: Click context object. See current12_t object definition for detailed explanation.
[out]temperature: Temperature data [degC].
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ current12_init()

err_t current12_init ( current12_t ctx,
current12_cfg_t cfg 
)

Current 12 initialization function.

This function initializes all necessary pins and peripherals used for this Click board.

Parameters
[out]ctx: Click context object. See current12_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See current12_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ current12_read_word()

err_t current12_read_word ( current12_t ctx,
uint8_t  reg,
uint16_t *  data_out 
)

Current 12 word data reading function.

This function reads a 16-byte data from the selected register of the TSC1641IQT, 60 V, 16-bit high-precision power monitor with I�C and MIPI I3C interface on the Current 12 Click board.

Parameters
[in]ctx: Click context object. See current12_t object definition for detailed explanation.
[in]reg: Register address.
[out]data_out: 16-byte output read data.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ current12_set_measure_cfg()

err_t current12_set_measure_cfg ( current12_t ctx,
current12_measure_cfg_t  measure_cfg 
)

Current 12 set measurement configuration function.

This function sets the desired measurement configuration of the TSC1641IQT, 60 V, 16-bit high-precision power monitor with I�C and MIPI I3C interface on the Current 12 Click board.

Parameters
[in]ctx: Click context object. See current12_t object definition for detailed explanation.
[in]measure_cfg: Measurement configuration. See current12_measure_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ current12_set_rshunt()

err_t current12_set_rshunt ( current12_t ctx,
float  rshunt_mohm 
)

Current 12 set RSHUNT function.

This function sets the RSHUNT resistor value [mOhm] of the TSC1641IQT, 60 V, 16-bit high-precision power monitor with I�C and MIPI I3C interface on the Current 12 Click board.

Parameters
[in]ctx: Click context object. See current12_t object definition for detailed explanation.
[in]rshunt_mohm: RSHUNT resistorvalue [mOhm].
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ current12_write_word()

err_t current12_write_word ( current12_t ctx,
uint8_t  reg,
uint16_t  data_in 
)

Current 12 word data writing function.

This function writes a desired 16-byte data to the selected register of the TSC1641IQT, 60 V, 16-bit high-precision power monitor with I�C and MIPI I3C interface on the Current 12 Click board.

Parameters
[in]ctx: Click context object. See current12_t object definition for detailed explanation.
[in]reg: Register address.
[in]data_in: 16-byte data to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.