![]() |
Da Vinci Firmware 1
Firmware for the DaVinci-M rocket avionics board.
|
This file provides a set of functions needed to drive the lis2mdl enhanced inertial module. More...

Modules | |
| "Interfaces Functions" | |
| This section provide a set of functions used to read and write a generic register of the device. MANDATORY: return 0 -> no Error. | |
| "Sensitivity" | |
| These functions convert raw-data into engineering units. | |
| "Data Generation" | |
| This section group all the functions concerning data generation. | |
| "Common" | |
| This section group common useful functions. | |
| "Interrupts" | |
| This section group all the functions that manage interrupts. | |
| "Serial Interface" | |
| This section group all the functions concerning serial interface management. | |
| definitions | |
| sensors common types | |
| LSM9DS1_Infos | |
| LIS2MDL_Register_Union | |
| This union group all the registers having a bit-field description. This union is useful but it's not needed by the driver. | |
Data Structures | |
| struct | lis2mdl_cfg_reg_a_t |
| struct | lis2mdl_cfg_reg_b_t |
| struct | lis2mdl_cfg_reg_c_t |
| struct | lis2mdl_int_crtl_reg_t |
| struct | lis2mdl_int_source_reg_t |
| struct | lis2mdl_status_reg_t |
Macros | |
| #define | LIS2MDL_OFFSET_X_REG_L 0x45U |
| #define | LIS2MDL_OFFSET_X_REG_H 0x46U |
| #define | LIS2MDL_OFFSET_Y_REG_L 0x47U |
| #define | LIS2MDL_OFFSET_Y_REG_H 0x48U |
| #define | LIS2MDL_OFFSET_Z_REG_L 0x49U |
| #define | LIS2MDL_OFFSET_Z_REG_H 0x4AU |
| #define | LIS2MDL_WHO_AM_I 0x4FU |
| #define | LIS2MDL_CFG_REG_A 0x60U |
| #define | LIS2MDL_CFG_REG_B 0x61U |
| #define | LIS2MDL_CFG_REG_C 0x62U |
| #define | LIS2MDL_INT_CRTL_REG 0x63U |
| #define | LIS2MDL_INT_SOURCE_REG 0x64U |
| #define | LIS2MDL_INT_THS_L_REG 0x65U |
| #define | LIS2MDL_INT_THS_H_REG 0x66U |
| #define | LIS2MDL_STATUS_REG 0x67U |
| #define | LIS2MDL_OUTX_L_REG 0x68U |
| #define | LIS2MDL_OUTX_H_REG 0x69U |
| #define | LIS2MDL_OUTY_L_REG 0x6AU |
| #define | LIS2MDL_OUTY_H_REG 0x6BU |
| #define | LIS2MDL_OUTZ_L_REG 0x6CU |
| #define | LIS2MDL_OUTZ_H_REG 0x6DU |
| #define | LIS2MDL_TEMP_OUT_L_REG 0x6EU |
| #define | LIS2MDL_TEMP_OUT_H_REG 0x6FU |
| #define | __weak __attribute__((weak)) |
Enumerations | |
| enum | lis2mdl_md_t { LIS2MDL_CONTINUOUS_MODE = 0 , LIS2MDL_SINGLE_TRIGGER = 1 , LIS2MDL_POWER_DOWN = 2 } |
| enum | lis2mdl_odr_t { LIS2MDL_ODR_10Hz = 0 , LIS2MDL_ODR_20Hz = 1 , LIS2MDL_ODR_50Hz = 2 , LIS2MDL_ODR_100Hz = 3 } |
| enum | lis2mdl_lp_t { LIS2MDL_HIGH_RESOLUTION = 0 , LIS2MDL_LOW_POWER = 1 } |
| enum | lis2mdl_lpf_t { LIS2MDL_ODR_DIV_2 = 0 , LIS2MDL_ODR_DIV_4 = 1 } |
| enum | lis2mdl_set_rst_t { LIS2MDL_SET_SENS_ODR_DIV_63 = 0 , LIS2MDL_SENS_OFF_CANC_EVERY_ODR = 1 , LIS2MDL_SET_SENS_ONLY_AT_POWER_ON = 2 } |
| enum | lis2mdl_ble_t { LIS2MDL_LSB_AT_LOW_ADD = 0 , LIS2MDL_MSB_AT_LOW_ADD = 1 } |
| enum | lis2mdl_int_on_dataoff_t { LIS2MDL_CHECK_BEFORE = 0 , LIS2MDL_CHECK_AFTER = 1 } |
| enum | lis2mdl_sim_t { LIS2MDL_SPI_4_WIRE = 1 , LIS2MDL_SPI_3_WIRE = 0 } |
| enum | lis2mdl_i2c_dis_t { LIS2MDL_I2C_ENABLE = 0 , LIS2MDL_I2C_DISABLE = 1 } |
Functions | |
| int32_t | lis2mdl_read_reg (const stmdev_ctx_t *ctx, uint8_t reg, uint8_t *data, uint16_t len) |
| Read generic device register. | |
| int32_t | lis2mdl_write_reg (const stmdev_ctx_t *ctx, uint8_t reg, uint8_t *data, uint16_t len) |
| Write generic device register. | |
| float_t | lis2mdl_from_lsb_to_mgauss (int16_t lsb) |
| float_t | lis2mdl_from_lsb_to_celsius (int16_t lsb) |
| float_t | lis2mdl_from_lsb_to_nanotesla (int16_t lsb) |
| Converts raw magnetic data to nanotesla (nT). Sensitivity: 1 LSB = 1.5 mG = 150 nT. | |
| int32_t | lis2mdl_mag_user_offset_set (const stmdev_ctx_t *ctx, int16_t *val) |
| These registers comprise a 3 group of 16-bit number and represent hard-iron offset in order to compensate environmental effects. Data format is the same of output data raw: two’s complement with 1LSb = 1.5mG. These values act on the magnetic output data value in order to delete the environmental offset.[set]. | |
| int32_t | lis2mdl_mag_user_offset_get (const stmdev_ctx_t *ctx, int16_t *val) |
| These registers comprise a 3 group of 16-bit number and represent hard-iron offset in order to compensate environmental effects. Data format is the same of output data raw: two’s complement with 1LSb = 1.5mG. These values act on the magnetic output data value in order to delete the environmental offset.[get]. | |
| int32_t | lis2mdl_operating_mode_set (const stmdev_ctx_t *ctx, lis2mdl_md_t val) |
| Operating mode selection.[set]. | |
| int32_t | lis2mdl_operating_mode_get (const stmdev_ctx_t *ctx, lis2mdl_md_t *val) |
| Operating mode selection.[get]. | |
| int32_t | lis2mdl_data_rate_set (const stmdev_ctx_t *ctx, lis2mdl_odr_t val) |
| Output data rate selection.[set]. | |
| int32_t | lis2mdl_data_rate_get (const stmdev_ctx_t *ctx, lis2mdl_odr_t *val) |
| Output data rate selection.[get]. | |
| int32_t | lis2mdl_power_mode_set (const stmdev_ctx_t *ctx, lis2mdl_lp_t val) |
| Enables high-resolution/low-power mode.[set]. | |
| int32_t | lis2mdl_power_mode_get (const stmdev_ctx_t *ctx, lis2mdl_lp_t *val) |
| Enables high-resolution/low-power mode.[get]. | |
| int32_t | lis2mdl_offset_temp_comp_set (const stmdev_ctx_t *ctx, uint8_t val) |
| Enables the magnetometer temperature compensation.[set]. | |
| int32_t | lis2mdl_offset_temp_comp_get (const stmdev_ctx_t *ctx, uint8_t *val) |
| Enables the magnetometer temperature compensation.[get]. | |
| int32_t | lis2mdl_low_pass_bandwidth_set (const stmdev_ctx_t *ctx, lis2mdl_lpf_t val) |
| Low-pass bandwidth selection.[set]. | |
| int32_t | lis2mdl_low_pass_bandwidth_get (const stmdev_ctx_t *ctx, lis2mdl_lpf_t *val) |
| Low-pass bandwidth selection.[get]. | |
| int32_t | lis2mdl_set_rst_mode_set (const stmdev_ctx_t *ctx, lis2mdl_set_rst_t val) |
| Reset mode.[set]. | |
| int32_t | lis2mdl_set_rst_mode_get (const stmdev_ctx_t *ctx, lis2mdl_set_rst_t *val) |
| Reset mode.[get]. | |
| int32_t | lis2mdl_set_rst_sensor_single_set (const stmdev_ctx_t *ctx, uint8_t val) |
| Enables offset cancellation in single measurement mode. The OFF_CANC bit must be set to 1 when enabling offset cancellation in single measurement mode this means a call function: set_rst_mode(SENS_OFF_CANC_EVERY_ODR) is need.[set]. | |
| int32_t | lis2mdl_set_rst_sensor_single_get (const stmdev_ctx_t *ctx, uint8_t *val) |
| Enables offset cancellation in single measurement mode. The OFF_CANC bit must be set to 1 when enabling offset cancellation in single measurement mode this means a call function: set_rst_mode(SENS_OFF_CANC_EVERY_ODR) is need.[get]. | |
| int32_t | lis2mdl_block_data_update_set (const stmdev_ctx_t *ctx, uint8_t val) |
| Blockdataupdate.[set]. | |
| int32_t | lis2mdl_block_data_update_get (const stmdev_ctx_t *ctx, uint8_t *val) |
| Blockdataupdate.[get]. | |
| int32_t | lis2mdl_mag_data_ready_get (const stmdev_ctx_t *ctx, uint8_t *val) |
| Magnetic set of data available.[get]. | |
| int32_t | lis2mdl_mag_data_ovr_get (const stmdev_ctx_t *ctx, uint8_t *val) |
| Magnetic set of data overrun.[get]. | |
| int32_t | lis2mdl_magnetic_raw_get (const stmdev_ctx_t *ctx, int16_t *val) |
| Magnetic output value.[get]. | |
| int32_t | lis2mdl_temperature_raw_get (const stmdev_ctx_t *ctx, int16_t *val) |
| Temperature output value.[get]. | |
| int32_t | lis2mdl_device_id_get (const stmdev_ctx_t *ctx, uint8_t *buff) |
| DeviceWhoamI.[get]. | |
| int32_t | lis2mdl_reset_set (const stmdev_ctx_t *ctx, uint8_t val) |
| Software reset. Restore the default values in user registers.[set]. | |
| int32_t | lis2mdl_reset_get (const stmdev_ctx_t *ctx, uint8_t *val) |
| Software reset. Restore the default values in user registers.[get]. | |
| int32_t | lis2mdl_boot_set (const stmdev_ctx_t *ctx, uint8_t val) |
| Reboot memory content. Reload the calibration parameters.[set]. | |
| int32_t | lis2mdl_boot_get (const stmdev_ctx_t *ctx, uint8_t *val) |
| Reboot memory content. Reload the calibration parameters.[get]. | |
| int32_t | lis2mdl_self_test_set (const stmdev_ctx_t *ctx, uint8_t val) |
| Selftest.[set]. | |
| int32_t | lis2mdl_self_test_get (const stmdev_ctx_t *ctx, uint8_t *val) |
| Selftest.[get]. | |
| int32_t | lis2mdl_data_format_set (const stmdev_ctx_t *ctx, lis2mdl_ble_t val) |
| Big/Little Endian data selection.[set]. | |
| int32_t | lis2mdl_data_format_get (const stmdev_ctx_t *ctx, lis2mdl_ble_t *val) |
| Big/Little Endian data selection.[get]. | |
| int32_t | lis2mdl_status_get (const stmdev_ctx_t *ctx, lis2mdl_status_reg_t *val) |
| Info about device status.[get]. | |
| int32_t | lis2mdl_offset_int_conf_set (const stmdev_ctx_t *ctx, lis2mdl_int_on_dataoff_t val) |
| The interrupt block recognition checks data after/before the hard-iron correction to discover the interrupt.[set]. | |
| int32_t | lis2mdl_offset_int_conf_get (const stmdev_ctx_t *ctx, lis2mdl_int_on_dataoff_t *val) |
| The interrupt block recognition checks data after/before the hard-iron correction to discover the interrupt.[get]. | |
| int32_t | lis2mdl_drdy_on_pin_set (const stmdev_ctx_t *ctx, uint8_t val) |
| Data-ready signal on INT_DRDY pin.[set]. | |
| int32_t | lis2mdl_drdy_on_pin_get (const stmdev_ctx_t *ctx, uint8_t *val) |
| Data-ready signal on INT_DRDY pin.[get]. | |
| int32_t | lis2mdl_int_on_pin_set (const stmdev_ctx_t *ctx, uint8_t val) |
| Interrupt signal on INT_DRDY pin.[set]. | |
| int32_t | lis2mdl_int_on_pin_get (const stmdev_ctx_t *ctx, uint8_t *val) |
| Interrupt signal on INT_DRDY pin.[get]. | |
| int32_t | lis2mdl_int_gen_conf_set (const stmdev_ctx_t *ctx, lis2mdl_int_crtl_reg_t *val) |
| Interrupt generator configuration register.[set]. | |
| int32_t | lis2mdl_int_gen_conf_get (const stmdev_ctx_t *ctx, lis2mdl_int_crtl_reg_t *val) |
| Interrupt generator configuration register.[get]. | |
| int32_t | lis2mdl_int_gen_source_get (const stmdev_ctx_t *ctx, lis2mdl_int_source_reg_t *val) |
| Interrupt generator source register.[get]. | |
| int32_t | lis2mdl_int_gen_threshold_set (const stmdev_ctx_t *ctx, uint16_t val) |
| User-defined threshold value for xl interrupt event on generator. Data format is the same of output data raw: two’s complement with 1LSb = 1.5mG.[set]. | |
| int32_t | lis2mdl_int_gen_threshold_get (const stmdev_ctx_t *ctx, uint16_t *val) |
| User-defined threshold value for xl interrupt event on generator. Data format is the same of output data raw: two’s complement with 1LSb = 1.5mG.[get]. | |
| int32_t | lis2mdl_spi_mode_set (const stmdev_ctx_t *ctx, lis2mdl_sim_t val) |
| SPI Serial Interface Mode selection.[set]. | |
| int32_t | lis2mdl_spi_mode_get (const stmdev_ctx_t *ctx, lis2mdl_sim_t *val) |
| SPI Serial Interface Mode selection.[get]. | |
| int32_t | lis2mdl_i2c_interface_set (const stmdev_ctx_t *ctx, lis2mdl_i2c_dis_t val) |
| Enable/Disable I2C interface.[set]. | |
| int32_t | lis2mdl_i2c_interface_get (const stmdev_ctx_t *ctx, lis2mdl_i2c_dis_t *val) |
| Enable/Disable I2C interface.[get]. | |
| int32_t | lis2mdl_init (stmdev_ctx_t *ctx) |
| Initialize the LIS2MDL sensor. | |
| int32_t | lis2mdl_init_2 (stmdev_ctx_t *ctx) |
This file provides a set of functions needed to drive the lis2mdl enhanced inertial module.
| #define __weak __attribute__((weak)) |
Definition at line 362 of file lis2mdl_reg.h.
| #define LIS2MDL_CFG_REG_A 0x60U |
Definition at line 189 of file lis2mdl_reg.h.
| #define LIS2MDL_CFG_REG_B 0x61U |
Definition at line 209 of file lis2mdl_reg.h.
| #define LIS2MDL_CFG_REG_C 0x62U |
Definition at line 227 of file lis2mdl_reg.h.
| #define LIS2MDL_INT_CRTL_REG 0x63U |
Definition at line 251 of file lis2mdl_reg.h.
| #define LIS2MDL_INT_SOURCE_REG 0x64U |
Definition at line 273 of file lis2mdl_reg.h.
| #define LIS2MDL_INT_THS_H_REG 0x66U |
Definition at line 298 of file lis2mdl_reg.h.
| #define LIS2MDL_INT_THS_L_REG 0x65U |
Definition at line 297 of file lis2mdl_reg.h.
| #define LIS2MDL_OFFSET_X_REG_H 0x46U |
Definition at line 183 of file lis2mdl_reg.h.
| #define LIS2MDL_OFFSET_X_REG_L 0x45U |
Definition at line 182 of file lis2mdl_reg.h.
| #define LIS2MDL_OFFSET_Y_REG_H 0x48U |
Definition at line 185 of file lis2mdl_reg.h.
| #define LIS2MDL_OFFSET_Y_REG_L 0x47U |
Definition at line 184 of file lis2mdl_reg.h.
| #define LIS2MDL_OFFSET_Z_REG_H 0x4AU |
Definition at line 187 of file lis2mdl_reg.h.
| #define LIS2MDL_OFFSET_Z_REG_L 0x49U |
Definition at line 186 of file lis2mdl_reg.h.
| #define LIS2MDL_OUTX_H_REG 0x69U |
Definition at line 324 of file lis2mdl_reg.h.
| #define LIS2MDL_OUTX_L_REG 0x68U |
Definition at line 323 of file lis2mdl_reg.h.
| #define LIS2MDL_OUTY_H_REG 0x6BU |
Definition at line 326 of file lis2mdl_reg.h.
| #define LIS2MDL_OUTY_L_REG 0x6AU |
Definition at line 325 of file lis2mdl_reg.h.
| #define LIS2MDL_OUTZ_H_REG 0x6DU |
Definition at line 328 of file lis2mdl_reg.h.
| #define LIS2MDL_OUTZ_L_REG 0x6CU |
Definition at line 327 of file lis2mdl_reg.h.
| #define LIS2MDL_STATUS_REG 0x67U |
Definition at line 299 of file lis2mdl_reg.h.
| #define LIS2MDL_TEMP_OUT_H_REG 0x6FU |
Definition at line 330 of file lis2mdl_reg.h.
| #define LIS2MDL_TEMP_OUT_L_REG 0x6EU |
Definition at line 329 of file lis2mdl_reg.h.
| #define LIS2MDL_WHO_AM_I 0x4FU |
Definition at line 188 of file lis2mdl_reg.h.
| enum lis2mdl_ble_t |
| Enumerator | |
|---|---|
| LIS2MDL_LSB_AT_LOW_ADD | |
| LIS2MDL_MSB_AT_LOW_ADD | |
Definition at line 471 of file lis2mdl_reg.h.
| enum lis2mdl_i2c_dis_t |
| Enumerator | |
|---|---|
| LIS2MDL_I2C_ENABLE | |
| LIS2MDL_I2C_DISABLE | |
Definition at line 519 of file lis2mdl_reg.h.
| Enumerator | |
|---|---|
| LIS2MDL_CHECK_BEFORE | |
| LIS2MDL_CHECK_AFTER | |
Definition at line 483 of file lis2mdl_reg.h.
| enum lis2mdl_lp_t |
| Enumerator | |
|---|---|
| LIS2MDL_HIGH_RESOLUTION | |
| LIS2MDL_LOW_POWER | |
Definition at line 411 of file lis2mdl_reg.h.
| enum lis2mdl_lpf_t |
| Enumerator | |
|---|---|
| LIS2MDL_ODR_DIV_2 | |
| LIS2MDL_ODR_DIV_4 | |
Definition at line 422 of file lis2mdl_reg.h.
| enum lis2mdl_md_t |
| Enumerator | |
|---|---|
| LIS2MDL_CONTINUOUS_MODE | |
| LIS2MDL_SINGLE_TRIGGER | |
| LIS2MDL_POWER_DOWN | |
Definition at line 390 of file lis2mdl_reg.h.
| enum lis2mdl_odr_t |
| Enumerator | |
|---|---|
| LIS2MDL_ODR_10Hz | |
| LIS2MDL_ODR_20Hz | |
| LIS2MDL_ODR_50Hz | |
| LIS2MDL_ODR_100Hz | |
Definition at line 401 of file lis2mdl_reg.h.
| enum lis2mdl_set_rst_t |
| Enumerator | |
|---|---|
| LIS2MDL_SET_SENS_ODR_DIV_63 | |
| LIS2MDL_SENS_OFF_CANC_EVERY_ODR | |
| LIS2MDL_SET_SENS_ONLY_AT_POWER_ON | |
Definition at line 432 of file lis2mdl_reg.h.
| enum lis2mdl_sim_t |
| Enumerator | |
|---|---|
| LIS2MDL_SPI_4_WIRE | |
| LIS2MDL_SPI_3_WIRE | |
Definition at line 511 of file lis2mdl_reg.h.
| int32_t lis2mdl_block_data_update_get | ( | const stmdev_ctx_t * | ctx, |
| uint8_t * | val | ||
| ) |
Blockdataupdate.[get].
| ctx | read / write interface definitions.(ptr) |
| val | change the values of bdu in reg CFG_REG_C.(ptr) |
| interface | status.(MANDATORY: return 0 -> no Error) |
Definition at line 646 of file lis2mdl_reg.c.
References lis2mdl_cfg_reg_c_t::bdu, LIS2MDL_CFG_REG_C, and lis2mdl_read_reg().

