ChibiOS 21.11.4

Detailed Description

Collaboration diagram for LIS3MDL:

LIS3MDL data structures and types

enum  lis3mdl_sad_t { LIS3MDL_SAD_GND = 0x1C , LIS3MDL_SAD_VCC = 0x1E }
 LIS3MDL slave address. More...
enum  lis3mdl_comp_fs_t { LIS3MDL_COMP_FS_4GA = 0x00 , LIS3MDL_COMP_FS_8GA = 0x20 , LIS3MDL_COMP_FS_12GA = 0x40 , LIS3MDL_COMP_FS_16GA = 0x60 }
 LIS3MDL full scale. More...
enum  lis3mdl_comp_odr_t {
  LIS3MDL_COMP_ODR_0_625HZ = 0x00 , LIS3MDL_COMP_ODR_1_25HZ = 0x04 , LIS3MDL_COMP_ODR_2_5HZ = 0x08 , LIS3MDL_COMP_ODR_5HZ = 0x0C ,
  LIS3MDL_COMP_ODR_10HZ = 0x10 , LIS3MDL_COMP_ODR_20HZ = 0x14 , LIS3MDL_COMP_ODR_40HZ = 0x18 , LIS3MDL_COMP_ODR_80HZ = 0x1C
}
 LIS3MDL output data rate. More...
enum  lis3mdl_comp_lp_t { LIS3MDL_COMP_LP_DISABLED = 0x00 , LIS3MDL_COMP_LP_ENABLED = 0x20 }
 LIS3MDL low power mode configuration. More...
enum  lis3mdl_comp_md_t { LIS3MDL_COMP_MD_CONTINUOUS = 0x00 , LIS3MDL_COMP_MD_SINGLE = 0x01 , LIS3MDL_COMP_MD_POWER_DOWN = 0x02 }
 LIS3MDL conversion mode. More...
enum  lis3mdl_comp_omxy_t { LIS3MDL_COMP_OMXY_LP = 0x00 , LIS3MDL_COMP_OMXY_MEDIUM = 0x20 , LIS3MDL_COMP_OMXY_HIGH = 0x40 , LIS3MDL_COMP_OMXY_ULTRA = 0x60 }
 LIS3MDL operation mode for X and Y axes. More...
enum  lis3mdl_comp_omz_t { LIS3MDL_COMP_OMZ_LP = 0x00 , LIS3MDL_COMP_OMZ_MEDIUM = 0x04 , LIS3MDL_COMP_OMZ_HIGH = 0x08 , LIS3MDL_COMP_OMZ_ULTRA = 0x0C }
 LIS3MDL operation mode for Z axis. More...
enum  lis3mdl_temp_t { LIS3MDL_TEMP_DISABLED = 0x00 , LIS3MDL_TEMP_ENABLED = 0x80 }
 LIS3MDL temperature sensor enabling. More...
enum  lis3mdl_bdu_t { LIS3MDL_BDU_CONTINUOUS = 0x00 , LIS3MDL_BDU_BLOCKED = 0x40 }
 LIS3MDL block data update. More...
enum  lis3mdl_end_t { LIS3MDL_END_LITTLE = 0x00 , LIS3MDL_END_BIG = 0x02 }
 LIS3MDL endianness. More...
enum  lis3mdl_state_t { LIS3MDL_UNINIT = 0 , LIS3MDL_STOP = 1 , LIS3MDL_READY = 2 }
 Driver state machine possible states. More...
typedef struct LIS3MDLDriver LIS3MDLDriver
 LIS3MDL slave address.
#define _lis3msl_methods_alone
 LIS3MDL specific methods.
#define _lis3mdl_methods
 LIS3MDL specific methods with inherited ones.
#define _lis3mdl_data
 LIS3MDLDriver specific data.

Version identification

#define EX_LIS3MDL_VERSION   "1.1.3"
 LIS3MDL driver version string.
#define EX_LIS3MDL_MAJOR   1
 LIS3MDL driver version major number.
#define EX_LIS3MDL_MINOR   1
 LIS3MDL driver version minor number.
#define EX_LIS3MDL_PATCH   3
 LIS3MDL driver version patch number.
#define LIS3MDL_COMP_NUMBER_OF_AXES   3U
 LIS3MDL compass subsystem characteristics.
#define LIS3MDL_COMP_4GA   4.0f
#define LIS3MDL_COMP_8GA   8.0f
#define LIS3MDL_COMP_12GA   12.0f
#define LIS3MDL_COMP_16GA   16.0f
#define LIS3MDL_COMP_SENS_4GA   0.00014615f
#define LIS3MDL_COMP_SENS_8GA   0.00029231f
#define LIS3MDL_COMP_SENS_12GA   0.0004384f
#define LIS3MDL_COMP_SENS_16GA   0.00058445f
#define LIS3MDL_COMP_BIAS   0.0f

LIS3MDL communication interfaces related bit masks

#define LIS3MDL_DI_MASK   0xFF
#define LIS3MDL_DI(n)
#define LIS3MDL_AD_MASK   0x3F
#define LIS3MDL_AD(n)
#define LIS3MDL_MS   (1 << 6)
#define LIS3MDL_RW   (1 << 7)
#define LIS3MDL_SUB_MS   (1 << 7)

LIS3MDL register addresses

#define LIS3MDL_AD_WHO_AM_I   0x0F
#define LIS3MDL_AD_CTRL_REG1   0x20
#define LIS3MDL_AD_CTRL_REG2   0x21
#define LIS3MDL_AD_CTRL_REG3   0x22
#define LIS3MDL_AD_CTRL_REG4   0x23
#define LIS3MDL_AD_CTRL_REG5   0x24
#define LIS3MDL_AD_STATUS_REG   0x27
#define LIS3MDL_AD_OUT_X_L   0x28
#define LIS3MDL_AD_OUT_X_H   0x29
#define LIS3MDL_AD_OUT_Y_L   0x2A
#define LIS3MDL_AD_OUT_Y_H   0x2B
#define LIS3MDL_AD_OUT_Z_L   0x2C
#define LIS3MDL_AD_OUT_Z_H   0x2D
#define LIS3MDL_AD_TEMP_OUT_L   0x2E
#define LIS3MDL_AD_TEMP_OUT_H   0x2F
#define LIS3MDL_AD_INT_CFG   0x30
#define LIS3MDL_AD_INT_SOURCE   0x31
#define LIS3MDL_AD_INT_THS_L   0x32
#define LIS3MDL_AD_INT_THS_H   0x33

