angle6 2.0.0.0
Angle 6 Click Driver

API for configuring and manipulating Angle 6 Click driver. More...

Topics

 Angle 6 Registers List
 List of registers of Angle 6 Click driver.
 
 Angle 6 Registers Settings
 Settings for registers of Angle 6 Click driver.
 
 Angle 6 MikroBUS Map
 MikroBUS pin mapping of Angle 6 Click driver.
 

Functions

void angle6_cfg_setup (angle6_cfg_t *cfg)
 Angle 6 configuration object setup function.
 
err_t angle6_init (angle6_t *ctx, angle6_cfg_t *cfg)
 Angle 6 initialization function.
 
err_t angle6_default_cfg (angle6_t *ctx)
 Angle 6 default configuration function.
 
err_t angle6_write_register (angle6_t *ctx, uint8_t reg, uint8_t data_in)
 Angle 6 write register function.
 
err_t angle6_read_register (angle6_t *ctx, uint8_t reg, uint8_t *data_out)
 Angle 6 read register function.
 
err_t angle6_read_angle (angle6_t *ctx, float *angle)
 Angle 6 read angle function.
 
uint8_t angle6_get_pwm_pin (angle6_t *ctx)
 Angle 6 get pwm pin function.
 
uint8_t angle6_get_mgh_pin (angle6_t *ctx)
 Angle 6 get mgh pin function.
 
uint8_t angle6_get_mgl_pin (angle6_t *ctx)
 Angle 6 get mgl pin function.
 

Detailed Description

API for configuring and manipulating Angle 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

◆ angle6_cfg_setup()

void angle6_cfg_setup ( angle6_cfg_t * cfg)

Angle 6 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ angle6_default_cfg()

err_t angle6_default_cfg ( angle6_t * ctx)

Angle 6 default configuration function.

This function executes a default configuration of Angle 6 click board.

Parameters
[in]ctx: Click context object. See angle6_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.

◆ angle6_get_mgh_pin()

uint8_t angle6_get_mgh_pin ( angle6_t * ctx)

Angle 6 get mgh pin function.

This function returns the MGH alarm flag (MGH) pin logic state.

Parameters
[in]ctx: Click context object. See angle6_t object definition for detailed explanation.
Returns
Pin logic state.
Note
None.

◆ angle6_get_mgl_pin()

uint8_t angle6_get_mgl_pin ( angle6_t * ctx)

Angle 6 get mgl pin function.

This function returns the MGL alarm flag (MGL) pin logic state.

Parameters
[in]ctx: Click context object. See angle6_t object definition for detailed explanation.
Returns
Pin logic state.
Note
None.

◆ angle6_get_pwm_pin()

uint8_t angle6_get_pwm_pin ( angle6_t * ctx)

Angle 6 get pwm pin function.

This function returns the PWM absolute output pin logic state.

Parameters
[in]ctx: Click context object. See angle6_t object definition for detailed explanation.
Returns
Pin logic state.
Note
None.

◆ angle6_init()

err_t angle6_init ( angle6_t * ctx,
angle6_cfg_t * cfg )

Angle 6 initialization function.

This function initializes all necessary pins and peripherals used for this click board.

Parameters
[out]ctx: Click context object. See angle6_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See angle6_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ angle6_read_angle()

err_t angle6_read_angle ( angle6_t * ctx,
float * angle )

Angle 6 read angle function.

This function reads raw angle data and converts it to degrees.

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

◆ angle6_read_register()

err_t angle6_read_register ( angle6_t * ctx,
uint8_t reg,
uint8_t * data_out )

Angle 6 read register function.

This function reads a data byte from the selected register by using SPI serial interface.

Parameters
[in]ctx: Click context object. See angle6_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.

◆ angle6_write_register()

err_t angle6_write_register ( angle6_t * ctx,
uint8_t reg,
uint8_t data_in )

Angle 6 write register function.

This function writes a data byte to the selected register by using SPI serial interface.

Parameters
[in]ctx: Click context object. See angle6_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.