gyro8 2.1.0.0
Gyro 8 Click Driver

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

Topics

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

Functions

void gyro8_cfg_setup (gyro8_cfg_t *cfg)
 Gyro 8 configuration object setup function.
 
err_t gyro8_init (gyro8_t *ctx, gyro8_cfg_t *cfg)
 Gyro 8 initialization function.
 
err_t gyro8_default_cfg (gyro8_t *ctx)
 Gyro 8 default configuration function.
 
err_t gyro8_write_register (gyro8_t *ctx, uint8_t reg, uint16_t data_in)
 Gyro 8 write register function.
 
err_t gyro8_read_register (gyro8_t *ctx, uint8_t reg, uint16_t *data_out)
 Gyro 8 read register function.
 
void gyro8_set_rst_pin (gyro8_t *ctx, uint8_t state)
 Gyro 8 set rst pin function.
 
void gyro8_reset_device (gyro8_t *ctx)
 Gyro 8 reset device function.
 
err_t gyro8_check_communication (gyro8_t *ctx)
 Gyro 8 check communication function.
 
err_t gyro8_read_serial_id (gyro8_t *ctx, uint32_t *serial_id)
 Gyro 8 read serial id function.
 
err_t gyro8_read_temperature (gyro8_t *ctx, float *temperature)
 Gyro 8 read temperature function.
 
err_t gyro8_read_angular_rate (gyro8_t *ctx, float *rate)
 Gyro 8 read angular rate function.
 

Detailed Description

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

◆ gyro8_cfg_setup()

void gyro8_cfg_setup ( gyro8_cfg_t * cfg)

Gyro 8 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ gyro8_check_communication()

err_t gyro8_check_communication ( gyro8_t * ctx)

Gyro 8 check communication function.

This function checks the communication by reading and verifying the product ID.

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

◆ gyro8_default_cfg()

err_t gyro8_default_cfg ( gyro8_t * ctx)

Gyro 8 default configuration function.

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

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

◆ gyro8_init()

err_t gyro8_init ( gyro8_t * ctx,
gyro8_cfg_t * cfg )

Gyro 8 initialization function.

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

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

◆ gyro8_read_angular_rate()

err_t gyro8_read_angular_rate ( gyro8_t * ctx,
float * rate )

Gyro 8 read angular rate function.

This function reads the angular rate of X-axis in dps.

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

◆ gyro8_read_register()

err_t gyro8_read_register ( gyro8_t * ctx,
uint8_t reg,
uint16_t * data_out )

Gyro 8 read register function.

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

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

◆ gyro8_read_serial_id()

err_t gyro8_read_serial_id ( gyro8_t * ctx,
uint32_t * serial_id )

Gyro 8 read serial id function.

This function reads the serial ID which is laser marked on the sensor lid.

Parameters
[in]ctx: Click context object. See gyro8_t object definition for detailed explanation.
[out]serial_id: Serial ID laser marked on the sensor lid.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ gyro8_read_temperature()

err_t gyro8_read_temperature ( gyro8_t * ctx,
float * temperature )

Gyro 8 read temperature function.

This function reads the temperature measurement in Celsius.

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

◆ gyro8_reset_device()

void gyro8_reset_device ( gyro8_t * ctx)

Gyro 8 reset device function.

This function resets the device by toggling the RST pin.

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

◆ gyro8_set_rst_pin()

void gyro8_set_rst_pin ( gyro8_t * ctx,
uint8_t state )

Gyro 8 set rst pin function.

This function sets the RST pin logic state.

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

◆ gyro8_write_register()

err_t gyro8_write_register ( gyro8_t * ctx,
uint8_t reg,
uint16_t data_in )

Gyro 8 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 gyro8_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.