| int32_t lis2mdl_block_data_update_set | ( | const stmdev_ctx_t * | ctx, |
| uint8_t | val | ||
| ) |
Blockdataupdate.[set].
| ctx | read / write interface definitions.(ptr) |
| val | change the values of bdu in reg CFG_REG_C |
| interface | status.(MANDATORY: return 0 -> no Error) |
Definition at line 622 of file lis2mdl_reg.c.
References lis2mdl_cfg_reg_c_t::bdu, LIS2MDL_CFG_REG_C, lis2mdl_read_reg(), and lis2mdl_write_reg().

| int32_t lis2mdl_boot_get | ( | const stmdev_ctx_t * | ctx, |
| uint8_t * | val | ||
| ) |
Reboot memory content. Reload the calibration parameters.[get].
| ctx | read / write interface definitions.(ptr) |
| val | change the values of reboot in reg CFG_REG_A.(ptr) |
| interface | status.(MANDATORY: return 0 -> no Error) |
Definition at line 843 of file lis2mdl_reg.c.
References LIS2MDL_CFG_REG_A, lis2mdl_read_reg(), and lis2mdl_cfg_reg_a_t::reboot.
Referenced by lis2mdl_init(), and lis2mdl_init_2().


| int32_t lis2mdl_boot_set | ( | const stmdev_ctx_t * | ctx, |
| uint8_t | val | ||
| ) |
Reboot memory content. Reload the calibration parameters.[set].
| ctx | read / write interface definitions.(ptr) |
| val | change the values of reboot in reg CFG_REG_A |
| interface | status.(MANDATORY: return 0 -> no Error) |
Definition at line 819 of file lis2mdl_reg.c.
References LIS2MDL_CFG_REG_A, lis2mdl_read_reg(), lis2mdl_write_reg(), and lis2mdl_cfg_reg_a_t::reboot.
Referenced by lis2mdl_init(), and lis2mdl_init_2().


