c6dofimu25 2.1.0.0
Loading...
Searching...
No Matches
6DOF IMU 25 Click Driver

API for configuring and manipulating 6DOF IMU 25 Click driver. More...

Topics

 6DOF IMU 25 Registers List
 List of registers of 6DOF IMU 25 Click driver.
 
 6DOF IMU 25 Registers Settings
 Settings for registers of 6DOF IMU 25 Click driver.
 
 6DOF IMU 25 MikroBUS Map
 MikroBUS pin mapping of 6DOF IMU 25 Click driver.
 

Functions

void c6dofimu25_cfg_setup (c6dofimu25_cfg_t *cfg)
 6DOF IMU 25 configuration object setup function.
 
void c6dofimu25_drv_interface_sel (c6dofimu25_cfg_t *cfg, c6dofimu25_drv_t drv_sel)
 6DOF IMU 25 driver interface setup function.
 
err_t c6dofimu25_init (c6dofimu25_t *ctx, c6dofimu25_cfg_t *cfg)
 6DOF IMU 25 initialization function.
 
err_t c6dofimu25_default_cfg (c6dofimu25_t *ctx)
 6DOF IMU 25 default configuration function.
 
err_t c6dofimu25_write_reg (c6dofimu25_t *ctx, uint8_t reg, uint8_t data_in)
 6DOF IMU 25 write reg function.
 
