hallcurrent9 2.0.0.0
Hall Current 9 Click Driver

API for configuring and manipulating Hall Current 9 Click driver. More...

Topics

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

Functions

void hallcurrent9_cfg_setup (hallcurrent9_cfg_t *cfg)
 Hall Current 9 configuration object setup function.
 
err_t hallcurrent9_init (hallcurrent9_t *ctx, hallcurrent9_cfg_t *cfg)
 Hall Current 9 initialization function.
 
err_t hallcurrent9_read_adc (hallcurrent9_t *ctx, uint16_t *read_adc)
 Hall Current 9 I2C ADC reading function.
 
err_t hallcurrent9_set_calibration (hallcurrent9_t *ctx, hallcurrent9_calibration_data_t *adc_val)
 Hall Current 9 set calibration function.
 
float hallcurrent9_get_current (hallcurrent9_t *ctx, hallcurrent9_calibration_data_t *adc_val)
 Hall Current 9 get current function.
 

Detailed Description

API for configuring and manipulating Hall Current 9 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

◆ hallcurrent9_cfg_setup()

void hallcurrent9_cfg_setup ( hallcurrent9_cfg_t * cfg)

Hall Current 9 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ hallcurrent9_get_current()

float hallcurrent9_get_current ( hallcurrent9_t * ctx,
hallcurrent9_calibration_data_t * adc_val )

Hall Current 9 get current function.

This function reads 12-bit ADC data and calculate current ( mA ) by using I2C serial interface.

Parameters
[in]ctx: Click context object. See hallcurrent9_t object definition for detailed explanation.
[in]adc_val: Pointer to the memory location of the structure where data be stored.
Returns
Current (mA)

See #err_t definition for detailed explanation.

Note
Measurement delay of 100 milliseconds.

◆ hallcurrent9_init()

err_t hallcurrent9_init ( hallcurrent9_t * ctx,
hallcurrent9_cfg_t * cfg )

Hall Current 9 initialization function.

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

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

◆ hallcurrent9_read_adc()

err_t hallcurrent9_read_adc ( hallcurrent9_t * ctx,
uint16_t * read_adc )

Hall Current 9 I2C ADC reading function.

This function reads 12-bit ADC data by using I2C serial interface.

Parameters
[in]ctx: Click context object. See hallcurrent9_t object definition for detailed explanation.
[out]read_adc: Output ADC read data.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ hallcurrent9_set_calibration()

err_t hallcurrent9_set_calibration ( hallcurrent9_t * ctx,
hallcurrent9_calibration_data_t * adc_val )

Hall Current 9 set calibration function.

This function sets the calibration value into the calibration data structure by using I2C serial interface.

Parameters
[in]ctx: Click context object. See #adc11_t object definition for detailed explanation.
[out]adc_val: Pointer to the memory location of the structure where data be stored.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
The function samples ADC 20 times in short intervals of 1 millisecond, which makes the total delay in function approximately 20 millisecond.