ICARUS OS (Intelligent Cooperative Architecture for Real-time Unified Systems) 0.1.0
Preemptive Real-Time Operating System for ARM Cortex-M7
Loading...
Searching...
No Matches
LSM9DS1_Data_generation

This section groups all the functions concerning data generation. More...

Functions

int32_t lsm9ds1_gy_full_scale_set (const stmdev_ctx_t *ctx, lsm9ds1_gy_fs_t val)
 Gyroscope full-scale selection.
 
int32_t lsm9ds1_gy_full_scale_get (const stmdev_ctx_t *ctx, lsm9ds1_gy_fs_t *val)
 Gyroscope full-scale selection.
 
int32_t lsm9ds1_imu_data_rate_set (const stmdev_ctx_t *ctx, lsm9ds1_imu_odr_t val)
 Data rate selection when both the accelerometer and gyroscope are activated.
 
int32_t lsm9ds1_imu_data_rate_get (const stmdev_ctx_t *ctx, lsm9ds1_imu_odr_t *val)
 Data rate selection when both the accelerometer and gyroscope are activated.
 
int32_t lsm9ds1_gy_orient_set (const stmdev_ctx_t *ctx, lsm9ds1_gy_orient_t val)
 Configure gyro orientation.
 
int32_t lsm9ds1_gy_orient_get (const stmdev_ctx_t *ctx, lsm9ds1_gy_orient_t *val)
 Configure gyro orientation.
 
int32_t lsm9ds1_xl_flag_data_ready_get (const stmdev_ctx_t *ctx, uint8_t *val)
 Accelerometer new data available.
 
int32_t lsm9ds1_gy_flag_data_ready_get (const stmdev_ctx_t *ctx, uint8_t *val)
 Gyroscope new data available.
 
int32_t lsm9ds1_temp_flag_data_ready_get (const stmdev_ctx_t *ctx, uint8_t *val)
 Temperature new data available.
 
int32_t lsm9ds1_gy_axis_set (const stmdev_ctx_t *ctx, lsm9ds1_gy_axis_t val)
 Enable gyroscope axis.
 
int32_t lsm9ds1_gy_axis_get (const stmdev_ctx_t *ctx, lsm9ds1_gy_axis_t *val)
 Enable gyroscope axis.
 
int32_t lsm9ds1_xl_axis_set (const stmdev_ctx_t *ctx, lsm9ds1_xl_axis_t val)
 Enable accelerometer axis.
 
int32_t lsm9ds1_xl_axis_get (const stmdev_ctx_t *ctx, lsm9ds1_xl_axis_t *val)
 Enable accelerometer axis.
 
int32_t lsm9ds1_xl_decimation_set (const stmdev_ctx_t *ctx, lsm9ds1_dec_t val)
 Decimation of acceleration data on OUT REG and FIFO.
 
int32_t lsm9ds1_xl_decimation_get (const stmdev_ctx_t *ctx, lsm9ds1_dec_t *val)
 Decimation of acceleration data on OUT REG and FIFO.
 
int32_t lsm9ds1_xl_full_scale_set (const stmdev_ctx_t *ctx, lsm9ds1_xl_fs_t val)
 Accelerometer full-scale selection.
 
int32_t lsm9ds1_xl_full_scale_get (const stmdev_ctx_t *ctx, lsm9ds1_xl_fs_t *val)
 Accelerometer full-scale selection.
 
int32_t lsm9ds1_block_data_update_set (const stmdev_ctx_t *ctx_mag, stmdev_ctx_t *ctx_imu, uint8_t val)
 Blockdataupdate.
 
int32_t lsm9ds1_block_data_update_get (const stmdev_ctx_t *ctx_mag, stmdev_ctx_t *ctx_imu, uint8_t *val)
 Blockdataupdate.
 
int32_t lsm9ds1_mag_offset_set (const stmdev_ctx_t *ctx, int16_t *val)
 This register is a 16-bit register and represents the X offset used to compensate environmental effects (data is expressed as two’s complement).
 
int32_t lsm9ds1_mag_offset_get (const stmdev_ctx_t *ctx, int16_t *val)
 This register is a 16-bit register and represents the X offset used to compensate environmental effects (data is expressed as two’s complement).
 
