hallcurrent825a 2.0.0.0
Hall Current 8 25A Click Driver

API for configuring and manipulating Hall Current 8 25A Click driver. More...

Topics

 Hall Current 8 25A MikroBUS Map
 MikroBUS pin mapping of Hall Current 8 25A Click driver.
 

Functions

void hallcurrent825a_cfg_setup (hallcurrent825a_cfg_t *cfg)
 Hall Current 8 25A configuration object setup function.
 
err_t hallcurrent825a_init (hallcurrent825a_t *ctx, hallcurrent825a_cfg_t *cfg)
 Hall Current 8 25A initialization function.
 
err_t hallcurrent825a_read_pin_value (hallcurrent825a_t *ctx, uint16_t *data_out)
 Hall Current 8 25A read AN pin value function.
 
err_t hallcurrent825a_read_pin_volt (hallcurrent825a_t *ctx, float *data_out)
 Hall Current 8 25A read AN pin voltage level function.
 
err_t hallcurrent825a_calibration (hallcurrent825a_t *ctx)
 Hall Current 8 25A calibration function.
 
err_t hallcurrent825a_get_voltage (hallcurrent825a_t *ctx, float *avr_voltage)
 Hall Current 8 25A read voltage level function.
 
err_t hallcurrent825a_get_current (hallcurrent825a_t *ctx, float *current)
 Hall Current 8 25A get current level function.
 
uint8_t hallcurrent825a_get_odc1 (hallcurrent825a_t *ctx)
 Hall Current 8 25A get state of OC1 function.
 
uint8_t hallcurrent825a_get_odc2 (hallcurrent825a_t *ctx)
 Hall Current 8 25A get state of OC2 function.
 

Detailed Description

API for configuring and manipulating Hall Current 8 25A 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

◆ hallcurrent825a_calibration()

err_t hallcurrent825a_calibration ( hallcurrent825a_t * ctx)

Hall Current 8 25A calibration function.

This function sets the calibration value into the offset data from context object of the TLI4971 high precision coreless current sensor on Hall Current 8 25A Click board.

Parameters
[in]ctx: Click context object. See hallcurrent825a_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
Function delay is approximately 500 ms.

◆ hallcurrent825a_cfg_setup()

void hallcurrent825a_cfg_setup ( hallcurrent825a_cfg_t * cfg)

Hall Current 8 25A configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ hallcurrent825a_get_current()

err_t hallcurrent825a_get_current ( hallcurrent825a_t * ctx,
float * current )

Hall Current 8 25A get current level function.

This function reads results of AD conversion of the AN pin and converts them to proportional current level.

Parameters
[in]ctx: Click context object. See hallcurrent825a_t object definition for detailed explanation.
[out]current: Average current level of the analog pin [A].
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
Function delay is approximately 500 ms.

◆ hallcurrent825a_get_odc1()

uint8_t hallcurrent825a_get_odc1 ( hallcurrent825a_t * ctx)

Hall Current 8 25A get state of OC1 function.

This function gets the state of the OC1 pin which detects overcurrent of the 201.6 [A] ( 120 [A] * 1.68 ) of the TLI4971 high precision coreless current sensor on the Hall Current 8 25A Click board.

Parameters
[out]ctx: Click context object. See #daq3_t object definition for detailed explanation.
Returns
  • 0x00 - Overcurrent detected,
  • 0x01 - OK.
Note
None.

◆ hallcurrent825a_get_odc2()

uint8_t hallcurrent825a_get_odc2 ( hallcurrent825a_t * ctx)

Hall Current 8 25A get state of OC2 function.

This function gets the state of the OC2 pin which detects overcurrent of the 98.4 [A] ( 120 [A] * 0.82 ) of the TLI4971 high precision coreless current sensor on the Hall Current 8 25A Click board.

Parameters
[out]ctx: Click context object. See #daq3_t object definition for detailed explanation.
Returns
  • 0x00 - Overcurrent detected,
  • 0x01 - OK.
Note
None.

◆ hallcurrent825a_get_voltage()

err_t hallcurrent825a_get_voltage ( hallcurrent825a_t * ctx,
float * avr_voltage )

Hall Current 8 25A read voltage level function.

This function reads results of AD conversion of the AN pin and converts them to proportional voltage level.

Parameters
[in]ctx: Click context object. See hallcurrent825a_t object definition for detailed explanation.
[out]avr_voltage: Average voltage level of the analog pin [V].
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
Function delay is approximately 500 ms.

◆ hallcurrent825a_init()

err_t hallcurrent825a_init ( hallcurrent825a_t * ctx,
hallcurrent825a_cfg_t * cfg )

Hall Current 8 25A initialization function.

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

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

◆ hallcurrent825a_read_pin_value()

err_t hallcurrent825a_read_pin_value ( hallcurrent825a_t * ctx,
uint16_t * data_out )

Hall Current 8 25A read AN pin value function.

This function reads results of AD conversion of the AN pin.

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

◆ hallcurrent825a_read_pin_volt()

err_t hallcurrent825a_read_pin_volt ( hallcurrent825a_t * ctx,
float * data_out )

Hall Current 8 25A read AN pin voltage level function.

This function reads results of AD conversion of the AN pin and converts them to proportional voltage level.

Parameters
[in]ctx: Click context object. See hallcurrent825a_t object definition for detailed explanation.
[out]data_out: Output voltage level of the analog pin [V].
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
The conversion to voltage depends on the entered configuration of the ADC (resolution, reference voltage).