| int32_t lis2mdl_data_format_get | ( | const stmdev_ctx_t * | ctx, |
| lis2mdl_ble_t * | val | ||
| ) |
Big/Little Endian data selection.[get].
| ctx | read / write interface definitions.(ptr) |
| val | Get the values of ble in reg CFG_REG_C.(ptr) |
| interface | status.(MANDATORY: return 0 -> no Error) |
Definition at line 929 of file lis2mdl_reg.c.
References lis2mdl_cfg_reg_c_t::ble, LIS2MDL_CFG_REG_C, LIS2MDL_LSB_AT_LOW_ADD, LIS2MDL_MSB_AT_LOW_ADD, and lis2mdl_read_reg().

| int32_t lis2mdl_data_format_set | ( | const stmdev_ctx_t * | ctx, |
| lis2mdl_ble_t | val | ||
| ) |
Big/Little Endian data selection.[set].
| ctx | read / write interface definitions.(ptr) |
| val | change the values of ble in reg CFG_REG_C |
| interface | status.(MANDATORY: return 0 -> no Error) |
Definition at line 905 of file lis2mdl_reg.c.
References lis2mdl_cfg_reg_c_t::ble, LIS2MDL_CFG_REG_C, lis2mdl_read_reg(), and lis2mdl_write_reg().

