hallswitch3 2.1.0.0
|
API for configuring and manipulating Hall Switch 3 Click driver. More...
Topics | |
Hall Switch 3 Registers List | |
List of registers of Hall Switch 3 Click driver. | |
Hall Switch 3 Registers Settings | |
Settings for registers of Hall Switch 3 Click driver. | |
Hall Switch 3 MikroBUS Map | |
MikroBUS pin mapping of Hall Switch 3 Click driver. | |
Functions | |
void | hallswitch3_cfg_setup (hallswitch3_cfg_t *cfg) |
Hall Switch 3 configuration object setup function. | |
err_t | hallswitch3_init (hallswitch3_t *ctx, hallswitch3_cfg_t *cfg) |
Hall Switch 3 initialization function. | |
err_t | hallswitch3_default_cfg (hallswitch3_t *ctx) |
Hall Switch 3 default configuration function. | |
err_t | hallswitch3_reg_write (hallswitch3_t *ctx, uint8_t reg, uint8_t data_in) |
Hall Switch 3 I2C writing function. | |
err_t | hallswitch3_reg_read (hallswitch3_t *ctx, uint8_t reg, uint8_t *data_out) |
Hall Switch 3 I2C reading function. | |
err_t | hallswitch3_get_status (hallswitch3_t *ctx, uint8_t *status) |
Hall Switch 3 get status function. | |
err_t | hallswitch3_reset (hallswitch3_t *ctx) |
Hall Switch 3 software reset function. | |
err_t | hallswitch3_set_one_shot (hallswitch3_t *ctx) |
Hall Switch 3 sets one-shot function. | |
err_t | hallswitch3_autonomous_mode (hallswitch3_t *ctx) |
Hall Switch 3 autonomous mode function. | |
err_t | hallswitch3_set_vpol (hallswitch3_t *ctx, uint8_t v_pol) |
Hall Switch 3 set VPOL function. | |
err_t | hallswitch3_get_mag_data (hallswitch3_t *ctx, int8_t *mag_data) |
Hall Switch 3 get mag data function. | |
err_t | hallswitch3_set_threshold (hallswitch3_t *ctx, uint8_t assert_thold, uint8_t clear_thold) |
Hall Switch 3 sets assert and clear threshold function. | |
err_t | hallswitch3_set_out_data_rate (hallswitch3_t *ctx, uint8_t odr) |
Hall Switch 3 sets output data rates function. | |
err_t | hallswitch3_get_device_id (hallswitch3_t *ctx, uint8_t *device_id) |
Hall Switch 3 get device ID function. | |
uint8_t | hallswitch3_check_mag_field (hallswitch3_t *ctx) |
Hall Switch 3 check magnetic field function. | |
API for configuring and manipulating Hall Switch 3 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
err_t hallswitch3_autonomous_mode | ( | hallswitch3_t * | ctx | ) |
Hall Switch 3 autonomous mode function.
This function starts the autonomous mode active to trigger a single sequence of compare of the NMH1000, Magnetic switch on the Hall Switch 3 Click board.
[in] | ctx | : Click context object. See hallswitch3_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void hallswitch3_cfg_setup | ( | hallswitch3_cfg_t * | cfg | ) |
Hall Switch 3 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See hallswitch3_cfg_t object definition for detailed explanation. |
uint8_t hallswitch3_check_mag_field | ( | hallswitch3_t * | ctx | ) |
Hall Switch 3 check magnetic field function.
This function is used to indicate absence of magnetic field of the NMH1000, Magnetic switch on the Hall Switch 3 Click board.
[in] | ctx | : Click context object. See hallswitch3_t object definition for detailed explanation. |
0
- Low state, 1
- High state. err_t hallswitch3_default_cfg | ( | hallswitch3_t * | ctx | ) |
Hall Switch 3 default configuration function.
This function executes a default configuration of Hall Switch 3 click board.
[in] | ctx | : Click context object. See hallswitch3_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t hallswitch3_get_device_id | ( | hallswitch3_t * | ctx, |
uint8_t * | device_id ) |
Hall Switch 3 get device ID function.
This function reads the device identification data of the NMH1000, Magnetic switch on the Hall Switch 3 Click board.
[in] | ctx | : Click context object. See hallswitch3_t object definition for detailed explanation. |
[out] | device_id | : Device identification. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t hallswitch3_get_mag_data | ( | hallswitch3_t * | ctx, |
int8_t * | mag_data ) |
Hall Switch 3 get mag data function.
This function is used to indicates a relative magnetic field strength of the NMH1000, Magnetic switch on the Hall Switch 3 Click board.
[in] | ctx | : Click context object. See hallswitch3_t object definition for detailed explanation. |
[out] | mag_data | : Relative magnetic field strength data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t hallswitch3_get_status | ( | hallswitch3_t * | ctx, |
uint8_t * | status ) |
Hall Switch 3 get status function.
This function reads a status reporting of modes and selections of the NMH1000, Magnetic switch on the Hall Switch 3 Click board.
[in] | ctx | : Click context object. See hallswitch3_t object definition for detailed explanation. |
[out] | status | : Status reporting data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t hallswitch3_init | ( | hallswitch3_t * | ctx, |
hallswitch3_cfg_t * | cfg ) |
Hall Switch 3 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See hallswitch3_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See hallswitch3_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t hallswitch3_reg_read | ( | hallswitch3_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out ) |
Hall Switch 3 I2C reading function.
This function reads a data byte from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See hallswitch3_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[out] | data_out | : Output read data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t hallswitch3_reg_write | ( | hallswitch3_t * | ctx, |
uint8_t | reg, | ||
uint8_t | data_in ) |
Hall Switch 3 I2C writing function.
This function writes a data byte to the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See hallswitch3_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[in] | data_in | : Data to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t hallswitch3_reset | ( | hallswitch3_t * | ctx | ) |
Hall Switch 3 software reset function.
This function performs the internal device reset is forced of the NMH1000, Magnetic switch on the Hall Switch 3 Click board.
[in] | ctx | : Click context object. See hallswitch3_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t hallswitch3_set_one_shot | ( | hallswitch3_t * | ctx | ) |
Hall Switch 3 sets one-shot function.
This function provides control of the state machine to trigger a single sequence of compare of the NMH1000, Magnetic switch on the Hall Switch 3 Click board.
[in] | ctx | : Click context object. See hallswitch3_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t hallswitch3_set_out_data_rate | ( | hallswitch3_t * | ctx, |
uint8_t | odr ) |
Hall Switch 3 sets output data rates function.
This function provides the capability for the user to override the fixed sample rate controlling the sleep-compare-Vout cycle time of the NMH1000, Magnetic switch on the Hall Switch 3 Click board.
[in] | ctx | : Click context object. See hallswitch3_t object definition for detailed explanation. |
[in] | odr | : Output data rates [0x00-0x06]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t hallswitch3_set_threshold | ( | hallswitch3_t * | ctx, |
uint8_t | assert_thold, | ||
uint8_t | clear_thold ) |
Hall Switch 3 sets assert and clear threshold function.
This function is used to sets the range of the magnetic field to assert/clear the output of the NMH1000, Magnetic switch on the Hall Switch 3 Click board.
[in] | ctx | : Click context object. See hallswitch3_t object definition for detailed explanation. |
[in] | assert_thold | : Assert threshold data [0x00-0x1F]. |
[in] | clear_thold | : Clear threshold data [0x00-0x1F]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t hallswitch3_set_vpol | ( | hallswitch3_t * | ctx, |
uint8_t | v_pol ) |
Hall Switch 3 set VPOL function.
This function provides control of the user-defined OUT pin and resultant bit assert or clear polarity of the NMH1000, Magnetic switch on the Hall Switch 3 Click board.
[in] | ctx | : Click context object. See hallswitch3_t object definition for detailed explanation. |
[in] | v_pol | : VPOL assert or clear polarity. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.