err_t c6dofimu25_write_regs (c6dofimu25_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 6DOF IMU 25 write regs function.
 
err_t c6dofimu25_read_reg (c6dofimu25_t *ctx, uint8_t reg, uint8_t *data_out)
 6DOF IMU 25 read reg function.
 
err_t c6dofimu25_read_regs (c6dofimu25_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 6DOF IMU 25 read regs function.
 
uint8_t c6dofimu25_get_int1_pin (c6dofimu25_t *ctx)
 6DOF IMU 25 get int1 pin function.
 
uint8_t c6dofimu25_get_int2_pin (c6dofimu25_t *ctx)
 6DOF IMU 25 get int2 pin function.
 
err_t c6dofimu25_check_communication (c6dofimu25_t *ctx)
 6DOF IMU 25 check communication function.
 
err_t c6dofimu25_set_mem_bank (c6dofimu25_t *ctx, uint8_t mem_bank)
 6DOF IMU 25 set mem bank function.
 
err_t c6dofimu25_sw_reset (c6dofimu25_t *ctx)
 6DOF IMU 25 sw reset function.
 
err_t c6dofimu25_set_accel_odr (c6dofimu25_t *ctx, uint8_t odr)
 6DOF IMU 25 set accel odr function.
 
err_t c6dofimu25_set_gyro_odr (c6dofimu25_t *ctx, uint8_t odr)
 6DOF IMU 25 set gyro odr function.
 
err_t c6dofimu25_set_accel_fsr (c6dofimu25_t *ctx, uint8_t fsr)
 6DOF IMU 25 set accel fsr function.
 
err_t c6dofimu25_set_gyro_fsr (c6dofimu25_t *ctx, uint8_t fsr)
 6DOF IMU 25 set gyro fsr function.
 
err_t c6dofimu25_get_accel_drdy (c6dofimu25_t *ctx, uint8_t *drdy)
 6DOF IMU 25 get accel drdy function.
 
err_t c6dofimu25_get_gyro_drdy (c6dofimu25_t *ctx, uint8_t *drdy)
 6DOF IMU 25 get gyro drdy function.
 
err_t c6dofimu25_get_temp_drdy (c6dofimu25_t *ctx, uint8_t *drdy)
 6DOF IMU 25 get temp drdy function.
 
err_t c6dofimu25_get_accel (c6dofimu25_t *ctx, c6dofimu25_axes_t *accel)
 6DOF IMU 25 get accel function.
 
err_t c6dofimu25_get_gyro (c6dofimu25_t *ctx, c6dofimu25_axes_t *gyro)
 6DOF IMU 25 get gyro function.
 
err_t c6dofimu25_get_temp (c6dofimu25_t *ctx, float *temp)
 6DOF IMU 25 get temp function.
 
err_t c6dofimu25_get_data (c6dofimu25_t *ctx, c6dofimu25_data_t *data_out)
 6DOF IMU 25 get data function.
 

Detailed Description

API for configuring and manipulating 6DOF IMU 25 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

◆ c6dofimu25_cfg_setup()

void c6dofimu25_cfg_setup ( c6dofimu25_cfg_t * cfg)

6DOF IMU 25 configuration object setup function.

This function initializes Click configuration structure to initial values.

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

◆ c6dofimu25_check_communication()

err_t c6dofimu25_check_communication ( c6dofimu25_t * ctx)

6DOF IMU 25 check communication function.

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

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

◆ c6dofimu25_default_cfg()

err_t c6dofimu25_default_cfg ( c6dofimu25_t * ctx)

6DOF IMU 25 default configuration function.

This function executes a default configuration of 6DOF IMU 25 Click board.

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

◆ c6dofimu25_drv_interface_sel()

void c6dofimu25_drv_interface_sel ( c6dofimu25_cfg_t * cfg,
c6dofimu25_drv_t drv_sel )

6DOF IMU 25 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 c6dofimu25_cfg_t object definition for detailed explanation.
[in]drv_sel: Driver interface selection. See c6dofimu25_drv_t object definition for detailed explanation.
Returns
Nothing.
Note
This driver selection should be called 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.

◆ c6dofimu25_get_accel()

err_t c6dofimu25_get_accel ( c6dofimu25_t * ctx,
c6dofimu25_axes_t * accel )

6DOF IMU 25 get accel function.

This function reads the accelerometer of X, Y, and Z axis relative to standard gravity (g).

Parameters
[in]ctx: Click context object. See c6dofimu25_t object definition for detailed explanation.
[out]accel: Output accelerometer data. See c6dofimu25_axes_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ c6dofimu25_get_accel_drdy()

err_t c6dofimu25_get_accel_drdy ( c6dofimu25_t * ctx,
uint8_t * drdy )

6DOF IMU 25 get accel drdy function.

This function gets the accel new data available flag.

Parameters
[in]ctx: Click context object. See c6dofimu25_t object definition for detailed explanation.
[out]drdy:
  • 0 - no new data available,
  • 1 - new data available.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ c6dofimu25_get_data()

err_t c6dofimu25_get_data ( c6dofimu25_t * ctx,
c6dofimu25_data_t * data_out )

6DOF IMU 25 get data function.

This function reads the accelerometer, gyroscope, and temperature measurement data.

Parameters
[in]ctx: Click context object. See c6dofimu25_t object definition for detailed explanation.
[out]data_out: Output data structure read. See c6dofimu25_data_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ c6dofimu25_get_gyro()

err_t c6dofimu25_get_gyro ( c6dofimu25_t * ctx,
c6dofimu25_axes_t * gyro )

6DOF IMU 25 get gyro function.

This function reads the angular rate of X, Y, and Z axis in degrees per second (dps).

Parameters
[in]ctx: Click context object. See c6dofimu25_t object definition for detailed explanation.
[out]gyro: Output gyro data. See c6dofimu25_axes_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ c6dofimu25_get_gyro_drdy()

err_t c6dofimu25_get_gyro_drdy ( c6dofimu25_t * ctx,
uint8_t * drdy )

6DOF IMU 25 get gyro drdy function.

This function gets the gyro new data available flag.

Parameters
[in]ctx: Click context object. See c6dofimu25_t object definition for detailed explanation.
[out]drdy:
  • 0 - no new data available,
  • 1 - new data available.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ c6dofimu25_get_int1_pin()

uint8_t c6dofimu25_get_int1_pin ( c6dofimu25_t * ctx)

6DOF IMU 25 get int1 pin function.

This function returns the interrupt 1 pin logic state.

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

◆ c6dofimu25_get_int2_pin()

uint8_t c6dofimu25_get_int2_pin ( c6dofimu25_t * ctx)

6DOF IMU 25 get int2 pin function.

This function returns the interrupt 2 pin logic state.

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

◆ c6dofimu25_get_temp()

err_t c6dofimu25_get_temp ( c6dofimu25_t * ctx,
float * temp )

6DOF IMU 25 get temp function.

This function reads the temperature measurement in degrees Celsius.

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

◆ c6dofimu25_get_temp_drdy()

err_t c6dofimu25_get_temp_drdy ( c6dofimu25_t * ctx,
uint8_t * drdy )

6DOF IMU 25 get temp drdy function.

This function gets the temperature new data available flag.

Parameters
[in]ctx: Click context object. See c6dofimu25_t object definition for detailed explanation.
[out]drdy:
  • 0 - no new data available,
  • 1 - new data available.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ c6dofimu25_init()

err_t c6dofimu25_init ( c6dofimu25_t * ctx,
c6dofimu25_cfg_t * cfg )

6DOF IMU 25 initialization function.

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

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

◆ c6dofimu25_read_reg()

err_t c6dofimu25_read_reg ( c6dofimu25_t * ctx,
uint8_t reg,
uint8_t * data_out )

6DOF IMU 25 read reg function.

This function reads a data byte from the selected register.

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

◆ c6dofimu25_read_regs()

err_t c6dofimu25_read_regs ( c6dofimu25_t * ctx,
uint8_t reg,
uint8_t * data_out,
uint8_t len )

6DOF IMU 25 read regs function.

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

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

◆ c6dofimu25_set_accel_fsr()

err_t c6dofimu25_set_accel_fsr ( c6dofimu25_t * ctx,
uint8_t fsr )

6DOF IMU 25 set accel fsr function.

This function sets the accel measurement full scale range.

Parameters
[in]ctx: Click context object. See c6dofimu25_t object definition for detailed explanation.
[in]fsr:
  • 0 - 2G,
  • 1 - 4G,
  • 2 - 8G,
  • 3 - 16G.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ c6dofimu25_set_accel_odr()

err_t c6dofimu25_set_accel_odr ( c6dofimu25_t * ctx,
uint8_t odr )

6DOF IMU 25 set accel odr function.

This function sets the accel measurement output data rate.

Parameters
[in]ctx: Click context object. See c6dofimu25_t object definition for detailed explanation.
[in]odr:
  • 0 - OFF,
  • 1 - 1.875Hz,
  • 2 - 7.5Hz,
  • 3 - 15Hz,
  • 4 - 30Hz,
  • 5 - 60Hz,
  • 6 - 120Hz,
  • 7 - 240Hz,
  • 8 - 480Hz,
  • 9 - 960Hz,
  • 10 - 1920Hz,
  • 11 - 3840Hz,
  • 12 - 7680Hz.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ c6dofimu25_set_gyro_fsr()

err_t c6dofimu25_set_gyro_fsr ( c6dofimu25_t * ctx,
uint8_t fsr )

6DOF IMU 25 set gyro fsr function.

This function sets the gyro measurement full scale range.

Parameters
[in]ctx: Click context object. See c6dofimu25_t object definition for detailed explanation.
[in]fsr:
  • 0 - 125DPS,
  • 1 - 250DPS,
  • 2 - 500DPS,
  • 3 - 1000DPS,
  • 4 - 2000DPS,
  • 5 - 4000DPS.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ c6dofimu25_set_gyro_odr()

err_t c6dofimu25_set_gyro_odr ( c6dofimu25_t * ctx,
uint8_t odr )

6DOF IMU 25 set gyro odr function.

This function sets the gyro measurement output data rate.

Parameters
[in]ctx: Click context object. See c6dofimu25_t object definition for detailed explanation.
[in]odr:
  • 0 - OFF,
  • 2 - 7.5Hz,
  • 3 - 15Hz,
  • 4 - 30Hz,
  • 5 - 60Hz,
  • 6 - 120Hz,
  • 7 - 240Hz,
  • 8 - 480Hz,
  • 9 - 960Hz,
  • 10 - 1920Hz,
  • 11 - 3840Hz,
  • 12 - 7680Hz.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ c6dofimu25_set_mem_bank()

err_t c6dofimu25_set_mem_bank ( c6dofimu25_t * ctx,
uint8_t mem_bank )

6DOF IMU 25 set mem bank function.

This function sets the memory bank to user memory or embedded functions configuration registers.

Parameters
[in]ctx: Click context object. See c6dofimu25_t object definition for detailed explanation.
[in]mem_bank:
  • 0 - User memory,
  • 1 - Embedded functions.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ c6dofimu25_sw_reset()

err_t c6dofimu25_sw_reset ( c6dofimu25_t * ctx)

6DOF IMU 25 sw reset function.

This function restores the default values in user memory registers.

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

◆ c6dofimu25_write_reg()

err_t c6dofimu25_write_reg ( c6dofimu25_t * ctx,
uint8_t reg,
uint8_t data_in )

6DOF IMU 25 write reg function.

This function writes a data byte to the selected register.

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

◆ c6dofimu25_write_regs()

err_t c6dofimu25_write_regs ( c6dofimu25_t * ctx,
uint8_t reg,
uint8_t * data_in,
uint8_t len )

6DOF IMU 25 write regs function.

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

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