c9dof3 2.0.0.0
|
Functions | |
void | c9dof3_cfg_setup (c9dof3_cfg_t *cfg) |
Config Object Initialization function. | |
void | c9dof3_drv_interface_selection (c9dof3_cfg_t *cfg, c9dof3_drv_t drv_sel) |
9DOF 3 driver interface setup function. | |
C9DOF3_RETVAL | c9dof3_init (c9dof3_t *ctx, c9dof3_cfg_t *cfg) |
Initialization function. | |
void | c9dof3_default_cfg (c9dof3_t *ctx) |
Click Default Configuration function. | |
void | c9dof3_generic_write (c9dof3_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic write function. | |
void | c9dof3_generic_read (c9dof3_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic read function. | |
uint8_t | c9dof3_check_communication (c9dof3_t *ctx) |
Check communication function. | |
void | c9dof3_read_accel_data (c9dof3_t *ctx, c9dof3_accel_t *accel_data) |
Read Accel data function. | |
void | c9dof3_read_gyro_data (c9dof3_t *ctx, c9dof3_gyro_t *gyro_data) |
Read Gyro data function. | |
void | c9dof3_read_mag_data (c9dof3_t *ctx, c9dof3_mag_t *mag_data) |
Read Mag data function. | |
void | c9dof3_get_data (c9dof3_t *ctx, c9dof3_accel_t *accel_data, c9dof3_gyro_t *gyro_data, c9dof3_mag_t *mag_data) |
Read Accel, Gyro and Mag data function. | |
uint8_t | c9dof3_check_interrupt (c9dof3_t *ctx) |
Check interrupt status function. | |
void c9dof3_cfg_setup | ( | c9dof3_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
@description This function initializes click configuration structure to init state.
uint8_t c9dof3_check_communication | ( | c9dof3_t * | ctx | ) |
Check communication function.
ctx | Click object. |
- [ Bit 0 ] Accelerometer ID check: - 0 : Error. - 1 : Success. - [ Bit 1 ] Gyroscope ID check: - 0 : Error. - 1 : Success. - [ Bit 2 ] Magnetometer ID check: - 0 : Error. - 1 : Success.
@description The function check device ID for accelerometer, gyroscope and magnetometer.
uint8_t c9dof3_check_interrupt | ( | c9dof3_t * | ctx | ) |
Check interrupt status function.
ctx | Click object. |
@description Function check interrupt state.
void c9dof3_default_cfg | ( | c9dof3_t * | ctx | ) |
Click Default Configuration function.
ctx | Click object. |
@description The function set default sensor configuration.
Accelerometer, Gyroscope and Magnetometer soft reset, Accelerometer default configuration: Select PMU Range( +-2 ), PMU_BW ( 7.81Hz ), PMU_LPW ( NomalMode, SleepDuration 0.5ms ). Gyroscope default configuration: Set Range( 262.4 LSB/�/s ), BW ( 32Hz ), LPM1 ( NomalMode, SleepDuration 2ms ). Magnetometer default configuration: Set sleep mode, Adv. stg., DataRate, OperationMode, SelfTest ( NomalMode, ODR 10Hz ), Repetitions for X-Y Axis: 0x04 -> ( 1 + 2 ( 2 ^ 2 ) ) = 9, Repetition for Z-Axis: 0x0F -> ( 1 +( 2 ^ 0 + 2 ^ 1 + 2 ^ 2 + 2 ^ 3) = 15.
void c9dof3_drv_interface_selection | ( | c9dof3_cfg_t * | cfg, |
c9dof3_drv_t | drv_sel ) |
9DOF 3 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 c9dof3_cfg_t object definition for detailed explanation. |
[in] | drv_sel | : Driver interface selection. See c9dof3_drv_t object definition for detailed explanation. |
void c9dof3_generic_read | ( | c9dof3_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_buf, | ||
uint8_t | len ) |
Generic read function.
ctx | Click object. |
reg | Register address. |
data_buf | Data buf to be written. |
len | Number of the bytes in data buf. |
@description This function reads data from the desired register.
void c9dof3_generic_write | ( | c9dof3_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_buf, | ||
uint8_t | len ) |
Generic write function.
ctx | Click object. |
reg | Register address. |
data_buf | Output data buf |
len | Number of the bytes to be read |
@description This function writes data to the desired register.
void c9dof3_get_data | ( | c9dof3_t * | ctx, |
c9dof3_accel_t * | accel_data, | ||
c9dof3_gyro_t * | gyro_data, | ||
c9dof3_mag_t * | mag_data ) |
Read Accel, Gyro and Mag data function.
ctx | Click object. |
accel_data | Pointer to memory location where Accel data be stored |
gyro_data | Pointer to memory location where Magnetometer data be stored |
mag_data | Pointer to memory location where Magnetometer data be stored |
@description Function read Accel, Gyro and Mag X-axis, Y-axis data and Z-axis data.
C9DOF3_RETVAL c9dof3_init | ( | c9dof3_t * | ctx, |
c9dof3_cfg_t * | cfg ) |
Initialization function.
ctx | Click object. |
cfg | Click configuration structure. |
@description This function initializes all necessary pins and peripherals used for this click.
void c9dof3_read_accel_data | ( | c9dof3_t * | ctx, |
c9dof3_accel_t * | accel_data ) |
Read Accel data function.
ctx | Click object. |
accel_data | Pointer to memory location where Accel data be stored |
@description Function read 12-bit ( signed ) Accel X-axis, Y-axis data and Z-axis data from the 6 targeted starts from C9DOF3_REG_ACC_DATA_START register address.
void c9dof3_read_gyro_data | ( | c9dof3_t * | ctx, |
c9dof3_gyro_t * | gyro_data ) |
Read Gyro data function.
ctx | Click object. |
gyro_data | Pointer to memory location where Gyro data be stored |
@description Function read 16-bit ( signed ) Gyro X-axis, Y-axis data and Z-axis data from the 6 targeted starts from C9DOF3_REG_GYRO_DATA_START register address.
void c9dof3_read_mag_data | ( | c9dof3_t * | ctx, |
c9dof3_mag_t * | mag_data ) |
Read Mag data function.
ctx | Click object. |
accel_data | Pointer to memory location where Mag data be stored |
@description Function read 13-bit ( signed ) Mag X-axis, Y-axis data and Z-axis data from the 6 targeted starts from C9DOF3_REG_MAG_DATA_START register address.