hallcurrent7 2.0.0.0
|
API for configuring and manipulating Hall Current 7 Click driver. More...
Topics | |
Hall Current 7 Registers Settings | |
Settings for registers of Hall Current 7 Click driver. | |
Hall Current 7 MikroBUS Map | |
MikroBUS pin mapping of Hall Current 7 Click driver. | |
Functions | |
void | hallcurrent7_cfg_setup (hallcurrent7_cfg_t *cfg) |
Hall Current 7 configuration object setup function. | |
err_t | hallcurrent7_init (hallcurrent7_t *ctx, hallcurrent7_cfg_t *cfg) |
Hall Current 7 initialization function. | |
err_t | hallcurrent7_generic_write (hallcurrent7_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len) |
Hall Current 7 I2C writing function. | |
err_t | hallcurrent7_generic_read (hallcurrent7_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len) |
Hall Current 7 I2C reading function. | |
uint16_t | hallcurrent7_read_data (hallcurrent7_t *ctx) |
Read data function. | |
uint16_t | hallcurrent7_read_voltage (hallcurrent7_t *ctx, uint16_t v_ref) |
Read voltage function. | |
int16_t | hallcurrent7_calc_current (hallcurrent7_t *ctx, uint16_t v_ref) |
Calculate current function. | |
int16_t | hallcurrent7_avg_current (hallcurrent7_t *ctx, uint16_t v_ref) |
Calculate Average current function. | |
API for configuring and manipulating Hall Current 7 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
int16_t hallcurrent7_avg_current | ( | hallcurrent7_t * | ctx, |
uint16_t | v_ref ) |
Calculate Average current function.
Function is used to calculate average current and correct for output error.
[in] | ctx | : Click context object. See hallcurrent7_t object definition for detailed explanation. |
[in] | v_ref | : 16-bit value representing power supply voltage. |
int16_t hallcurrent7_calc_current | ( | hallcurrent7_t * | ctx, |
uint16_t | v_ref ) |
Calculate current function.
Function is used to calculate current.
[in] | ctx | : Click context object. See hallcurrent7_t object definition for detailed explanation. |
[in] | v_ref | : 16-bit value representing power supply voltage. |
void hallcurrent7_cfg_setup | ( | hallcurrent7_cfg_t * | cfg | ) |
Hall Current 7 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See hallcurrent7_cfg_t object definition for detailed explanation. |
err_t hallcurrent7_generic_read | ( | hallcurrent7_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | rx_buf, | ||
uint8_t | rx_len ) |
Hall Current 7 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 hallcurrent7_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[out] | rx_buf | : Output read data. |
[in] | rx_len | : Number of bytes to be read. |
0
- Success, -1
- Error.err_t hallcurrent7_generic_write | ( | hallcurrent7_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | tx_buf, | ||
uint8_t | tx_len ) |
Hall Current 7 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 hallcurrent7_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[in] | tx_buf | : Data to be written. |
[in] | tx_len | : Number of bytes to be written. |
0
- Success, -1
- Error.err_t hallcurrent7_init | ( | hallcurrent7_t * | ctx, |
hallcurrent7_cfg_t * | cfg ) |
Hall Current 7 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See hallcurrent7_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See hallcurrent7_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.uint16_t hallcurrent7_read_data | ( | hallcurrent7_t * | ctx | ) |
Read data function.
Function is used to read raw data from MCP3221.
[in] | ctx | : Click context object. See hallcurrent7_t object definition for detailed explanation. |
uint16_t hallcurrent7_read_voltage | ( | hallcurrent7_t * | ctx, |
uint16_t | v_ref ) |
Read voltage function.
Function is used to calculate raw output voltage.
[in] | ctx | : Click context object. See hallcurrent7_t object definition for detailed explanation. |
[in] | v_ref | : 16-bit value representing power supply voltage. |