LIS3MDL_CTRL_REG1 register bits definitions

#define LIS3MDL_CTRL_REG1_MASK   0xFF
#define LIS3MDL_CTRL_REG1_ST   (1 << 0)
#define LIS3MDL_CTRL_REG1_FAST_ODR   (1 << 1)
#define LIS3MDL_CTRL_REG1_DO0   (1 << 2)
#define LIS3MDL_CTRL_REG1_DO1   (1 << 3)
#define LIS3MDL_CTRL_REG1_DO2   (1 << 4)
#define LIS3MDL_CTRL_REG1_OM0   (1 << 5)
#define LIS3MDL_CTRL_REG1_OM1   (1 << 6)
#define LIS3MDL_CTRL_REG1_TEMP_EN   (1 << 7)

LIS3MDL_CTRL_REG2 register bits definitions

#define LIS3MDL_CTRL_REG2_MASK   0x6C
#define LIS3MDL_CTRL_REG2_SOFT_RST   (1 << 2)
#define LIS3MDL_CTRL_REG2_REBOOT   (1 << 3)
#define LIS3MDL_CTRL_REG2_FS_MASK   0x60
#define LIS3MDL_CTRL_REG2_FS0   (1 << 5)
#define LIS3MDL_CTRL_REG2_FS1   (1 << 6)

LIS3MDL_CTRL_REG3 register bits definitions

#define LIS3MDL_CTRL_REG3_MASK   0x27
#define LIS3MDL_CTRL_REG3_MD0   (1 << 0)
#define LIS3MDL_CTRL_REG3_MD1   (1 << 1)
#define LIS3MDL_CTRL_REG3_SIM   (1 << 2)
#define LIS3MDL_CTRL_REG3_LP   (1 << 5)

LIS3MDL_CTRL_REG4 register bits definitions

#define LIS3MDL_CTRL_REG4_MASK   0x0E
#define LIS3MDL_CTRL_REG4_BLE   (1 << 1)
#define LIS3MDL_CTRL_REG4_OMZ0   (1 << 2)
#define LIS3MDL_CTRL_REG4_OMZ1   (1 << 3)

LIS3MDL_CTRL_REG5 register bits definitions

#define LIS3MDL_CTRL_REG5_MASK   0xC0
#define LIS3MDL_CTRL_REG5_BDU   (1 << 6)
#define LIS3MDL_CTRL_REG5_FAST_READ   (1 << 7)

Configuration options

#define LIS3MDL_USE_SPI   FALSE
 LIS3MDL SPI interface switch.
#define LIS3MDL_SHARED_SPI   FALSE
 LIS3MDL shared SPI switch.
#define LIS3MDL_USE_I2C   TRUE
 LIS3MDL I2C interface switch.
#define LIS3MDL_SHARED_I2C   FALSE
 LIS3MDL shared I2C switch.
#define LIS3MDL_USE_ADVANCED   FALSE
 LIS3MDL advanced configurations switch.

Data Structures

struct  LIS3MDLConfig
 LIS3MDL configuration structure. More...
struct  LIS3MDLVMT
 LIS3MDL virtual methods table. More...
struct  LIS3MDLDriver
 LIS3MDL 3-axis compass class. More...

Macros

#define lis3mdlCompassGetAxesNumber(devp)
 Return the number of axes of the BaseCompass.
#define lis3mdlCompassReadRaw(devp, axes)
 Retrieves raw data from the BaseCompass.
#define lis3mdlCompassReadCooked(devp, axes)
 Retrieves cooked data from the BaseCompass.
#define lis3mdlCompassSetBias(devp, bp)
 Set bias values for the BaseCompass.
#define lis3mdlCompassResetBias(devp)
 Reset bias values for the BaseCompass.
#define lis3mdlCompassSetSensitivity(devp, sp)
 Set sensitivity values for the BaseCompass.
#define lis3mdlCompassResetSensitivity(devp)
 Reset sensitivity values for the BaseCompass.
#define lis3mdlCompassSetFullScale(devp, fs)
 Changes the LIS3MDLDriver compass fullscale value.

Functions

msg_t lis3mdlI2CReadRegister (I2CDriver *i2cp, lis3mdl_sad_t sad, uint8_t reg, uint8_t *rxbuf, size_t n)
 Reads registers value using I2C.
msg_t lis3mdlI2CWriteRegister (I2CDriver *i2cp, lis3mdl_sad_t sad, uint8_t *txbuf, uint8_t n)
 Writes a value into a register using I2C.
static size_t comp_get_axes_number (void *ip)
 Return the number of axes of the BaseCompass.
static msg_t comp_read_raw (void *ip, int32_t axes[])
 Retrieves raw data from the BaseCompass.
static msg_t comp_read_cooked (void *ip, float axes[])
 Retrieves cooked data from the BaseCompass.
static msg_t comp_set_bias (void *ip, float *bp)
 Set bias values for the BaseCompass.
static msg_t comp_reset_bias (void *ip)
 Reset bias values for the BaseCompass.
static msg_t comp_set_sensivity (void *ip, float *sp)
 Set sensitivity values for the BaseCompass.
static msg_t comp_reset_sensivity (void *ip)
 Reset sensitivity values for the BaseCompass.
static msg_t comp_set_full_scale (LIS3MDLDriver *devp, lis3mdl_comp_fs_t fs)
 Changes the LIS3MDLDriver compass fullscale value.
void lis3mdlObjectInit (LIS3MDLDriver *devp)
 Initializes an instance.
void lis3mdlStart (LIS3MDLDriver *devp, const LIS3MDLConfig *config)
 Configures and activates LIS3MDL Complex Driver peripheral.
void lis3mdlStop (LIS3MDLDriver *devp)
 Deactivates the LIS3MDL Complex Driver peripheral.

Variables

static const struct LIS3MDLVMT vmt_device
static const struct BaseCompassVMT vmt_compass

Macro Definition Documentation

◆ EX_LIS3MDL_VERSION

#define EX_LIS3MDL_VERSION   "1.1.3"

LIS3MDL driver version string.

Definition at line 45 of file lis3mdl.h.

◆ EX_LIS3MDL_MAJOR

#define EX_LIS3MDL_MAJOR   1

LIS3MDL driver version major number.

Definition at line 50 of file lis3mdl.h.

◆ EX_LIS3MDL_MINOR

