hallswitch2 2.0.0.0
Hall Switch 2 Click Driver

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

Topics

 Hall Switch 2 setting.
 Specified settings for Hall Switch 2 Click driver.
 
 Hall Switch 2 MikroBUS Map
 MikroBUS pin mapping of Hall Switch 2 Click driver.
 

Functions

void hallswitch2_cfg_setup (hallswitch2_cfg_t *cfg)
 Hall Switch 2 configuration object setup function.
 
err_t hallswitch2_init (hallswitch2_t *ctx, hallswitch2_cfg_t *cfg)
 Hall Switch 2 initialization function.
 
uint8_t hallswitch2_check_state (hallswitch2_t *ctx)
 Hall Switch 2 check state function.
 

Detailed Description

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

◆ hallswitch2_cfg_setup()

void hallswitch2_cfg_setup ( hallswitch2_cfg_t * cfg)

Hall Switch 2 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ hallswitch2_check_state()

uint8_t hallswitch2_check_state ( hallswitch2_t * ctx)

Hall Switch 2 check state function.

This function checks the S and N pin states, which indicates a magnetic field poles.

Parameters
[in]ctx: Click context object. See hallswitch2_t object definition for detailed explanation.
Returns
  • 0 - No magnet detected,
  • 1 - South pole detected,
  • 2 - North pole detected.
Note
None.

◆ hallswitch2_init()

err_t hallswitch2_init ( hallswitch2_t * ctx,
hallswitch2_cfg_t * cfg )

Hall Switch 2 initialization function.

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

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