c6dofimu18 2.1.0.0
6DOF IMU 18 Click Driver

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

Topics

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

Functions

void c6dofimu18_cfg_setup (c6dofimu18_cfg_t *cfg)
 6DOF IMU 18 configuration object setup function.
 
void c6dofimu18_drv_interface_selection (c6dofimu18_cfg_t *cfg, c6dofimu18_drv_t drv_sel)
 6DOF IMU 18 driver interface setup function.
 
err_t c6dofimu18_init (c6dofimu18_t *ctx, c6dofimu18_cfg_t *cfg)
 6DOF IMU 18 initialization function.
 
err_t c6dofimu18_default_cfg (c6dofimu18_t *ctx)
 6DOF IMU 18 default configuration function.
 
err_t c6dofimu18_generic_write (c6dofimu18_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 6DOF IMU 18 data writing function.
 
err_t c6dofimu18_generic_read (c6dofimu18_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 6DOF IMU 18 data reading function.
 
err_t c6dofimu18_set_reg_bank (c6dofimu18_t *ctx, uint8_t bank)
 6DOF IMU 18 set register bank function.
 
err_t c6dofimu18_reg_write (c6dofimu18_t *ctx, uint8_t reg_bank, uint8_t reg, uint8_t *data_in, uint8_t len)
 6DOF IMU 18 register data writing function.
 
err_t c6dofimu18_reg_read (c6dofimu18_t *ctx, uint8_t reg_bank, uint8_t reg, uint8_t *data_out, uint8_t len)
 6DOF IMU 18 data reading function.
 
err_t c6dofimu18_configure_digital_interface (c6dofimu18_t *ctx, uint8_t slew_rate)
 6DOF IMU 18 configure digital interface function.
 
uint8_t c6dofimu18_get_int1_state (c6dofimu18_t *ctx)
 6DOF IMU 18 read INT1 pin state function.
 
err_t c6dofimu18_sw_reset (c6dofimu18_t *ctx)
 6DOF IMU 18 software reset function.
 
err_t c6dofimu18_read_temperature (c6dofimu18_t *ctx, float *temperature_data)
 6DOF IMU 18 read temperature function.
 
err_t c6dofimu18_read_timestamp (c6dofimu18_t *ctx, uint32_t *tmst_data)
 6DOF IMU 18 read timestamp function.
 
err_t c6dofimu18_get_data_from_register (c6dofimu18_t *ctx, float *temperature_data, c6dofimu18_data_t *accel_data, c6dofimu18_data_t *gyro_data, uint32_t *tmst_data)
 6DOF IMU 18 read data function.
 
err_t c6dofimu18_set_basic_tap_detection (c6dofimu18_t *ctx)
 6DOF IMU 18 basic tap detection configuration function.
 
err_t c6dofimu18_get_tap_detection (c6dofimu18_t *ctx, uint8_t *tap_num, uint8_t *tap_axis, uint8_t *tap_dir)
 6DOF IMU 18 get tap detection data function.
 

Detailed Description

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

◆ c6dofimu18_cfg_setup()

void c6dofimu18_cfg_setup ( c6dofimu18_cfg_t * cfg)

6DOF IMU 18 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ c6dofimu18_configure_digital_interface()

err_t c6dofimu18_configure_digital_interface ( c6dofimu18_t * ctx,
uint8_t slew_rate )

6DOF IMU 18 configure digital interface function.

This function sets a digital communication interface based on selected communication.

Parameters
[in]ctx: Click context object. See c6dofimu18_t object definition for detailed explanation.
[in]slew_rate: Slew rate of selected interface.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ c6dofimu18_default_cfg()

err_t c6dofimu18_default_cfg ( c6dofimu18_t * ctx)

6DOF IMU 18 default configuration function.

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

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

◆ c6dofimu18_drv_interface_selection()

void c6dofimu18_drv_interface_selection ( c6dofimu18_cfg_t * cfg,
c6dofimu18_drv_t drv_sel )

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

◆ c6dofimu18_generic_read()

err_t c6dofimu18_generic_read ( c6dofimu18_t * ctx,
uint8_t reg,
uint8_t * data_out,
uint8_t len )

6DOF IMU 18 data reading function.

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

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

◆ c6dofimu18_generic_write()

err_t c6dofimu18_generic_write ( c6dofimu18_t * ctx,
uint8_t reg,
uint8_t * data_in,
uint8_t len )

6DOF IMU 18 data writing function.

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

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

◆ c6dofimu18_get_data_from_register()

err_t c6dofimu18_get_data_from_register ( c6dofimu18_t * ctx,
float * temperature_data,
c6dofimu18_data_t * accel_data,
c6dofimu18_data_t * gyro_data,
uint32_t * tmst_data )

6DOF IMU 18 read data function.

This function is used to read accel, gyro, temperature, and timestamp data from the 6DOF IMU 18 click board. This data can be then processed and used in a specific way.

Parameters
[in]ctx: Click context object. See c6dofimu18_t object definition for detailed explanation.
[out]temperature_data: Temperature data value.
[out]accel_data: Accel data value.
[out]gyro_data: Gyro data value.
[out]tmst_data: Timestamp value.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ c6dofimu18_get_int1_state()

uint8_t c6dofimu18_get_int1_state ( c6dofimu18_t * ctx)

6DOF IMU 18 read INT1 pin state function.

6DOF IMU 18 read INT2 pin state function.

This function is used to get state of the INT1 (int_pin).

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

This function is used to get state of the INT2 (int_pin).

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

◆ c6dofimu18_get_tap_detection()

err_t c6dofimu18_get_tap_detection ( c6dofimu18_t * ctx,
uint8_t * tap_num,
uint8_t * tap_axis,
uint8_t * tap_dir )

6DOF IMU 18 get tap detection data function.

This function is used to read tap detection data from the 6DOF IMU 18 click board.

Parameters
[in]ctx: Click context object. See c6dofimu18_t object definition for detailed explanation.
[out]tap_num: Numbers of taps.
[out]tap_axis: Axis of the tap direction.
[out]tap_dir: Direction of the tap in correspondence to the starting point.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ c6dofimu18_init()

err_t c6dofimu18_init ( c6dofimu18_t * ctx,
c6dofimu18_cfg_t * cfg )

6DOF IMU 18 initialization function.

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

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

◆ c6dofimu18_read_temperature()

err_t c6dofimu18_read_temperature ( c6dofimu18_t * ctx,
float * temperature_data )

6DOF IMU 18 read temperature function.

This function is used to read temperature from the 6DOF IMU 18 click board.

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

◆ c6dofimu18_read_timestamp()

err_t c6dofimu18_read_timestamp ( c6dofimu18_t * ctx,
uint32_t * tmst_data )

6DOF IMU 18 read timestamp function.

This function is used to read data timestamp from the 6DOF IMU 18 click board.

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

◆ c6dofimu18_reg_read()

err_t c6dofimu18_reg_read ( c6dofimu18_t * ctx,
uint8_t reg_bank,
uint8_t reg,
uint8_t * data_out,
uint8_t len )

6DOF IMU 18 data reading function.

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

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

◆ c6dofimu18_reg_write()

err_t c6dofimu18_reg_write ( c6dofimu18_t * ctx,
uint8_t reg_bank,
uint8_t reg,
uint8_t * data_in,
uint8_t len )

6DOF IMU 18 register data writing function.

This function writes a desired number of data bytes starting from the selected register. Register addresses are self increasing according to the number of bytes of input data.

Parameters
[in]ctx: Click context object. See c6dofimu18_t object definition for detailed explanation.
[in]bank: Specific register bank.
[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.

◆ c6dofimu18_set_basic_tap_detection()

err_t c6dofimu18_set_basic_tap_detection ( c6dofimu18_t * ctx)

6DOF IMU 18 basic tap detection configuration function.

This function is used to configure the 6DOF IMU 18 click board into tap detection configuration.

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

◆ c6dofimu18_set_reg_bank()

err_t c6dofimu18_set_reg_bank ( c6dofimu18_t * ctx,
uint8_t bank )

6DOF IMU 18 set register bank function.

This function switches to the desired register bank in order to access specific registers on that bank.

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

◆ c6dofimu18_sw_reset()

err_t c6dofimu18_sw_reset ( c6dofimu18_t * ctx)

6DOF IMU 18 software reset function.

This function is used to perform a software reset of the 6DOF IMU 18 click board.

Parameters
[in]ctx: Click context object. See c6dofimu18_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
All registers will be set at their default value.