gyro7 2.0.0.0
Gyro 7 Click Driver

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

Topics

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

Functions

void gyro7_cfg_setup (gyro7_cfg_t *cfg)
 Gyro 7 configuration object setup function.
 
err_t gyro7_init (gyro7_t *ctx, gyro7_cfg_t *cfg)
 Gyro 7 initialization function.
 
err_t gyro7_default_cfg (gyro7_t *ctx)
 Gyro 7 default configuration function.
 
err_t gyro7_generic_write (gyro7_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 Gyro 7 data writing function.
 
err_t gyro7_generic_read (gyro7_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 Gyro 7 data reading function.
 
err_t gyro7_write_register (gyro7_t *ctx, uint8_t reg, uint8_t data_in)
 Gyro 7 write register function.
 
err_t gyro7_read_register (gyro7_t *ctx, uint8_t reg, uint8_t *data_out)
 Gyro 7 read register function.
 
err_t gyro7_check_communication (gyro7_t *ctx)
 Gyro 7 check communication function.
 
uint8_t gyro7_get_int_pin (gyro7_t *ctx)
 Gyro 7 get int pin function.
 
err_t gyro7_set_dlpf_config (gyro7_t *ctx, uint8_t freq)
 Gyro 7 set DLPF config function.
 
err_t gyro7_read_gyroscope (gyro7_t *ctx, float *x_axis, float *y_axis)
 Gyro 7 read gyroscope function.
 
err_t gyro7_read_temperature (gyro7_t *ctx, float *temperature)
 Gyro 7 read temperature function.
 

Detailed Description

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

◆ gyro7_cfg_setup()

void gyro7_cfg_setup ( gyro7_cfg_t * cfg)

Gyro 7 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ gyro7_check_communication()

err_t gyro7_check_communication ( gyro7_t * ctx)

Gyro 7 check communication function.

This function checks the communication by reading and verifying the WHO AM I register.

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

◆ gyro7_default_cfg()

err_t gyro7_default_cfg ( gyro7_t * ctx)

Gyro 7 default configuration function.

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

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

◆ gyro7_generic_read()

err_t gyro7_generic_read ( gyro7_t * ctx,
uint8_t reg,
uint8_t * data_out,
uint8_t len )

Gyro 7 data reading function.

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

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

◆ gyro7_generic_write()

err_t gyro7_generic_write ( gyro7_t * ctx,
uint8_t reg,
uint8_t * data_in,
uint8_t len )

Gyro 7 data writing function.

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

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

◆ gyro7_get_int_pin()

uint8_t gyro7_get_int_pin ( gyro7_t * ctx)

Gyro 7 get int pin function.

This function returns the INT pin logic state.

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

◆ gyro7_init()

err_t gyro7_init ( gyro7_t * ctx,
gyro7_cfg_t * cfg )

Gyro 7 initialization function.

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

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

◆ gyro7_read_gyroscope()

err_t gyro7_read_gyroscope ( gyro7_t * ctx,
float * x_axis,
float * y_axis )

Gyro 7 read gyroscope function.

This function reads the gyroscope X and Y axis in degrees per second (dps).

Parameters
[in]ctx: Click context object. See gyro7_t object definition for detailed explanation.
[out]x_axis: X axis value in dps.
[out]y_axis: Y axis value in dps.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ gyro7_read_register()

err_t gyro7_read_register ( gyro7_t * ctx,
uint8_t reg,
uint8_t * data_out )

Gyro 7 read register function.

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

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

◆ gyro7_read_temperature()

err_t gyro7_read_temperature ( gyro7_t * ctx,
float * temperature )

Gyro 7 read temperature function.

This function reads the internal temperature in Celsius.

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

◆ gyro7_set_dlpf_config()

err_t gyro7_set_dlpf_config ( gyro7_t * ctx,
uint8_t freq )

Gyro 7 set DLPF config function.

This function sets the DLPF register for the selected corner frequency.

Parameters
[in]ctx: Click context object. See gyro7_t object definition for detailed explanation.
[in]freq:
  • 0 - 40/160 Hz,
  • 1 - 80/320 Hz,
  • 2 - 160/640 Hz,
  • 3 - 250 Hz,
  • 4 - 500 Hz.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ gyro7_write_register()

err_t gyro7_write_register ( gyro7_t * ctx,
uint8_t reg,
uint8_t data_in )

Gyro 7 write register function.

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

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