c9dof3 2.0.0.0
Public function

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.
 

Detailed Description

Function Documentation

◆ c9dof3_cfg_setup()

void c9dof3_cfg_setup ( c9dof3_cfg_t * cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

@description This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ c9dof3_check_communication()

uint8_t c9dof3_check_communication ( c9dof3_t * ctx)

Check communication function.

Parameters
ctxClick object.
Returns
3-bit communication status:
- [ 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.

◆ c9dof3_check_interrupt()

uint8_t c9dof3_check_interrupt ( c9dof3_t * ctx)

Check interrupt status function.

Parameters
ctxClick object.
Returns
Interrupt state: 0 - No active; 1 - Active;

@description Function check interrupt state.

◆ c9dof3_default_cfg()

void c9dof3_default_cfg ( c9dof3_t * ctx)

Click Default Configuration function.

Parameters
ctxClick object.

@description The function set default sensor configuration.

Note
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.

◆ c9dof3_drv_interface_selection()

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.

Parameters
[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.
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.

◆ c9dof3_generic_read()

void c9dof3_generic_read ( c9dof3_t * ctx,
uint8_t reg,
uint8_t * data_buf,
uint8_t len )

Generic read function.

Parameters
ctxClick object.
regRegister address.
data_bufData buf to be written.
lenNumber of the bytes in data buf.

@description This function reads data from the desired register.

◆ c9dof3_generic_write()

void c9dof3_generic_write ( c9dof3_t * ctx,
uint8_t reg,
uint8_t * data_buf,
uint8_t len )

Generic write function.

Parameters
ctxClick object.
regRegister address.
data_bufOutput data buf
lenNumber of the bytes to be read

@description This function writes data to the desired register.

◆ c9dof3_get_data()

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.

Parameters
ctxClick object.
accel_dataPointer to memory location where Accel data be stored
gyro_dataPointer to memory location where Magnetometer data be stored
mag_dataPointer 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_init()

C9DOF3_RETVAL c9dof3_init ( c9dof3_t * ctx,
c9dof3_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

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

◆ c9dof3_read_accel_data()

void c9dof3_read_accel_data ( c9dof3_t * ctx,
c9dof3_accel_t * accel_data )

Read Accel data function.

Parameters
ctxClick object.
accel_dataPointer 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.

◆ c9dof3_read_gyro_data()

void c9dof3_read_gyro_data ( c9dof3_t * ctx,
c9dof3_gyro_t * gyro_data )

Read Gyro data function.

Parameters
ctxClick object.
gyro_dataPointer 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.

◆ c9dof3_read_mag_data()

void c9dof3_read_mag_data ( c9dof3_t * ctx,
c9dof3_mag_t * mag_data )

Read Mag data function.

Parameters
ctxClick object.
accel_dataPointer 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.