int32_t lsm9ds1_mag_data_rate_set (const stmdev_ctx_t *ctx, lsm9ds1_mag_data_rate_t val)
 Magnetometer data rate selection.
 
int32_t lsm9ds1_mag_data_rate_get (const stmdev_ctx_t *ctx, lsm9ds1_mag_data_rate_t *val)
 Magnetometer data rate selection.
 
int32_t lsm9ds1_mag_full_scale_set (const stmdev_ctx_t *ctx, lsm9ds1_mag_fs_t val)
 Magnetometer full Scale Selection.
 
int32_t lsm9ds1_mag_full_scale_get (const stmdev_ctx_t *ctx, lsm9ds1_mag_fs_t *val)
 Magnetometer full scale selection.
 
int32_t lsm9ds1_mag_flag_data_ready_get (const stmdev_ctx_t *ctx, uint8_t *val)
 New data available from magnetometer.
 

Detailed Description

This section groups all the functions concerning data generation.

Function Documentation

◆ lsm9ds1_block_data_update_get()

int32_t lsm9ds1_block_data_update_get ( const stmdev_ctx_t ctx_mag,
stmdev_ctx_t ctx_imu,
uint8_t *  val 
)

Blockdataupdate.

[get]

Parameters
ctx_magRead / write magnetometer interface definitions.(ptr)
ctx_imuRead / write imu interface definitions.(ptr)
valGet the values of bdu in reg CTRL_REG8.(ptr)
Return values
Interfacestatus (MANDATORY: return 0 -> no Error).

Definition at line 847 of file lsm9ds1_reg.c.

References lsm9ds1_ctrl_reg8_t::bdu, LSM9DS1_CTRL_REG5_M, LSM9DS1_CTRL_REG8, and lsm9ds1_read_reg().

◆ lsm9ds1_block_data_update_set()

int32_t lsm9ds1_block_data_update_set ( const stmdev_ctx_t ctx_mag,
stmdev_ctx_t ctx_imu,
uint8_t  val 
)

Blockdataupdate.

[set]

Parameters
ctx_magRead / write magnetometer interface definitions.(ptr)
ctx_imuRead / write imu interface definitions.(ptr)
valChange the values of bdu in reg CTRL_REG8.
Return values
Interfacestatus (MANDATORY: return 0 -> no Error).

Definition at line 804 of file lsm9ds1_reg.c.

References lsm9ds1_ctrl_reg8_t::bdu, lsm9ds1_ctrl_reg5_m_t::bdu, lsm9ds1_ctrl_reg5_m_t::fast_read, LSM9DS1_CTRL_REG5_M, LSM9DS1_CTRL_REG8, lsm9ds1_read_reg(), and lsm9ds1_write_reg().

◆ lsm9ds1_gy_axis_get()

int32_t lsm9ds1_gy_axis_get ( const stmdev_ctx_t ctx,
lsm9ds1_gy_axis_t val 
)

Enable gyroscope axis.

[get]

Parameters
ctxRead / write interface definitions.(ptr)
valGyroscope’s pitch axis (X) output enable.(ptr)
Return values
Interfacestatus (MANDATORY: return 0 -> no Error).

Definition at line 592 of file lsm9ds1_reg.c.

References LSM9DS1_CTRL_REG4, lsm9ds1_read_reg(), lsm9ds1_ctrl_reg4_t::xen_g, lsm9ds1_gy_axis_t::xen_g, lsm9ds1_ctrl_reg4_t::yen_g, lsm9ds1_gy_axis_t::yen_g, lsm9ds1_ctrl_reg4_t::zen_g, and lsm9ds1_gy_axis_t::zen_g.

◆ lsm9ds1_gy_axis_set()

int32_t lsm9ds1_gy_axis_set ( const stmdev_ctx_t ctx,
lsm9ds1_gy_axis_t  val 
)

Enable gyroscope axis.

[set]

Parameters
ctxRead / write interface definitions.(ptr)
valGyroscope’s pitch axis (X) output enable.
Return values
Interfacestatus (MANDATORY: return 0 -> no Error).