| int32_t lis2mdl_data_rate_get | ( | const stmdev_ctx_t * | ctx, |
| lis2mdl_odr_t * | val | ||
| ) |
Output data rate selection.[get].
| ctx | read / write interface definitions.(ptr) |
| val | Get the values of odr in reg CFG_REG_A.(ptr) |
| interface | status.(MANDATORY: return 0 -> no Error) |
Definition at line 306 of file lis2mdl_reg.c.
References LIS2MDL_CFG_REG_A, LIS2MDL_ODR_100Hz, LIS2MDL_ODR_10Hz, LIS2MDL_ODR_20Hz, LIS2MDL_ODR_50Hz, lis2mdl_read_reg(), and lis2mdl_cfg_reg_a_t::odr.

| int32_t lis2mdl_data_rate_set | ( | const stmdev_ctx_t * | ctx, |
| lis2mdl_odr_t | val | ||
| ) |
Output data rate selection.[set].
| ctx | read / write interface definitions.(ptr) |
| val | change the values of odr in reg CFG_REG_A |
| interface | status.(MANDATORY: return 0 -> no Error) |
Definition at line 282 of file lis2mdl_reg.c.
References LIS2MDL_CFG_REG_A, lis2mdl_read_reg(), lis2mdl_write_reg(), and lis2mdl_cfg_reg_a_t::odr.

| int32_t lis2mdl_device_id_get | ( | const stmdev_ctx_t * | ctx, |
| uint8_t * | buff | ||
| ) |
DeviceWhoamI.[get].
| ctx | read / write interface definitions.(ptr) |
| buff | that stores data read |
| interface | status.(MANDATORY: return 0 -> no Error) |
Definition at line 759 of file lis2mdl_reg.c.
References lis2mdl_read_reg(), and LIS2MDL_WHO_AM_I.
Referenced by lis2mdl_init(), and lis2mdl_init_2().


| int32_t lis2mdl_drdy_on_pin_get | ( | const stmdev_ctx_t * | ctx, |
| uint8_t * | val | ||
| ) |
Data-ready signal on INT_DRDY pin.[get].
| ctx | read / write interface definitions.(ptr) |
| val | change the values of drdy_on_pin in reg CFG_REG_C.(ptr) |
| interface | status.(MANDATORY: return 0 -> no Error) |
Definition at line 1077 of file lis2mdl_reg.c.
References lis2mdl_cfg_reg_c_t::drdy_on_pin, LIS2MDL_CFG_REG_C, and lis2mdl_read_reg().

| int32_t lis2mdl_drdy_on_pin_set | ( | const stmdev_ctx_t * | ctx, |
| uint8_t | val | ||
| ) |
Data-ready signal on INT_DRDY pin.[set].
| ctx | read / write interface definitions.(ptr) |
| val | change the values of drdy_on_pin in reg CFG_REG_C |
| interface | status.(MANDATORY: return 0 -> no Error) |
Definition at line 1053 of file lis2mdl_reg.c.
References lis2mdl_cfg_reg_c_t::drdy_on_pin, LIS2MDL_CFG_REG_C, lis2mdl_read_reg(), and lis2mdl_write_reg().

| float_t lis2mdl_from_lsb_to_celsius | ( | int16_t | lsb | ) |
Definition at line 124 of file lis2mdl_reg.c.
| float_t lis2mdl_from_lsb_to_mgauss | ( | int16_t | lsb | ) |
Definition at line 119 of file lis2mdl_reg.c.
| float_t lis2mdl_from_lsb_to_nanotesla | ( | int16_t | lsb | ) |
Converts raw magnetic data to nanotesla (nT). Sensitivity: 1 LSB = 1.5 mG = 150 nT.
| lsb | raw data from sensor output register (16-bit) |
| magnetic | field in nanotesla |
Definition at line 137 of file lis2mdl_reg.c.
| int32_t lis2mdl_i2c_interface_get | ( | const stmdev_ctx_t * | ctx, |
| lis2mdl_i2c_dis_t * | val | ||
| ) |
Enable/Disable I2C interface.[get].
| ctx | read / write interface definitions.(ptr) |
| val | Get the values of i2c_dis in reg CFG_REG_C.(ptr) |
| interface | status.(MANDATORY: return 0 -> no Error) |
Definition at line 1332 of file lis2mdl_reg.c.
References lis2mdl_cfg_reg_c_t::i2c_dis, LIS2MDL_CFG_REG_C, LIS2MDL_I2C_DISABLE, LIS2MDL_I2C_ENABLE, and lis2mdl_read_reg().

