hallcurrent16 2.1.0.0
Hall Current 16 Click Driver

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

Topics

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

Functions

void hallcurrent16_cfg_setup (hallcurrent16_cfg_t *cfg)
 Hall Current 16 configuration object setup function.
 
err_t hallcurrent16_init (hallcurrent16_t *ctx, hallcurrent16_cfg_t *cfg)
 Hall Current 16 initialization function.
 
err_t hallcurrent16_default_cfg (hallcurrent16_t *ctx)
 Hall Current 16 default configuration function.
 
void hallcurrent16_set_vref (hallcurrent16_t *ctx, float vref)
 Hall Current 16 set vref function.
 
void hallcurrent16_set_sens (hallcurrent16_t *ctx)
 Hall Current 16 set sens function.
 
err_t hallcurrent16_get_voltage (hallcurrent16_t *ctx, float *voltage)
 Hall Current 16 get voltage function.
 
err_t hallcurrent16_get_vout (hallcurrent16_t *ctx, float *adc_vout)
 Hall Current 16 get vout function.
 
err_t hallcurrent16_get_vref (hallcurrent16_t *ctx, float *adc_vref)
 Hall Current 16 get vout function.
 
err_t hallcurrent16_get_current (hallcurrent16_t *ctx, float *current)
 Hall Current 16 get current function.
 
uint8_t hallcurrent16_get_ovc_fault (hallcurrent16_t *ctx)
 Hall Current 16 get overcurrent fault function.
 

Detailed Description

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

◆ hallcurrent16_cfg_setup()

void hallcurrent16_cfg_setup ( hallcurrent16_cfg_t * cfg)

Hall Current 16 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ hallcurrent16_default_cfg()

err_t hallcurrent16_default_cfg ( hallcurrent16_t * ctx)

Hall Current 16 default configuration function.

This function executes a default configuration of Hall Current 16 click board.

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

◆ hallcurrent16_get_current()

err_t hallcurrent16_get_current ( hallcurrent16_t * ctx,
float * current )

Hall Current 16 get current function.

This function reads and calculate input current value of the ACS37002, 400 kHz, High Accuracy Current Sensor with Pin-Selectable Gains on the Hall Current 16 Click board™.

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

◆ hallcurrent16_get_ovc_fault()

uint8_t hallcurrent16_get_ovc_fault ( hallcurrent16_t * ctx)

Hall Current 16 get overcurrent fault function.

This function get states of the OCF ( Overcurrent Fault ) pin of the ACS37002, 400 kHz, High Accuracy Current Sensor with Pin-Selectable Gains on the Hall Current 16 Click board™.

Parameters
[in]ctx: Click context object. See hallcurrent16_t object definition for detailed explanation.
Returns
  • 0 - Overcurrent Fault state,
  • 1 - OK state.
Note
None.

◆ hallcurrent16_get_voltage()

err_t hallcurrent16_get_voltage ( hallcurrent16_t * ctx,
float * voltage )

Hall Current 16 get voltage function.

This function reads raw ADC value and converts it to proportional voltage level of the ADC122S101, 2 Channel, 500 ksps to 1 Msps 12-Bit A/D Converter on the Hall Current 16 Click board™.

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

◆ hallcurrent16_get_vout()

err_t hallcurrent16_get_vout ( hallcurrent16_t * ctx,
float * adc_vout )

Hall Current 16 get vout function.

This function reads output voltage of the ACS37002, 400 kHz, High Accuracy Current Sensor with Pin-Selectable Gains on the Hall Current 16 Click board™.

Parameters
[in]ctx: Click context object. See hallcurrent16_t object definition for detailed explanation.
[out]adc_vout: ADC output voltage [V].
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ hallcurrent16_get_vref()

err_t hallcurrent16_get_vref ( hallcurrent16_t * ctx,
float * adc_vref )

Hall Current 16 get vout function.

This function reads output voltage of the ACS37002, 400 kHz, High Accuracy Current Sensor with Pin-Selectable Gains on the Hall Current 16 Click board™.

Parameters
[in]ctx: Click context object. See hallcurrent16_t object definition for detailed explanation.
[out]adc_vref: ADC reference voltage [V].
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ hallcurrent16_init()

err_t hallcurrent16_init ( hallcurrent16_t * ctx,
hallcurrent16_cfg_t * cfg )

Hall Current 16 initialization function.

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

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

◆ hallcurrent16_set_sens()

void hallcurrent16_set_sens ( hallcurrent16_t * ctx)

Hall Current 16 set sens function.

This function sets the sensitivity values for the calculation depending on the selected gain of the ACS37002, 400 kHz, High Accuracy Current Sensor with Pin-Selectable Gains on the Hall Current 16 Click board™.

Parameters
[in]ctx: Click context object. See hallcurrent16_t object definition for detailed explanation.
[in]vref: Reference voltage [V].
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ hallcurrent16_set_vref()

void hallcurrent16_set_vref ( hallcurrent16_t * ctx,
float vref )

Hall Current 16 set vref function.

This function sets the voltage reference of the ADC122S101, 2 Channel, 500 ksps to 1 Msps 12-Bit A/D Converter on the Hall Current 16 Click board™.

Parameters
[in]ctx: Click context object. See hallcurrent16_t object definition for detailed explanation.
[in]vref: Reference voltage [V].
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.