current12
2.1.0.0
|
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... | |
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.
void current12_cfg_setup | ( | current12_cfg_t * | cfg | ) |
Current 12 configuration object setup function.
This function initializes Click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See current12_cfg_t object definition for detailed explanation. |
err_t current12_default_cfg | ( | current12_t * | ctx | ) |
Current 12 default configuration function.
This function executes a default configuration of Current 12 Click board.
[in] | ctx | : Click context object. See current12_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[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. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[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. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[in] | ctx | : Click context object. See current12_t object definition for detailed explanation. |
0
- Low state, 1
- High state. 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.
[in] | ctx | : Click context object. See current12_t object definition for detailed explanation. |
[out] | current | : Current data [mA]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[in] | ctx | : Click context object. See current12_t object definition for detailed explanation. |
[out] | load_voltage | : Load voltage data [W]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[in] | ctx | : Click context object. See current12_t object definition for detailed explanation. |
[out] | device_id | : Manufacturing ID [0x0006]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[in] | ctx | : Click context object. See current12_t object definition for detailed explanation. |
[out] | load_voltage | : Load voltage data [V]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[in] | ctx | : Click context object. See current12_t object definition for detailed explanation. |
[out] | shunt_voltage | : Shunt voltage data [mV]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[in] | ctx | : Click context object. See current12_t object definition for detailed explanation. |
[out] | temperature | : Temperature data [degC]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[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. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[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. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[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. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[in] | ctx | : Click context object. See current12_t object definition for detailed explanation. |
[in] | rshunt_mohm | : RSHUNT resistorvalue [mOhm]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[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. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.