linhall2 2.1.0.0
LIN Hall 2 Click Driver

API for configuring and manipulating LIN Hall 2 Click driver. More...

Topics

 LIN Hall 2 Registers Settings
 Settings for registers of LIN Hall 2 Click driver.
 
 LIN Hall 2 MikroBUS Map
 MikroBUS pin mapping of LIN Hall 2 Click driver.
 

Functions

void linhall2_cfg_setup (linhall2_cfg_t *cfg)
 LIN Hall 2 configuration object setup function.
 
err_t linhall2_init (linhall2_t *ctx, linhall2_cfg_t *cfg)
 LIN Hall 2 initialization function.
 
err_t linhall2_read_an_pin_value (linhall2_t *ctx, uint16_t *data_out)
 LIN Hall 2 read AN pin value function.
 
err_t linhall2_read_an_pin_voltage (linhall2_t *ctx, float *data_out)
 LIN Hall 2 read AN pin voltage level function.
 
void linhal2_set_en_pin (linhall2_t *ctx, uint8_t pin_state)
 LIN Hall 2 set EN pin state function.
 
err_t linhal2_get_flux_density (linhall2_t *ctx, float *data_out)
 LIN Hall 2 read flux density function.
 

Detailed Description

API for configuring and manipulating LIN Hall 2 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

◆ linhal2_get_flux_density()

err_t linhal2_get_flux_density ( linhall2_t * ctx,
float * data_out )

LIN Hall 2 read flux density function.

This function reads magnetic flux density in mT.

Parameters
[in]ctx: Click context object. See linhall2_t object definition for detailed explanation.
[out]data_out: Magnetic flux density in mT.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ linhal2_set_en_pin()

void linhal2_set_en_pin ( linhall2_t * ctx,
uint8_t pin_state )

LIN Hall 2 set EN pin state function.

This function is used to set EN pin state of the LIN Hall 2 click board.

Parameters
[in]ctx: Click context object. See linhall2_t object definition for detailed explanation.
[in]pin_state: State of the EN pin state.
Returns
Nothing.
Note
None.

◆ linhall2_cfg_setup()

void linhall2_cfg_setup ( linhall2_cfg_t * cfg)

LIN Hall 2 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ linhall2_init()

err_t linhall2_init ( linhall2_t * ctx,
linhall2_cfg_t * cfg )

LIN Hall 2 initialization function.

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

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

◆ linhall2_read_an_pin_value()

err_t linhall2_read_an_pin_value ( linhall2_t * ctx,
uint16_t * data_out )

LIN Hall 2 read AN pin value function.

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

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

◆ linhall2_read_an_pin_voltage()

err_t linhall2_read_an_pin_voltage ( linhall2_t * ctx,
float * data_out )

LIN Hall 2 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 linhall2_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).