gyro4 2.0.0.0
gyro4.h File Reference

This file contains API for Gyro 4 Click driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_spi_master.h"

Go to the source code of this file.

Data Structures

struct  gyro4_t
 Click ctx object definition. More...
 
struct  gyro4_cfg_t
 Click configuration structure definition. More...
 

Macros

#define GYRO4_MAP_MIKROBUS(cfg, mikrobus)
 
#define GYRO4_RETVAL   uint8_t
 
#define GYRO4_OK   0x00
 
#define GYRO4_INIT_ERROR   0xFF
 
#define GYRO4_REG_WHO_AM_I   0x00
 
#define GYRO4_REG_TEMP_OUT_L   0x01
 
#define GYRO4_REG_TEMP_OUT_H   0x02
 
#define GYRO4_REG_OUT_X_L   0x03
 
#define GYRO4_REG_OUT_X_H   0x04
 
#define GYRO4_REG_OUT_Y_L   0x05
 
#define GYRO4_REG_OUT_Y_H   0x06
 
#define GYRO4_REG_DATA_STATUS_OIS   0x0A
 
#define GYRO4_REG_CTRL1_OIS   0x0B
 
#define GYRO4_REG_CTRL2_OIS   0x0C
 
#define GYRO4_REG_CTRL3_OIS   0x0D
 
#define GYRO4_REG_CTRL4_OIS   0x0E
 
#define GYRO4_REG_OFF_X   0x0F
 
#define GYRO4_REG_OFF_Y   0x10
 
#define GYRO4_REG_OIS_CFG   0x1F
 
#define GYRO4_POWER_DOWN_MODE   0x01
 
#define GYRO4_SLEEP_MODE   0x02
 
#define GYRO4_NORMAL_MODE   0x03
 
#define GYRO4_100_DPS   0x01
 
#define GYRO4_200_DPS   0x02
 

Functions

void gyro4_cfg_setup (gyro4_cfg_t *cfg)
 Config Object Initialization function.
 
GYRO4_RETVAL gyro4_init (gyro4_t *ctx, gyro4_cfg_t *cfg)
 Initialization function.
 
void gyro4_generic_transfer (gyro4_t *ctx, uint8_t *wr_buf, uint16_t wr_len, uint8_t *rd_buf, uint16_t rd_len)
 Generic transfer function.
 
uint8_t gyro4_int_get (gyro4_t *ctx)
 Getting INT pin state.
 
void gyro4_cs_set (gyro4_t *ctx, uint8_t pin_state)
 Setting CS pin state.
 
uint8_t gyro4_spi_get (gyro4_t *ctx, uint8_t register_address, uint8_t *register_buffer, uint16_t n_registers)
 Getting register content.
 
uint8_t gyro4_spi_set (gyro4_t *ctx, uint8_t register_address, uint8_t data_in)
 Setting register content.
 
uint8_t gyro4_initialize (gyro4_t *ctx)
 Device initialization.
 
uint8_t gyro4_get_temperature (gyro4_t *ctx, float *temperature)
 Getting die temperature value.
 
uint8_t gyro4_get_axes (gyro4_t *ctx, float *x_axis, float *y_axis)
 Getting axes values.
 
uint8_t gyro4_software_reset (gyro4_t *ctx)
 Performing software reset.
 
uint8_t gyro4_set_power_mode (gyro4_t *ctx, uint8_t power_mode)
 Setting power mode.
 
uint8_t gyro4_set_full_scale_range (gyro4_t *ctx, uint8_t full_scale_range)
 Settinf full scale range.
 

Detailed Description

This file contains API for Gyro 4 Click driver.