magneticrotary3 2.0.0.0
|
API for configuring and manipulating Magnetic Rotary 3 Click driver. More...
Topics | |
Magnetic Rotary 3 Registers List | |
List of registers of Magnetic Rotary 3 Click driver. | |
Magnetic Rotary 3 Registers Settings | |
Settings for registers of Magnetic Rotary 3 Click driver. | |
Magnetic Rotary 3 MikroBUS Map | |
MikroBUS pin mapping of Magnetic Rotary 3 Click driver. | |
Functions | |
void | magneticrotary3_cfg_setup (magneticrotary3_cfg_t *cfg) |
Magnetic Rotary 3 configuration object setup function. | |
err_t | magneticrotary3_init (magneticrotary3_t *ctx, magneticrotary3_cfg_t *cfg) |
Magnetic Rotary 3 initialization function. | |
err_t | magneticrotary3_write_register (magneticrotary3_t *ctx, uint16_t reg, uint16_t data_in) |
Magnetic Rotary 3 write register function. | |
err_t | magneticrotary3_read_register (magneticrotary3_t *ctx, uint16_t reg, uint16_t *data_out) |
Magnetic Rotary 3 read register function. | |
err_t | magneticrotary3_get_angle (magneticrotary3_t *ctx, float *angle) |
Magnetic Rotary 3 get angle function. | |
API for configuring and manipulating Magnetic Rotary 3 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void magneticrotary3_cfg_setup | ( | magneticrotary3_cfg_t * | cfg | ) |
Magnetic Rotary 3 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See magneticrotary3_cfg_t object definition for detailed explanation. |
err_t magneticrotary3_get_angle | ( | magneticrotary3_t * | ctx, |
float * | angle ) |
Magnetic Rotary 3 get angle function.
This function reads the absolute position raw data and converts it to degrees (Angle).
[in] | ctx | : Click context object. See magneticrotary3_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 magneticrotary3_init | ( | magneticrotary3_t * | ctx, |
magneticrotary3_cfg_t * | cfg ) |
Magnetic Rotary 3 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See magneticrotary3_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See magneticrotary3_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t magneticrotary3_read_register | ( | magneticrotary3_t * | ctx, |
uint16_t | reg, | ||
uint16_t * | data_out ) |
Magnetic Rotary 3 read register function.
This function reads data from the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See magneticrotary3_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 magneticrotary3_write_register | ( | magneticrotary3_t * | ctx, |
uint16_t | reg, | ||
uint16_t | data_in ) |
Magnetic Rotary 3 write register function.
This function writes a desired data to the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See magneticrotary3_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.