| int32_t lis2mdl_i2c_interface_set | ( | const stmdev_ctx_t * | ctx, |
| lis2mdl_i2c_dis_t | val | ||
| ) |
Enable/Disable I2C interface.[set].
| ctx | read / write interface definitions.(ptr) |
| val | change the values of i2c_dis in reg CFG_REG_C |
| interface | status.(MANDATORY: return 0 -> no Error) |
Definition at line 1307 of file lis2mdl_reg.c.
References lis2mdl_cfg_reg_c_t::i2c_dis, LIS2MDL_CFG_REG_C, lis2mdl_read_reg(), and lis2mdl_write_reg().

| int32_t lis2mdl_init | ( | stmdev_ctx_t * | ctx | ) |
Initialize the LIS2MDL sensor.
| ctx | Sensor context with SPI handle and platform functions |
| 0 | if OK, -1 if error or WHO_AM_I mismatch |
Definition at line 1461 of file lis2mdl_reg.c.
References lis2mdl_cfg_reg_c_t::bdu, lis2mdl_cfg_reg_c_t::ble, lis2mdl_cfg_reg_a_t::comp_temp_en, lis2mdl_cfg_reg_c_t::drdy_on_pin, stmdev_ctx_t::handle, hspi2, lis2mdl_cfg_reg_c_t::i2c_dis, lis2mdl_cfg_reg_c_t::int_on_pin, lis2mdl_boot_get(), lis2mdl_boot_set(), LIS2MDL_CFG_REG_A, LIS2MDL_CFG_REG_C, LIS2MDL_CONTINUOUS_MODE, lis2mdl_device_id_get(), LIS2MDL_HIGH_RESOLUTION, LIS2MDL_ID, LIS2MDL_LSB_AT_LOW_ADD, LIS2MDL_ODR_10Hz, lis2mdl_read_reg(), lis2mdl_reset_get(), lis2mdl_reset_set(), LIS2MDL_SPI_4_WIRE, lis2mdl_spi_mode_set(), lis2mdl_write_reg(), lis2mdl_cfg_reg_a_t::lp, lis2mdl_cfg_reg_a_t::md, NULL, lis2mdl_cfg_reg_a_t::odr, platform_delay, platform_spi_read(), platform_spi_write(), stmdev_ctx_t::read_reg, lis2mdl_cfg_reg_a_t::reboot, lis2mdl_cfg_reg_c_t::self_test, lis2mdl_cfg_reg_a_t::soft_rst, and stmdev_ctx_t::write_reg.

| int32_t lis2mdl_init_2 | ( | stmdev_ctx_t * | ctx | ) |
Definition at line 1556 of file lis2mdl_reg.c.
References lis2mdl_cfg_reg_c_t::bdu, lis2mdl_cfg_reg_c_t::ble, lis2mdl_cfg_reg_a_t::comp_temp_en, lis2mdl_cfg_reg_c_t::drdy_on_pin, stmdev_ctx_t::handle, hspi3, lis2mdl_cfg_reg_c_t::i2c_dis, lis2mdl_cfg_reg_c_t::int_on_pin, lis2mdl_boot_get(), lis2mdl_boot_set(), LIS2MDL_CFG_REG_A, LIS2MDL_CFG_REG_C, LIS2MDL_CONTINUOUS_MODE, lis2mdl_device_id_get(), LIS2MDL_HIGH_RESOLUTION, LIS2MDL_ID, LIS2MDL_LSB_AT_LOW_ADD, LIS2MDL_ODR_10Hz, lis2mdl_read_reg(), lis2mdl_reset_get(), lis2mdl_reset_set(), LIS2MDL_SPI_4_WIRE, lis2mdl_spi_mode_set(), lis2mdl_write_reg(), lis2mdl_cfg_reg_a_t::lp, lis2mdl_cfg_reg_a_t::md, NULL, lis2mdl_cfg_reg_a_t::odr, platform_delay, platform_spi_read(), platform_spi_write(), stmdev_ctx_t::read_reg, lis2mdl_cfg_reg_a_t::reboot, lis2mdl_cfg_reg_c_t::self_test, lis2mdl_cfg_reg_a_t::soft_rst, and stmdev_ctx_t::write_reg.

| int32_t lis2mdl_int_gen_conf_get | ( | const stmdev_ctx_t * | ctx, |
| lis2mdl_int_crtl_reg_t * | val | ||
| ) |
Interrupt generator configuration register.[get].
| ctx | read / write interface definitions.(ptr) |
| val | registers INT_CRTL_REG.(ptr) |
| interface | status.(MANDATORY: return 0 -> no Error) |
Definition at line 1157 of file lis2mdl_reg.c.
References LIS2MDL_INT_CRTL_REG, and lis2mdl_read_reg().

| int32_t lis2mdl_int_gen_conf_set | ( | const stmdev_ctx_t * | ctx, |
| lis2mdl_int_crtl_reg_t * | val | ||
| ) |
Interrupt generator configuration register.[set].
| ctx | read / write interface definitions.(ptr) |
| val | registers INT_CRTL_REG.(ptr) |
| interface | status.(MANDATORY: return 0 -> no Error) |
Definition at line 1139 of file lis2mdl_reg.c.
References LIS2MDL_INT_CRTL_REG, and lis2mdl_write_reg().

| int32_t lis2mdl_int_gen_source_get | ( | const stmdev_ctx_t * | ctx, |
| lis2mdl_int_source_reg_t * | val | ||
| ) |
Interrupt generator source register.[get].
| ctx | read / write interface definitions.(ptr) |
| val | registers INT_SOURCE_REG.(ptr) |
| interface | status.(MANDATORY: return 0 -> no Error) |
Definition at line 1175 of file lis2mdl_reg.c.
References LIS2MDL_INT_SOURCE_REG, and lis2mdl_read_reg().

| int32_t lis2mdl_int_gen_threshold_get | ( | const stmdev_ctx_t * | ctx, |
| uint16_t * | val | ||
| ) |
User-defined threshold value for xl interrupt event on generator. Data format is the same of output data raw: two’s complement with 1LSb = 1.5mG.[get].
| ctx | read / write interface definitions.(ptr) |
| buff | that stores data read |
| interface | status.(MANDATORY: return 0 -> no Error) |
Definition at line 1217 of file lis2mdl_reg.c.
References LIS2MDL_INT_THS_L_REG, and lis2mdl_read_reg().

| int32_t lis2mdl_int_gen_threshold_set | ( | const stmdev_ctx_t * | ctx, |
| uint16_t | val | ||
| ) |
User-defined threshold value for xl interrupt event on generator. Data format is the same of output data raw: two’s complement with 1LSb = 1.5mG.[set].
| ctx | read / write interface definitions.(ptr) |
| buff | that contains data to write |
| interface | status.(MANDATORY: return 0 -> no Error) |
Definition at line 1195 of file lis2mdl_reg.c.
References LIS2MDL_INT_THS_L_REG, and lis2mdl_write_reg().

| int32_t lis2mdl_int_on_pin_get | ( | const stmdev_ctx_t * | ctx, |
| uint8_t * | val | ||
| ) |
Interrupt signal on INT_DRDY pin.[get].
| ctx | read / write interface definitions.(ptr) |
| val | change the values of int_on_pin in reg CFG_REG_C.(ptr) |
| interface | status.(MANDATORY: return 0 -> no Error) |
Definition at line 1120 of file lis2mdl_reg.c.
References lis2mdl_cfg_reg_c_t::int_on_pin, LIS2MDL_CFG_REG_C, and lis2mdl_read_reg().

