magneticrotary3 2.0.0.0
Magnetic Rotary 3 Click Driver

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.
 

Detailed Description

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.

Function Documentation

◆ magneticrotary3_cfg_setup()

void magneticrotary3_cfg_setup ( magneticrotary3_cfg_t * cfg)

Magnetic Rotary 3 configuration object setup function.

This function initializes click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See magneticrotary3_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ magneticrotary3_get_angle()

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).

Parameters
[in]ctx: Click context object. See magneticrotary3_t object definition for detailed explanation.
[out]angle: Angle in degrees [0-360].
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ magneticrotary3_init()

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.

Parameters
[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.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ magneticrotary3_read_register()

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.

Parameters
[in]ctx: Click context object. See magneticrotary3_t object definition for detailed explanation.
[in]reg: Register address.
[out]data_out: Output read data.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ magneticrotary3_write_register()

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.

Parameters
[in]ctx: Click context object. See magneticrotary3_t object definition for detailed explanation.
[in]reg: Register address.
[in]data_in: Data to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.