c9dof 2.0.0.0
Public function

Functions

void c9dof_cfg_setup (c9dof_cfg_t *cfg)
 Config Object Initialization function.
 
C9DOF_RETVAL c9dof_init (c9dof_t *ctx, c9dof_cfg_t *cfg)
 Initialization function.
 
void c9dof_default_cfg (c9dof_t *ctx)
 Click Default Configuration function.
 
void c9dof_set_power_mode (c9dof_t *ctx, uint8_t pwr_mode)
 Set accel and gyro power mode function.
 
void c9dof_generic_write_accel_gyro (c9dof_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic accel and gyro write function.
 
void c9dof_generic_read_accel_gyro (c9dof_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic accel and gyro read function.
 
void c9dof_generic_write_mag (c9dof_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic mag write function.
 
void c9dof_generic_read_mag (c9dof_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic mag read function.
 
void c9dof_read_accel (c9dof_t *ctx, c9dof_accel_data_t *accel_data)
 Get accelerometer data function.
 
void c9dof_read_gyro (c9dof_t *ctx, c9dof_gyro_data_t *gyro_data)
 Get gyroscope data function.
 
void c9dof_read_mag (c9dof_t *ctx, c9dof_mag_data_t *mag_data)
 Get magnetometer data function.
 
uint8_t c9dof_get_interrupt (c9dof_t *ctx)
 Get state of the Magnetic sensor interrupt function.
 

Detailed Description

Function Documentation

◆ c9dof_cfg_setup()

void c9dof_cfg_setup ( c9dof_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.

◆ c9dof_default_cfg()

void c9dof_default_cfg ( c9dof_t * ctx)

Click Default Configuration function.

Parameters
ctxClick object.

@description This function executes default configuration for 9Dof click.

Note

Click default configuration:

   Enable accel and gyro sensors.

reg : C9DOF_REG_CTRL_REG4

   tx_data : C9DOF_CTRL_REG4_CONFIG
   reg     : C9DOF_REG_CTRL_REG1_G
-------------------------------------------------
   tx_data : C9DOF_CTRL_REG1_G_CONFIG

reg : C9DOF_REG_CTRL_REG5_XL

   tx_data : C9DOF_CTRL_REG5_XL_CONFIG
   reg     : C9DOF_REG_CTRL_REG6_XL
-------------------------------------------------
   tx_data : C9DOF_CTRL_REG6_XL_CONFIG

reg : C9DOF_REG_CTRL_REG8

   tx_data : C9DOF_CTRL_REG8_CONFIG
   reg     : C9DOF_REG_CTRL_REG1_M
-------------------------------------------------
   tx_data : C9DOF_CTRL_REG1_M_CONFIG

reg : C9DOF_REG_CTRL_REG2_M

   tx_data : C9DOF_CTRL_REG2_M_CONFIG
   reg     : C9DOF_REG_CTRL_REG3_M
-------------------------------------------------
   tx_data : C9DOF_CTRL_REG3_M_CONFIG

reg : C9DOF_REG_CTRL_REG4_M

   tx_data : C9DOF_CTRL_REG4_M_CONFIG
   reg     : C9DOF_REG_CTRL_REG5_M
-------------------------------------------------
   tx_data : C9DOF_CTRL_REG5_M_CONFIG

◆ c9dof_generic_read_accel_gyro()

void c9dof_generic_read_accel_gyro ( c9dof_t * ctx,
uint8_t reg,
uint8_t * data_buf,
uint8_t len )

Generic accel and gyro read function.

Parameters
ctxClick object.
regAccel and gyro register address.
data_bufOutput data buf
lenNumber of the bytes to be read

@description This function reads accel and gyro data from the desired accel and gyro register of the LSM9DS1 module.

◆ c9dof_generic_read_mag()

void c9dof_generic_read_mag ( c9dof_t * ctx,
uint8_t reg,
uint8_t * data_buf,
uint8_t len )

Generic mag read function.

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

@description This function reads mag data from the desired mag register of the LSM9DS1 module.

◆ c9dof_generic_write_accel_gyro()

void c9dof_generic_write_accel_gyro ( c9dof_t * ctx,
uint8_t reg,
uint8_t * data_buf,
uint8_t len )

Generic accel and gyro write function.

Parameters
ctxClick object.
regAccel and gyro register address.
data_bufData buf to be written.
lenNumber of the bytes in data buf.

@description This function writes accel and gyro write data to the desired accel and gyro register of the LSM9DS1 module.

◆ c9dof_generic_write_mag()

void c9dof_generic_write_mag ( c9dof_t * ctx,
uint8_t reg,
uint8_t * data_buf,
uint8_t len )

Generic mag write function.

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

@description This function writes mag data to the desired mag register of the LSM9DS1 module.

◆ c9dof_get_interrupt()

uint8_t c9dof_get_interrupt ( c9dof_t * ctx)

Get state of the Magnetic sensor interrupt function.

Parameters
ctxClick object.
Returns
Magnetic sensor interrupt state:
   0 : Not active.
   1 : Active.

@description This function gets states of the Magnetic sensor interrupt of the LSM9DS1 module.

◆ c9dof_init()

C9DOF_RETVAL c9dof_init ( c9dof_t * ctx,
c9dof_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

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

◆ c9dof_read_accel()

void c9dof_read_accel ( c9dof_t * ctx,
c9dof_accel_data_t * accel_data )

Get accelerometer data function.

Parameters
ctxClick object.
accel_dataPointer to structure where Accel data be stored.

@description This function reads Accel data ( X, Y and Z axis ) from the desired Accel registers of the LSM9DS1 module.

◆ c9dof_read_gyro()

void c9dof_read_gyro ( c9dof_t * ctx,
c9dof_gyro_data_t * gyro_data )

Get gyroscope data function.

Parameters
ctxClick object.
accel_dataPointer to structure where Gyro data be stored.

@description This function reads Gyro data ( X, Y and Z axis ) from the desired Gyro registers of the LSM9DS1 module.

◆ c9dof_read_mag()

void c9dof_read_mag ( c9dof_t * ctx,
c9dof_mag_data_t * mag_data )

Get magnetometer data function.

Parameters
ctxClick object.
accel_dataPointer to structure where Mag data be stored.

@description This function reads Mag data ( X, Y and Z axis ) from the desired Mag registers of the LSM9DS1 module.

◆ c9dof_set_power_mode()

void c9dof_set_power_mode ( c9dof_t * ctx,
uint8_t pwr_mode )

Set accel and gyro power mode function.

Parameters
ctxClick object.
pwr_modePower mode.
0 ( C9DOF_ACCEL_GYRO_POWER_MODE_OFF ) : Disable accel and gyro sensors.
1 ( C9DOF_ACCEL_GYRO_POWER_MODE_ON )  : Enable accel and gyro sensors.

@description This function sets power mode of the 9Dof click.