| int32_t lis2mdl_int_on_pin_set | ( | const stmdev_ctx_t * | ctx, |
| uint8_t | val | ||
| ) |
Interrupt signal on INT_DRDY pin.[set].
| ctx | read / write interface definitions.(ptr) |
| val | change the values of int_on_pin in reg CFG_REG_C |
| interface | status.(MANDATORY: return 0 -> no Error) |
Definition at line 1096 of file lis2mdl_reg.c.
References lis2mdl_cfg_reg_c_t::int_on_pin, LIS2MDL_CFG_REG_C, lis2mdl_read_reg(), and lis2mdl_write_reg().

| int32_t lis2mdl_low_pass_bandwidth_get | ( | const stmdev_ctx_t * | ctx, |
| lis2mdl_lpf_t * | val | ||
| ) |
Low-pass bandwidth selection.[get].
| ctx | read / write interface definitions.(ptr) |
| val | Get the values of lpf in reg CFG_REG_B.(ptr) |
| interface | status.(MANDATORY: return 0 -> no Error) |
Definition at line 472 of file lis2mdl_reg.c.
References LIS2MDL_CFG_REG_B, LIS2MDL_ODR_DIV_2, LIS2MDL_ODR_DIV_4, lis2mdl_read_reg(), and lis2mdl_cfg_reg_b_t::lpf.

| int32_t lis2mdl_low_pass_bandwidth_set | ( | const stmdev_ctx_t * | ctx, |
| lis2mdl_lpf_t | val | ||
| ) |
Low-pass bandwidth selection.[set].
| ctx | read / write interface definitions.(ptr) |
| val | change the values of lpf in reg CFG_REG_B |
| interface | status.(MANDATORY: return 0 -> no Error) |
Definition at line 447 of file lis2mdl_reg.c.
References LIS2MDL_CFG_REG_B, lis2mdl_read_reg(), lis2mdl_write_reg(), and lis2mdl_cfg_reg_b_t::lpf.

| int32_t lis2mdl_mag_data_ovr_get | ( | const stmdev_ctx_t * | ctx, |
| uint8_t * | val | ||
| ) |
Magnetic set of data overrun.[get].
| ctx | read / write interface definitions.(ptr) |
| val | change the values of zyxor in reg STATUS_REG.(ptr) |
| interface | status.(MANDATORY: return 0 -> no Error) |
Definition at line 684 of file lis2mdl_reg.c.
References lis2mdl_read_reg(), LIS2MDL_STATUS_REG, and lis2mdl_status_reg_t::zyxor.

| int32_t lis2mdl_mag_data_ready_get | ( | const stmdev_ctx_t * | ctx, |
| uint8_t * | val | ||
| ) |
Magnetic set of data available.[get].
| ctx | read / write interface definitions.(ptr) |
| val | change the values of zyxda in reg STATUS_REG.(ptr) |
| interface | status.(MANDATORY: return 0 -> no Error) |
Definition at line 665 of file lis2mdl_reg.c.
References lis2mdl_read_reg(), LIS2MDL_STATUS_REG, and lis2mdl_status_reg_t::zyxda.

| int32_t lis2mdl_mag_user_offset_get | ( | const stmdev_ctx_t * | ctx, |
| int16_t * | val | ||
| ) |
These registers comprise a 3 group of 16-bit number and represent hard-iron offset in order to compensate environmental effects. Data format is the same of output data raw: two’s complement with 1LSb = 1.5mG. These values act on the magnetic output data value in order to delete the environmental offset.[get].
| ctx | read / write interface definitions.(ptr) |
| buff | that stores data read |
| interface | status.(MANDATORY: return 0 -> no Error) |
Definition at line 195 of file lis2mdl_reg.c.
References LIS2MDL_OFFSET_X_REG_L, and lis2mdl_read_reg().

| int32_t lis2mdl_mag_user_offset_set | ( | const stmdev_ctx_t * | ctx, |
| int16_t * | val | ||
| ) |
These registers comprise a 3 group of 16-bit number and represent hard-iron offset in order to compensate environmental effects. Data format is the same of output data raw: two’s complement with 1LSb = 1.5mG. These values act on the magnetic output data value in order to delete the environmental offset.[set].
| ctx | read / write interface definitions.(ptr) |
| buff | buffer that contains data to write |
| interface | status.(MANDATORY: return 0 -> no Error) |
Definition at line 167 of file lis2mdl_reg.c.
References LIS2MDL_OFFSET_X_REG_L, and lis2mdl_write_reg().

| int32_t lis2mdl_magnetic_raw_get | ( | const stmdev_ctx_t * | ctx, |
| int16_t * | val | ||
| ) |
Magnetic output value.[get].
| ctx | read / write interface definitions.(ptr) |
| buff | that stores data read |
| interface | status.(MANDATORY: return 0 -> no Error) |
Definition at line 703 of file lis2mdl_reg.c.
References LIS2MDL_OUTX_L_REG, and lis2mdl_read_reg().

| int32_t lis2mdl_offset_int_conf_get | ( | const stmdev_ctx_t * | ctx, |
| lis2mdl_int_on_dataoff_t * | val | ||
| ) |
The interrupt block recognition checks data after/before the hard-iron correction to discover the interrupt.[get].
| ctx | read / write interface definitions.(ptr) |
| val | Get the values of int_on_dataoff in reg CFG_REG_B.(ptr) |
| interface | status.(MANDATORY: return 0 -> no Error) |
Definition at line 1019 of file lis2mdl_reg.c.
References lis2mdl_cfg_reg_b_t::int_on_dataoff, LIS2MDL_CFG_REG_B, LIS2MDL_CHECK_AFTER, LIS2MDL_CHECK_BEFORE, and lis2mdl_read_reg().

| int32_t lis2mdl_offset_int_conf_set | ( | const stmdev_ctx_t * | ctx, |
| lis2mdl_int_on_dataoff_t | val | ||
| ) |
The interrupt block recognition checks data after/before the hard-iron correction to discover the interrupt.[set].
| ctx | read / write interface definitions.(ptr) |
| val | change the values of int_on_dataoff in reg CFG_REG_B |
| interface | status.(MANDATORY: return 0 -> no Error) |
Definition at line 993 of file lis2mdl_reg.c.
References lis2mdl_cfg_reg_b_t::int_on_dataoff, LIS2MDL_CFG_REG_B, lis2mdl_read_reg(), and lis2mdl_write_reg().

| int32_t lis2mdl_offset_temp_comp_get | ( | const stmdev_ctx_t * | ctx, |
| uint8_t * | val | ||
| ) |
Enables the magnetometer temperature compensation.[get].
| ctx | read / write interface definitions.(ptr) |
| val | change the values of comp_temp_en in reg CFG_REG_A.(ptr) |
| interface | status.(MANDATORY: return 0 -> no Error) |
Definition at line 428 of file lis2mdl_reg.c.
References lis2mdl_cfg_reg_a_t::comp_temp_en, LIS2MDL_CFG_REG_A, and lis2mdl_read_reg().

| int32_t lis2mdl_offset_temp_comp_set | ( | const stmdev_ctx_t * | ctx, |
| uint8_t | val | ||
| ) |
Enables the magnetometer temperature compensation.[set].
| ctx | read / write interface definitions.(ptr) |
| val | change the values of comp_temp_en in reg CFG_REG_A |
| interface | status.(MANDATORY: return 0 -> no Error) |
Definition at line 404 of file lis2mdl_reg.c.
References lis2mdl_cfg_reg_a_t::comp_temp_en, LIS2MDL_CFG_REG_A, lis2mdl_read_reg(), and lis2mdl_write_reg().

