3-axis MEMS ultra low power magnetometer
Dependencies: X_NUCLEO_COMMON ST_INTERFACES
Dependents: X_NUCLEO_IKS01A3 X_NUCLEO_IKS01A3
This section group all the functions concerning data generation. More...
Functions | |
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. |
Detailed Description
This section group all the functions concerning data generation.
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_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_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_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_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_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.
Generated on Tue Jul 12 2022 20:53:15 by 1.7.2