magneticrotary4 2.0.0.0
|
API for configuring and manipulating Magnetic Rotary 4 Click driver. More...
Topics | |
Magnetic Rotary 4 Registers List | |
List of registers of Magnetic Rotary 4 Click driver. | |
Magnetic Rotary 4 Registers Settings | |
Settings for registers of Magnetic Rotary 4 Click driver. | |
Magnetic Rotary 4 MikroBUS Map | |
MikroBUS pin mapping of Magnetic Rotary 4 Click driver. | |
Functions | |
void | magneticrotary4_cfg_setup (magneticrotary4_cfg_t *cfg) |
Magnetic Rotary 4 configuration object setup function. | |
err_t | magneticrotary4_init (magneticrotary4_t *ctx, magneticrotary4_cfg_t *cfg) |
Magnetic Rotary 4 initialization function. | |
err_t | magneticrotary4_write_register (magneticrotary4_t *ctx, uint16_t reg, uint16_t data_in) |
Magnetic Rotary 4 write register function. | |
err_t | magneticrotary4_read_register (magneticrotary4_t *ctx, uint16_t reg, uint16_t *data_out) |
Magnetic Rotary 4 read register function. | |
err_t | magneticrotary4_get_angle (magneticrotary4_t *ctx, float *angle) |
Magnetic Rotary 4 get angle function. | |
err_t | magneticrotary4_calibrate_zero_position (magneticrotary4_t *ctx) |
Magnetic Rotary 4 calibrate zero position function. | |
err_t | magneticrotary4_set_rotation_direction (magneticrotary4_t *ctx, uint8_t direction) |
Magnetic Rotary 4 set rotation direction function. | |
API for configuring and manipulating Magnetic Rotary 4 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 magneticrotary4_calibrate_zero_position | ( | magneticrotary4_t * | ctx | ) |
Magnetic Rotary 4 calibrate zero position function.
This function calibrates the sensor to zero Angle position.
[in] | ctx | : Click context object. See magneticrotary4_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void magneticrotary4_cfg_setup | ( | magneticrotary4_cfg_t * | cfg | ) |
Magnetic Rotary 4 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See magneticrotary4_cfg_t object definition for detailed explanation. |
err_t magneticrotary4_get_angle | ( | magneticrotary4_t * | ctx, |
float * | angle ) |
Magnetic Rotary 4 get angle function.
This function reads the absolute position raw data and converts it to degrees (Angle).
[in] | ctx | : Click context object. See magneticrotary4_t object definition for detailed explanation. |
[out] | angle | : Angle in degrees [0-360]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t magneticrotary4_init | ( | magneticrotary4_t * | ctx, |
magneticrotary4_cfg_t * | cfg ) |
Magnetic Rotary 4 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See magneticrotary4_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See magneticrotary4_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t magneticrotary4_read_register | ( | magneticrotary4_t * | ctx, |
uint16_t | reg, | ||
uint16_t * | data_out ) |
Magnetic Rotary 4 read register function.
This function reads data from the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See magneticrotary4_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[out] | data_out | : Output read data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t magneticrotary4_set_rotation_direction | ( | magneticrotary4_t * | ctx, |
uint8_t | direction ) |
Magnetic Rotary 4 set rotation direction function.
This function sets the magnet rotation direction to clockwise or counter-clockwise.
[in] | ctx | : Click context object. See magneticrotary4_t object definition for detailed explanation. |
[in] | direction | :
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t magneticrotary4_write_register | ( | magneticrotary4_t * | ctx, |
uint16_t | reg, | ||
uint16_t | data_in ) |
Magnetic Rotary 4 write register function.
This function writes a desired data to the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See magneticrotary4_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[in] | data_in | : Data to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.