| int32_t lis2mdl_operating_mode_get | ( | const stmdev_ctx_t * | ctx, |
| lis2mdl_md_t * | val | ||
| ) |
Operating mode selection.[get].
| ctx | read / write interface definitions.(ptr) |
| val | Get the values of md in reg CFG_REG_A.(ptr) |
| interface | status.(MANDATORY: return 0 -> no Error) |
Definition at line 244 of file lis2mdl_reg.c.
References LIS2MDL_CFG_REG_A, LIS2MDL_CONTINUOUS_MODE, LIS2MDL_POWER_DOWN, lis2mdl_read_reg(), LIS2MDL_SINGLE_TRIGGER, and lis2mdl_cfg_reg_a_t::md.

| int32_t lis2mdl_operating_mode_set | ( | const stmdev_ctx_t * | ctx, |
| lis2mdl_md_t | val | ||
| ) |
Operating mode selection.[set].
| ctx | read / write interface definitions.(ptr) |
| val | change the values of md in reg CFG_REG_A |
| interface | status.(MANDATORY: return 0 -> no Error) |
Definition at line 219 of file lis2mdl_reg.c.
References LIS2MDL_CFG_REG_A, lis2mdl_read_reg(), lis2mdl_write_reg(), and lis2mdl_cfg_reg_a_t::md.

| int32_t lis2mdl_power_mode_get | ( | const stmdev_ctx_t * | ctx, |
| lis2mdl_lp_t * | val | ||
| ) |
Enables high-resolution/low-power mode.[get].
| ctx | read / write interface definitions.(ptr) |
| val | Get the values of lp in reg CFG_REG_A.(ptr) |
| interface | status.(MANDATORY: return 0 -> no Error) |
Definition at line 371 of file lis2mdl_reg.c.
References LIS2MDL_CFG_REG_A, LIS2MDL_HIGH_RESOLUTION, LIS2MDL_LOW_POWER, lis2mdl_read_reg(), and lis2mdl_cfg_reg_a_t::lp.

| int32_t lis2mdl_power_mode_set | ( | const stmdev_ctx_t * | ctx, |
| lis2mdl_lp_t | val | ||
| ) |
Enables high-resolution/low-power mode.[set].
| ctx | read / write interface definitions.(ptr) |
| val | change the values of lp in reg CFG_REG_A |
| interface | status.(MANDATORY: return 0 -> no Error) |
Definition at line 347 of file lis2mdl_reg.c.
References LIS2MDL_CFG_REG_A, lis2mdl_read_reg(), lis2mdl_write_reg(), and lis2mdl_cfg_reg_a_t::lp.

| int32_t lis2mdl_read_reg | ( | const stmdev_ctx_t * | ctx, |
| uint8_t | reg, | ||
| uint8_t * | data, | ||
| uint16_t | len | ||
| ) |
Read generic device register.
| ctx | read / write interface definitions(ptr) |
| reg | register to read |
| data | pointer to buffer that store the data read(ptr) |
| len | number of consecutive register to read |
| interface | status (MANDATORY: return 0 -> no Error) |
Definition at line 66 of file lis2mdl_reg.c.
References stmdev_ctx_t::handle, NULL, and stmdev_ctx_t::read_reg.
Referenced by lis2mdl_block_data_update_get(), lis2mdl_block_data_update_set(), lis2mdl_boot_get(), lis2mdl_boot_set(), lis2mdl_data_format_get(), lis2mdl_data_format_set(), lis2mdl_data_rate_get(), lis2mdl_data_rate_set(), lis2mdl_device_id_get(), lis2mdl_drdy_on_pin_get(), lis2mdl_drdy_on_pin_set(), lis2mdl_i2c_interface_get(), lis2mdl_i2c_interface_set(), lis2mdl_init(), lis2mdl_init_2(), lis2mdl_int_gen_conf_get(), lis2mdl_int_gen_source_get(), lis2mdl_int_gen_threshold_get(), lis2mdl_int_on_pin_get(), lis2mdl_int_on_pin_set(), lis2mdl_low_pass_bandwidth_get(), lis2mdl_low_pass_bandwidth_set(), lis2mdl_mag_data_ovr_get(), lis2mdl_mag_data_ready_get(), lis2mdl_mag_user_offset_get(), lis2mdl_magnetic_raw_get(), lis2mdl_offset_int_conf_get(), lis2mdl_offset_int_conf_set(), lis2mdl_offset_temp_comp_get(), lis2mdl_offset_temp_comp_set(), lis2mdl_operating_mode_get(), lis2mdl_operating_mode_set(), lis2mdl_power_mode_get(), lis2mdl_power_mode_set(), lis2mdl_reset_get(), lis2mdl_reset_set(), lis2mdl_self_test_get(), lis2mdl_self_test_set(), lis2mdl_set_rst_mode_get(), lis2mdl_set_rst_mode_set(), lis2mdl_set_rst_sensor_single_get(), lis2mdl_set_rst_sensor_single_set(), lis2mdl_spi_mode_get(), lis2mdl_spi_mode_set(), lis2mdl_status_get(), and lis2mdl_temperature_raw_get().

| int32_t lis2mdl_reset_get | ( | const stmdev_ctx_t * | ctx, |
| uint8_t * | val | ||
| ) |
Software reset. Restore the default values in user registers.[get].
| ctx | read / write interface definitions.(ptr) |
| val | change the values of soft_rst in reg CFG_REG_A.(ptr) |
| interface | status.(MANDATORY: return 0 -> no Error) |
Definition at line 800 of file lis2mdl_reg.c.
References LIS2MDL_CFG_REG_A, lis2mdl_read_reg(), and lis2mdl_cfg_reg_a_t::soft_rst.
Referenced by lis2mdl_init(), and lis2mdl_init_2().


| int32_t lis2mdl_reset_set | ( | const stmdev_ctx_t * | ctx, |
| uint8_t | val | ||
| ) |
Software reset. Restore the default values in user registers.[set].
| ctx | read / write interface definitions.(ptr) |
| val | change the values of soft_rst in reg CFG_REG_A |
| interface | status.(MANDATORY: return 0 -> no Error) |
Definition at line 776 of file lis2mdl_reg.c.
References LIS2MDL_CFG_REG_A, lis2mdl_read_reg(), lis2mdl_write_reg(), and lis2mdl_cfg_reg_a_t::soft_rst.
Referenced by lis2mdl_init(), and lis2mdl_init_2().


| int32_t lis2mdl_self_test_get | ( | const stmdev_ctx_t * | ctx, |
| uint8_t * | val | ||
| ) |
Selftest.[get].
| ctx | read / write interface definitions.(ptr) |
| val | change the values of self_test in reg CFG_REG_C.(ptr) |
| interface | status.(MANDATORY: return 0 -> no Error) |
Definition at line 886 of file lis2mdl_reg.c.
References LIS2MDL_CFG_REG_C, lis2mdl_read_reg(), and lis2mdl_cfg_reg_c_t::self_test.

