angle8 2.0.0.0
Angle 8 Click Driver

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

Topics

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

Functions

void angle8_cfg_setup (angle8_cfg_t *cfg)
 Angle 8 configuration object setup function.
 
err_t angle8_init (angle8_t *ctx, angle8_cfg_t *cfg)
 Angle 8 initialization function.
 
err_t angle8_default_cfg (angle8_t *ctx)
 Angle 8 default configuration function.
 
err_t angle8_write_register (angle8_t *ctx, uint8_t reg, uint8_t data_in)
 Angle 8 write register function.
 
err_t angle8_read_register (angle8_t *ctx, uint8_t reg, uint8_t *data_out)
 Angle 8 read register function.
 
err_t angle8_read_angle (angle8_t *ctx, float *angle)
 Angle 8 read angle function.
 
err_t angle8_store_all_registers (angle8_t *ctx)
 Angle 8 store all registers function.
 
err_t angle8_store_single_register (angle8_t *ctx, uint8_t reg)
 Angle 8 store single register function.
 
err_t angle8_clear_error_flags (angle8_t *ctx)
 Angle 8 clear error flags function.
 
void angle8_enable_device (angle8_t *ctx)
 Angle 8 enable device function.
 
void angle8_disable_device (angle8_t *ctx)
 Angle 8 disable device function.
 
uint8_t angle8_get_nd_pin (angle8_t *ctx)
 Angle 8 get nd pin function.
 
uint8_t angle8_get_dv_pin (angle8_t *ctx)
 Angle 8 get dv pin function.
 
uint8_t angle8_get_mgl_pin (angle8_t *ctx)
 Angle 8 get mgl pin function.
 
err_t angle8_set_cycle_time (angle8_t *ctx, float time_ms)
 Angle 8 set cycle time function.
 

Detailed Description

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

◆ angle8_cfg_setup()

void angle8_cfg_setup ( angle8_cfg_t * cfg)

Angle 8 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ angle8_clear_error_flags()

err_t angle8_clear_error_flags ( angle8_t * ctx)

Angle 8 clear error flags function.

This function executes the clear error flags command.

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

◆ angle8_default_cfg()

err_t angle8_default_cfg ( angle8_t * ctx)

Angle 8 default configuration function.

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

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

◆ angle8_disable_device()

void angle8_disable_device ( angle8_t * ctx)

Angle 8 disable device function.

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

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

◆ angle8_enable_device()

void angle8_enable_device ( angle8_t * ctx)

Angle 8 enable device function.

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

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

◆ angle8_get_dv_pin()

uint8_t angle8_get_dv_pin ( angle8_t * ctx)

Angle 8 get dv pin function.

This function returns the data valid (DV) pin logic state.

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

◆ angle8_get_mgl_pin()

uint8_t angle8_get_mgl_pin ( angle8_t * ctx)

Angle 8 get mgl pin function.

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

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

◆ angle8_get_nd_pin()

uint8_t angle8_get_nd_pin ( angle8_t * ctx)

Angle 8 get nd pin function.

This function returns the new data ready (ND) pin logic state.

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

◆ angle8_init()

err_t angle8_init ( angle8_t * ctx,
angle8_cfg_t * cfg )

Angle 8 initialization function.

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

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

◆ angle8_read_angle()

err_t angle8_read_angle ( angle8_t * ctx,
float * angle )

Angle 8 read angle function.

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

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

◆ angle8_read_register()

err_t angle8_read_register ( angle8_t * ctx,
uint8_t reg,
uint8_t * data_out )

Angle 8 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 angle8_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.

◆ angle8_set_cycle_time()

err_t angle8_set_cycle_time ( angle8_t * ctx,
float time_ms )

Angle 8 set cycle time function.

This function sets the sensor cycle time (measurement rate) in milliseconds.

Parameters
[in]ctx: Click context object. See angle8_t object definition for detailed explanation.
[in]time_ms: Cycle time in milliseconds.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ angle8_store_all_registers()

err_t angle8_store_all_registers ( angle8_t * ctx)

Angle 8 store all registers function.

This function executes the store all registers to NVM command.

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

◆ angle8_store_single_register()

err_t angle8_store_single_register ( angle8_t * ctx,
uint8_t reg )

Angle 8 store single register function.

This function executes the store single register to NVM command.

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

◆ angle8_write_register()

err_t angle8_write_register ( angle8_t * ctx,
uint8_t reg,
uint8_t data_in )

Angle 8 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 angle8_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.