#define EX_LIS3MDL_MINOR   1

LIS3MDL driver version minor number.

Definition at line 55 of file lis3mdl.h.

◆ EX_LIS3MDL_PATCH

#define EX_LIS3MDL_PATCH   3

LIS3MDL driver version patch number.

Definition at line 60 of file lis3mdl.h.

◆ LIS3MDL_COMP_NUMBER_OF_AXES

#define LIS3MDL_COMP_NUMBER_OF_AXES   3U

LIS3MDL compass subsystem characteristics.

Note
Sensitivity is expressed as G/LSB whereas G stands for Gauss.
Bias is expressed as G.

Definition at line 70 of file lis3mdl.h.

Referenced by comp_get_axes_number(), comp_read_cooked(), comp_read_raw(), comp_reset_bias(), comp_reset_sensivity(), comp_set_bias(), comp_set_full_scale(), comp_set_sensivity(), lis3mdlObjectInit(), and lis3mdlStart().

◆ LIS3MDL_COMP_4GA

#define LIS3MDL_COMP_4GA   4.0f

Definition at line 72 of file lis3mdl.h.

Referenced by comp_set_full_scale(), and lis3mdlStart().

◆ LIS3MDL_COMP_8GA

#define LIS3MDL_COMP_8GA   8.0f

Definition at line 73 of file lis3mdl.h.

Referenced by comp_set_full_scale(), and lis3mdlStart().

◆ LIS3MDL_COMP_12GA

#define LIS3MDL_COMP_12GA   12.0f

Definition at line 74 of file lis3mdl.h.

Referenced by comp_set_full_scale(), and lis3mdlStart().

◆ LIS3MDL_COMP_16GA

#define LIS3MDL_COMP_16GA   16.0f

Definition at line 75 of file lis3mdl.h.

Referenced by comp_set_full_scale(), and lis3mdlStart().

◆ LIS3MDL_COMP_SENS_4GA

#define LIS3MDL_COMP_SENS_4GA   0.00014615f

Definition at line 77 of file lis3mdl.h.

Referenced by comp_reset_sensivity(), and lis3mdlStart().

◆ LIS3MDL_COMP_SENS_8GA

#define LIS3MDL_COMP_SENS_8GA   0.00029231f

Definition at line 78 of file lis3mdl.h.

Referenced by comp_reset_sensivity(), and lis3mdlStart().

◆ LIS3MDL_COMP_SENS_12GA

#define LIS3MDL_COMP_SENS_12GA   0.0004384f

Definition at line 79 of file lis3mdl.h.

Referenced by comp_reset_sensivity(), and lis3mdlStart().

◆ LIS3MDL_COMP_SENS_16GA

#define LIS3MDL_COMP_SENS_16GA   0.00058445f

Definition at line 80 of file lis3mdl.h.

Referenced by comp_reset_sensivity(), and lis3mdlStart().

◆ LIS3MDL_COMP_BIAS

#define LIS3MDL_COMP_BIAS   0.0f

Definition at line 82 of file lis3mdl.h.

Referenced by comp_reset_bias(), and lis3mdlStart().

◆ LIS3MDL_DI_MASK

#define LIS3MDL_DI_MASK   0xFF

Definition at line 89 of file lis3mdl.h.

◆ LIS3MDL_DI

#define LIS3MDL_DI ( n)
Value:
(1 << n)

Definition at line 90 of file lis3mdl.h.

◆ LIS3MDL_AD_MASK

#define LIS3MDL_AD_MASK   0x3F

Definition at line 91 of file lis3mdl.h.

◆ LIS3MDL_AD

#define LIS3MDL_AD ( n)
Value:
(1 << n)

Definition at line 92 of file lis3mdl.h.

◆ LIS3MDL_MS

#define LIS3MDL_MS   (1 << 6)

Definition at line 93 of file lis3mdl.h.

◆ LIS3MDL_RW

#define LIS3MDL_RW   (1 << 7)

Definition at line 94 of file lis3mdl.h.

◆ LIS3MDL_SUB_MS

#define LIS3MDL_SUB_MS   (1 << 7)

Definition at line 96 of file lis3mdl.h.

Referenced by lis3mdlI2CReadRegister(), and lis3mdlI2CWriteRegister().

◆ LIS3MDL_AD_WHO_AM_I

#define LIS3MDL_AD_WHO_AM_I   0x0F

Definition at line 103 of file lis3mdl.h.

◆ LIS3MDL_AD_CTRL_REG1

#define LIS3MDL_AD_CTRL_REG1   0x20

Definition at line 104 of file lis3mdl.h.

Referenced by lis3mdlStart().

◆ LIS3MDL_AD_CTRL_REG2

#define LIS3MDL_AD_CTRL_REG2   0x21

Definition at line 105 of file lis3mdl.h.

Referenced by comp_set_full_scale().

◆ LIS3MDL_AD_CTRL_REG3

#define LIS3MDL_AD_CTRL_REG3   0x22

Definition at line 106 of file lis3mdl.h.

Referenced by lis3mdlStop().

◆ LIS3MDL_AD_CTRL_REG4

#define LIS3MDL_AD_CTRL_REG4   0x23

Definition at line 107 of file lis3mdl.h.

◆ LIS3MDL_AD_CTRL_REG5

#define LIS3MDL_AD_CTRL_REG5   0x24

Definition at line 108 of file lis3mdl.h.

◆ LIS3MDL_AD_STATUS_REG

#define LIS3MDL_AD_STATUS_REG   0x27

Definition at line 109 of file lis3mdl.h.

◆ LIS3MDL_AD_OUT_X_L

#define LIS3MDL_AD_OUT_X_L   0x28

Definition at line 110 of file lis3mdl.h.

Referenced by comp_read_raw().

◆ LIS3MDL_AD_OUT_X_H

#define LIS3MDL_AD_OUT_X_H   0x29

Definition at line 111 of file lis3mdl.h.

◆ LIS3MDL_AD_OUT_Y_L

#define LIS3MDL_AD_OUT_Y_L   0x2A

Definition at line 112 of file lis3mdl.h.

◆ LIS3MDL_AD_OUT_Y_H

#define LIS3MDL_AD_OUT_Y_H   0x2B

Definition at line 113 of file lis3mdl.h.

◆ LIS3MDL_AD_OUT_Z_L

#define LIS3MDL_AD_OUT_Z_L   0x2C

Definition at line 114 of file lis3mdl.h.