| int32_t lis2mdl_self_test_set | ( | const stmdev_ctx_t * | ctx, |
| uint8_t | val | ||
| ) |
Selftest.[set].
| ctx | read / write interface definitions.(ptr) |
| val | change the values of self_test in reg CFG_REG_C |
| interface | status.(MANDATORY: return 0 -> no Error) |
Definition at line 862 of file lis2mdl_reg.c.
References LIS2MDL_CFG_REG_C, lis2mdl_read_reg(), lis2mdl_write_reg(), and lis2mdl_cfg_reg_c_t::self_test.

| int32_t lis2mdl_set_rst_mode_get | ( | const stmdev_ctx_t * | ctx, |
| lis2mdl_set_rst_t * | val | ||
| ) |
Reset mode.[get].
| ctx | read / write interface definitions.(ptr) |
| val | Get the values of set_rst in reg CFG_REG_B.(ptr) |
| interface | status.(MANDATORY: return 0 -> no Error) |
Definition at line 531 of file lis2mdl_reg.c.
References LIS2MDL_CFG_REG_B, lis2mdl_read_reg(), LIS2MDL_SENS_OFF_CANC_EVERY_ODR, LIS2MDL_SET_SENS_ODR_DIV_63, LIS2MDL_SET_SENS_ONLY_AT_POWER_ON, and lis2mdl_cfg_reg_b_t::set_rst.

| int32_t lis2mdl_set_rst_mode_set | ( | const stmdev_ctx_t * | ctx, |
| lis2mdl_set_rst_t | val | ||
| ) |
Reset mode.[set].
| ctx | read / write interface definitions.(ptr) |
| val | change the values of set_rst in reg CFG_REG_B |
| interface | status.(MANDATORY: return 0 -> no Error) |
Definition at line 506 of file lis2mdl_reg.c.
References LIS2MDL_CFG_REG_B, lis2mdl_read_reg(), lis2mdl_write_reg(), and lis2mdl_cfg_reg_b_t::set_rst.

| int32_t lis2mdl_set_rst_sensor_single_get | ( | const stmdev_ctx_t * | ctx, |
| uint8_t * | val | ||
| ) |
Enables offset cancellation in single measurement mode. The OFF_CANC bit must be set to 1 when enabling offset cancellation in single measurement mode this means a call function: set_rst_mode(SENS_OFF_CANC_EVERY_ODR) is need.[get].
| ctx | read / write interface definitions.(ptr) |
| val | change the values of off_canc_one_shot in reg CFG_REG_B.(ptr) |
| interface | status.(MANDATORY: return 0 -> no Error) |
Definition at line 602 of file lis2mdl_reg.c.
References LIS2MDL_CFG_REG_B, lis2mdl_read_reg(), and lis2mdl_cfg_reg_b_t::off_canc_one_shot.

| int32_t lis2mdl_set_rst_sensor_single_set | ( | const stmdev_ctx_t * | ctx, |
| uint8_t | val | ||
| ) |
Enables offset cancellation in single measurement mode. The OFF_CANC bit must be set to 1 when enabling offset cancellation in single measurement mode this means a call function: set_rst_mode(SENS_OFF_CANC_EVERY_ODR) is need.[set].
| ctx | read / write interface definitions.(ptr) |
| val | change the values of off_canc_one_shot in reg CFG_REG_B |
| interface | status.(MANDATORY: return 0 -> no Error) |
Definition at line 573 of file lis2mdl_reg.c.
References LIS2MDL_CFG_REG_B, lis2mdl_read_reg(), lis2mdl_write_reg(), and lis2mdl_cfg_reg_b_t::off_canc_one_shot.

| int32_t lis2mdl_spi_mode_get | ( | const stmdev_ctx_t * | ctx, |
| lis2mdl_sim_t * | val | ||
| ) |
SPI Serial Interface Mode selection.[get].
| ctx | read / write interface definitions |
| val | Get the values of 4wspi in reg CFG_REG_C |
| interface | status (MANDATORY: return 0 -> no Error) |
Definition at line 1274 of file lis2mdl_reg.c.
References lis2mdl_cfg_reg_c_t::_4wspi, LIS2MDL_CFG_REG_C, lis2mdl_read_reg(), LIS2MDL_SPI_3_WIRE, and LIS2MDL_SPI_4_WIRE.

| int32_t lis2mdl_spi_mode_set | ( | const stmdev_ctx_t * | ctx, |
| lis2mdl_sim_t | val | ||
| ) |
SPI Serial Interface Mode selection.[set].
| ctx | read / write interface definitions |
| val | change the values of 4wspi in reg CFG_REG_C |
| interface | status (MANDATORY: return 0 -> no Error) |
Definition at line 1250 of file lis2mdl_reg.c.
References lis2mdl_cfg_reg_c_t::_4wspi, LIS2MDL_CFG_REG_C, lis2mdl_read_reg(), and lis2mdl_write_reg().
Referenced by lis2mdl_init(), and lis2mdl_init_2().


| int32_t lis2mdl_status_get | ( | const stmdev_ctx_t * | ctx, |
| lis2mdl_status_reg_t * | val | ||
| ) |
Info about device status.[get].
| ctx | read / write interface definitions.(ptr) |
| val | registers STATUS_REG.(ptr) |
| interface | status.(MANDATORY: return 0 -> no Error) |
Definition at line 962 of file lis2mdl_reg.c.
References lis2mdl_read_reg(), and LIS2MDL_STATUS_REG.

| int32_t lis2mdl_temperature_raw_get | ( | const stmdev_ctx_t * | ctx, |
| int16_t * | val | ||
| ) |
Temperature output value.[get].
| ctx | read / write interface definitions.(ptr) |
| buff | that stores data read |
| interface | status.(MANDATORY: return 0 -> no Error) |
Definition at line 727 of file lis2mdl_reg.c.
References lis2mdl_read_reg(), and LIS2MDL_TEMP_OUT_L_REG.

| int32_t lis2mdl_write_reg | ( | const stmdev_ctx_t * | ctx, |
| uint8_t | reg, | ||
| uint8_t * | data, | ||
| uint16_t | len | ||
| ) |
Write generic device register.
| ctx | read / write interface definitions(ptr) |
| reg | register to write |
| data | pointer to data to write in register reg(ptr) |
| len | number of consecutive register to write |
| interface | status (MANDATORY: return 0 -> no Error) |
Definition at line 92 of file lis2mdl_reg.c.
References stmdev_ctx_t::handle, NULL, and stmdev_ctx_t::write_reg.
Referenced by lis2mdl_block_data_update_set(), lis2mdl_boot_set(), lis2mdl_data_format_set(), lis2mdl_data_rate_set(), lis2mdl_drdy_on_pin_set(), lis2mdl_i2c_interface_set(), lis2mdl_init(), lis2mdl_init_2(), lis2mdl_int_gen_conf_set(), lis2mdl_int_gen_threshold_set(), lis2mdl_int_on_pin_set(), lis2mdl_low_pass_bandwidth_set(), lis2mdl_mag_user_offset_set(), lis2mdl_offset_int_conf_set(), lis2mdl_offset_temp_comp_set(), lis2mdl_operating_mode_set(), lis2mdl_power_mode_set(), lis2mdl_reset_set(), lis2mdl_self_test_set(), lis2mdl_set_rst_mode_set(), lis2mdl_set_rst_sensor_single_set(), and lis2mdl_spi_mode_set().
