gyro9 2.1.0.0
Gyro 9 Click Driver

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

Topics

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

Functions

void gyro9_cfg_setup (gyro9_cfg_t *cfg)
 Gyro 9 configuration object setup function.
 
void gyro9_drv_interface_selection (gyro9_cfg_t *cfg, gyro9_drv_t drv_sel)
 Gyro 9 driver interface setup function.
 
err_t gyro9_init (gyro9_t *ctx, gyro9_cfg_t *cfg)
 Gyro 9 initialization function.
 
err_t gyro9_default_cfg (gyro9_t *ctx)
 Gyro 9 default configuration function.
 
err_t gyro9_generic_write (gyro9_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 Gyro 9 data writing function.
 
err_t gyro9_generic_read (gyro9_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 Gyro 9 data reading function.
 
err_t gyro9_get_device_id (gyro9_t *ctx, uint8_t *who_am_i)
 Gyro 9 get device ID function.
 
err_t gyro9_set_output_data_rate (gyro9_t *ctx, uint8_t odr)
 Gyro 9 set output data rate function.
 
err_t gyro9_set_bandwidth_sel (gyro9_t *ctx, uint8_t bandwidth)
 Gyro 9 set bandwidth function.
 
err_t gyro9_set_mode_pd (gyro9_t *ctx)
 Gyro 9 set power-down mode function.
 
err_t gyro9_set_mode_sleep (gyro9_t *ctx)
 Gyro 9 set sleep mode function.
 
err_t gyro9_set_mode_normal (gyro9_t *ctx)
 Gyro 9 set normal mode function.
 
err_t gyro9_set_fifo_mode (gyro9_t *ctx, uint8_t fifo_mode)
 Gyro 9 set FIFO mode function.
 
err_t gyro9_enable_data_ready (gyro9_t *ctx)
 Gyro 9 enable data ready function.
 
err_t gyro9_get_status (gyro9_t *ctx, uint8_t *status)
 Gyro 9 get status function.
 
err_t gyro9_get_axis_data (gyro9_t *ctx, gyro9_axis_data_t *gyro_axis)
 Gyro 9 get gyro data function.
 
err_t gyro9_get_gyro_axis (gyro9_t *ctx, gyro9_axis_t *gyro_axis)
 Gyro 9 get gyro sensor axes function.
 
err_t gyro9_get_temperature_raw (gyro9_t *ctx, int8_t *temp_raw)
 Gyro 9 get temperature data function.
 
uint8_t gyro9_get_data_ready (gyro9_t *ctx)
 Gyro 9 get data ready function.
 
uint8_t gyro9_get_interrupt (gyro9_t *ctx)
 Gyro 9 get interrupt function.
 

Detailed Description

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

◆ gyro9_cfg_setup()

void gyro9_cfg_setup ( gyro9_cfg_t * cfg)

Gyro 9 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ gyro9_default_cfg()

err_t gyro9_default_cfg ( gyro9_t * ctx)

Gyro 9 default configuration function.

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

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

◆ gyro9_drv_interface_selection()

void gyro9_drv_interface_selection ( gyro9_cfg_t * cfg,
gyro9_drv_t drv_sel )

Gyro 9 driver interface setup function.

This function sets a serial driver interface which will be used further in the click driver.

Parameters
[out]cfg: Click configuration structure. See gyro9_cfg_t object definition for detailed explanation.
[in]drv_sel: Driver interface selection. See gyro9_drv_t object definition for detailed explanation.
Returns
Nothing.
Note
This driver selection should be call before init function to configure the driver to work with the serial interface which is consistent with the real state of the hardware. If this function is not called, the default driver interface will be set.

◆ gyro9_enable_data_ready()

err_t gyro9_enable_data_ready ( gyro9_t * ctx)

Gyro 9 enable data ready function.

This function enable data ready DR pin of the A3G4250D, MEMS motion sensor: 3-axis digital output gyroscope on the Gyro 9 click board™.

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

◆ gyro9_generic_read()

err_t gyro9_generic_read ( gyro9_t * ctx,
uint8_t reg,
uint8_t * data_out,
uint8_t len )

Gyro 9 data reading function.

This function reads a desired number of data bytes starting from the selected register.

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

◆ gyro9_generic_write()

err_t gyro9_generic_write ( gyro9_t * ctx,
uint8_t reg,
uint8_t * data_in,
uint8_t len )

Gyro 9 data writing function.

This function writes a desired number of data bytes starting from the selected register.

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

◆ gyro9_get_axis_data()

err_t gyro9_get_axis_data ( gyro9_t * ctx,
gyro9_axis_data_t * gyro_axis )

Gyro 9 get gyro data function.

This function reads the gyroscope raw data of the A3G4250D, MEMS motion sensor: 3-axis digital output gyroscope on the Gyro 9 click board™.

Parameters
[in]ctx: Click context object. See gyro9_t object definition for detailed explanation.
[out]gyro_axis: Gyroscope raw data object. See gyro9_axis_data_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ gyro9_get_data_ready()

uint8_t gyro9_get_data_ready ( gyro9_t * ctx)

Gyro 9 get data ready function.

This function gets states of the data ready (DR) pin of the A3G4250D, MEMS motion sensor: 3-axis digital output gyroscope on the Gyro 9 click board™.

Parameters
[in]ctx: Click context object. See gyro9_t object definition for detailed explanation.
Returns
  • 0 - Data is not ready,
  • 1 - Data is ready.
Note
None.

◆ gyro9_get_device_id()

err_t gyro9_get_device_id ( gyro9_t * ctx,
uint8_t * who_am_i )

Gyro 9 get device ID function.

This function reads a device identification value of the A3G4250D, MEMS motion sensor: 3-axis digital output gyroscope on the Gyro 9 click board™.

Parameters
[in]ctx: Click context object. See gyro9_t object definition for detailed explanation.
[out]who_am_i: Device identification data value.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ gyro9_get_gyro_axis()

err_t gyro9_get_gyro_axis ( gyro9_t * ctx,
gyro9_axis_t * gyro_axis )

Gyro 9 get gyro sensor axes function.

This function reads the gyroscope raw data and convert to the engineering units of the A3G4250D, MEMS motion sensor: 3-axis digital output gyroscope on the Gyro 9 click board™.

Parameters
[in]ctx: Click context object. See gyro9_t object definition for detailed explanation.
[out]gyro_axis: Angular rate output data object (dps). See gyro9_axis_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ gyro9_get_interrupt()

uint8_t gyro9_get_interrupt ( gyro9_t * ctx)

Gyro 9 get interrupt function.

This function gets states of the Interrupt (INT) pin of the A3G4250D, MEMS motion sensor: 3-axis digital output gyroscope on the Gyro 9 click board™.

Parameters
[in]ctx: Click context object. See gyro9_t object definition for detailed explanation.
Returns
  • 0 - Low pin state,
  • 1 - High pin state.
Note
None.

◆ gyro9_get_status()

err_t gyro9_get_status ( gyro9_t * ctx,
uint8_t * status )

Gyro 9 get status function.

This function reads status register of the A3G4250D, MEMS motion sensor: 3-axis digital output gyroscope on the Gyro 9 click board™.

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

◆ gyro9_get_temperature_raw()

err_t gyro9_get_temperature_raw ( gyro9_t * ctx,
int8_t * temp_raw )

Gyro 9 get temperature data function.

This function reads the temperature raw data of the A3G4250D, MEMS motion sensor: 3-axis digital output gyroscope on the Gyro 9 click board™.

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

◆ gyro9_init()

err_t gyro9_init ( gyro9_t * ctx,
gyro9_cfg_t * cfg )

Gyro 9 initialization function.

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

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

◆ gyro9_set_bandwidth_sel()

err_t gyro9_set_bandwidth_sel ( gyro9_t * ctx,
uint8_t bandwidth )

Gyro 9 set bandwidth function.

This function sets the desired bandwidth of the A3G4250D, MEMS motion sensor: 3-axis digital output gyroscope on the Gyro 9 click board™.

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

◆ gyro9_set_fifo_mode()

err_t gyro9_set_fifo_mode ( gyro9_t * ctx,
uint8_t fifo_mode )

Gyro 9 set FIFO mode function.

This function sets the desired FIFO mode of the A3G4250D, MEMS motion sensor: 3-axis digital output gyroscope on the Gyro 9 click board™.

Parameters
[in]ctx: Click context object. See gyro9_t object definition for detailed explanation.
[in]fifo_mode: FIFO mode configuration [0-2].
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ gyro9_set_mode_normal()

err_t gyro9_set_mode_normal ( gyro9_t * ctx)

Gyro 9 set normal mode function.

This function sets normal mode of the A3G4250D, MEMS motion sensor: 3-axis digital output gyroscope on the Gyro 9 click board™.

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

◆ gyro9_set_mode_pd()

err_t gyro9_set_mode_pd ( gyro9_t * ctx)

Gyro 9 set power-down mode function.

This function sets power-down mode of the A3G4250D, MEMS motion sensor: 3-axis digital output gyroscope on the Gyro 9 click board™.

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

◆ gyro9_set_mode_sleep()

err_t gyro9_set_mode_sleep ( gyro9_t * ctx)

Gyro 9 set sleep mode function.

This function sets sleep mode of the A3G4250D, MEMS motion sensor: 3-axis digital output gyroscope on the Gyro 9 click board™.

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

◆ gyro9_set_output_data_rate()

err_t gyro9_set_output_data_rate ( gyro9_t * ctx,
uint8_t odr )

Gyro 9 set output data rate function.

This function sets the desired output data rate of the A3G4250D, MEMS motion sensor: 3-axis digital output gyroscope on the Gyro 9 click board™.

Parameters
[in]ctx: Click context object. See gyro9_t object definition for detailed explanation.
[in]odr: Output data rate [0-3].
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.