Definition at line 566 of file lsm9ds1_reg.c.

References LSM9DS1_CTRL_REG4, lsm9ds1_read_reg(), lsm9ds1_write_reg(), lsm9ds1_ctrl_reg4_t::xen_g, lsm9ds1_gy_axis_t::xen_g, lsm9ds1_ctrl_reg4_t::yen_g, lsm9ds1_gy_axis_t::yen_g, lsm9ds1_ctrl_reg4_t::zen_g, and lsm9ds1_gy_axis_t::zen_g.

◆ lsm9ds1_gy_flag_data_ready_get()

int32_t lsm9ds1_gy_flag_data_ready_get ( const stmdev_ctx_t ctx,
uint8_t *  val 
)

Gyroscope new data available.

[get]

Parameters
ctxRead / write interface definitions.(ptr)
valIet the values of "gda" in reg STATUS_REG.(ptr)
Return values
Interfacestatus (MANDATORY: return 0 -> no Error).

Definition at line 524 of file lsm9ds1_reg.c.

References lsm9ds1_status_reg_t::gda, lsm9ds1_read_reg(), and LSM9DS1_STATUS_REG.

◆ lsm9ds1_gy_full_scale_get()

int32_t lsm9ds1_gy_full_scale_get ( const stmdev_ctx_t ctx,
lsm9ds1_gy_fs_t val 
)

Gyroscope full-scale selection.

[get]

Parameters
ctxRead / write interface definitions.(ptr)
valGet the values of fs_g in reg CTRL_REG1_G.(ptr)
Return values
Interfacestatus (MANDATORY: return 0 -> no Error).

Definition at line 211 of file lsm9ds1_reg.c.

References lsm9ds1_ctrl_reg1_g_t::fs_g, LSM9DS1_2000dps, LSM9DS1_245dps, LSM9DS1_500dps, LSM9DS1_CTRL_REG1_G, and lsm9ds1_read_reg().

◆ lsm9ds1_gy_full_scale_set()

int32_t lsm9ds1_gy_full_scale_set ( const stmdev_ctx_t ctx,
lsm9ds1_gy_fs_t  val 
)

Gyroscope full-scale selection.

[set]

Parameters
ctxRead / write interface definitions.(ptr)
valChange the values of "fs_g" in reg LSM9DS1.
Return values
Interfacestatus (MANDATORY: return 0 -> no Error).

Definition at line 184 of file lsm9ds1_reg.c.

References lsm9ds1_ctrl_reg1_g_t::fs_g, LSM9DS1_CTRL_REG1_G, lsm9ds1_read_reg(), and lsm9ds1_write_reg().

◆ lsm9ds1_gy_orient_get()

int32_t lsm9ds1_gy_orient_get ( const stmdev_ctx_t ctx,
lsm9ds1_gy_orient_t val 
)

Configure gyro orientation.

[get]

Parameters
ctxRead / write interface definitions.(ptr)
valDirectional user orientation selection.(ptr)
Return values
Interfacestatus (MANDATORY: return 0 -> no Error).

Definition at line 479 of file lsm9ds1_reg.c.

References LSM9DS1_ORIENT_CFG_G, lsm9ds1_read_reg(), lsm9ds1_orient_cfg_g_t::orient, lsm9ds1_gy_orient_t::orient, lsm9ds1_orient_cfg_g_t::signx_g, lsm9ds1_gy_orient_t::signx_g, lsm9ds1_orient_cfg_g_t::signy_g, lsm9ds1_gy_orient_t::signy_g, lsm9ds1_orient_cfg_g_t::signz_g, and lsm9ds1_gy_orient_t::signz_g.

◆ lsm9ds1_gy_orient_set()

int32_t lsm9ds1_gy_orient_set ( const stmdev_ctx_t ctx,
lsm9ds1_gy_orient_t  val 
)

Configure gyro orientation.

[set]

Parameters
ctxRead / write interface definitions.(ptr)
valDirectional user orientation selection.
Return values
Interfacestatus (MANDATORY: return 0 -> no Error).

Definition at line 449 of file lsm9ds1_reg.c.

