magneticrotary6 2.0.0.0
Magnetic Rotary 6 Click Driver

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.
 

Detailed Description

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.

Function Documentation

◆ magneticrotary6_cfg_setup()

void magneticrotary6_cfg_setup ( magneticrotary6_cfg_t * cfg)

Magnetic Rotary 6 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ magneticrotary6_default_cfg()

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.

Parameters
[in]ctx: Click context object. See magneticrotary6_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ magneticrotary6_get_angle()

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

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

◆ magneticrotary6_init()

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.

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

◆ magneticrotary6_read_register()

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.

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

◆ magneticrotary6_set_direction()

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.

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

◆ magneticrotary6_write_register()

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.

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