amrangle 2.0.0.0
AMR Angle Click Driver

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

Topics

 AMR Angle toolchain select
 List of working boards for AMR Angle gain control.
 
 AMR Angle gain control mode list
 List of possible modes of AMR Angle gain control.
 
 AMR Angle power down state mode list
 List of possible modes for AMR Angle power down.
 
 AMR Angle MikroBUS Map
 MikroBUS pin mapping of AMR Angle Click driver.
 

Functions

void amrangle_cfg_setup (amrangle_cfg_t *cfg, uint8_t sel_toolchain)
 AMR Angle configuration object setup function.
 
err_t amrangle_init (amrangle_t *ctx, amrangle_cfg_t *cfg)
 AMR Angle initialization function.
 
void amrangle_default_cfg (amrangle_t *ctx)
 AMR Angle default configuration function.
 
float amrangle_angle_read (amrangle_t *ctx)
 AMR Angle read angle function.
 
err_t amrangle_read_vtp_voltage (amrangle_t *ctx, float *vtp_volts)
 AMR Angle read vtp voltage function.
 
float amrangle_read_vtp_temp (amrangle_t *ctx)
 AMR Angle read temperature function.
 
void amrangle_gain_control_mode (amrangle_t *ctx, uint8_t gain_control)
 AMR Angle gain control mode function.
 
void amrangle_power_down_pin (amrangle_t *ctx, uint8_t pd_state)
 AMR Angle power down function.
 

Detailed Description

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

◆ amrangle_angle_read()

float amrangle_angle_read ( amrangle_t * ctx)

AMR Angle read angle function.

This function reads an angle in degrees.

Parameters
[in]ctx: Click context object. See amrangle_t object definition for detailed explanation.
Returns
Angle in degrees.
Note
None.

◆ amrangle_cfg_setup()

void amrangle_cfg_setup ( amrangle_cfg_t * cfg,
uint8_t sel_toolchain )

AMR Angle configuration object setup function.

This function initializes click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See amrangle_cfg_t object definition for detailed explanation.
[in]sel_toolchain: Selected toolchain.
  • 0x00 ( AMRANGLE_ARM_TOOLCHAIN ) - Insert for ARM board,
  • 0x01 ( AMRANGLE_PIC_TOOLCHAIN ) - Insert for PIC board.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ amrangle_default_cfg()

void amrangle_default_cfg ( amrangle_t * ctx)

AMR Angle default configuration function.

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

Parameters
[in]ctx: Click context object. See amrangle_t object definition for detailed explanation.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ amrangle_gain_control_mode()

void amrangle_gain_control_mode ( amrangle_t * ctx,
uint8_t gain_control )

AMR Angle gain control mode function.

This function sets the gain control mode pin which is used to compensate the sensor amplitude output for reduction of temperature variation.

Parameters
[in]ctx: Click context object. See amrangle_t object definition for detailed explanation.
[in]state: Gain control state.

See #err_t definition for detailed explanation.

Note
None.

◆ amrangle_init()

err_t amrangle_init ( amrangle_t * ctx,
amrangle_cfg_t * cfg )

AMR Angle initialization function.

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

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

◆ amrangle_power_down_pin()

void amrangle_power_down_pin ( amrangle_t * ctx,
uint8_t pd_state )

AMR Angle power down function.

This function controls the power down pin which can be used to shut down the device.

Parameters
[in]ctx: Click context object. See amrangle_t object definition for detailed explanation.
[in]state: Power down state.

See #err_t definition for detailed explanation.

Note
None.

◆ amrangle_read_vtp_temp()

float amrangle_read_vtp_temp ( amrangle_t * ctx)

AMR Angle read temperature function.

This function returns calculated temperature using vtp pin voltage. The calculation is performed by extracting constants from linear function using VTEMP Output Voltage vs Temperature graph ( ADA4571 datasheet - Figure 21. ).

Parameters
[in]ctx: Click context object. See amrangle_t object definition for detailed explanation.
Returns
Temperature in degrees celsius.

See #err_t definition for detailed explanation.

Note
None.

◆ amrangle_read_vtp_voltage()

err_t amrangle_read_vtp_voltage ( amrangle_t * ctx,
float * vtp_volts )

AMR Angle read vtp voltage function.

This function reads analog voltage from vtp pin.

Parameters
[in]ctx: Click context object. See amrangle_t object definition for detailed explanation.
[out]vtp_volts: Analog pin voltage.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.