References LSM9DS1_ORIENT_CFG_G, lsm9ds1_read_reg(), lsm9ds1_write_reg(), lsm9ds1_orient_cfg_g_t::orient, lsm9ds1_gy_orient_t::orient, lsm9ds1_orient_cfg_g_t::signx_g, lsm9ds1_gy_orient_t::signx_g, lsm9ds1_orient_cfg_g_t::signy_g, lsm9ds1_gy_orient_t::signy_g, lsm9ds1_orient_cfg_g_t::signz_g, and lsm9ds1_gy_orient_t::signz_g.

◆ lsm9ds1_imu_data_rate_get()

◆ lsm9ds1_imu_data_rate_set()

int32_t lsm9ds1_imu_data_rate_set ( const stmdev_ctx_t ctx,
lsm9ds1_imu_odr_t  val 
)

Data rate selection when both the accelerometer and gyroscope are activated.

[set]

Parameters
ctxRead / write interface definitions.(ptr)
valChange the values of "odr_g" in reg LSM9DS1.
Return values
Interfacestatus (MANDATORY: return 0 -> no Error).

Definition at line 251 of file lsm9ds1_reg.c.

References lsm9ds1_ctrl_reg3_g_t::lp_mode, LSM9DS1_CTRL_REG1_G, LSM9DS1_CTRL_REG3_G, LSM9DS1_CTRL_REG6_XL, lsm9ds1_read_reg(), lsm9ds1_write_reg(), lsm9ds1_ctrl_reg1_g_t::odr_g, and lsm9ds1_ctrl_reg6_xl_t::odr_xl.

◆ lsm9ds1_mag_data_rate_get()

◆ lsm9ds1_mag_data_rate_set()

int32_t lsm9ds1_mag_data_rate_set ( const stmdev_ctx_t ctx,
lsm9ds1_mag_data_rate_t  val 
)

Magnetometer data rate selection.

[set]

Parameters
ctxRead / write interface definitions.(ptr)
valChange the values of "fast_odr" in reg LSM9DS1.
Return values
Interfacestatus (MANDATORY: return 0 -> no Error).

Definition at line 927 of file lsm9ds1_reg.c.

References lsm9ds1_ctrl_reg1_m_t::_do, lsm9ds1_ctrl_reg1_m_t::fast_odr, LSM9DS1_CTRL_REG1_M, LSM9DS1_CTRL_REG3_M, LSM9DS1_CTRL_REG4_M, lsm9ds1_read_reg(), lsm9ds1_write_reg(), lsm9ds1_ctrl_reg3_m_t::md, lsm9ds1_ctrl_reg1_m_t::om, lsm9ds1_ctrl_reg4_m_t::omz, PROPERTY_ENABLE, and lsm9ds1_ctrl_reg1_m_t::temp_comp.

◆ lsm9ds1_mag_flag_data_ready_get()

int32_t lsm9ds1_mag_flag_data_ready_get ( const stmdev_ctx_t ctx,
uint8_t *  val 
)

New data available from magnetometer.

[get]

Parameters
ctxRead / write interface definitions.(ptr)
valIet the values of "zyxda" in reg STATUS_REG_M.(ptr)
Return values
Interfacestatus (MANDATORY: return 0 -> no Error).

Definition at line 1242 of file lsm9ds1_reg.c.

References lsm9ds1_read_reg(), LSM9DS1_STATUS_REG_M, and lsm9ds1_status_reg_m_t::zyxda.

◆ lsm9ds1_mag_full_scale_get()

int32_t lsm9ds1_mag_full_scale_get ( const stmdev_ctx_t ctx,
lsm9ds1_mag_fs_t val 
)

Magnetometer full scale selection.

[get]

Parameters
ctxRead / write interface definitions.(ptr)
valGet the values of fs in reg CTRL_REG2_M.(ptr)
Return values
Interfacestatus (MANDATORY: return 0 -> no Error).

Definition at line 1199 of file lsm9ds1_reg.c.

References lsm9ds1_ctrl_reg2_m_t::fs, LSM9DS1_12Ga, LSM9DS1_16Ga, LSM9DS1_4Ga, LSM9DS1_8Ga, LSM9DS1_CTRL_REG2_M, and lsm9ds1_read_reg().