◆ LIS3MDL_AD_OUT_Z_H

#define LIS3MDL_AD_OUT_Z_H   0x2D

Definition at line 115 of file lis3mdl.h.

◆ LIS3MDL_AD_TEMP_OUT_L

#define LIS3MDL_AD_TEMP_OUT_L   0x2E

Definition at line 116 of file lis3mdl.h.

◆ LIS3MDL_AD_TEMP_OUT_H

#define LIS3MDL_AD_TEMP_OUT_H   0x2F

Definition at line 117 of file lis3mdl.h.

◆ LIS3MDL_AD_INT_CFG

#define LIS3MDL_AD_INT_CFG   0x30

Definition at line 118 of file lis3mdl.h.

◆ LIS3MDL_AD_INT_SOURCE

#define LIS3MDL_AD_INT_SOURCE   0x31

Definition at line 119 of file lis3mdl.h.

◆ LIS3MDL_AD_INT_THS_L

#define LIS3MDL_AD_INT_THS_L   0x32

Definition at line 120 of file lis3mdl.h.

◆ LIS3MDL_AD_INT_THS_H

#define LIS3MDL_AD_INT_THS_H   0x33

Definition at line 121 of file lis3mdl.h.

◆ LIS3MDL_CTRL_REG1_MASK

#define LIS3MDL_CTRL_REG1_MASK   0xFF

Definition at line 128 of file lis3mdl.h.

◆ LIS3MDL_CTRL_REG1_ST

#define LIS3MDL_CTRL_REG1_ST   (1 << 0)

Definition at line 129 of file lis3mdl.h.

◆ LIS3MDL_CTRL_REG1_FAST_ODR

#define LIS3MDL_CTRL_REG1_FAST_ODR   (1 << 1)

Definition at line 130 of file lis3mdl.h.

◆ LIS3MDL_CTRL_REG1_DO0

#define LIS3MDL_CTRL_REG1_DO0   (1 << 2)

Definition at line 131 of file lis3mdl.h.

◆ LIS3MDL_CTRL_REG1_DO1

#define LIS3MDL_CTRL_REG1_DO1   (1 << 3)

Definition at line 132 of file lis3mdl.h.

◆ LIS3MDL_CTRL_REG1_DO2

#define LIS3MDL_CTRL_REG1_DO2   (1 << 4)

Definition at line 133 of file lis3mdl.h.

◆ LIS3MDL_CTRL_REG1_OM0

#define LIS3MDL_CTRL_REG1_OM0   (1 << 5)

Definition at line 134 of file lis3mdl.h.

Referenced by lis3mdlStart().

◆ LIS3MDL_CTRL_REG1_OM1

#define LIS3MDL_CTRL_REG1_OM1   (1 << 6)

Definition at line 135 of file lis3mdl.h.

Referenced by lis3mdlStart().

◆ LIS3MDL_CTRL_REG1_TEMP_EN

#define LIS3MDL_CTRL_REG1_TEMP_EN   (1 << 7)

Definition at line 136 of file lis3mdl.h.

◆ LIS3MDL_CTRL_REG2_MASK

#define LIS3MDL_CTRL_REG2_MASK   0x6C

Definition at line 143 of file lis3mdl.h.

◆ LIS3MDL_CTRL_REG2_SOFT_RST

#define LIS3MDL_CTRL_REG2_SOFT_RST   (1 << 2)

Definition at line 144 of file lis3mdl.h.

◆ LIS3MDL_CTRL_REG2_REBOOT

#define LIS3MDL_CTRL_REG2_REBOOT   (1 << 3)

Definition at line 145 of file lis3mdl.h.

◆ LIS3MDL_CTRL_REG2_FS_MASK

#define LIS3MDL_CTRL_REG2_FS_MASK   0x60

Definition at line 146 of file lis3mdl.h.

Referenced by comp_set_full_scale().

◆ LIS3MDL_CTRL_REG2_FS0

#define LIS3MDL_CTRL_REG2_FS0   (1 << 5)

Definition at line 147 of file lis3mdl.h.

◆ LIS3MDL_CTRL_REG2_FS1

#define LIS3MDL_CTRL_REG2_FS1   (1 << 6)

Definition at line 148 of file lis3mdl.h.

◆ LIS3MDL_CTRL_REG3_MASK

#define LIS3MDL_CTRL_REG3_MASK   0x27

Definition at line 155 of file lis3mdl.h.

◆ LIS3MDL_CTRL_REG3_MD0

#define LIS3MDL_CTRL_REG3_MD0   (1 << 0)

Definition at line 156 of file lis3mdl.h.

Referenced by lis3mdlStop().

◆ LIS3MDL_CTRL_REG3_MD1

#define LIS3MDL_CTRL_REG3_MD1   (1 << 1)

Definition at line 157 of file lis3mdl.h.

Referenced by lis3mdlStop().

◆ LIS3MDL_CTRL_REG3_SIM

#define LIS3MDL_CTRL_REG3_SIM   (1 << 2)

Definition at line 158 of file lis3mdl.h.

◆ LIS3MDL_CTRL_REG3_LP

#define LIS3MDL_CTRL_REG3_LP   (1 << 5)

Definition at line 159 of file lis3mdl.h.

◆ LIS3MDL_CTRL_REG4_MASK

#define LIS3MDL_CTRL_REG4_MASK   0x0E

Definition at line 166 of file lis3mdl.h.

◆ LIS3MDL_CTRL_REG4_BLE

#define LIS3MDL_CTRL_REG4_BLE   (1 << 1)

Definition at line 167 of file lis3mdl.h.

◆ LIS3MDL_CTRL_REG4_OMZ0

#define LIS3MDL_CTRL_REG4_OMZ0   (1 << 2)

Definition at line 168 of file lis3mdl.h.

◆ LIS3MDL_CTRL_REG4_OMZ1

#define LIS3MDL_CTRL_REG4_OMZ1   (1 << 3)

Definition at line 169 of file lis3mdl.h.

◆ LIS3MDL_CTRL_REG5_MASK

#define LIS3MDL_CTRL_REG5_MASK   0xC0

Definition at line 176 of file lis3mdl.h.

◆ LIS3MDL_CTRL_REG5_BDU

#define LIS3MDL_CTRL_REG5_BDU   (1 << 6)

Definition at line 177 of file lis3mdl.h.

◆ LIS3MDL_CTRL_REG5_FAST_READ

