3-axis MEMS ultra low power magnetometer
Dependencies: X_NUCLEO_COMMON ST_INTERFACES
Dependents: X_NUCLEO_IKS01A3 X_NUCLEO_IKS01A3
This file provides a set of functions needed to drive the lis2mdl enhanced inertial module. More...
Modules | |
LIS2MDL_Interfaces_Functions | |
This section provide a set of functions used to read and write a generic register of the device. | |
LIS2MDL_Sensitivity | |
These functions convert raw-data into engineering units. | |
LIS2MDL_data_generation | |
This section group all the functions concerning data generation. | |
LIS2MDL_common | |
This section group common usefull functions. | |
LIS2MDL_interrupts | |
This section group all the functions that manage interrupts. | |
LIS2MDL_serial_interface | |
This section group all the functions concerning serial interface management. | |
LIS2MDL_sensors_common_types | |
LSM9DS1_Infos | |
LIS2MDL_Register_Union | |
This union group all the registers that has a bit-field description. | |
Functions | |
int32_t | lis2mdl_read_reg (lis2mdl_ctx_t *ctx, uint8_t reg, uint8_t *data, uint16_t len) |
Read generic device register. | |
int32_t | lis2mdl_write_reg (lis2mdl_ctx_t *ctx, uint8_t reg, uint8_t *data, uint16_t len) |
Write generic device register. | |
int32_t | lis2mdl_mag_user_offset_set (lis2mdl_ctx_t *ctx, uint8_t *buff) |
These registers comprise a 3 group of 16-bit number and represent hard-iron offset in order to compensate environmental effects. | |
int32_t | lis2mdl_mag_user_offset_get (lis2mdl_ctx_t *ctx, uint8_t *buff) |
These registers comprise a 3 group of 16-bit number and represent hard-iron offset in order to compensate environmental effects. | |
int32_t | lis2mdl_operating_mode_set (lis2mdl_ctx_t *ctx, lis2mdl_md_t val) |
Operating mode selection. | |
int32_t | lis2mdl_operating_mode_get (lis2mdl_ctx_t *ctx, lis2mdl_md_t *val) |
Operating mode selection. | |
int32_t | lis2mdl_data_rate_set (lis2mdl_ctx_t *ctx, lis2mdl_odr_t val) |
Output data rate selection. | |
int32_t | lis2mdl_data_rate_get (lis2mdl_ctx_t *ctx, lis2mdl_odr_t *val) |
Output data rate selection. | |
int32_t | lis2mdl_power_mode_set (lis2mdl_ctx_t *ctx, lis2mdl_lp_t val) |
Enables high-resolution/low-power mode. | |
int32_t | lis2mdl_power_mode_get (lis2mdl_ctx_t *ctx, lis2mdl_lp_t *val) |
Enables high-resolution/low-power mode. | |
int32_t | lis2mdl_offset_temp_comp_set (lis2mdl_ctx_t *ctx, uint8_t val) |
Enables the magnetometer temperature compensation. | |
int32_t | lis2mdl_offset_temp_comp_get (lis2mdl_ctx_t *ctx, uint8_t *val) |
Enables the magnetometer temperature compensation. | |
int32_t | lis2mdl_low_pass_bandwidth_set (lis2mdl_ctx_t *ctx, lis2mdl_lpf_t val) |
Low-pass bandwidth selection. | |
int32_t | lis2mdl_low_pass_bandwidth_get (lis2mdl_ctx_t *ctx, lis2mdl_lpf_t *val) |
Low-pass bandwidth selection. | |
int32_t | lis2mdl_set_rst_mode_set (lis2mdl_ctx_t *ctx, lis2mdl_set_rst_t val) |
Reset mode. | |
int32_t | lis2mdl_set_rst_mode_get (lis2mdl_ctx_t *ctx, lis2mdl_set_rst_t *val) |
Reset mode. | |
int32_t | lis2mdl_set_rst_sensor_single_set (lis2mdl_ctx_t *ctx, uint8_t val) |
Enables offset cancellation in single measurement mode. | |
int32_t | lis2mdl_set_rst_sensor_single_get (lis2mdl_ctx_t *ctx, uint8_t *val) |
Enables offset cancellation in single measurement mode. | |
int32_t | lis2mdl_block_data_update_set (lis2mdl_ctx_t *ctx, uint8_t val) |
Blockdataupdate. | |
int32_t | lis2mdl_block_data_update_get (lis2mdl_ctx_t *ctx, uint8_t *val) |
Blockdataupdate. | |
int32_t | lis2mdl_mag_data_ready_get (lis2mdl_ctx_t *ctx, uint8_t *val) |
Magnetic set of data available. | |
int32_t | lis2mdl_mag_data_ovr_get (lis2mdl_ctx_t *ctx, uint8_t *val) |
Magnetic set of data overrun. | |
int32_t | lis2mdl_magnetic_raw_get (lis2mdl_ctx_t *ctx, uint8_t *buff) |
Magnetic output value. | |
int32_t | lis2mdl_temperature_raw_get (lis2mdl_ctx_t *ctx, uint8_t *buff) |
Temperature output value. | |
int32_t | lis2mdl_device_id_get (lis2mdl_ctx_t *ctx, uint8_t *buff) |
DeviceWhoamI. | |
int32_t | lis2mdl_reset_set (lis2mdl_ctx_t *ctx, uint8_t val) |
Software reset. | |
int32_t | lis2mdl_reset_get (lis2mdl_ctx_t *ctx, uint8_t *val) |
Software reset. | |
int32_t | lis2mdl_boot_set (lis2mdl_ctx_t *ctx, uint8_t val) |
Reboot memory content. | |
int32_t | lis2mdl_boot_get (lis2mdl_ctx_t *ctx, uint8_t *val) |
Reboot memory content. | |
int32_t | lis2mdl_self_test_set (lis2mdl_ctx_t *ctx, uint8_t val) |
Selftest. | |
int32_t | lis2mdl_self_test_get (lis2mdl_ctx_t *ctx, uint8_t *val) |
Selftest. | |
int32_t | lis2mdl_data_format_set (lis2mdl_ctx_t *ctx, lis2mdl_ble_t val) |
Big/Little Endian data selection. | |
int32_t | lis2mdl_data_format_get (lis2mdl_ctx_t *ctx, lis2mdl_ble_t *val) |
Big/Little Endian data selection. | |
int32_t | lis2mdl_status_get (lis2mdl_ctx_t *ctx, lis2mdl_status_reg_t *val) |
Info about device status. | |
int32_t | lis2mdl_offset_int_conf_set (lis2mdl_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. | |
int32_t | lis2mdl_offset_int_conf_get (lis2mdl_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. | |
int32_t | lis2mdl_drdy_on_pin_set (lis2mdl_ctx_t *ctx, uint8_t val) |
Data-ready signal on INT_DRDY pin. | |
int32_t | lis2mdl_drdy_on_pin_get (lis2mdl_ctx_t *ctx, uint8_t *val) |
Data-ready signal on INT_DRDY pin. | |
int32_t | lis2mdl_int_on_pin_set (lis2mdl_ctx_t *ctx, uint8_t val) |
Interrupt signal on INT_DRDY pin. | |
int32_t | lis2mdl_int_on_pin_get (lis2mdl_ctx_t *ctx, uint8_t *val) |
Interrupt signal on INT_DRDY pin. | |
int32_t | lis2mdl_int_gen_conf_set (lis2mdl_ctx_t *ctx, lis2mdl_int_crtl_reg_t *val) |
Interrupt generator configuration register. | |
int32_t | lis2mdl_int_gen_conf_get (lis2mdl_ctx_t *ctx, lis2mdl_int_crtl_reg_t *val) |
Interrupt generator configuration register. | |
int32_t | lis2mdl_int_gen_source_get (lis2mdl_ctx_t *ctx, lis2mdl_int_source_reg_t *val) |
Interrupt generator source register. | |
int32_t | lis2mdl_int_gen_treshold_set (lis2mdl_ctx_t *ctx, uint8_t *buff) |
User-defined threshold value for xl interrupt event on generator. | |
int32_t | lis2mdl_int_gen_treshold_get (lis2mdl_ctx_t *ctx, uint8_t *buff) |
User-defined threshold value for xl interrupt event on generator. | |
int32_t | lis2mdl_i2c_interface_set (lis2mdl_ctx_t *ctx, lis2mdl_i2c_dis_t val) |
Enable/Disable I2C interface. | |
int32_t | lis2mdl_i2c_interface_get (lis2mdl_ctx_t *ctx, lis2mdl_i2c_dis_t *val) |
Enable/Disable I2C interface. |
Detailed Description
This file provides a set of functions needed to drive the lis2mdl enhanced inertial module.
Function Documentation
int32_t lis2mdl_block_data_update_get | ( | lis2mdl_ctx_t * | ctx, |
uint8_t * | val | ||
) |
Blockdataupdate.
[get]
- Parameters:
-
ctx read / write interface definitions.(ptr) val change the values of bdu in reg CFG_REG_C.(ptr)
- Return values:
-
interface status.(MANDATORY: return 0 -> no Error)
Definition at line 556 of file lis2mdl_reg.c.
int32_t lis2mdl_block_data_update_set | ( | lis2mdl_ctx_t * | ctx, |
uint8_t | val | ||
) |
Blockdataupdate.
[set]
- Parameters:
-
ctx read / write interface definitions.(ptr) val change the values of bdu in reg CFG_REG_C
- Return values:
-
interface status.(MANDATORY: return 0 -> no Error)
Definition at line 533 of file lis2mdl_reg.c.
int32_t lis2mdl_boot_get | ( | lis2mdl_ctx_t * | ctx, |
uint8_t * | val | ||
) |
Reboot memory content.
Reload the calibration parameters.[get]
- Parameters:
-
ctx read / write interface definitions.(ptr) val change the values of reboot in reg CFG_REG_A.(ptr)
- Return values:
-
interface status.(MANDATORY: return 0 -> no Error)
Definition at line 735 of file lis2mdl_reg.c.
int32_t lis2mdl_boot_set | ( | lis2mdl_ctx_t * | ctx, |
uint8_t | val | ||
) |
Reboot memory content.
Reload the calibration parameters.[set]
- Parameters:
-
ctx read / write interface definitions.(ptr) val change the values of reboot in reg CFG_REG_A
- Return values:
-
interface status.(MANDATORY: return 0 -> no Error)
Definition at line 712 of file lis2mdl_reg.c.
int32_t lis2mdl_data_format_get | ( | lis2mdl_ctx_t * | ctx, |
lis2mdl_ble_t * | val | ||
) |
Big/Little Endian data selection.
[get]
- Parameters:
-
ctx read / write interface definitions.(ptr) val Get the values of ble in reg CFG_REG_C.(ptr)
- Return values:
-
interface status.(MANDATORY: return 0 -> no Error)
Definition at line 819 of file lis2mdl_reg.c.
int32_t lis2mdl_data_format_set | ( | lis2mdl_ctx_t * | ctx, |
lis2mdl_ble_t | val | ||
) |
Big/Little Endian data selection.
[set]
- Parameters:
-
ctx read / write interface definitions.(ptr) val change the values of ble in reg CFG_REG_C
- Return values:
-
interface status.(MANDATORY: return 0 -> no Error)
Definition at line 796 of file lis2mdl_reg.c.
int32_t lis2mdl_data_rate_get | ( | lis2mdl_ctx_t * | ctx, |
lis2mdl_odr_t * | val | ||
) |
Output data rate selection.
[get]
- Parameters:
-
ctx read / write interface definitions.(ptr) val Get the values of odr in reg CFG_REG_A.(ptr)
- Return values:
-
interface status.(MANDATORY: return 0 -> no Error)
Definition at line 249 of file lis2mdl_reg.c.
int32_t lis2mdl_data_rate_set | ( | lis2mdl_ctx_t * | ctx, |
lis2mdl_odr_t | val | ||
) |
Output data rate selection.
[set]
- Parameters:
-
ctx read / write interface definitions.(ptr) val change the values of odr in reg CFG_REG_A
- Return values:
-
interface status.(MANDATORY: return 0 -> no Error)
Definition at line 226 of file lis2mdl_reg.c.
int32_t lis2mdl_device_id_get | ( | lis2mdl_ctx_t * | ctx, |
uint8_t * | buff | ||
) |
DeviceWhoamI.
[get]
- Parameters:
-
ctx read / write interface definitions.(ptr) buff that stores data read
- Return values:
-
interface status.(MANDATORY: return 0 -> no Error)
Definition at line 655 of file lis2mdl_reg.c.
int32_t lis2mdl_drdy_on_pin_get | ( | lis2mdl_ctx_t * | ctx, |
uint8_t * | val | ||
) |
Data-ready signal on INT_DRDY pin.
[get]
- Parameters:
-
ctx read / write interface definitions.(ptr) val change the values of drdy_on_pin in reg CFG_REG_C.(ptr)
- Return values:
-
interface status.(MANDATORY: return 0 -> no Error)
Definition at line 952 of file lis2mdl_reg.c.
int32_t lis2mdl_drdy_on_pin_set | ( | lis2mdl_ctx_t * | ctx, |
uint8_t | val | ||
) |
Data-ready signal on INT_DRDY pin.
[set]
- Parameters:
-
ctx read / write interface definitions.(ptr) val change the values of drdy_on_pin in reg CFG_REG_C
- Return values:
-
interface status.(MANDATORY: return 0 -> no Error)
Definition at line 929 of file lis2mdl_reg.c.
int32_t lis2mdl_i2c_interface_get | ( | lis2mdl_ctx_t * | ctx, |
lis2mdl_i2c_dis_t * | val | ||
) |
Enable/Disable I2C interface.
[get]
- Parameters:
-
ctx read / write interface definitions.(ptr) val Get the values of i2c_dis in reg CFG_REG_C.(ptr)
- Return values:
-
interface status.(MANDATORY: return 0 -> no Error)
Definition at line 1131 of file lis2mdl_reg.c.
int32_t lis2mdl_i2c_interface_set | ( | lis2mdl_ctx_t * | ctx, |
lis2mdl_i2c_dis_t | val | ||
) |
Enable/Disable I2C interface.
[set]
- Parameters:
-
ctx read / write interface definitions.(ptr) val change the values of i2c_dis in reg CFG_REG_C
- Return values:
-
interface status.(MANDATORY: return 0 -> no Error)
Definition at line 1108 of file lis2mdl_reg.c.
int32_t lis2mdl_int_gen_conf_get | ( | lis2mdl_ctx_t * | ctx, |
lis2mdl_int_crtl_reg_t * | val | ||
) |
Interrupt generator configuration register.
[get]
- Parameters:
-
ctx read / write interface definitions.(ptr) val registers INT_CRTL_REG.(ptr)
- Return values:
-
interface status.(MANDATORY: return 0 -> no Error)
Definition at line 1029 of file lis2mdl_reg.c.
int32_t lis2mdl_int_gen_conf_set | ( | lis2mdl_ctx_t * | ctx, |
lis2mdl_int_crtl_reg_t * | val | ||
) |
Interrupt generator configuration register.
[set]
- Parameters:
-
ctx read / write interface definitions.(ptr) val registers INT_CRTL_REG.(ptr)
- Return values:
-
interface status.(MANDATORY: return 0 -> no Error)
Definition at line 1013 of file lis2mdl_reg.c.
int32_t lis2mdl_int_gen_source_get | ( | lis2mdl_ctx_t * | ctx, |
lis2mdl_int_source_reg_t * | val | ||
) |
Interrupt generator source register.
[get]
- Parameters:
-
ctx read / write interface definitions.(ptr) val registers INT_SOURCE_REG.(ptr)
- Return values:
-
interface status.(MANDATORY: return 0 -> no Error)
Definition at line 1045 of file lis2mdl_reg.c.
int32_t lis2mdl_int_gen_treshold_get | ( | lis2mdl_ctx_t * | ctx, |
uint8_t * | buff | ||
) |
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]
- Parameters:
-
ctx read / write interface definitions.(ptr) buff that stores data read
- Return values:
-
interface status.(MANDATORY: return 0 -> no Error)
Definition at line 1080 of file lis2mdl_reg.c.
int32_t lis2mdl_int_gen_treshold_set | ( | lis2mdl_ctx_t * | ctx, |
uint8_t * | buff | ||
) |
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]
- Parameters:
-
ctx read / write interface definitions.(ptr) buff that contains data to write
- Return values:
-
interface status.(MANDATORY: return 0 -> no Error)
Definition at line 1063 of file lis2mdl_reg.c.
int32_t lis2mdl_int_on_pin_get | ( | lis2mdl_ctx_t * | ctx, |
uint8_t * | val | ||
) |
Interrupt signal on INT_DRDY pin.
[get]
- Parameters:
-
ctx read / write interface definitions.(ptr) val change the values of int_on_pin in reg CFG_REG_C.(ptr)
- Return values:
-
interface status.(MANDATORY: return 0 -> no Error)
Definition at line 994 of file lis2mdl_reg.c.
int32_t lis2mdl_int_on_pin_set | ( | lis2mdl_ctx_t * | ctx, |
uint8_t | val | ||
) |
Interrupt signal on INT_DRDY pin.
[set]
- Parameters:
-
ctx read / write interface definitions.(ptr) val change the values of int_on_pin in reg CFG_REG_C
- Return values:
-
interface status.(MANDATORY: return 0 -> no Error)
Definition at line 971 of file lis2mdl_reg.c.
int32_t lis2mdl_low_pass_bandwidth_get | ( | lis2mdl_ctx_t * | ctx, |
lis2mdl_lpf_t * | val | ||
) |
Low-pass bandwidth selection.
[get]
- Parameters:
-
ctx read / write interface definitions.(ptr) val Get the values of lpf in reg CFG_REG_B.(ptr)
- Return values:
-
interface status.(MANDATORY: return 0 -> no Error)
Definition at line 400 of file lis2mdl_reg.c.
int32_t lis2mdl_low_pass_bandwidth_set | ( | lis2mdl_ctx_t * | ctx, |
lis2mdl_lpf_t | val | ||
) |
Low-pass bandwidth selection.
[set]
- Parameters:
-
ctx read / write interface definitions.(ptr) val change the values of lpf in reg CFG_REG_B
- Return values:
-
interface status.(MANDATORY: return 0 -> no Error)
Definition at line 376 of file lis2mdl_reg.c.
int32_t lis2mdl_mag_data_ovr_get | ( | lis2mdl_ctx_t * | ctx, |
uint8_t * | val | ||
) |
Magnetic set of data overrun.
[get]
- Parameters:
-
ctx read / write interface definitions.(ptr) val change the values of zyxor in reg STATUS_REG.(ptr)
- Return values:
-
interface status.(MANDATORY: return 0 -> no Error)
Definition at line 594 of file lis2mdl_reg.c.
int32_t lis2mdl_mag_data_ready_get | ( | lis2mdl_ctx_t * | ctx, |
uint8_t * | val | ||
) |
Magnetic set of data available.
[get]
- Parameters:
-
ctx read / write interface definitions.(ptr) val change the values of zyxda in reg STATUS_REG.(ptr)
- Return values:
-
interface status.(MANDATORY: return 0 -> no Error)
Definition at line 575 of file lis2mdl_reg.c.
int32_t lis2mdl_mag_user_offset_get | ( | lis2mdl_ctx_t * | ctx, |
uint8_t * | buff | ||
) |
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]
- Parameters:
-
ctx read / write interface definitions.(ptr) buff that stores data read
- Return values:
-
interface status.(MANDATORY: return 0 -> no Error)
Definition at line 156 of file lis2mdl_reg.c.
int32_t lis2mdl_mag_user_offset_set | ( | lis2mdl_ctx_t * | ctx, |
uint8_t * | buff | ||
) |
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]
- Parameters:
-
ctx read / write interface definitions.(ptr) buff buffer that contains data to write
- Return values:
-
interface status.(MANDATORY: return 0 -> no Error)
Definition at line 137 of file lis2mdl_reg.c.
int32_t lis2mdl_magnetic_raw_get | ( | lis2mdl_ctx_t * | ctx, |
uint8_t * | buff | ||
) |
Magnetic output value.
[get]
- Parameters:
-
ctx read / write interface definitions.(ptr) buff that stores data read
- Return values:
-
interface status.(MANDATORY: return 0 -> no Error)
Definition at line 613 of file lis2mdl_reg.c.
int32_t lis2mdl_offset_int_conf_get | ( | lis2mdl_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]
- Parameters:
-
ctx read / write interface definitions.(ptr) val Get the values of int_on_dataoff in reg CFG_REG_B.(ptr)
- Return values:
-
interface status.(MANDATORY: return 0 -> no Error)
Definition at line 900 of file lis2mdl_reg.c.
int32_t lis2mdl_offset_int_conf_set | ( | lis2mdl_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]
- Parameters:
-
ctx read / write interface definitions.(ptr) val change the values of int_on_dataoff in reg CFG_REG_B
- Return values:
-
interface status.(MANDATORY: return 0 -> no Error)
Definition at line 875 of file lis2mdl_reg.c.
int32_t lis2mdl_offset_temp_comp_get | ( | lis2mdl_ctx_t * | ctx, |
uint8_t * | val | ||
) |
Enables the magnetometer temperature compensation.
[get]
- Parameters:
-
ctx read / write interface definitions.(ptr) val change the values of comp_temp_en in reg CFG_REG_A.(ptr)
- Return values:
-
interface status.(MANDATORY: return 0 -> no Error)
Definition at line 357 of file lis2mdl_reg.c.
int32_t lis2mdl_offset_temp_comp_set | ( | lis2mdl_ctx_t * | ctx, |
uint8_t | val | ||
) |
Enables the magnetometer temperature compensation.
[set]
- Parameters:
-
ctx read / write interface definitions.(ptr) val change the values of comp_temp_en in reg CFG_REG_A
- Return values:
-
interface status.(MANDATORY: return 0 -> no Error)
Definition at line 334 of file lis2mdl_reg.c.
int32_t lis2mdl_operating_mode_get | ( | lis2mdl_ctx_t * | ctx, |
lis2mdl_md_t * | val | ||
) |
Operating mode selection.
[get]
- Parameters:
-
ctx read / write interface definitions.(ptr) val Get the values of md in reg CFG_REG_A.(ptr)
- Return values:
-
interface status.(MANDATORY: return 0 -> no Error)
Definition at line 194 of file lis2mdl_reg.c.
int32_t lis2mdl_operating_mode_set | ( | lis2mdl_ctx_t * | ctx, |
lis2mdl_md_t | val | ||
) |
Operating mode selection.
[set]
- Parameters:
-
ctx read / write interface definitions.(ptr) val change the values of md in reg CFG_REG_A
- Return values:
-
interface status.(MANDATORY: return 0 -> no Error)
Definition at line 171 of file lis2mdl_reg.c.
int32_t lis2mdl_power_mode_get | ( | lis2mdl_ctx_t * | ctx, |
lis2mdl_lp_t * | val | ||
) |
Enables high-resolution/low-power mode.
[get]
- Parameters:
-
ctx read / write interface definitions.(ptr) val Get the values of lp in reg CFG_REG_A.(ptr)
- Return values:
-
interface status.(MANDATORY: return 0 -> no Error)
Definition at line 306 of file lis2mdl_reg.c.
int32_t lis2mdl_power_mode_set | ( | lis2mdl_ctx_t * | ctx, |
lis2mdl_lp_t | val | ||
) |
Enables high-resolution/low-power mode.
[set]
- Parameters:
-
ctx read / write interface definitions.(ptr) val change the values of lp in reg CFG_REG_A
- Return values:
-
interface status.(MANDATORY: return 0 -> no Error)
Definition at line 283 of file lis2mdl_reg.c.
int32_t lis2mdl_read_reg | ( | lis2mdl_ctx_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data, | ||
uint16_t | len | ||
) |
Read generic device register.
- Parameters:
-
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
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 65 of file lis2mdl_reg.c.
int32_t lis2mdl_reset_get | ( | lis2mdl_ctx_t * | ctx, |
uint8_t * | val | ||
) |
Software reset.
Restore the default values in user registers.[get]
- Parameters:
-
ctx read / write interface definitions.(ptr) val change the values of soft_rst in reg CFG_REG_A.(ptr)
- Return values:
-
interface status.(MANDATORY: return 0 -> no Error)
Definition at line 693 of file lis2mdl_reg.c.
int32_t lis2mdl_reset_set | ( | lis2mdl_ctx_t * | ctx, |
uint8_t | val | ||
) |
Software reset.
Restore the default values in user registers.[set]
- Parameters:
-
ctx read / write interface definitions.(ptr) val change the values of soft_rst in reg CFG_REG_A
- Return values:
-
interface status.(MANDATORY: return 0 -> no Error)
Definition at line 670 of file lis2mdl_reg.c.
int32_t lis2mdl_self_test_get | ( | lis2mdl_ctx_t * | ctx, |
uint8_t * | val | ||
) |
Selftest.
[get]
- Parameters:
-
ctx read / write interface definitions.(ptr) val change the values of self_test in reg CFG_REG_C.(ptr)
- Return values:
-
interface status.(MANDATORY: return 0 -> no Error)
Definition at line 777 of file lis2mdl_reg.c.
int32_t lis2mdl_self_test_set | ( | lis2mdl_ctx_t * | ctx, |
uint8_t | val | ||
) |
Selftest.
[set]
- Parameters:
-
ctx read / write interface definitions.(ptr) val change the values of self_test in reg CFG_REG_C
- Return values:
-
interface status.(MANDATORY: return 0 -> no Error)
Definition at line 754 of file lis2mdl_reg.c.
int32_t lis2mdl_set_rst_mode_get | ( | lis2mdl_ctx_t * | ctx, |
lis2mdl_set_rst_t * | val | ||
) |
Reset mode.
[get]
- Parameters:
-
ctx read / write interface definitions.(ptr) val Get the values of set_rst in reg CFG_REG_B.(ptr)
- Return values:
-
interface status.(MANDATORY: return 0 -> no Error)
Definition at line 452 of file lis2mdl_reg.c.
int32_t lis2mdl_set_rst_mode_set | ( | lis2mdl_ctx_t * | ctx, |
lis2mdl_set_rst_t | val | ||
) |
Reset mode.
[set]
- Parameters:
-
ctx read / write interface definitions.(ptr) val change the values of set_rst in reg CFG_REG_B
- Return values:
-
interface status.(MANDATORY: return 0 -> no Error)
Definition at line 429 of file lis2mdl_reg.c.
int32_t lis2mdl_set_rst_sensor_single_get | ( | lis2mdl_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]
- Parameters:
-
ctx read / write interface definitions.(ptr) val change the values of off_canc_one_shot in reg CFG_REG_B.(ptr)
- Return values:
-
interface status.(MANDATORY: return 0 -> no Error)
Definition at line 514 of file lis2mdl_reg.c.
int32_t lis2mdl_set_rst_sensor_single_set | ( | lis2mdl_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]
- Parameters:
-
ctx read / write interface definitions.(ptr) val change the values of off_canc_one_shot in reg CFG_REG_B
- Return values:
-
interface status.(MANDATORY: return 0 -> no Error)
Definition at line 487 of file lis2mdl_reg.c.
int32_t lis2mdl_status_get | ( | lis2mdl_ctx_t * | ctx, |
lis2mdl_status_reg_t * | val | ||
) |
Info about device status.
[get]
- Parameters:
-
ctx read / write interface definitions.(ptr) val registers STATUS_REG.(ptr)
- Return values:
-
interface status.(MANDATORY: return 0 -> no Error)
Definition at line 847 of file lis2mdl_reg.c.
int32_t lis2mdl_temperature_raw_get | ( | lis2mdl_ctx_t * | ctx, |
uint8_t * | buff | ||
) |
Temperature output value.
[get]
- Parameters:
-
ctx read / write interface definitions.(ptr) buff that stores data read
- Return values:
-
interface status.(MANDATORY: return 0 -> no Error)
Definition at line 628 of file lis2mdl_reg.c.
int32_t lis2mdl_write_reg | ( | lis2mdl_ctx_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data, | ||
uint16_t | len | ||
) |
Write generic device register.
- Parameters:
-
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
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 83 of file lis2mdl_reg.c.
Generated on Tue Jul 12 2022 20:53:15 by 1.7.2