◆ lsm9ds1_mag_full_scale_set()

int32_t lsm9ds1_mag_full_scale_set ( const stmdev_ctx_t ctx,
lsm9ds1_mag_fs_t  val 
)

Magnetometer full Scale Selection.

[set]

Parameters
ctxRead / write interface definitions.(ptr)
valChange the values of "fs" in reg LSM9DS1.
Return values
Interfacestatus (MANDATORY: return 0 -> no Error).

Definition at line 1172 of file lsm9ds1_reg.c.

References lsm9ds1_ctrl_reg2_m_t::fs, LSM9DS1_CTRL_REG2_M, lsm9ds1_read_reg(), and lsm9ds1_write_reg().

◆ lsm9ds1_mag_offset_get()

int32_t lsm9ds1_mag_offset_get ( const stmdev_ctx_t ctx,
int16_t *  val 
)

This register is a 16-bit register and represents the X offset used to compensate environmental effects (data is expressed as two’s complement).

[get]

Parameters
ctxRead / write interface definitions.(ptr)
buffBuffer that stores data read.(ptr)
Return values
Interfacestatus (MANDATORY: return 0 -> no Error).

Definition at line 903 of file lsm9ds1_reg.c.

References LSM9DS1_OFFSET_X_REG_L_M, and lsm9ds1_read_reg().

◆ lsm9ds1_mag_offset_set()

int32_t lsm9ds1_mag_offset_set ( const stmdev_ctx_t ctx,
int16_t *  val 
)

This register is a 16-bit register and represents the X offset used to compensate environmental effects (data is expressed as two’s complement).

[set]

Parameters
ctxRead / write interface definitions.(ptr)
buffBuffer that stores data to be write.(ptr)
Return values
Interfacestatus (MANDATORY: return 0 -> no Error).

Definition at line 877 of file lsm9ds1_reg.c.

References LSM9DS1_OFFSET_X_REG_L_M, and lsm9ds1_write_reg().

◆ lsm9ds1_temp_flag_data_ready_get()

int32_t lsm9ds1_temp_flag_data_ready_get ( const stmdev_ctx_t ctx,
uint8_t *  val 
)

Temperature new data available.

[get]

Parameters
ctxRead / write interface definitions.(ptr)
valIet the values of "tda" in reg STATUS_REG.(ptr)
Return values
Interfacestatus (MANDATORY: return 0 -> no Error).

Definition at line 545 of file lsm9ds1_reg.c.

References lsm9ds1_read_reg(), LSM9DS1_STATUS_REG, and lsm9ds1_status_reg_t::tda.

◆ lsm9ds1_xl_axis_get()

int32_t lsm9ds1_xl_axis_get ( const stmdev_ctx_t ctx,
lsm9ds1_xl_axis_t val 
)

Enable accelerometer axis.

[get]

Parameters
ctxRead / write interface definitions.(ptr)
valAccelerometer’s X-axis output enable.(ptr)
Return values
Interfacestatus (MANDATORY: return 0 -> no Error).

Definition at line 641 of file lsm9ds1_reg.c.

References LSM9DS1_CTRL_REG5_XL, lsm9ds1_read_reg(), lsm9ds1_ctrl_reg5_xl_t::xen_xl, lsm9ds1_xl_axis_t::xen_xl, lsm9ds1_ctrl_reg5_xl_t::yen_xl, lsm9ds1_xl_axis_t::yen_xl, lsm9ds1_ctrl_reg5_xl_t::zen_xl, and lsm9ds1_xl_axis_t::zen_xl.

◆ lsm9ds1_xl_axis_set()

int32_t lsm9ds1_xl_axis_set ( const stmdev_ctx_t ctx,
lsm9ds1_xl_axis_t  val 
)

Enable accelerometer axis.

[set]

Parameters
ctxRead / write interface definitions.(ptr)
valAccelerometer’s X-axis output enable.
Return values
Interfacestatus (MANDATORY: return 0 -> no Error).

Definition at line 613 of file lsm9ds1_reg.c.