#define LIS3MDL_CTRL_REG5_FAST_READ   (1 << 7)

Definition at line 178 of file lis3mdl.h.

◆ LIS3MDL_USE_SPI

#define LIS3MDL_USE_SPI   FALSE

LIS3MDL SPI interface switch.

If set to TRUE the support for SPI is included.

Note
The default is FALSE.

Definition at line 195 of file lis3mdl.h.

◆ LIS3MDL_SHARED_SPI

#define LIS3MDL_SHARED_SPI   FALSE

LIS3MDL shared SPI switch.

If set to TRUE the device acquires SPI bus ownership on each transaction.

Note
The default is FALSE. Requires SPI_USE_MUTUAL_EXCLUSION.

Definition at line 205 of file lis3mdl.h.

◆ LIS3MDL_USE_I2C

#define LIS3MDL_USE_I2C   TRUE

LIS3MDL I2C interface switch.

If set to TRUE the support for I2C is included.

Note
The default is TRUE.

Definition at line 214 of file lis3mdl.h.

◆ LIS3MDL_SHARED_I2C

#define LIS3MDL_SHARED_I2C   FALSE

LIS3MDL shared I2C switch.

If set to TRUE the device acquires I2C bus ownership on each transaction.

Note
The default is FALSE. Requires I2C_USE_MUTUAL_EXCLUSION

Definition at line 224 of file lis3mdl.h.

◆ LIS3MDL_USE_ADVANCED

#define LIS3MDL_USE_ADVANCED   FALSE

LIS3MDL advanced configurations switch.

If set to TRUE more configurations are available.

Note
The default is FALSE.

Definition at line 233 of file lis3mdl.h.

◆ _lis3msl_methods_alone

#define _lis3msl_methods_alone
Value:
/* Change full scale value of LIS3MDL compass subsystem.*/ \
static msg_t comp_set_full_scale(LIS3MDLDriver *devp, lis3mdl_comp_fs_t fs)
Changes the LIS3MDLDriver compass fullscale value.
Definition lis3mdl.c:345
lis3mdl_comp_fs_t
LIS3MDL full scale.
Definition lis3mdl.h:296
LIS3MDL 3-axis compass class.
Definition lis3mdl.h:503

LIS3MDL specific methods.

Definition at line 462 of file lis3mdl.h.

◆ _lis3mdl_methods

#define _lis3mdl_methods
Value:
_base_object_methods \
_lis3msl_methods_alone

LIS3MDL specific methods with inherited ones.

Definition at line 469 of file lis3mdl.h.

◆ _lis3mdl_data

#define _lis3mdl_data
Value:
/* Driver state.*/ \
lis3mdl_state_t state; \
/* Current configuration data.*/ \
const LIS3MDLConfig *config; \
/* Compass subsystem axes number.*/ \
size_t compaxes; \
/* Compass subsystem current sensitivity.*/ \
float compsensitivity[LIS3MDL_COMP_NUMBER_OF_AXES]; \
/* Compass subsystem current bias.*/ \
float compbias[LIS3MDL_COMP_NUMBER_OF_AXES]; \
/* Compass subsystem current full scale value.*/ \
float compfullscale;
#define _base_compass_data
BaseCompass specific data.
Definition ex_compass.h:77
#define LIS3MDL_COMP_NUMBER_OF_AXES
LIS3MDL compass subsystem characteristics.
Definition lis3mdl.h:70
lis3mdl_state_t
Driver state machine possible states.
Definition lis3mdl.h:381
LIS3MDL configuration structure.
Definition lis3mdl.h:390

LIS3MDLDriver specific data.

Definition at line 485 of file lis3mdl.h.

◆ lis3mdlCompassGetAxesNumber

#define lis3mdlCompassGetAxesNumber ( devp)
Value:
compassGetAxesNumber(&((devp)->comp_if))
#define compassGetAxesNumber(ip)
Compass get axes number.
Definition ex_compass.h:107

Return the number of axes of the BaseCompass.

Parameters
[in]devppointer to LIS3MDLDriver.
Returns
the number of axes.
Function Class:
Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 525 of file lis3mdl.h.

◆ lis3mdlCompassReadRaw

#define lis3mdlCompassReadRaw ( devp,
axes )
Value:
compassReadRaw(&((devp)->comp_if), axes)
#define compassReadRaw(ip, dp)
Compass read raw data.
Definition ex_compass.h:122

Retrieves raw data from the BaseCompass.

Note
This data is retrieved from MEMS register without any algebraical manipulation.
The axes array must be at least the same size of the BaseCompass axes number.
Parameters
[in]devppointer to BaseCompass interface.
[out]axesa buffer which would be filled with raw data.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.
MSG_RESETif one or more I2C errors occurred, the errors can be retrieved using i2cGetErrors().
MSG_TIMEOUTif a timeout occurred before operation end.
Function Class:
Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 546 of file lis3mdl.h.

◆ lis3mdlCompassReadCooked

#define lis3mdlCompassReadCooked ( devp,
axes )
Value:
compassReadCooked(&((devp)->comp_if), axes)
#define compassReadCooked(ip, dp)
Compass read cooked data.
Definition ex_compass.h:137

Retrieves cooked data from the BaseCompass.

Note
This data is manipulated according to the formula cooked = (raw * sensitivity) - bias.
Final data is expressed as G.
The axes array must be at least the same size of the BaseCompass axes number.
Parameters
[in]devppointer to BaseCompass interface.
[out]axesa buffer which would be filled with cooked data.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.
MSG_RESETif one or more I2C errors occurred, the errors can be retrieved using i2cGetErrors().
MSG_TIMEOUTif a timeout occurred before operation end.
Function Class:
Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 568 of file lis3mdl.h.

◆ lis3mdlCompassSetBias

#define lis3mdlCompassSetBias ( devp,
bp )
Value:
compassSetBias(&((devp)->comp_if), bp)
#define compassSetBias(ip, bp)
Updates compass bias data from received buffer.
Definition ex_compass.h:154

Set bias values for the BaseCompass.

Note
Bias must be expressed as G.
The bias buffer must be at least the same size of the BaseCompass axes number.
Parameters
[in]devppointer to BaseCompass interface.
[in]bpa buffer which contains biases.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.
Function Class:
Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 585 of file lis3mdl.h.

◆ lis3mdlCompassResetBias

#define lis3mdlCompassResetBias ( devp)
Value:
compassResetBias(&((devp)->comp_if))
#define compassResetBias(ip)
Reset compass bias data restoring it to zero.
Definition ex_compass.h:168

