magneticrotary6 2.0.0.0
|
API for configuring and manipulating Magnetic Rotary 6 Click driver. More...
Topics | |
Magnetic Rotary 6 Registers List | |
List of registers of Magnetic Rotary 6 Click driver. | |
Magnetic Rotary 6 Registers Settings | |
Settings for registers of Magnetic Rotary 6 Click driver. | |
Magnetic Rotary 6 MikroBUS Map | |
MikroBUS pin mapping of Magnetic Rotary 6 Click driver. | |
Functions | |
void | magneticrotary6_cfg_setup (magneticrotary6_cfg_t *cfg) |
Magnetic Rotary 6 configuration object setup function. | |
err_t | magneticrotary6_init (magneticrotary6_t *ctx, magneticrotary6_cfg_t *cfg) |
Magnetic Rotary 6 initialization function. | |
err_t | magneticrotary6_default_cfg (magneticrotary6_t *ctx) |
Magnetic Rotary 6 default configuration function. | |
err_t | magneticrotary6_write_register (magneticrotary6_t *ctx, uint8_t die_sel, uint16_t reg, uint16_t data_in) |
Magnetic Rotary 6 write register function. | |
err_t | magneticrotary6_read_register (magneticrotary6_t *ctx, uint8_t die_sel, uint16_t reg, uint16_t *data_out) |
Magnetic Rotary 6 read register b function. | |
err_t | magneticrotary6_get_angle (magneticrotary6_t *ctx, uint8_t die_sel, float *angle) |
Magnetic Rotary 6 get angle function. | |
err_t | magneticrotary6_set_direction (magneticrotary6_t *ctx, uint8_t die_sel, uint8_t dir) |
Magnetic Rotary 6 set direction function. | |
API for configuring and manipulating Magnetic Rotary 6 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void magneticrotary6_cfg_setup | ( | magneticrotary6_cfg_t * | cfg | ) |
Magnetic Rotary 6 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See magneticrotary6_cfg_t object definition for detailed explanation. |
err_t magneticrotary6_default_cfg | ( | magneticrotary6_t * | ctx | ) |
Magnetic Rotary 6 default configuration function.
This function executes a default configuration of Magnetic Rotary 6 click board.
[in] | ctx | : Click context object. See magneticrotary6_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t magneticrotary6_get_angle | ( | magneticrotary6_t * | ctx, |
uint8_t | die_sel, | ||
float * | angle ) |
Magnetic Rotary 6 get angle function.
This function reads the absolute position raw data of a desired sensor die and converts it to degrees (Angle).
[in] | ctx | : Click context object. See magneticrotary6_t object definition for detailed explanation. |
[in] | die_sel | : Sensor die selection: 0 - Bottom die, 1 - Top die. |
[out] | angle | : Angle in degrees [0-360]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t magneticrotary6_init | ( | magneticrotary6_t * | ctx, |
magneticrotary6_cfg_t * | cfg ) |
Magnetic Rotary 6 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See magneticrotary6_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See magneticrotary6_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t magneticrotary6_read_register | ( | magneticrotary6_t * | ctx, |
uint8_t | die_sel, | ||
uint16_t | reg, | ||
uint16_t * | data_out ) |
Magnetic Rotary 6 read register b function.
This function reads data from the selected register of a desired sensor die by using SPI serial interface.
[in] | ctx | : Click context object. See magneticrotary6_t object definition for detailed explanation. |
[in] | die_sel | : Sensor die selection: 0 - Bottom die, 1 - Top die. |
[in] | reg | : Register address. |
[out] | data_out | : Output read data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t magneticrotary6_set_direction | ( | magneticrotary6_t * | ctx, |
uint8_t | die_sel, | ||
uint8_t | dir ) |
Magnetic Rotary 6 set direction function.
This function sets the rotation direction of a desired sensor die.
[in] | ctx | : Click context object. See magneticrotary6_t object definition for detailed explanation. |
[in] | die_sel | : Sensor die selection: 0 - Bottom die, 1 - Top die. |
[in] | dir | : Rotation direction: 0 - Clockwise, 1 - Counter-Clockwise. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t magneticrotary6_write_register | ( | magneticrotary6_t * | ctx, |
uint8_t | die_sel, | ||
uint16_t | reg, | ||
uint16_t | data_in ) |
Magnetic Rotary 6 write register function.
This function writes a desired data to the selected register of a desired sensor die by using SPI serial interface.
[in] | ctx | : Click context object. See magneticrotary6_t object definition for detailed explanation. |
[in] | die_sel | : Sensor die selection: 0 - Bottom die, 1 - Top die. |
[in] | reg | : Register address. |
[in] | data_in | : Data to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.