c6dofimu20 2.1.0.0
6 DOF IMU 20 Click Driver

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

Topics

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

Functions

void c6dofimu20_cfg_setup (c6dofimu20_cfg_t *cfg)
 6 DOF IMU 20 configuration object setup function.
 
void c6dofimu20_drv_interface_selection (c6dofimu20_cfg_t *cfg, c6dofimu20_drv_t drv_sel)
 6 DOF IMU 20 driver interface setup function.
 
err_t c6dofimu20_init (c6dofimu20_t *ctx, c6dofimu20_cfg_t *cfg)
 6 DOF IMU 20 initialization function.
 
err_t c6dofimu20_default_cfg (c6dofimu20_t *ctx)
 6 DOF IMU 20 default configuration function.
 
err_t c6dofimu20_generic_write (c6dofimu20_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 6 DOF IMU 20 data writing function.
 
err_t c6dofimu20_generic_read (c6dofimu20_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 6 DOF IMU 20 data reading function.
 
err_t c6dofimu20_set_reg (c6dofimu20_t *ctx, uint8_t reg, uint16_t data_in)
 6 DOF IMU 20 register data writing function.
 
err_t c6dofimu20_get_reg (c6dofimu20_t *ctx, uint8_t reg, uint16_t *data_out)
 6 DOF IMU 20 register data reading function.
 
err_t c6dofimu20_get_id (c6dofimu20_t *ctx, uint8_t *chip_id)
 6 DOF IMU 20 register chip id reading function.
 
uint8_t c6dofimu20_get_int1_state (c6dofimu20_t *ctx)
 6 DOF IMU 20 IT1 state reading function.
 
uint8_t c6dofimu20_get_int2_state (c6dofimu20_t *ctx)
 6 DOF IMU 20 IT2 state reading function.
 
err_t c6dofimu20_get_acc_data (c6dofimu20_t *ctx, c6dofimu20_data_t *acc_data)
 6 DOF IMU 20 accel data reading function.
 
err_t c6dofimu20_get_gyr_data (c6dofimu20_t *ctx, c6dofimu20_data_t *gyr_data)
 6 DOF IMU 20 gyro data reading function.
 
err_t c6dofimu20_get_temperature (c6dofimu20_t *ctx, float *temp_data)
 6 DOF IMU 20 temperature reading function.
 
err_t c6dofimu20_sw_reset (c6dofimu20_t *ctx)
 6 DOF IMU 20 software reset function.
 

Detailed Description

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

◆ c6dofimu20_cfg_setup()

void c6dofimu20_cfg_setup ( c6dofimu20_cfg_t * cfg)

6 DOF IMU 20 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ c6dofimu20_default_cfg()

err_t c6dofimu20_default_cfg ( c6dofimu20_t * ctx)

6 DOF IMU 20 default configuration function.

This function executes a default configuration of 6 DOF IMU 20 click board.

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

◆ c6dofimu20_drv_interface_selection()

void c6dofimu20_drv_interface_selection ( c6dofimu20_cfg_t * cfg,
c6dofimu20_drv_t drv_sel )

6 DOF IMU 20 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 c6dofimu20_cfg_t object definition for detailed explanation.
[in]drv_sel: Driver interface selection. See c6dofimu20_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.

◆ c6dofimu20_generic_read()

err_t c6dofimu20_generic_read ( c6dofimu20_t * ctx,
uint8_t reg,
uint8_t * data_out,
uint8_t len )

6 DOF IMU 20 data reading function.

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

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

◆ c6dofimu20_generic_write()

err_t c6dofimu20_generic_write ( c6dofimu20_t * ctx,
uint8_t reg,
uint8_t * data_in,
uint8_t len )

6 DOF IMU 20 data writing function.

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

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

◆ c6dofimu20_get_acc_data()

err_t c6dofimu20_get_acc_data ( c6dofimu20_t * ctx,
c6dofimu20_data_t * acc_data )

6 DOF IMU 20 accel data reading function.

This function reads a accel data from registers.

Parameters
[in]ctx: Click context object. See c6dofimu20_t object definition for detailed explanation.
[out]acc_data: Read accel data. See c6dofimu20_data_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ c6dofimu20_get_gyr_data()

err_t c6dofimu20_get_gyr_data ( c6dofimu20_t * ctx,
c6dofimu20_data_t * gyr_data )

6 DOF IMU 20 gyro data reading function.

This function reads a gyro data from registers.

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

◆ c6dofimu20_get_id()

err_t c6dofimu20_get_id ( c6dofimu20_t * ctx,
uint8_t * chip_id )

6 DOF IMU 20 register chip id reading function.

This function reads a chip id from the CHIP_ID register.

Parameters
[in]ctx: Click context object. See c6dofimu20_t object definition for detailed explanation.
[out]chip_id: Rread chip id data.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ c6dofimu20_get_int1_state()

uint8_t c6dofimu20_get_int1_state ( c6dofimu20_t * ctx)

6 DOF IMU 20 IT1 state reading function.

This function reads a state of the IT1 pin.

Parameters
[in]ctx: Click context object. See c6dofimu20_t object definition for detailed explanation.
Returns
State of the IN1 pin.
Note
None.

◆ c6dofimu20_get_int2_state()

uint8_t c6dofimu20_get_int2_state ( c6dofimu20_t * ctx)

6 DOF IMU 20 IT2 state reading function.

This function reads a state of the IT2 pin.

Parameters
[in]ctx: Click context object. See c6dofimu20_t object definition for detailed explanation.
Returns
State of the IN2 pin.
Note
None.

◆ c6dofimu20_get_reg()

err_t c6dofimu20_get_reg ( c6dofimu20_t * ctx,
uint8_t reg,
uint16_t * data_out )

6 DOF IMU 20 register data reading function.

This function reads a 16 bits of data from the selected register.

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

◆ c6dofimu20_get_temperature()

err_t c6dofimu20_get_temperature ( c6dofimu20_t * ctx,
float * temp_data )

6 DOF IMU 20 temperature reading function.

This function reads a temperature from registers.

Parameters
[in]ctx: Click context object. See c6dofimu20_t object definition for detailed explanation.
[out]temp_data: Read temperature data in degrees of celsius.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ c6dofimu20_init()

err_t c6dofimu20_init ( c6dofimu20_t * ctx,
c6dofimu20_cfg_t * cfg )

6 DOF IMU 20 initialization function.

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

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

◆ c6dofimu20_set_reg()

err_t c6dofimu20_set_reg ( c6dofimu20_t * ctx,
uint8_t reg,
uint16_t data_in )

6 DOF IMU 20 register data writing function.

This function writes a 16 bits of data to the selected register.

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

◆ c6dofimu20_sw_reset()

err_t c6dofimu20_sw_reset ( c6dofimu20_t * ctx)

6 DOF IMU 20 software reset function.

This function performs software reset.

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