Reset bias values for the BaseCompass.

Note
Default biases value are obtained from device datasheet when available otherwise they are considered zero.
Parameters
[in]devppointer to LIS3MDLDriver.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.
Function Class:
Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 600 of file lis3mdl.h.

◆ lis3mdlCompassSetSensitivity

#define lis3mdlCompassSetSensitivity ( devp,
sp )
Value:
compassSetSensitivity(&((devp)->comp_if), sp)
#define compassSetSensitivity(ip, sp)
Updates compass sensitivity data from received buffer.
Definition ex_compass.h:185

Set sensitivity values for the BaseCompass.

Note
Sensitivity must be expressed as G/LSB.
The sensitivity buffer must be at least the same size of the BaseCompass axes number.
Parameters
[in]devppointer to LIS3MDLDriver.
[in]spa buffer which contains sensitivities.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.
Function Class:
Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 617 of file lis3mdl.h.

◆ lis3mdlCompassResetSensitivity

#define lis3mdlCompassResetSensitivity ( devp)
Value:
compassResetSensitivity(&((devp)->comp_if))
#define compassResetSensitivity(ip)
Reset compass sensitivity data restoring it to its typical value.
Definition ex_compass.h:200

Reset sensitivity values for the BaseCompass.

Note
Default sensitivities value are obtained from device datasheet.
Parameters
[in]devppointer to LIS3MDLDriver.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.
MSG_RESETotherwise.
Function Class:
Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 632 of file lis3mdl.h.

◆ lis3mdlCompassSetFullScale

#define lis3mdlCompassSetFullScale ( devp,
fs )
Value:
(devp)->vmt->comp_set_full_scale(devp, fs)
static const struct EFlashDriverVMT vmt
Definition hal_efl.c:71

Changes the LIS3MDLDriver compass fullscale value.

Note
This function also rescale sensitivities and biases based on previous and next fullscale value.
A recalibration is highly suggested after calling this function.
Parameters
[in]devppointer to LIS3MDLDriver.
[in]fsnew fullscale value.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.
MSG_RESETotherwise.
Function Class:
Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 650 of file lis3mdl.h.

Typedef Documentation

◆ LIS3MDLDriver

typedef struct LIS3MDLDriver LIS3MDLDriver

LIS3MDL slave address.

Structure representing a LIS3MDL driver.

Definition at line 283 of file lis3mdl.h.

Enumeration Type Documentation

◆ lis3mdl_sad_t

LIS3MDL slave address.

Enumerator
LIS3MDL_SAD_GND 

Slave Address when SA1 is to GND

LIS3MDL_SAD_VCC 

Slave Address when SA1 is to VCC

Definition at line 288 of file lis3mdl.h.

◆ lis3mdl_comp_fs_t

LIS3MDL full scale.

Enumerator
LIS3MDL_COMP_FS_4GA 

�4 Gauss

LIS3MDL_COMP_FS_8GA 

�8 Gauss

LIS3MDL_COMP_FS_12GA 

�12 Gauss

LIS3MDL_COMP_FS_16GA 

�16 Gauss

Definition at line 296 of file lis3mdl.h.

◆ lis3mdl_comp_odr_t

LIS3MDL output data rate.

Enumerator
LIS3MDL_COMP_ODR_0_625HZ 

Output Data Rate = 0.625 Hz

LIS3MDL_COMP_ODR_1_25HZ 

Output Data Rate = 1.25 Hz

LIS3MDL_COMP_ODR_2_5HZ 

Output Data Rate = 2.5 Hz

LIS3MDL_COMP_ODR_5HZ 

Output Data Rate = 5 Hz

LIS3MDL_COMP_ODR_10HZ 

Output Data Rate = 10 Hz

LIS3MDL_COMP_ODR_20HZ 

Output Data Rate = 20 Hz

LIS3MDL_COMP_ODR_40HZ 

Output Data Rate = 40 Hz

LIS3MDL_COMP_ODR_80HZ 

Output Data Rate = 80 Hz

Definition at line 306 of file lis3mdl.h.

◆ lis3mdl_comp_lp_t

LIS3MDL low power mode configuration.

Enumerator
LIS3MDL_COMP_LP_DISABLED 

Low Power mode disabled

LIS3MDL_COMP_LP_ENABLED 

Low Power mode enabled

Definition at line 320 of file lis3mdl.h.

◆ lis3mdl_comp_md_t

LIS3MDL conversion mode.

Enumerator
LIS3MDL_COMP_MD_CONTINUOUS 

Continuous conversion mode

LIS3MDL_COMP_MD_SINGLE 

Single conversion mode

LIS3MDL_COMP_MD_POWER_DOWN 

Power down mode

Definition at line 328 of file lis3mdl.h.

◆ lis3mdl_comp_omxy_t

LIS3MDL operation mode for X and Y axes.

Enumerator
LIS3MDL_COMP_OMXY_LP 

X-Y axes low power mode

LIS3MDL_COMP_OMXY_MEDIUM 

X-Y axes medium performance mode

LIS3MDL_COMP_OMXY_HIGH 

X-Y axes high performance mode

LIS3MDL_COMP_OMXY_ULTRA 

X-Y axes ultra performance mode

Definition at line 337 of file lis3mdl.h.

◆ lis3mdl_comp_omz_t

LIS3MDL operation mode for Z axis.

Enumerator
LIS3MDL_COMP_OMZ_LP 

Z axis low power mode

LIS3MDL_COMP_OMZ_MEDIUM 

Z axis medium performance mode

LIS3MDL_COMP_OMZ_HIGH 

Z axis high performance mode

LIS3MDL_COMP_OMZ_ULTRA 

Z axis ultra performance mode

Definition at line 347 of file lis3mdl.h.

◆ lis3mdl_temp_t

LIS3MDL temperature sensor enabling.

Enumerator
LIS3MDL_TEMP_DISABLED 

Temperature sensor disabled.

LIS3MDL_TEMP_ENABLED 

Temperature sensor enabled.

Definition at line 357 of file lis3mdl.h.

◆ lis3mdl_bdu_t

LIS3MDL block data update.

Enumerator
LIS3MDL_BDU_CONTINUOUS 

Continuous Update

LIS3MDL_BDU_BLOCKED 

Block data updated after reading.

Definition at line 365 of file lis3mdl.h.

◆ lis3mdl_end_t

LIS3MDL endianness.

