angle7 2.0.0.0
Angle 7 Click Driver

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

Topics

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

Functions

void angle7_cfg_setup (angle7_cfg_t *cfg)
 Angle 7 configuration object setup function.
 
err_t angle7_init (angle7_t *ctx, angle7_cfg_t *cfg)
 Angle 7 initialization function.
 
err_t angle7_default_cfg (angle7_t *ctx)
 Angle 7 default configuration function.
 
err_t angle7_generic_write (angle7_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 Angle 7 I2C writing function.
 
err_t angle7_generic_read (angle7_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 Angle 7 I2C reading function.
 
err_t angle7_write_two_bytes (angle7_t *ctx, uint8_t reg, uint16_t data_in)
 Angle 7 write two bytes function.
 
err_t angle7_read_two_bytes (angle7_t *ctx, uint8_t reg, uint16_t *data_out)
 Angle 7 read two bytes function.
 
err_t angle7_read_an_pin_value (angle7_t *ctx, uint16_t *data_out)
 Angle 7 read AN pin value function.
 
err_t angle7_read_an_pin_voltage (angle7_t *ctx, float *data_out)
 Angle 7 read AN pin voltage level function.
 
uint8_t angle7_get_int_pin (angle7_t *ctx)
 Angle 7 get int pin function.
 
void angle7_enable_device (angle7_t *ctx)
 Angle 7 enable device function.
 
void angle7_disable_device (angle7_t *ctx)
 Angle 7 disable device function.
 
err_t angle7_set_start_position (angle7_t *ctx, float angle)
 Angle 7 set start position function.
 
err_t angle7_get_start_position (angle7_t *ctx, float *angle)
 Angle 7 get start position function.
 
err_t angle7_set_stop_position (angle7_t *ctx, float angle)
 Angle 7 set stop position function.
 
err_t angle7_get_stop_position (angle7_t *ctx, float *angle)
 Angle 7 get stop position function.
 
err_t angle7_get_raw_angle (angle7_t *ctx, float *angle)
 Angle 7 get raw angle function.
 
err_t angle7_get_angle (angle7_t *ctx, float *angle)
 Angle 7 get angle function.
 
err_t angle7_get_status (angle7_t *ctx, uint8_t *status)
 Angle 7 get status function.
 
err_t angle7_get_agc (angle7_t *ctx, uint8_t *agc)
 Angle 7 get agc function.
 
err_t angle7_get_magnitude (angle7_t *ctx, uint16_t *magnitude)
 Angle 7 get magnitude function.
 

Detailed Description

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

◆ angle7_cfg_setup()

void angle7_cfg_setup ( angle7_cfg_t * cfg)

Angle 7 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ angle7_default_cfg()

err_t angle7_default_cfg ( angle7_t * ctx)

Angle 7 default configuration function.

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

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

◆ angle7_disable_device()

void angle7_disable_device ( angle7_t * ctx)

Angle 7 disable device function.

This function disables the device by setting the EN pin to LOW logic state.

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

◆ angle7_enable_device()

void angle7_enable_device ( angle7_t * ctx)

Angle 7 enable device function.

This function enables the device by setting the EN pin to HIGH logic state.

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

◆ angle7_generic_read()

err_t angle7_generic_read ( angle7_t * ctx,
uint8_t reg,
uint8_t * data_out,
uint8_t len )

Angle 7 I2C reading function.

This function reads a desired number of data bytes starting from the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See angle7_t object definition for detailed explanation.
[in]reg: Start register address.
[out]data_out: Output read data.
[in]len: Number of bytes to be read.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ angle7_generic_write()

err_t angle7_generic_write ( angle7_t * ctx,
uint8_t reg,
uint8_t * data_in,
uint8_t len )

Angle 7 I2C writing function.

This function writes a desired number of data bytes starting from the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See angle7_t object definition for detailed explanation.
[in]reg: Start register address.
[in]data_in: Data to be written.
[in]len: Number of bytes to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ angle7_get_agc()

err_t angle7_get_agc ( angle7_t * ctx,
uint8_t * agc )

Angle 7 get agc function.

This function reads the AGC (automatic gain control) data.

Parameters
[in]ctx: Click context object. See angle7_t object definition for detailed explanation.
[out]agc: AGC register data.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ angle7_get_angle()

err_t angle7_get_angle ( angle7_t * ctx,
float * angle )

Angle 7 get angle function.

This function reads the calculated angle in degrees.

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

◆ angle7_get_int_pin()

uint8_t angle7_get_int_pin ( angle7_t * ctx)

Angle 7 get int pin function.

This function returns the INT pin logic state.

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

◆ angle7_get_magnitude()

err_t angle7_get_magnitude ( angle7_t * ctx,
uint16_t * magnitude )

Angle 7 get magnitude function.

This function reads the magnitude data.

Parameters
[in]ctx: Click context object. See angle7_t object definition for detailed explanation.
[out]magnitude: Magnitude register data.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ angle7_get_raw_angle()

err_t angle7_get_raw_angle ( angle7_t * ctx,
float * angle )

Angle 7 get raw angle function.

This function reads the RAW angle in degrees.

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

◆ angle7_get_start_position()

err_t angle7_get_start_position ( angle7_t * ctx,
float * angle )

Angle 7 get start position function.

This function reads the start position in angle degrees used for angle calculation.

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

◆ angle7_get_status()

err_t angle7_get_status ( angle7_t * ctx,
uint8_t * status )

Angle 7 get status function.

This function reads the status data.

Parameters
[in]ctx: Click context object. See angle7_t object definition for detailed explanation.
[out]status: Status register data.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ angle7_get_stop_position()

err_t angle7_get_stop_position ( angle7_t * ctx,
float * angle )

Angle 7 get stop position function.

This function reads the stop position in angle degrees used for angle calculation.

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

◆ angle7_init()

err_t angle7_init ( angle7_t * ctx,
angle7_cfg_t * cfg )

Angle 7 initialization function.

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

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

◆ angle7_read_an_pin_value()

err_t angle7_read_an_pin_value ( angle7_t * ctx,
uint16_t * data_out )

Angle 7 read AN pin value function.

This function reads results of AD conversion of the AN pin.

Parameters
[in]ctx: Click context object. See angle7_t object definition for detailed explanation.
[out]data_out: Output ADC result.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ angle7_read_an_pin_voltage()

err_t angle7_read_an_pin_voltage ( angle7_t * ctx,
float * data_out )

Angle 7 read AN pin voltage level function.

This function reads results of AD conversion of the AN pin and converts them to proportional voltage level.

Parameters
[in]ctx: Click context object. See angle7_t object definition for detailed explanation.
[out]data_out: Output voltage level of the analog pin [V].
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
The conversion to voltage depends on the entered configuration of the ADC (resolution, reference voltage).

◆ angle7_read_two_bytes()

err_t angle7_read_two_bytes ( angle7_t * ctx,
uint8_t reg,
uint16_t * data_out )

Angle 7 read two bytes function.

This function reads two bytes of data from two consecutive registers starting from the selected address by using I2C serial interface.

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

◆ angle7_set_start_position()

err_t angle7_set_start_position ( angle7_t * ctx,
float angle )

Angle 7 set start position function.

This function sets the start position in angle degrees used for angle calculation.

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

◆ angle7_set_stop_position()

err_t angle7_set_stop_position ( angle7_t * ctx,
float angle )

Angle 7 set stop position function.

This function sets the stop position in angle degrees used for angle calculation.

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

◆ angle7_write_two_bytes()

err_t angle7_write_two_bytes ( angle7_t * ctx,
uint8_t reg,
uint16_t data_in )

Angle 7 write two bytes function.

This function writes two bytes of data to two consecutive registers starting from the selected address by using I2C serial interface.

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