c6dofimu22
2.1.0.0
|
API for configuring and manipulating 6DOF IMU 22 Click driver. More...
Modules | |
6DOF IMU 22 Registers List | |
List of registers of 6DOF IMU 22 Click driver. | |
6DOF IMU 22 Registers Settings | |
Settings for registers of 6DOF IMU 22 Click driver. | |
6DOF IMU 22 MikroBUS Map | |
MikroBUS pin mapping of 6DOF IMU 22 Click driver. | |
Functions | |
void | c6dofimu22_cfg_setup (c6dofimu22_cfg_t *cfg) |
6DOF IMU 22 configuration object setup function. More... | |
void | c6dofimu22_drv_interface_sel (c6dofimu22_cfg_t *cfg, c6dofimu22_drv_t drv_sel) |
6DOF IMU 22 driver interface setup function. More... | |
err_t | c6dofimu22_init (c6dofimu22_t *ctx, c6dofimu22_cfg_t *cfg) |
6DOF IMU 22 initialization function. More... | |
err_t | c6dofimu22_default_cfg (c6dofimu22_t *ctx) |
6DOF IMU 22 default configuration function. More... | |
err_t | c6dofimu22_generic_write (c6dofimu22_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
6DOF IMU 22 data writing function. More... | |
err_t | c6dofimu22_generic_read (c6dofimu22_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
6DOF IMU 22 data reading function. More... | |
err_t | c6dofimu22_write_reg (c6dofimu22_t *ctx, uint8_t reg, uint8_t data_in) |
6DOF IMU 22 write register function. More... | |
err_t | c6dofimu22_read_reg (c6dofimu22_t *ctx, uint8_t reg, uint8_t *data_out) |
6DOF IMU 22 read register function. More... | |
err_t | c6dofimu22_write_mreg (c6dofimu22_t *ctx, uint16_t mreg, uint8_t data_in) |
6DOF IMU 22 write mreg function. More... | |
err_t | c6dofimu22_read_mreg (c6dofimu22_t *ctx, uint16_t mreg, uint8_t *data_out) |
6DOF IMU 22 read mreg function. More... | |
void | c6dofimu22_set_fsync_pin (c6dofimu22_t *ctx, uint8_t state) |
6DOF IMU 22 set fsync pin function. More... | |
uint8_t | c6dofimu22_get_int1_pin (c6dofimu22_t *ctx) |
6DOF IMU 22 get int1 pin function. More... | |
uint8_t | c6dofimu22_get_int2_pin (c6dofimu22_t *ctx) |
6DOF IMU 22 get int2 pin function. More... | |
err_t | c6dofimu22_reset_device (c6dofimu22_t *ctx) |
6DOF IMU 22 reset device function. More... | |
err_t | c6dofimu22_check_communication (c6dofimu22_t *ctx) |
6DOF IMU 22 check communication function. More... | |
err_t | c6dofimu22_clear_data_ready (c6dofimu22_t *ctx) |
6DOF IMU 22 clear data ready function. More... | |
err_t | c6dofimu22_set_gyro_fs_odr (c6dofimu22_t *ctx, uint8_t fs_sel, uint8_t odr) |
6DOF IMU 22 set gyro fs odr function. More... | |
err_t | c6dofimu22_set_accel_fs_odr (c6dofimu22_t *ctx, uint8_t fs_sel, uint8_t odr) |
6DOF IMU 22 set accel fs odr function. More... | |
err_t | c6dofimu22_read_gyro (c6dofimu22_t *ctx, c6dofimu22_axes_t *gyro) |
6DOF IMU 22 read gyro function. More... | |
err_t | c6dofimu22_read_accel (c6dofimu22_t *ctx, c6dofimu22_axes_t *accel) |
6DOF IMU 22 read accel function. More... | |
err_t | c6dofimu22_read_temperature (c6dofimu22_t *ctx, float *temperature) |
6DOF IMU 22 read temperature function. More... | |
err_t | c6dofimu22_read_data (c6dofimu22_t *ctx, c6dofimu22_data_t *data_out) |
6DOF IMU 22 read data function. More... | |
API for configuring and manipulating 6DOF IMU 22 Click driver.
void c6dofimu22_cfg_setup | ( | c6dofimu22_cfg_t * | cfg | ) |
6DOF IMU 22 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See c6dofimu22_cfg_t object definition for detailed explanation. |
err_t c6dofimu22_check_communication | ( | c6dofimu22_t * | ctx | ) |
6DOF IMU 22 check communication function.
This function checks the communication by reading and verifying the device ID.
[in] | ctx | : Click context object. See c6dofimu22_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t c6dofimu22_clear_data_ready | ( | c6dofimu22_t * | ctx | ) |
6DOF IMU 22 clear data ready function.
This function clears the data ready interrupt by reading the INT_STATUS_DRDY register.
[in] | ctx | : Click context object. See c6dofimu22_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t c6dofimu22_default_cfg | ( | c6dofimu22_t * | ctx | ) |
6DOF IMU 22 default configuration function.
This function executes a default configuration of 6DOF IMU 22 click board.
[in] | ctx | : Click context object. See c6dofimu22_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void c6dofimu22_drv_interface_sel | ( | c6dofimu22_cfg_t * | cfg, |
c6dofimu22_drv_t | drv_sel | ||
) |
6DOF IMU 22 driver interface setup function.
This function sets a serial driver interface which will be used further in the click driver.
[out] | cfg | : Click configuration structure. See c6dofimu22_cfg_t object definition for detailed explanation. |
[in] | drv_sel | : Driver interface selection. See c6dofimu22_drv_t object definition for detailed explanation. |
err_t c6dofimu22_generic_read | ( | c6dofimu22_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out, | ||
uint8_t | len | ||
) |
6DOF IMU 22 data reading function.
This function reads a desired number of data bytes starting from the selected register.
[in] | ctx | : Click context object. See c6dofimu22_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. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t c6dofimu22_generic_write | ( | c6dofimu22_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_in, | ||
uint8_t | len | ||
) |
6DOF IMU 22 data writing function.
This function writes a desired number of data bytes starting from the selected register.
[in] | ctx | : Click context object. See c6dofimu22_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. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. uint8_t c6dofimu22_get_int1_pin | ( | c6dofimu22_t * | ctx | ) |
6DOF IMU 22 get int1 pin function.
This function returns the INT1 pin logic state.
[in] | ctx | : Click context object. See c6dofimu22_t object definition for detailed explanation. |
uint8_t c6dofimu22_get_int2_pin | ( | c6dofimu22_t * | ctx | ) |
6DOF IMU 22 get int2 pin function.
This function returns the INT2 pin logic state.
[in] | ctx | : Click context object. See c6dofimu22_t object definition for detailed explanation. |
err_t c6dofimu22_init | ( | c6dofimu22_t * | ctx, |
c6dofimu22_cfg_t * | cfg | ||
) |
6DOF IMU 22 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See c6dofimu22_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See c6dofimu22_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t c6dofimu22_read_accel | ( | c6dofimu22_t * | ctx, |
c6dofimu22_axes_t * | accel | ||
) |
6DOF IMU 22 read accel function.
This function reads the accelerometer of X, Y, and Z axis relative to standard gravity (g).
[in] | ctx | : Click context object. See c6dofimu22_t object definition for detailed explanation. |
[out] | accel | : Output accelerometer data. See c6dofimu22_axes_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t c6dofimu22_read_data | ( | c6dofimu22_t * | ctx, |
c6dofimu22_data_t * | data_out | ||
) |
6DOF IMU 22 read data function.
This function reads the accelerometer, gyroscope, and temperature measurement data.
[in] | ctx | : Click context object. See c6dofimu22_t object definition for detailed explanation. |
[out] | data_out | : Output data structure read. See c6dofimu22_data_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t c6dofimu22_read_gyro | ( | c6dofimu22_t * | ctx, |
c6dofimu22_axes_t * | gyro | ||
) |
6DOF IMU 22 read gyro function.
This function reads the angular rate of X, Y, and Z axis in degrees per second (dps).
[in] | ctx | : Click context object. See c6dofimu22_t object definition for detailed explanation. |
[out] | gyro | : Output gyro data. See c6dofimu22_axes_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t c6dofimu22_read_mreg | ( | c6dofimu22_t * | ctx, |
uint16_t | mreg, | ||
uint8_t * | data_out | ||
) |
6DOF IMU 22 read mreg function.
This function reads data from the selected register from MREG1-3 banks.
[in] | ctx | : Click context object. See c6dofimu22_t object definition for detailed explanation. |
[in] | mreg | : MREG address in format 0xbbrr, where bb represents bank access byte and rr is a register address. |
[out] | data_out | : Output read data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t c6dofimu22_read_reg | ( | c6dofimu22_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out | ||
) |
6DOF IMU 22 read register function.
This function reads data from the selected bank 0 register.
[in] | ctx | : Click context object. See c6dofimu22_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[out] | data_out | : Output read data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t c6dofimu22_read_temperature | ( | c6dofimu22_t * | ctx, |
float * | temperature | ||
) |
6DOF IMU 22 read temperature function.
This function reads the temperature measurement in degrees Celsius.
[in] | ctx | : Click context object. See c6dofimu22_t object definition for detailed explanation. |
[out] | temperature | : Temperature in degrees Celsius. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t c6dofimu22_reset_device | ( | c6dofimu22_t * | ctx | ) |
6DOF IMU 22 reset device function.
This function performs the device software reset.
[in] | ctx | : Click context object. See c6dofimu22_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t c6dofimu22_set_accel_fs_odr | ( | c6dofimu22_t * | ctx, |
uint8_t | fs_sel, | ||
uint8_t | odr | ||
) |
6DOF IMU 22 set accel fs odr function.
This function sets the accel full scale resolution and output data rate.
[in] | ctx | : Click context object. See c6dofimu22_t object definition for detailed explanation. |
[in] | fs_sel | : Full scale selection: 0-3 which leads to 2x2^fs_sel G. |
[in] | odr | : Output data rate: 0-10 which leads to 1.5625x2^odr Hz. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void c6dofimu22_set_fsync_pin | ( | c6dofimu22_t * | ctx, |
uint8_t | state | ||
) |
6DOF IMU 22 set fsync pin function.
This function sets the FSYNC pin logic state.
[in] | ctx | : Click context object. See c6dofimu22_t object definition for detailed explanation. |
[in] | state | : Pin logic state. |
err_t c6dofimu22_set_gyro_fs_odr | ( | c6dofimu22_t * | ctx, |
uint8_t | fs_sel, | ||
uint8_t | odr | ||
) |
6DOF IMU 22 set gyro fs odr function.
This function sets the gyro full scale resolution and output data rate.
[in] | ctx | : Click context object. See c6dofimu22_t object definition for detailed explanation. |
[in] | fs_sel | : Full scale selection: 0-3 which leads to 250x2^fs_sel DPS. |
[in] | odr | : Output data rate: 0-7 which leads to 12.5x2^odr Hz. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t c6dofimu22_write_mreg | ( | c6dofimu22_t * | ctx, |
uint16_t | mreg, | ||
uint8_t | data_in | ||
) |
6DOF IMU 22 write mreg function.
This function writes a data byte to the selected register from MREG1-3 banks.
[in] | ctx | : Click context object. See c6dofimu22_t object definition for detailed explanation. |
[in] | mreg | : MREG address in format 0xbbrr, where bb represents bank access byte and rr is a register address. |
[in] | data_in | : Data to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t c6dofimu22_write_reg | ( | c6dofimu22_t * | ctx, |
uint8_t | reg, | ||
uint8_t | data_in | ||
) |
6DOF IMU 22 write register function.
This function writes a data byte to the selected bank 0 register.
[in] | ctx | : Click context object. See c6dofimu22_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[in] | data_in | : Data to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.