Enumerator
LIS3MDL_END_LITTLE 

Little endian.

LIS3MDL_END_BIG 

Big endian.

Definition at line 373 of file lis3mdl.h.

◆ lis3mdl_state_t

Driver state machine possible states.

Enumerator
LIS3MDL_UNINIT 

Not initialized.

LIS3MDL_STOP 

Stopped.

LIS3MDL_READY 

Ready.

Definition at line 381 of file lis3mdl.h.

Function Documentation

◆ lis3mdlI2CReadRegister()

msg_t lis3mdlI2CReadRegister ( I2CDriver * i2cp,
lis3mdl_sad_t sad,
uint8_t reg,
uint8_t * rxbuf,
size_t n )

Reads registers value using I2C.

Precondition
The I2C interface must be initialized and the driver started.
Parameters
[in]i2cppointer to the I2C interface
[in]sadslave address without R bit
[in]regfirst sub-register address
[out]rxbufpointer to an output buffer
[in]nnumber of consecutive register to read
Returns
the operation status.
Function Class:
Not an API, this function is for internal use only.

Definition at line 62 of file lis3mdl.c.

References i2cMasterTransmitTimeout(), LIS3MDL_SUB_MS, and TIME_INFINITE.

Referenced by comp_read_raw(), and comp_set_full_scale().

Here is the call graph for this function:

◆ lis3mdlI2CWriteRegister()

msg_t lis3mdlI2CWriteRegister ( I2CDriver * i2cp,
lis3mdl_sad_t sad,
uint8_t * txbuf,
uint8_t n )

Writes a value into a register using I2C.

Precondition
The I2C interface must be initialized and the driver started.
Parameters
[in]i2cppointer to the I2C interface
[in]sadslave address without R bit
[in]txbufbuffer containing sub-address value in first position and values to write
[in]nsize of txbuf less one (not considering the first element)
Returns
the operation status.
Function Class:
Not an API, this function is for internal use only.

Definition at line 85 of file lis3mdl.c.

References i2cMasterTransmitTimeout(), LIS3MDL_SUB_MS, and TIME_INFINITE.

Referenced by comp_set_full_scale(), lis3mdlStart(), and lis3mdlStop().

Here is the call graph for this function:

◆ comp_get_axes_number()

size_t comp_get_axes_number ( void * ip)
static

Return the number of axes of the BaseCompass.

Parameters
[in]ippointer to BaseCompass interface
Returns
the number of axes.

Definition at line 102 of file lis3mdl.c.

References LIS3MDL_COMP_NUMBER_OF_AXES, and osalDbgCheck.

◆ comp_read_raw()

msg_t comp_read_raw ( void * ip,
int32_t axes[] )
static

Retrieves raw data from the BaseCompass.

Note
This data is retrieved from MEMS register without any algebraical manipulation.
The axes array must be at least the same size of the BaseCompass axes number.
Parameters
[in]ippointer to BaseCompass interface.
[out]axesa buffer which would be filled with raw data.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.
MSG_RESETif one or more I2C errors occurred, the errors can be retrieved using i2cGetErrors().
MSG_TIMEOUTif a timeout occurred before operation end.

Definition at line 124 of file lis3mdl.c.

References I2C_READY, i2cAcquireBus(), i2cReleaseBus(), i2cStart(), LIS3MDL_AD_OUT_X_L, LIS3MDL_COMP_NUMBER_OF_AXES, LIS3MDL_READY, lis3mdlI2CReadRegister(), MSG_OK, objGetInstance, osalDbgAssert, and osalDbgCheck.

Referenced by comp_read_cooked().

Here is the call graph for this function:

◆ comp_read_cooked()

msg_t comp_read_cooked ( void * ip,
float axes[] )
static

Retrieves cooked data from the BaseCompass.

Note
This data is manipulated according to the formula cooked = (raw * sensitivity) - bias.
Final data is expressed as G.
The axes array must be at least the same size of the BaseCompass axes number.
Parameters
[in]ippointer to BaseCompass interface.
[out]axesa buffer which would be filled with cooked data.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.
MSG_RESETif one or more I2C errors occurred, the errors can be retrieved using i2cGetErrors().
MSG_TIMEOUTif a timeout occurred before operation end.

Definition at line 178 of file lis3mdl.c.

References comp_read_raw(), LIS3MDL_COMP_NUMBER_OF_AXES, LIS3MDL_READY, objGetInstance, osalDbgAssert, and osalDbgCheck.

Here is the call graph for this function:

◆ comp_set_bias()

msg_t comp_set_bias ( void * ip,
float * bp )
static

Set bias values for the BaseCompass.

Note
Bias must be expressed as G.
The bias buffer must be at least the same size of the BaseCompass axes number.
Parameters
[in]ippointer to BaseCompass interface.
[in]bpa buffer which contains biases.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.

Definition at line 212 of file lis3mdl.c.

References LIS3MDL_COMP_NUMBER_OF_AXES, LIS3MDL_READY, MSG_OK, objGetInstance, osalDbgAssert, and osalDbgCheck.

◆ comp_reset_bias()

msg_t comp_reset_bias ( void * ip)
static

Reset bias values for the BaseCompass.

Note
Default biases value are obtained from device datasheet when available otherwise they are considered zero.
Parameters
[in]ippointer to BaseCompass interface.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.

Definition at line 241 of file lis3mdl.c.

References LIS3MDL_COMP_BIAS, LIS3MDL_COMP_NUMBER_OF_AXES, LIS3MDL_READY, MSG_OK, objGetInstance, osalDbgAssert, and osalDbgCheck.

◆ comp_set_sensivity()

msg_t comp_set_sensivity ( void * ip,
float * sp )
static

Set sensitivity values for the BaseCompass.

Note
Sensitivity must be expressed as G/LSB.
The sensitivity buffer must be at least the same size of the BaseCompass axes number.
Parameters
[in]ippointer to BaseCompass interface.
[in]spa buffer which contains sensitivities.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.

Definition at line 271 of file lis3mdl.c.

References LIS3MDL_COMP_NUMBER_OF_AXES, LIS3MDL_READY, MSG_OK, objGetInstance, osalDbgAssert, and osalDbgCheck.

◆ comp_reset_sensivity()

msg_t comp_reset_sensivity ( void * ip)
static

Reset sensitivity values for the BaseCompass.

Note
Default sensitivities value are obtained from device datasheet.
Parameters
[in]ippointer to BaseCompass interface.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.
MSG_RESETotherwise.