References LSM9DS1_CTRL_REG5_XL, lsm9ds1_read_reg(), lsm9ds1_write_reg(), lsm9ds1_ctrl_reg5_xl_t::xen_xl, lsm9ds1_xl_axis_t::xen_xl, lsm9ds1_ctrl_reg5_xl_t::yen_xl, lsm9ds1_xl_axis_t::yen_xl, lsm9ds1_ctrl_reg5_xl_t::zen_xl, and lsm9ds1_xl_axis_t::zen_xl.

◆ lsm9ds1_xl_decimation_get()

int32_t lsm9ds1_xl_decimation_get ( const stmdev_ctx_t ctx,
lsm9ds1_dec_t val 
)

Decimation of acceleration data on OUT REG and FIFO.

[get]

Parameters
ctxRead / write interface definitions.(ptr)
valGet the values of dec in reg CTRL_REG5_XL.(ptr)
Return values
Interfacestatus (MANDATORY: return 0 -> no Error).

Definition at line 690 of file lsm9ds1_reg.c.

References lsm9ds1_ctrl_reg5_xl_t::dec, LSM9DS1_CTRL_REG5_XL, LSM9DS1_EVERY_2_SAMPLES, LSM9DS1_EVERY_4_SAMPLES, LSM9DS1_EVERY_8_SAMPLES, LSM9DS1_NO_DECIMATION, and lsm9ds1_read_reg().

◆ lsm9ds1_xl_decimation_set()

int32_t lsm9ds1_xl_decimation_set ( const stmdev_ctx_t ctx,
lsm9ds1_dec_t  val 
)

Decimation of acceleration data on OUT REG and FIFO.

[set]

Parameters
ctxRead / write interface definitions.(ptr)
valChange the values of "dec" in reg LSM9DS1.
Return values
Interfacestatus (MANDATORY: return 0 -> no Error).

Definition at line 663 of file lsm9ds1_reg.c.

References lsm9ds1_ctrl_reg5_xl_t::dec, LSM9DS1_CTRL_REG5_XL, lsm9ds1_read_reg(), and lsm9ds1_write_reg().

◆ lsm9ds1_xl_flag_data_ready_get()

int32_t lsm9ds1_xl_flag_data_ready_get ( const stmdev_ctx_t ctx,
uint8_t *  val 
)

Accelerometer new data available.

[get]

Parameters
ctxRead / write interface definitions.(ptr)
valIet the values of "xlda" in reg STATUS_REG.(ptr)
Return values
Interfacestatus (MANDATORY: return 0 -> no Error).

Definition at line 503 of file lsm9ds1_reg.c.

References lsm9ds1_read_reg(), LSM9DS1_STATUS_REG, and lsm9ds1_status_reg_t::xlda.

◆ lsm9ds1_xl_full_scale_get()

int32_t lsm9ds1_xl_full_scale_get ( const stmdev_ctx_t ctx,
lsm9ds1_xl_fs_t val 
)

Accelerometer full-scale selection.

[get]

Parameters
ctxRead / write interface definitions.(ptr)
valGet the values of fs_xl in reg CTRL_REG6_XL.(ptr)
Return values
Interfacestatus (MANDATORY: return 0 -> no Error).

Definition at line 760 of file lsm9ds1_reg.c.

References lsm9ds1_ctrl_reg6_xl_t::fs_xl, LSM9DS1_16g, LSM9DS1_2g, LSM9DS1_4g, LSM9DS1_8g, LSM9DS1_CTRL_REG6_XL, and lsm9ds1_read_reg().

◆ lsm9ds1_xl_full_scale_set()

int32_t lsm9ds1_xl_full_scale_set ( const stmdev_ctx_t ctx,
lsm9ds1_xl_fs_t  val 
)

Accelerometer full-scale selection.

[set]

Parameters
ctxRead / write interface definitions.(ptr)
valChange the values of "fs_xl" in reg LSM9DS1.
Return values
Interfacestatus (MANDATORY: return 0 -> no Error).

Definition at line 733 of file lsm9ds1_reg.c.

References lsm9ds1_ctrl_reg6_xl_t::fs_xl, LSM9DS1_CTRL_REG6_XL, lsm9ds1_read_reg(), and lsm9ds1_write_reg().