hallswitch2 2.0.0.0
|
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. | |
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.
void hallswitch2_cfg_setup | ( | hallswitch2_cfg_t * | cfg | ) |
Hall Switch 2 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See hallswitch2_cfg_t object definition for detailed explanation. |
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.
[in] | ctx | : Click context object. See hallswitch2_t object definition for detailed explanation. |
0
- No magnet detected, 1
- South pole detected, 2
- North pole detected. 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.
[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. |
0
- Success, -1
- Error.