Definition at line 300 of file lis3mdl.c.

References FALSE, LIS3MDL_COMP_FS_12GA, LIS3MDL_COMP_FS_16GA, LIS3MDL_COMP_FS_4GA, LIS3MDL_COMP_FS_8GA, LIS3MDL_COMP_NUMBER_OF_AXES, LIS3MDL_COMP_SENS_12GA, LIS3MDL_COMP_SENS_16GA, LIS3MDL_COMP_SENS_4GA, LIS3MDL_COMP_SENS_8GA, LIS3MDL_READY, MSG_OK, MSG_RESET, objGetInstance, osalDbgAssert, and osalDbgCheck.

◆ comp_set_full_scale()

msg_t comp_set_full_scale ( LIS3MDLDriver * devp,
lis3mdl_comp_fs_t fs )
static

Changes the LIS3MDLDriver compass fullscale value.

Note
This function also rescale sensitivities and biases based on previous and next fullscale value.
A recalibration is highly suggested after calling this function.
Parameters
[in]devppointer to LIS3MDLDriver interface.
[in]fsnew fullscale value.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.
MSG_RESETotherwise.

Definition at line 345 of file lis3mdl.c.

References I2C_READY, i2cAcquireBus(), i2cReleaseBus(), i2cStart(), LIS3MDL_AD_CTRL_REG2, LIS3MDL_COMP_12GA, LIS3MDL_COMP_16GA, LIS3MDL_COMP_4GA, LIS3MDL_COMP_8GA, LIS3MDL_COMP_FS_12GA, LIS3MDL_COMP_FS_16GA, LIS3MDL_COMP_FS_4GA, LIS3MDL_COMP_FS_8GA, LIS3MDL_COMP_NUMBER_OF_AXES, LIS3MDL_CTRL_REG2_FS_MASK, LIS3MDL_READY, lis3mdlI2CReadRegister(), lis3mdlI2CWriteRegister(), MSG_OK, MSG_RESET, osalDbgAssert, and osalDbgCheck.

Here is the call graph for this function:

◆ lis3mdlObjectInit()

void lis3mdlObjectInit ( LIS3MDLDriver * devp)

Initializes an instance.

Parameters
[out]devppointer to the LIS3MDLDriver object
Function Class:
Object or module nitializer function.

Definition at line 450 of file lis3mdl.c.

References LIS3MDLDriver::comp_if, LIS3MDL_COMP_NUMBER_OF_AXES, LIS3MDL_STOP, BaseCompass::vmt, LIS3MDLDriver::vmt, vmt_compass, and vmt_device.

◆ lis3mdlStart()

void lis3mdlStart ( LIS3MDLDriver * devp,
const LIS3MDLConfig * config )

Configures and activates LIS3MDL Complex Driver peripheral.

Parameters
[in]devppointer to the LIS3MDLDriver object
[in]configpointer to the LIS3MDLConfig object
Function Class:
Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 469 of file lis3mdl.c.

References hal_i2c_driver::config, FALSE, i2cAcquireBus(), LIS3MDLConfig::i2cp, i2cReleaseBus(), i2cStart(), LIS3MDL_AD_CTRL_REG1, LIS3MDL_COMP_12GA, LIS3MDL_COMP_16GA, LIS3MDL_COMP_4GA, LIS3MDL_COMP_8GA, LIS3MDL_COMP_BIAS, LIS3MDL_COMP_FS_12GA, LIS3MDL_COMP_FS_16GA, LIS3MDL_COMP_FS_4GA, LIS3MDL_COMP_FS_8GA, LIS3MDL_COMP_NUMBER_OF_AXES, LIS3MDL_COMP_SENS_12GA, LIS3MDL_COMP_SENS_16GA, LIS3MDL_COMP_SENS_4GA, LIS3MDL_COMP_SENS_8GA, LIS3MDL_CTRL_REG1_OM0, LIS3MDL_CTRL_REG1_OM1, LIS3MDL_READY, LIS3MDL_STOP, lis3mdlI2CWriteRegister(), osalDbgAssert, osalDbgCheck, and osalThreadSleepMilliseconds.

Here is the call graph for this function:

◆ lis3mdlStop()

void lis3mdlStop ( LIS3MDLDriver * devp)

Deactivates the LIS3MDL Complex Driver peripheral.

Parameters
[in]devppointer to the LIS3MDLDriver object
Function Class:
Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 602 of file lis3mdl.c.

References i2cAcquireBus(), i2cReleaseBus(), i2cStart(), i2cStop(), LIS3MDL_AD_CTRL_REG3, LIS3MDL_CTRL_REG3_MD0, LIS3MDL_CTRL_REG3_MD1, LIS3MDL_READY, LIS3MDL_STOP, lis3mdlI2CWriteRegister(), osalDbgAssert, and osalDbgCheck.

Here is the call graph for this function:

Variable Documentation

◆ vmt_device

const struct LIS3MDLVMT vmt_device
static
Initial value:
= {
(size_t)0,
}

Definition at line 428 of file lis3mdl.c.

◆ vmt_compass

const struct BaseCompassVMT vmt_compass
static
Initial value:
= {
sizeof(struct LIS3MDLVMT*),
}
static size_t comp_get_axes_number(void *ip)
Return the number of axes of the BaseCompass.
Definition lis3mdl.c:102
static msg_t comp_set_sensivity(void *ip, float *sp)
Set sensitivity values for the BaseCompass.
Definition lis3mdl.c:271
static msg_t comp_reset_bias(void *ip)
Reset bias values for the BaseCompass.
Definition lis3mdl.c:241
static msg_t comp_set_bias(void *ip, float *bp)
Set bias values for the BaseCompass.
Definition lis3mdl.c:212
static msg_t comp_reset_sensivity(void *ip)
Reset sensitivity values for the BaseCompass.
Definition lis3mdl.c:300
static msg_t comp_read_cooked(void *ip, float axes[])
Retrieves cooked data from the BaseCompass.
Definition lis3mdl.c:178
static msg_t comp_read_raw(void *ip, int32_t axes[])
Retrieves raw data from the BaseCompass.
Definition lis3mdl.c:124
LIS3MDL virtual methods table.
Definition lis3mdl.h:478

Definition at line 433 of file lis3mdl.c.

Referenced by lis3mdlObjectInit(), lsm303agrObjectInit(), and lsm303dlhcObjectInit().