ChibiOS 21.11.4

Detailed Description

Collaboration diagram for LIS3DSH:

LIS3DSH data structures and types

enum  lis3dsh_acc_fs_t {
  LIS3DSH_ACC_FS_2G = 0x00 , LIS3DSH_ACC_FS_4G = 0x08 , LIS3DSH_ACC_FS_6G = 0x10 , LIS3DSH_ACC_FS_8G = 0x18 ,
  LIS3DSH_ACC_FS_16G = 0x20
}
 LIS3DSH full scale. More...
enum  lis3dsh_acc_odr_t {
  LIS3DSH_ACC_ODR_PD = 0x00 , LIS3DSH_ACC_ODR_3_125HZ = 0x10 , LIS3DSH_ACC_ODR_6_25HZ = 0x20 , LIS3DSH_ACC_ODR_12_5HZ = 0x30 ,
  LIS3DSH_ACC_ODR_25HZ = 0x40 , LIS3DSH_ACC_ODR_50HZ = 0x50 , LIS3DSH_ACC_ODR_100HZ = 0x60 , LIS3DSH_ACC_ODR_400HZ = 0x70 ,
  LIS3DSH_ACC_ODR_800HZ = 0x80 , LIS3DSH_ACC_ODR_1600HZ = 0x90
}
 LIS3DSH output data rate. More...
enum  lis3dsh_acc_bw_t { LIS3DSH_ACC_BW_800HZ = 0x00 , LIS3DSH_ACC_BW_200HZ = 0x40 , LIS3DSH_ACC_BW_400HZ = 0x80 , LIS3DSH_ACC_BW_50HZ = 0xC0 }
 LIS3DSH anti-aliasing bandwidth. More...
enum  lis3dsh_acc_bdu_t { LIS3DSH_ACC_BDU_CONTINUOUS = 0x00 , LIS3DSH_ACC_BDU_BLOCKED = 0x80 }
 LIS3DSH block data update. More...
enum  lis3dsh_state_t { LIS3DSH_UNINIT = 0 , LIS3DSH_STOP = 1 , LIS3DSH_READY = 2 }
 Driver state machine possible states. More...
typedef struct LIS3DSHDriver LIS3DSHDriver
 Structure representing a LIS3DSH driver.
#define _lis3dsh_methods_alone
 LIS3DSH specific methods.
#define _lis3dsh_methods
 LIS3DSH specific methods with inherited ones.
#define _lis3dsh_data
 LIS3DSHDriver specific data.

Version identification

#define EX_LIS3DSH_VERSION   "1.1.3"
 LIS3DSH driver version string.
#define EX_LIS3DSH_MAJOR   1
 LIS3DSH driver version major number.
#define EX_LIS3DSH_MINOR   1
 LIS3DSH driver version minor number.
#define EX_LIS3DSH_PATCH   3
 LIS3DSH driver version patch number.
#define LIS3DSH_ACC_NUMBER_OF_AXES   3U
 LIS3DSH accelerometer subsystem characteristics.
#define LIS3DSH_ACC_2G   2.0f
#define LIS3DSH_ACC_4G   4.0f
#define LIS3DSH_ACC_6G   6.0f
#define LIS3DSH_ACC_8G   8.0f
#define LIS3DSH_ACC_16G   16.0f
#define LIS3DSH_ACC_SENS_2G   0.06f
#define LIS3DSH_ACC_SENS_4G   0.12f
#define LIS3DSH_ACC_SENS_6G   0.18f
#define LIS3DSH_ACC_SENS_8G   0.24f
#define LIS3DSH_ACC_SENS_16G   0.73f
#define LIS3DSH_ACC_BIAS   0.0f

LIS3DSH communication interfaces related bit masks

#define LIS3DSH_DI_MASK   0xFF
#define LIS3DSH_DI(n)
#define LIS3DSH_AD_MASK   0x3F
#define LIS3DSH_AD(n)
#define LIS3DSH_MS   (1 << 6)
#define LIS3DSH_RW   (1 << 7)

LIS3DSH register addresses

#define LIS3DSH_AD_OUT_T   0x0C
#define LIS3DSH_AD_INFO1   0x0D
#define LIS3DSH_AD_INFO2   0x0E
#define LIS3DSH_AD_WHO_AM_I   0x0F
#define LIS3DSH_AD_OFF_X   0x10
#define LIS3DSH_AD_OFF_Y   0x11
#define LIS3DSH_AD_OFF_Z   0x12
#define LIS3DSH_AD_CS_X   0x13
#define LIS3DSH_AD_CS_Y   0x14
#define LIS3DSH_AD_CS_Z   0x15
#define LIS3DSH_AD_LC_L   0x16
#define LIS3DSH_AD_LC_H   0x17
#define LIS3DSH_AD_STAT   0x18
#define LIS3DSH_AD_PEAK1   0x19
#define LIS3DSH_AD_PEAK2   0x1A
#define LIS3DSH_AD_VFC_1   0x1B
#define LIS3DSH_AD_VFC_2   0x1C
#define LIS3DSH_AD_VFC_3   0x1D
#define LIS3DSH_AD_VFC_4   0x1E
#define LIS3DSH_AD_THRS3   0x1F
#define LIS3DSH_AD_CTRL_REG4   0x20
#define LIS3DSH_AD_CTRL_REG1   0x21
#define LIS3DSH_AD_CTRL_REG2   0x22
#define LIS3DSH_AD_CTRL_REG3   0x23
#define LIS3DSH_AD_CTRL_REG5   0x24
#define LIS3DSH_AD_CTRL_REG6   0x25
#define LIS3DSH_AD_STATUS   0x27
#define LIS3DSH_AD_OUT_X_L   0x28
#define LIS3DSH_AD_OUT_X_H   0x29
#define LIS3DSH_AD_OUT_Y_L   0x2A
#define LIS3DSH_AD_OUT_Y_H   0x2B
#define LIS3DSH_AD_OUT_Z_L   0x2C
#define LIS3DSH_AD_OUT_Z_H   0x2D
#define LIS3DSH_AD_FIFO_CTRL   0x2E
#define LIS3DSH_AD_FIFO_SRC   0x2F
#define LIS3DSH_AD_ST1_0   0x40
#define LIS3DSH_AD_ST1_1   0x41
#define LIS3DSH_AD_ST1_2   0x42
#define LIS3DSH_AD_ST1_3   0x43
#define LIS3DSH_AD_ST1_4   0x44
#define LIS3DSH_AD_ST1_5   0x45
#define LIS3DSH_AD_ST1_6   0x46
#define LIS3DSH_AD_ST1_7   0x47
#define LIS3DSH_AD_ST1_8   0x48
#define LIS3DSH_AD_ST1_9   0x49
#define LIS3DSH_AD_ST1_A   0x4A
#define LIS3DSH_AD_ST1_B   0x4B
#define LIS3DSH_AD_ST1_C   0x4C
#define LIS3DSH_AD_ST1_D   0x4D
#define LIS3DSH_AD_ST1_E   0x4E
#define LIS3DSH_AD_ST1_F   0x4F
#define LIS3DSH_AD_TIM4_1   0x50
#define LIS3DSH_AD_TIM3_1   0x51
#define LIS3DSH_AD_TIM2_1_L   0x52
#define LIS3DSH_AD_TIM2_1_H   0x53
#define LIS3DSH_AD_TIM1_1_L   0x54
#define LIS3DSH_AD_TIM1_1_H   0x55
#define LIS3DSH_AD_THRS2_1   0x56
#define LIS3DSH_AD_THRS1_1   0x57
#define LIS3DSH_AD_MASK1_B   0x59
#define LIS3DSH_AD_MASK1_A   0x5A
#define LIS3DSH_AD_SETT1   0x5B
#define LIS3DSH_AD_PR1   0x5C
#define LIS3DSH_AD_TC1_L   0x5D
#define LIS3DSH_AD_TC1_H   0x5E
#define LIS3DSH_AD_OUTS1   0x5F
#define LIS3DSH_AD_ST2_0   0x60
#define LIS3DSH_AD_ST2_1   0x61
#define LIS3DSH_AD_ST2_2   0x62
#define LIS3DSH_AD_ST2_3   0x63
#define LIS3DSH_AD_ST2_4   0x64
#define LIS3DSH_AD_ST2_5   0x65
#define LIS3DSH_AD_ST2_6   0x66
#define LIS3DSH_AD_ST2_7   0x67
#define LIS3DSH_AD_ST2_8   0x68
#define LIS3DSH_AD_ST2_9   0x69
#define LIS3DSH_AD_ST2_A   0x6A
#define LIS3DSH_AD_ST2_B   0x6B
#define LIS3DSH_AD_ST2_C   0x6C
#define LIS3DSH_AD_ST2_D   0x6D
#define LIS3DSH_AD_ST2_E   0x6E
#define LIS3DSH_AD_ST2_F   0x6F
#define LIS3DSH_AD_TIM4_2   0x70
#define LIS3DSH_AD_TIM3_2   0x71
#define LIS3DSH_AD_TIM2_2_L   0x72
#define LIS3DSH_AD_TIM2_2_H   0x73
#define LIS3DSH_AD_TIM1_2_L   0x74
#define LIS3DSH_AD_TIM1_2_H   0x75
#define LIS3DSH_AD_THRS2_2   0x76
#define LIS3DSH_AD_THRS1_2   0x77
#define LIS3DSH_AD_DES2   0x78
#define LIS3DSH_AD_MASK2_B   0x79
#define LIS3DSH_AD_MASK2_A   0x7A
#define LIS3DSH_AD_SETT2   0x7B
#define LIS3DSH_AD_PR2   0x7C
#define LIS3DSH_AD_TC2_L   0x7D
#define LIS3DSH_AD_TC2_H   0x7E
#define LIS3DSH_AD_OUTS2   0x7F

LIS3DSH_CTRL_REG1 register bits definitions

#define LIS3DSH_CTRL_REG1_MASK   0xE9
#define LIS3DSH_CTRL_REG1_SM1_EN   (1 << 0)
#define LIS3DSH_CTRL_REG1_SM1_PIN   (1 << 3)
#define LIS3DSH_CTRL_REG1_HYST0_1   (1 << 5)
#define LIS3DSH_CTRL_REG1_HYST1_1   (1 << 6)
#define LIS3DSH_CTRL_REG1_HYST2_1   (1 << 7)

LIS3DSH_CTRL_REG2 register bits definitions

#define LIS3DSH_CTRL_REG2_MASK   0xE9
#define LIS3DSH_CTRL_REG2_SM2_EN   (1 << 0)
#define LIS3DSH_CTRL_REG2_SM2_PIN   (1 << 3)
#define LIS3DSH_CTRL_REG2_HYST0_2   (1 << 5)
#define LIS3DSH_CTRL_REG2_HYST1_2   (1 << 6)
#define LIS3DSH_CTRL_REG2_HYST2_2   (1 << 7)

LIS3DSH_CTRL_REG3 register bits definitions

#define LIS3DSH_CTRL_REG3_MASK   0xFF
#define LIS3DSH_CTRL_REG3_STRT   (1 << 0)
#define LIS3DSH_CTRL_REG3_VFILT   (1 << 2)
#define LIS3DSH_CTRL_REG3_INT1_EN   (1 << 3)
#define LIS3DSH_CTRL_REG3_INT2_EN   (1 << 4)
#define LIS3DSH_CTRL_REG3_IEL   (1 << 5)
#define LIS3DSH_CTRL_REG3_IEA   (1 << 6)
#define LIS3DSH_CTRL_REG3_DR_EN   (1 << 7)

LIS3DSH_CTRL_REG4 register bits definitions

#define LIS3DSH_CTRL_REG4_MASK   0xFF
#define LIS3DSH_CTRL_REG4_XEN   (1 << 0)
#define LIS3DSH_CTRL_REG4_YEN   (1 << 1)
#define LIS3DSH_CTRL_REG4_ZEN   (1 << 2)
#define LIS3DSH_CTRL_REG4_BDU   (1 << 3)
#define LIS3DSH_CTRL_REG4_ODR_0   (1 << 4)
#define LIS3DSH_CTRL_REG4_ODR_1   (1 << 5)
#define LIS3DSH_CTRL_REG4_ODR_2   (1 << 6)
#define LIS3DSH_CTRL_REG4_ODR_3   (1 << 7)

LIS3DSH_CTRL_REG5 register bits definitions

#define LIS3DSH_CTRL_REG5_MASK   0xFF
#define LIS3DSH_CTRL_REG5_SIM   (1 << 0)
#define LIS3DSH_CTRL_REG5_ST1   (1 << 1)
#define LIS3DSH_CTRL_REG5_ST2   (1 << 2)
#define LIS3DSH_CTRL_REG5_FS_MASK   0x38
#define LIS3DSH_CTRL_REG5_FS0   (1 << 3)
#define LIS3DSH_CTRL_REG5_FS1   (1 << 4)
#define LIS3DSH_CTRL_REG5_FS2   (1 << 5)
#define LIS3DSH_CTRL_REG5_BW1   (1 << 6)
#define LIS3DSH_CTRL_REG5_BW2   (1 << 7)

LIS3DSH_CTRL_REG6 register bits definitions

#define LIS3DSH_CTRL_REG6_MASK   0xFF
#define LIS3DSH_CTRL_REG6_P2_BOOT   (1 << 0)
#define LIS3DSH_CTRL_REG6_P1_OVRUN   (1 << 1)
#define LIS3DSH_CTRL_REG6_P1_WTM   (1 << 2)
#define LIS3DSH_CTRL_REG6_P1_EMPTY   (1 << 3)
#define LIS3DSH_CTRL_REG6_ADD_INC   (1 << 4)
#define LIS3DSH_CTRL_REG6_WTM_EN   (1 << 5)
#define LIS3DSH_CTRL_REG6_FIFO_EN   (1 << 6)
#define LIS3DSH_CTRL_REG6_BOOT   (1 << 7)

Configuration options

#define LIS3DSH_USE_SPI   TRUE
 LIS3DSH SPI interface switch.
#define LIS3DSH_SHARED_SPI   FALSE
 LIS3DSH shared SPI switch.
#define LIS3DSH_USE_I2C   FALSE
 LIS3DSH I2C interface switch.
#define LIS3DSH_SHARED_I2C   FALSE
 LIS3DSH shared I2C switch.
#define LIS3DSH_USE_ADVANCED   FALSE
 LIS3DSH advanced configurations switch.

Data Structures

struct  LIS3DSHConfig
 LIS3DSH configuration structure. More...
struct  LIS3DSHVMT
 LIS3DSH virtual methods table. More...
struct  LIS3DSHDriver
 LIS3DSH 3-axis accelerometer class. More...

Macros

#define lis3dshAccelerometerGetAxesNumber(devp)
 Return the number of axes of the BaseAccelerometer.
#define lis3dshAccelerometerReadRaw(devp, axes)
 Retrieves raw data from the BaseAccelerometer.
#define lis3dshAccelerometerReadCooked(devp, axes)
 Retrieves cooked data from the BaseAccelerometer.
#define lis3dshAccelerometerSetBias(devp, bp)
 Set bias values for the BaseAccelerometer.
#define lis3dshAccelerometerResetBias(devp)
 Reset bias values for the BaseAccelerometer.
#define lis3dshAccelerometerSetSensitivity(devp, sp)
 Set sensitivity values for the BaseAccelerometer.
#define lis3dshAccelerometerResetSensitivity(devp)
 Reset sensitivity values for the BaseAccelerometer.
#define lis3dshAccelerometerSetFullScale(devp, fs)
 Changes the LIS3DSHDriver accelerometer fullscale value.

Functions

static void lis3dshSPIReadRegister (SPIDriver *spip, uint8_t reg, size_t n, uint8_t *b)
 Reads a generic register value using SPI.
static void lis3dshSPIWriteRegister (SPIDriver *spip, uint8_t reg, size_t n, uint8_t *b)
 Writes a value into a generic register using SPI.
static size_t acc_get_axes_number (void *ip)
 Return the number of axes of the BaseAccelerometer.
static msg_t acc_read_raw (void *ip, int32_t axes[])
 Retrieves raw data from the BaseAccelerometer.
static msg_t acc_read_cooked (void *ip, float axes[])
 Retrieves cooked data from the BaseAccelerometer.
static msg_t acc_set_bias (void *ip, float *bp)
 Set bias values for the BaseAccelerometer.
static msg_t acc_reset_bias (void *ip)
 Reset bias values for the BaseAccelerometer.
static msg_t acc_set_sensivity (void *ip, float *sp)
 Set sensitivity values for the BaseAccelerometer.
static msg_t acc_reset_sensivity (void *ip)
 Reset sensitivity values for the BaseAccelerometer.
static msg_t acc_set_full_scale (LIS3DSHDriver *devp, lis3dsh_acc_fs_t fs)
 Changes the LIS3DSHDriver accelerometer fullscale value.
void lis3dshObjectInit (LIS3DSHDriver *devp)
 Initializes an instance.
void lis3dshStart (LIS3DSHDriver *devp, const LIS3DSHConfig *config)
 Configures and activates LIS3DSH Complex Driver peripheral.
void lis3dshStop (LIS3DSHDriver *devp)
 Deactivates the LIS3DSH Complex Driver peripheral.

Variables

static const struct LIS3DSHVMT vmt_device
static const struct BaseAccelerometerVMT vmt_accelerometer

Macro Definition Documentation

◆ EX_LIS3DSH_VERSION

#define EX_LIS3DSH_VERSION   "1.1.3"

LIS3DSH driver version string.

Definition at line 46 of file lis3dsh.h.

◆ EX_LIS3DSH_MAJOR

#define EX_LIS3DSH_MAJOR   1

LIS3DSH driver version major number.

Definition at line 51 of file lis3dsh.h.

◆ EX_LIS3DSH_MINOR

#define EX_LIS3DSH_MINOR   1

LIS3DSH driver version minor number.

Definition at line 56 of file lis3dsh.h.

◆ EX_LIS3DSH_PATCH

#define EX_LIS3DSH_PATCH   3

LIS3DSH driver version patch number.

Definition at line 61 of file lis3dsh.h.

◆ LIS3DSH_ACC_NUMBER_OF_AXES

#define LIS3DSH_ACC_NUMBER_OF_AXES   3U

LIS3DSH accelerometer subsystem characteristics.

Note
Sensitivity is expressed as milli-G/LSB whereas 1 milli-G = 0.00980665 m/s^2.
Bias is expressed as milli-G.

Definition at line 72 of file lis3dsh.h.

Referenced by acc_get_axes_number(), acc_read_cooked(), acc_read_raw(), acc_reset_bias(), acc_reset_sensivity(), acc_set_bias(), acc_set_full_scale(), acc_set_sensivity(), lis3dshObjectInit(), and lis3dshStart().

◆ LIS3DSH_ACC_2G

#define LIS3DSH_ACC_2G   2.0f

Definition at line 74 of file lis3dsh.h.

Referenced by acc_set_full_scale(), and lis3dshStart().

◆ LIS3DSH_ACC_4G

#define LIS3DSH_ACC_4G   4.0f

Definition at line 75 of file lis3dsh.h.

Referenced by acc_set_full_scale(), and lis3dshStart().

◆ LIS3DSH_ACC_6G

#define LIS3DSH_ACC_6G   6.0f

Definition at line 76 of file lis3dsh.h.

Referenced by acc_set_full_scale(), and lis3dshStart().

◆ LIS3DSH_ACC_8G

#define LIS3DSH_ACC_8G   8.0f

Definition at line 77 of file lis3dsh.h.

Referenced by acc_set_full_scale(), and lis3dshStart().

◆ LIS3DSH_ACC_16G

#define LIS3DSH_ACC_16G   16.0f

Definition at line 78 of file lis3dsh.h.

Referenced by acc_set_full_scale(), and lis3dshStart().

◆ LIS3DSH_ACC_SENS_2G

#define LIS3DSH_ACC_SENS_2G   0.06f

Definition at line 80 of file lis3dsh.h.

Referenced by acc_reset_sensivity(), and lis3dshStart().

◆ LIS3DSH_ACC_SENS_4G

#define LIS3DSH_ACC_SENS_4G   0.12f

Definition at line 81 of file lis3dsh.h.

Referenced by acc_reset_sensivity(), and lis3dshStart().

◆ LIS3DSH_ACC_SENS_6G

#define LIS3DSH_ACC_SENS_6G   0.18f

Definition at line 82 of file lis3dsh.h.

Referenced by acc_reset_sensivity(), and lis3dshStart().

◆ LIS3DSH_ACC_SENS_8G

#define LIS3DSH_ACC_SENS_8G   0.24f

Definition at line 83 of file lis3dsh.h.

Referenced by acc_reset_sensivity(), and lis3dshStart().

◆ LIS3DSH_ACC_SENS_16G

#define LIS3DSH_ACC_SENS_16G   0.73f

Definition at line 84 of file lis3dsh.h.

Referenced by acc_reset_sensivity(), and lis3dshStart().

◆ LIS3DSH_ACC_BIAS

#define LIS3DSH_ACC_BIAS   0.0f

Definition at line 86 of file lis3dsh.h.

Referenced by acc_reset_bias(), and lis3dshStart().

◆ LIS3DSH_DI_MASK

#define LIS3DSH_DI_MASK   0xFF

Definition at line 93 of file lis3dsh.h.

◆ LIS3DSH_DI

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

Definition at line 94 of file lis3dsh.h.

◆ LIS3DSH_AD_MASK

#define LIS3DSH_AD_MASK   0x3F

Definition at line 95 of file lis3dsh.h.

◆ LIS3DSH_AD

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

Definition at line 96 of file lis3dsh.h.

◆ LIS3DSH_MS

#define LIS3DSH_MS   (1 << 6)

Definition at line 97 of file lis3dsh.h.

◆ LIS3DSH_RW

#define LIS3DSH_RW   (1 << 7)

Definition at line 98 of file lis3dsh.h.

Referenced by lis3dshSPIReadRegister().

◆ LIS3DSH_AD_OUT_T

#define LIS3DSH_AD_OUT_T   0x0C

Definition at line 105 of file lis3dsh.h.

◆ LIS3DSH_AD_INFO1

#define LIS3DSH_AD_INFO1   0x0D

Definition at line 106 of file lis3dsh.h.

◆ LIS3DSH_AD_INFO2

#define LIS3DSH_AD_INFO2   0x0E

Definition at line 107 of file lis3dsh.h.

◆ LIS3DSH_AD_WHO_AM_I

#define LIS3DSH_AD_WHO_AM_I   0x0F

Definition at line 108 of file lis3dsh.h.

◆ LIS3DSH_AD_OFF_X

#define LIS3DSH_AD_OFF_X   0x10

Definition at line 109 of file lis3dsh.h.

◆ LIS3DSH_AD_OFF_Y

#define LIS3DSH_AD_OFF_Y   0x11

Definition at line 110 of file lis3dsh.h.

◆ LIS3DSH_AD_OFF_Z

#define LIS3DSH_AD_OFF_Z   0x12

Definition at line 111 of file lis3dsh.h.

◆ LIS3DSH_AD_CS_X

#define LIS3DSH_AD_CS_X   0x13

Definition at line 112 of file lis3dsh.h.

◆ LIS3DSH_AD_CS_Y

#define LIS3DSH_AD_CS_Y   0x14

Definition at line 113 of file lis3dsh.h.

◆ LIS3DSH_AD_CS_Z

#define LIS3DSH_AD_CS_Z   0x15

Definition at line 114 of file lis3dsh.h.

◆ LIS3DSH_AD_LC_L

#define LIS3DSH_AD_LC_L   0x16

Definition at line 115 of file lis3dsh.h.

◆ LIS3DSH_AD_LC_H

#define LIS3DSH_AD_LC_H   0x17

Definition at line 116 of file lis3dsh.h.

◆ LIS3DSH_AD_STAT

#define LIS3DSH_AD_STAT   0x18

Definition at line 117 of file lis3dsh.h.

◆ LIS3DSH_AD_PEAK1

#define LIS3DSH_AD_PEAK1   0x19

Definition at line 118 of file lis3dsh.h.

◆ LIS3DSH_AD_PEAK2

#define LIS3DSH_AD_PEAK2   0x1A

Definition at line 119 of file lis3dsh.h.

◆ LIS3DSH_AD_VFC_1

#define LIS3DSH_AD_VFC_1   0x1B

Definition at line 120 of file lis3dsh.h.

◆ LIS3DSH_AD_VFC_2

#define LIS3DSH_AD_VFC_2   0x1C

Definition at line 121 of file lis3dsh.h.

◆ LIS3DSH_AD_VFC_3

#define LIS3DSH_AD_VFC_3   0x1D

Definition at line 122 of file lis3dsh.h.

◆ LIS3DSH_AD_VFC_4

#define LIS3DSH_AD_VFC_4   0x1E

Definition at line 123 of file lis3dsh.h.

◆ LIS3DSH_AD_THRS3

#define LIS3DSH_AD_THRS3   0x1F

Definition at line 124 of file lis3dsh.h.

◆ LIS3DSH_AD_CTRL_REG4

#define LIS3DSH_AD_CTRL_REG4   0x20

Definition at line 125 of file lis3dsh.h.

Referenced by lis3dshStart(), and lis3dshStop().

◆ LIS3DSH_AD_CTRL_REG1

#define LIS3DSH_AD_CTRL_REG1   0x21

Definition at line 126 of file lis3dsh.h.

◆ LIS3DSH_AD_CTRL_REG2

#define LIS3DSH_AD_CTRL_REG2   0x22

Definition at line 127 of file lis3dsh.h.

◆ LIS3DSH_AD_CTRL_REG3

#define LIS3DSH_AD_CTRL_REG3   0x23

Definition at line 128 of file lis3dsh.h.

◆ LIS3DSH_AD_CTRL_REG5

#define LIS3DSH_AD_CTRL_REG5   0x24

Definition at line 129 of file lis3dsh.h.

Referenced by acc_set_full_scale(), and lis3dshStart().

◆ LIS3DSH_AD_CTRL_REG6

#define LIS3DSH_AD_CTRL_REG6   0x25

Definition at line 130 of file lis3dsh.h.

Referenced by lis3dshStart().

◆ LIS3DSH_AD_STATUS

#define LIS3DSH_AD_STATUS   0x27

Definition at line 131 of file lis3dsh.h.

◆ LIS3DSH_AD_OUT_X_L

#define LIS3DSH_AD_OUT_X_L   0x28

Definition at line 132 of file lis3dsh.h.

Referenced by acc_read_raw().

◆ LIS3DSH_AD_OUT_X_H

#define LIS3DSH_AD_OUT_X_H   0x29

Definition at line 133 of file lis3dsh.h.

◆ LIS3DSH_AD_OUT_Y_L

#define LIS3DSH_AD_OUT_Y_L   0x2A

Definition at line 134 of file lis3dsh.h.

◆ LIS3DSH_AD_OUT_Y_H

#define LIS3DSH_AD_OUT_Y_H   0x2B

Definition at line 135 of file lis3dsh.h.

◆ LIS3DSH_AD_OUT_Z_L

#define LIS3DSH_AD_OUT_Z_L   0x2C

Definition at line 136 of file lis3dsh.h.

◆ LIS3DSH_AD_OUT_Z_H

#define LIS3DSH_AD_OUT_Z_H   0x2D

Definition at line 137 of file lis3dsh.h.

◆ LIS3DSH_AD_FIFO_CTRL

#define LIS3DSH_AD_FIFO_CTRL   0x2E

Definition at line 138 of file lis3dsh.h.

◆ LIS3DSH_AD_FIFO_SRC

#define LIS3DSH_AD_FIFO_SRC   0x2F

Definition at line 139 of file lis3dsh.h.

◆ LIS3DSH_AD_ST1_0

#define LIS3DSH_AD_ST1_0   0x40

Definition at line 140 of file lis3dsh.h.

◆ LIS3DSH_AD_ST1_1

#define LIS3DSH_AD_ST1_1   0x41

Definition at line 141 of file lis3dsh.h.

◆ LIS3DSH_AD_ST1_2

#define LIS3DSH_AD_ST1_2   0x42

Definition at line 142 of file lis3dsh.h.

◆ LIS3DSH_AD_ST1_3

#define LIS3DSH_AD_ST1_3   0x43

Definition at line 143 of file lis3dsh.h.

◆ LIS3DSH_AD_ST1_4

#define LIS3DSH_AD_ST1_4   0x44

Definition at line 144 of file lis3dsh.h.

◆ LIS3DSH_AD_ST1_5

#define LIS3DSH_AD_ST1_5   0x45

Definition at line 145 of file lis3dsh.h.

◆ LIS3DSH_AD_ST1_6

#define LIS3DSH_AD_ST1_6   0x46

Definition at line 146 of file lis3dsh.h.

◆ LIS3DSH_AD_ST1_7

#define LIS3DSH_AD_ST1_7   0x47

Definition at line 147 of file lis3dsh.h.

◆ LIS3DSH_AD_ST1_8

#define LIS3DSH_AD_ST1_8   0x48

Definition at line 148 of file lis3dsh.h.

◆ LIS3DSH_AD_ST1_9

#define LIS3DSH_AD_ST1_9   0x49

Definition at line 149 of file lis3dsh.h.

◆ LIS3DSH_AD_ST1_A

#define LIS3DSH_AD_ST1_A   0x4A

Definition at line 150 of file lis3dsh.h.

◆ LIS3DSH_AD_ST1_B

#define LIS3DSH_AD_ST1_B   0x4B

Definition at line 151 of file lis3dsh.h.

◆ LIS3DSH_AD_ST1_C

#define LIS3DSH_AD_ST1_C   0x4C

Definition at line 152 of file lis3dsh.h.

◆ LIS3DSH_AD_ST1_D

#define LIS3DSH_AD_ST1_D   0x4D

Definition at line 153 of file lis3dsh.h.

◆ LIS3DSH_AD_ST1_E

#define LIS3DSH_AD_ST1_E   0x4E

Definition at line 154 of file lis3dsh.h.

◆ LIS3DSH_AD_ST1_F

#define LIS3DSH_AD_ST1_F   0x4F

Definition at line 155 of file lis3dsh.h.

◆ LIS3DSH_AD_TIM4_1

#define LIS3DSH_AD_TIM4_1   0x50

Definition at line 156 of file lis3dsh.h.

◆ LIS3DSH_AD_TIM3_1

#define LIS3DSH_AD_TIM3_1   0x51

Definition at line 157 of file lis3dsh.h.

◆ LIS3DSH_AD_TIM2_1_L

#define LIS3DSH_AD_TIM2_1_L   0x52

Definition at line 158 of file lis3dsh.h.

◆ LIS3DSH_AD_TIM2_1_H

#define LIS3DSH_AD_TIM2_1_H   0x53

Definition at line 159 of file lis3dsh.h.

◆ LIS3DSH_AD_TIM1_1_L

#define LIS3DSH_AD_TIM1_1_L   0x54

Definition at line 160 of file lis3dsh.h.

◆ LIS3DSH_AD_TIM1_1_H

#define LIS3DSH_AD_TIM1_1_H   0x55

Definition at line 161 of file lis3dsh.h.

◆ LIS3DSH_AD_THRS2_1

#define LIS3DSH_AD_THRS2_1   0x56

Definition at line 162 of file lis3dsh.h.

◆ LIS3DSH_AD_THRS1_1

#define LIS3DSH_AD_THRS1_1   0x57

Definition at line 163 of file lis3dsh.h.

◆ LIS3DSH_AD_MASK1_B

#define LIS3DSH_AD_MASK1_B   0x59

Definition at line 164 of file lis3dsh.h.

◆ LIS3DSH_AD_MASK1_A

#define LIS3DSH_AD_MASK1_A   0x5A

Definition at line 165 of file lis3dsh.h.

◆ LIS3DSH_AD_SETT1

#define LIS3DSH_AD_SETT1   0x5B

Definition at line 166 of file lis3dsh.h.

◆ LIS3DSH_AD_PR1

#define LIS3DSH_AD_PR1   0x5C

Definition at line 167 of file lis3dsh.h.

◆ LIS3DSH_AD_TC1_L

#define LIS3DSH_AD_TC1_L   0x5D

Definition at line 168 of file lis3dsh.h.

◆ LIS3DSH_AD_TC1_H

#define LIS3DSH_AD_TC1_H   0x5E

Definition at line 169 of file lis3dsh.h.

◆ LIS3DSH_AD_OUTS1

#define LIS3DSH_AD_OUTS1   0x5F

Definition at line 170 of file lis3dsh.h.

◆ LIS3DSH_AD_ST2_0

#define LIS3DSH_AD_ST2_0   0x60

Definition at line 171 of file lis3dsh.h.

◆ LIS3DSH_AD_ST2_1

#define LIS3DSH_AD_ST2_1   0x61

Definition at line 172 of file lis3dsh.h.

◆ LIS3DSH_AD_ST2_2

#define LIS3DSH_AD_ST2_2   0x62

Definition at line 173 of file lis3dsh.h.

◆ LIS3DSH_AD_ST2_3

#define LIS3DSH_AD_ST2_3   0x63

Definition at line 174 of file lis3dsh.h.

◆ LIS3DSH_AD_ST2_4

#define LIS3DSH_AD_ST2_4   0x64

Definition at line 175 of file lis3dsh.h.

◆ LIS3DSH_AD_ST2_5

#define LIS3DSH_AD_ST2_5   0x65

Definition at line 176 of file lis3dsh.h.

◆ LIS3DSH_AD_ST2_6

#define LIS3DSH_AD_ST2_6   0x66

Definition at line 177 of file lis3dsh.h.

◆ LIS3DSH_AD_ST2_7

#define LIS3DSH_AD_ST2_7   0x67

Definition at line 178 of file lis3dsh.h.

◆ LIS3DSH_AD_ST2_8

#define LIS3DSH_AD_ST2_8   0x68

Definition at line 179 of file lis3dsh.h.

◆ LIS3DSH_AD_ST2_9

#define LIS3DSH_AD_ST2_9   0x69

Definition at line 180 of file lis3dsh.h.

◆ LIS3DSH_AD_ST2_A

#define LIS3DSH_AD_ST2_A   0x6A

Definition at line 181 of file lis3dsh.h.

◆ LIS3DSH_AD_ST2_B

#define LIS3DSH_AD_ST2_B   0x6B

Definition at line 182 of file lis3dsh.h.

◆ LIS3DSH_AD_ST2_C

#define LIS3DSH_AD_ST2_C   0x6C

Definition at line 183 of file lis3dsh.h.

◆ LIS3DSH_AD_ST2_D

#define LIS3DSH_AD_ST2_D   0x6D

Definition at line 184 of file lis3dsh.h.

◆ LIS3DSH_AD_ST2_E

#define LIS3DSH_AD_ST2_E   0x6E

Definition at line 185 of file lis3dsh.h.

◆ LIS3DSH_AD_ST2_F

#define LIS3DSH_AD_ST2_F   0x6F

Definition at line 186 of file lis3dsh.h.

◆ LIS3DSH_AD_TIM4_2

#define LIS3DSH_AD_TIM4_2   0x70

Definition at line 187 of file lis3dsh.h.

◆ LIS3DSH_AD_TIM3_2

#define LIS3DSH_AD_TIM3_2   0x71

Definition at line 188 of file lis3dsh.h.

◆ LIS3DSH_AD_TIM2_2_L

#define LIS3DSH_AD_TIM2_2_L   0x72

Definition at line 189 of file lis3dsh.h.

◆ LIS3DSH_AD_TIM2_2_H

#define LIS3DSH_AD_TIM2_2_H   0x73

Definition at line 190 of file lis3dsh.h.

◆ LIS3DSH_AD_TIM1_2_L

#define LIS3DSH_AD_TIM1_2_L   0x74

Definition at line 191 of file lis3dsh.h.

◆ LIS3DSH_AD_TIM1_2_H

#define LIS3DSH_AD_TIM1_2_H   0x75

Definition at line 192 of file lis3dsh.h.

◆ LIS3DSH_AD_THRS2_2

#define LIS3DSH_AD_THRS2_2   0x76

Definition at line 193 of file lis3dsh.h.

◆ LIS3DSH_AD_THRS1_2

#define LIS3DSH_AD_THRS1_2   0x77

Definition at line 194 of file lis3dsh.h.

◆ LIS3DSH_AD_DES2

#define LIS3DSH_AD_DES2   0x78

Definition at line 195 of file lis3dsh.h.

◆ LIS3DSH_AD_MASK2_B

#define LIS3DSH_AD_MASK2_B   0x79

Definition at line 196 of file lis3dsh.h.

◆ LIS3DSH_AD_MASK2_A

#define LIS3DSH_AD_MASK2_A   0x7A

Definition at line 197 of file lis3dsh.h.

◆ LIS3DSH_AD_SETT2

#define LIS3DSH_AD_SETT2   0x7B

Definition at line 198 of file lis3dsh.h.

◆ LIS3DSH_AD_PR2

#define LIS3DSH_AD_PR2   0x7C

Definition at line 199 of file lis3dsh.h.

◆ LIS3DSH_AD_TC2_L

#define LIS3DSH_AD_TC2_L   0x7D

Definition at line 200 of file lis3dsh.h.

◆ LIS3DSH_AD_TC2_H

#define LIS3DSH_AD_TC2_H   0x7E

Definition at line 201 of file lis3dsh.h.

◆ LIS3DSH_AD_OUTS2

#define LIS3DSH_AD_OUTS2   0x7F

Definition at line 202 of file lis3dsh.h.

◆ LIS3DSH_CTRL_REG1_MASK

#define LIS3DSH_CTRL_REG1_MASK   0xE9

Definition at line 209 of file lis3dsh.h.

◆ LIS3DSH_CTRL_REG1_SM1_EN

#define LIS3DSH_CTRL_REG1_SM1_EN   (1 << 0)

Definition at line 210 of file lis3dsh.h.

◆ LIS3DSH_CTRL_REG1_SM1_PIN

#define LIS3DSH_CTRL_REG1_SM1_PIN   (1 << 3)

Definition at line 211 of file lis3dsh.h.

◆ LIS3DSH_CTRL_REG1_HYST0_1

#define LIS3DSH_CTRL_REG1_HYST0_1   (1 << 5)

Definition at line 212 of file lis3dsh.h.

◆ LIS3DSH_CTRL_REG1_HYST1_1

#define LIS3DSH_CTRL_REG1_HYST1_1   (1 << 6)

Definition at line 213 of file lis3dsh.h.

◆ LIS3DSH_CTRL_REG1_HYST2_1

#define LIS3DSH_CTRL_REG1_HYST2_1   (1 << 7)

Definition at line 214 of file lis3dsh.h.

◆ LIS3DSH_CTRL_REG2_MASK

#define LIS3DSH_CTRL_REG2_MASK   0xE9

Definition at line 221 of file lis3dsh.h.

◆ LIS3DSH_CTRL_REG2_SM2_EN

#define LIS3DSH_CTRL_REG2_SM2_EN   (1 << 0)

Definition at line 222 of file lis3dsh.h.

◆ LIS3DSH_CTRL_REG2_SM2_PIN

#define LIS3DSH_CTRL_REG2_SM2_PIN   (1 << 3)

Definition at line 223 of file lis3dsh.h.

◆ LIS3DSH_CTRL_REG2_HYST0_2

#define LIS3DSH_CTRL_REG2_HYST0_2   (1 << 5)

Definition at line 224 of file lis3dsh.h.

◆ LIS3DSH_CTRL_REG2_HYST1_2

#define LIS3DSH_CTRL_REG2_HYST1_2   (1 << 6)

Definition at line 225 of file lis3dsh.h.

◆ LIS3DSH_CTRL_REG2_HYST2_2

#define LIS3DSH_CTRL_REG2_HYST2_2   (1 << 7)

Definition at line 226 of file lis3dsh.h.

◆ LIS3DSH_CTRL_REG3_MASK

#define LIS3DSH_CTRL_REG3_MASK   0xFF

Definition at line 233 of file lis3dsh.h.

◆ LIS3DSH_CTRL_REG3_STRT

#define LIS3DSH_CTRL_REG3_STRT   (1 << 0)

Definition at line 234 of file lis3dsh.h.

◆ LIS3DSH_CTRL_REG3_VFILT

#define LIS3DSH_CTRL_REG3_VFILT   (1 << 2)

Definition at line 235 of file lis3dsh.h.

◆ LIS3DSH_CTRL_REG3_INT1_EN

#define LIS3DSH_CTRL_REG3_INT1_EN   (1 << 3)

Definition at line 236 of file lis3dsh.h.

◆ LIS3DSH_CTRL_REG3_INT2_EN

#define LIS3DSH_CTRL_REG3_INT2_EN   (1 << 4)

Definition at line 237 of file lis3dsh.h.

◆ LIS3DSH_CTRL_REG3_IEL

#define LIS3DSH_CTRL_REG3_IEL   (1 << 5)

Definition at line 238 of file lis3dsh.h.

◆ LIS3DSH_CTRL_REG3_IEA

#define LIS3DSH_CTRL_REG3_IEA   (1 << 6)

Definition at line 239 of file lis3dsh.h.

◆ LIS3DSH_CTRL_REG3_DR_EN

#define LIS3DSH_CTRL_REG3_DR_EN   (1 << 7)

Definition at line 240 of file lis3dsh.h.

◆ LIS3DSH_CTRL_REG4_MASK

#define LIS3DSH_CTRL_REG4_MASK   0xFF

Definition at line 247 of file lis3dsh.h.

◆ LIS3DSH_CTRL_REG4_XEN

#define LIS3DSH_CTRL_REG4_XEN   (1 << 0)

Definition at line 248 of file lis3dsh.h.

Referenced by lis3dshStart().

◆ LIS3DSH_CTRL_REG4_YEN

#define LIS3DSH_CTRL_REG4_YEN   (1 << 1)

Definition at line 249 of file lis3dsh.h.

Referenced by lis3dshStart().

◆ LIS3DSH_CTRL_REG4_ZEN

#define LIS3DSH_CTRL_REG4_ZEN   (1 << 2)

Definition at line 250 of file lis3dsh.h.

Referenced by lis3dshStart().

◆ LIS3DSH_CTRL_REG4_BDU

#define LIS3DSH_CTRL_REG4_BDU   (1 << 3)

Definition at line 251 of file lis3dsh.h.

◆ LIS3DSH_CTRL_REG4_ODR_0

#define LIS3DSH_CTRL_REG4_ODR_0   (1 << 4)

Definition at line 252 of file lis3dsh.h.

◆ LIS3DSH_CTRL_REG4_ODR_1

#define LIS3DSH_CTRL_REG4_ODR_1   (1 << 5)

Definition at line 253 of file lis3dsh.h.

◆ LIS3DSH_CTRL_REG4_ODR_2

#define LIS3DSH_CTRL_REG4_ODR_2   (1 << 6)

Definition at line 254 of file lis3dsh.h.

◆ LIS3DSH_CTRL_REG4_ODR_3

#define LIS3DSH_CTRL_REG4_ODR_3   (1 << 7)

Definition at line 255 of file lis3dsh.h.

◆ LIS3DSH_CTRL_REG5_MASK

#define LIS3DSH_CTRL_REG5_MASK   0xFF

Definition at line 262 of file lis3dsh.h.

◆ LIS3DSH_CTRL_REG5_SIM

#define LIS3DSH_CTRL_REG5_SIM   (1 << 0)

Definition at line 263 of file lis3dsh.h.

◆ LIS3DSH_CTRL_REG5_ST1

#define LIS3DSH_CTRL_REG5_ST1   (1 << 1)

Definition at line 264 of file lis3dsh.h.

◆ LIS3DSH_CTRL_REG5_ST2

#define LIS3DSH_CTRL_REG5_ST2   (1 << 2)

Definition at line 265 of file lis3dsh.h.

◆ LIS3DSH_CTRL_REG5_FS_MASK

#define LIS3DSH_CTRL_REG5_FS_MASK   0x38

Definition at line 266 of file lis3dsh.h.

Referenced by acc_set_full_scale().

◆ LIS3DSH_CTRL_REG5_FS0

#define LIS3DSH_CTRL_REG5_FS0   (1 << 3)

Definition at line 267 of file lis3dsh.h.

◆ LIS3DSH_CTRL_REG5_FS1

#define LIS3DSH_CTRL_REG5_FS1   (1 << 4)

Definition at line 268 of file lis3dsh.h.

◆ LIS3DSH_CTRL_REG5_FS2

#define LIS3DSH_CTRL_REG5_FS2   (1 << 5)

Definition at line 269 of file lis3dsh.h.

◆ LIS3DSH_CTRL_REG5_BW1

#define LIS3DSH_CTRL_REG5_BW1   (1 << 6)

Definition at line 270 of file lis3dsh.h.

◆ LIS3DSH_CTRL_REG5_BW2

#define LIS3DSH_CTRL_REG5_BW2   (1 << 7)

Definition at line 271 of file lis3dsh.h.

◆ LIS3DSH_CTRL_REG6_MASK

#define LIS3DSH_CTRL_REG6_MASK   0xFF

Definition at line 278 of file lis3dsh.h.

◆ LIS3DSH_CTRL_REG6_P2_BOOT

#define LIS3DSH_CTRL_REG6_P2_BOOT   (1 << 0)

Definition at line 279 of file lis3dsh.h.

◆ LIS3DSH_CTRL_REG6_P1_OVRUN

#define LIS3DSH_CTRL_REG6_P1_OVRUN   (1 << 1)

Definition at line 280 of file lis3dsh.h.

◆ LIS3DSH_CTRL_REG6_P1_WTM

#define LIS3DSH_CTRL_REG6_P1_WTM   (1 << 2)

Definition at line 281 of file lis3dsh.h.

◆ LIS3DSH_CTRL_REG6_P1_EMPTY

#define LIS3DSH_CTRL_REG6_P1_EMPTY   (1 << 3)

Definition at line 282 of file lis3dsh.h.

◆ LIS3DSH_CTRL_REG6_ADD_INC

#define LIS3DSH_CTRL_REG6_ADD_INC   (1 << 4)

Definition at line 283 of file lis3dsh.h.

Referenced by lis3dshStart().

◆ LIS3DSH_CTRL_REG6_WTM_EN

#define LIS3DSH_CTRL_REG6_WTM_EN   (1 << 5)

Definition at line 284 of file lis3dsh.h.

◆ LIS3DSH_CTRL_REG6_FIFO_EN

#define LIS3DSH_CTRL_REG6_FIFO_EN   (1 << 6)

Definition at line 285 of file lis3dsh.h.

◆ LIS3DSH_CTRL_REG6_BOOT

#define LIS3DSH_CTRL_REG6_BOOT   (1 << 7)

Definition at line 286 of file lis3dsh.h.

◆ LIS3DSH_USE_SPI

#define LIS3DSH_USE_SPI   TRUE

LIS3DSH SPI interface switch.

If set to TRUE the support for SPI is included.

Note
The default is TRUE.

Definition at line 303 of file lis3dsh.h.

◆ LIS3DSH_SHARED_SPI

#define LIS3DSH_SHARED_SPI   FALSE

LIS3DSH 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 313 of file lis3dsh.h.

◆ LIS3DSH_USE_I2C

#define LIS3DSH_USE_I2C   FALSE

LIS3DSH I2C interface switch.

If set to TRUE the support for I2C is included.

Note
The default is FALSE.

Definition at line 322 of file lis3dsh.h.

◆ LIS3DSH_SHARED_I2C

#define LIS3DSH_SHARED_I2C   FALSE

LIS3DSH 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 332 of file lis3dsh.h.

◆ LIS3DSH_USE_ADVANCED

#define LIS3DSH_USE_ADVANCED   FALSE

LIS3DSH advanced configurations switch.

If set to TRUE more configurations are available.

Note
The default is FALSE.

Definition at line 341 of file lis3dsh.h.

◆ _lis3dsh_methods_alone

#define _lis3dsh_methods_alone
Value:
/* Change full scale value of LIS3DSH accelerometer subsystem.*/ \
static msg_t acc_set_full_scale(ADXL355Driver *devp, adxl355_acc_fs_t fs)
Changes the ADXL355Driver accelerometer fullscale value.
Definition adxl355.c:301
lis3dsh_acc_fs_t
LIS3DSH full scale.
Definition lis3dsh.h:392
LIS3DSH 3-axis accelerometer class.
Definition lis3dsh.h:541

LIS3DSH specific methods.

Definition at line 499 of file lis3dsh.h.

◆ _lis3dsh_methods

#define _lis3dsh_methods
Value:
_base_object_methods \
_lis3dsh_methods_alone

LIS3DSH specific methods with inherited ones.

Definition at line 507 of file lis3dsh.h.

◆ _lis3dsh_data

#define _lis3dsh_data
Value:
/* Driver state.*/ \
lis3dsh_state_t state; \
/* Current configuration data.*/ \
const LIS3DSHConfig *config; \
/* Accelerometer subsystem axes number.*/ \
size_t accaxes; \
/* Accelerometer subsystem current sensitivity.*/ \
float accsensitivity[LIS3DSH_ACC_NUMBER_OF_AXES]; \
/* Accelerometer subsystem current bias .*/ \
float accbias[LIS3DSH_ACC_NUMBER_OF_AXES]; \
/* Accelerometer subsystem current full scale value.*/ \
float accfullscale;
#define _base_sensor_data
BaseSensor specific data.
Definition ex_sensors.h:74
#define LIS3DSH_ACC_NUMBER_OF_AXES
LIS3DSH accelerometer subsystem characteristics.
Definition lis3dsh.h:72
lis3dsh_state_t
Driver state machine possible states.
Definition lis3dsh.h:437
LIS3DSH configuration structure.
Definition lis3dsh.h:446

LIS3DSHDriver specific data.

Definition at line 523 of file lis3dsh.h.

◆ lis3dshAccelerometerGetAxesNumber

#define lis3dshAccelerometerGetAxesNumber ( devp)
Value:
accelerometerGetAxesNumber(&((devp)->acc_if))
#define accelerometerGetAxesNumber(ip)
Accelerometer get axes number.

Return the number of axes of the BaseAccelerometer.

Parameters
[in]devppointer to LIS3DSHDriver.
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 563 of file lis3dsh.h.

◆ lis3dshAccelerometerReadRaw

#define lis3dshAccelerometerReadRaw ( devp,
axes )
Value:
accelerometerReadRaw(&((devp)->acc_if), axes)
#define accelerometerReadRaw(ip, dp)
Accelerometer read raw data.

Retrieves raw data from the BaseAccelerometer.

Note
This data is retrieved from MEMS register without any algebraical manipulation.
The axes array must be at least the same size of the BaseAccelerometer axes number.
Parameters
[in]devppointer to LIS3DSHDriver.
[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 584 of file lis3dsh.h.

◆ lis3dshAccelerometerReadCooked

#define lis3dshAccelerometerReadCooked ( devp,
axes )
Value:
accelerometerReadCooked(&((devp)->acc_if), axes)
#define accelerometerReadCooked(ip, dp)
Accelerometer read cooked data.

Retrieves cooked data from the BaseAccelerometer.

Note
This data is manipulated according to the formula cooked = (raw * sensitivity) - bias.
Final data is expressed as milli-G.
The axes array must be at least the same size of the BaseAccelerometer axes number.
Parameters
[in]devppointer to LIS3DSHDriver.
[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 606 of file lis3dsh.h.

◆ lis3dshAccelerometerSetBias

#define lis3dshAccelerometerSetBias ( devp,
bp )
Value:
accelerometerSetBias(&((devp)->acc_if), bp)
#define accelerometerSetBias(ip, bp)
Updates accelerometer bias data from received buffer.

Set bias values for the BaseAccelerometer.

Note
Bias must be expressed as milli-G.
The bias buffer must be at least the same size of the BaseAccelerometer axes number.
Parameters
[in]devppointer to LIS3DSHDriver.
[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 623 of file lis3dsh.h.

◆ lis3dshAccelerometerResetBias

#define lis3dshAccelerometerResetBias ( devp)
Value:
accelerometerResetBias(&((devp)->acc_if))
#define accelerometerResetBias(ip)
Reset accelerometer bias data restoring it to zero.

Reset bias values for the BaseAccelerometer.

Note
Default biases value are obtained from device datasheet when available otherwise they are considered zero.
Parameters
[in]devppointer to LIS3DSHDriver.
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 638 of file lis3dsh.h.

◆ lis3dshAccelerometerSetSensitivity

#define lis3dshAccelerometerSetSensitivity ( devp,
sp )
Value:
accelerometerSetSensitivity(&((devp)->acc_if), sp)
#define accelerometerSetSensitivity(ip, sp)
Updates accelerometer sensitivity data from received buffer.

Set sensitivity values for the BaseAccelerometer.

Note
Sensitivity must be expressed as milli-G/LSB.
The sensitivity buffer must be at least the same size of the BaseAccelerometer axes number.
Parameters
[in]devppointer to LIS3DSHDriver.
[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 655 of file lis3dsh.h.

◆ lis3dshAccelerometerResetSensitivity

#define lis3dshAccelerometerResetSensitivity ( devp)
Value:
accelerometerResetSensitivity(&((devp)->acc_if))
#define accelerometerResetSensitivity(ip)
Reset accelerometer sensitivity data restoring it to its typical value.

Reset sensitivity values for the BaseAccelerometer.

Note
Default sensitivities value are obtained from device datasheet.
Parameters
[in]devppointer to LIS3DSHDriver.
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 670 of file lis3dsh.h.

◆ lis3dshAccelerometerSetFullScale

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

Changes the LIS3DSHDriver accelerometer 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 LIS3DSHDriver.
[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 688 of file lis3dsh.h.

Typedef Documentation

◆ LIS3DSHDriver

typedef struct LIS3DSHDriver LIS3DSHDriver

Structure representing a LIS3DSH driver.

Definition at line 387 of file lis3dsh.h.

Enumeration Type Documentation

◆ lis3dsh_acc_fs_t

LIS3DSH full scale.

Enumerator
LIS3DSH_ACC_FS_2G 

Full scale �2g.

LIS3DSH_ACC_FS_4G 

Full scale �4g.

LIS3DSH_ACC_FS_6G 

Full scale �6g.

LIS3DSH_ACC_FS_8G 

Full scale �8g.

LIS3DSH_ACC_FS_16G 

Full scale �16g.

Definition at line 392 of file lis3dsh.h.

◆ lis3dsh_acc_odr_t

LIS3DSH output data rate.

Enumerator
LIS3DSH_ACC_ODR_PD 

ODR 100 Hz.

LIS3DSH_ACC_ODR_3_125HZ 

ODR 3.125 Hz.

LIS3DSH_ACC_ODR_6_25HZ 

ODR 6.25 Hz.

LIS3DSH_ACC_ODR_12_5HZ 

ODR 12.5 Hz.

LIS3DSH_ACC_ODR_25HZ 

ODR 25 Hz.

LIS3DSH_ACC_ODR_50HZ 

ODR 50 Hz.

LIS3DSH_ACC_ODR_100HZ 

ODR 100 Hz.

LIS3DSH_ACC_ODR_400HZ 

ODR 400 Hz.

LIS3DSH_ACC_ODR_800HZ 

ODR 800 Hz.

LIS3DSH_ACC_ODR_1600HZ 

ODR 1600 Hz.

Definition at line 403 of file lis3dsh.h.

◆ lis3dsh_acc_bw_t

LIS3DSH anti-aliasing bandwidth.

Enumerator
LIS3DSH_ACC_BW_800HZ 

AA filter BW 800Hz.

LIS3DSH_ACC_BW_200HZ 

AA filter BW 200Hz.

LIS3DSH_ACC_BW_400HZ 

AA filter BW 400Hz.

LIS3DSH_ACC_BW_50HZ 

AA filter BW 50Hz.

Definition at line 419 of file lis3dsh.h.

◆ lis3dsh_acc_bdu_t

LIS3DSH block data update.

Enumerator
LIS3DSH_ACC_BDU_CONTINUOUS 

Block data continuously updated.

LIS3DSH_ACC_BDU_BLOCKED 

Block data updated after reading.

Definition at line 429 of file lis3dsh.h.

◆ lis3dsh_state_t

Driver state machine possible states.

Enumerator
LIS3DSH_UNINIT 

Not initialized.

LIS3DSH_STOP 

Stopped.

LIS3DSH_READY 

Ready.

Definition at line 437 of file lis3dsh.h.

Function Documentation

◆ lis3dshSPIReadRegister()

void lis3dshSPIReadRegister ( SPIDriver * spip,
uint8_t reg,
size_t n,
uint8_t * b )
static

Reads a generic register value using SPI.

Precondition
The SPI interface must be initialized and the driver started.
Note
Multiple write/read requires proper settings in CTRL_REG6.
Parameters
[in]spippointer to the SPI interface
[in]regstarting register address
[in]nnumber of adjacent registers to write
[in]bpointer to a buffer.

Definition at line 60 of file lis3dsh.c.

References LIS3DSH_RW, spiReceive(), spiSelect(), spiSend(), and spiUnselect().

Referenced by acc_read_raw(), and acc_set_full_scale().

Here is the call graph for this function:

◆ lis3dshSPIWriteRegister()

void lis3dshSPIWriteRegister ( SPIDriver * spip,
uint8_t reg,
size_t n,
uint8_t * b )
static

Writes a value into a generic register using SPI.

Precondition
The SPI interface must be initialized and the driver started.
Note
Multiple write/read requires proper settings in CTRL_REG6.
Parameters
[in]spippointer to the SPI interface
[in]regstarting register address
[in]nnumber of adjacent registers to write
[in]bpointer to a buffer of values.

Definition at line 80 of file lis3dsh.c.

References spiSelect(), spiSend(), and spiUnselect().

Referenced by acc_set_full_scale(), lis3dshStart(), and lis3dshStop().

Here is the call graph for this function:

◆ acc_get_axes_number()

size_t acc_get_axes_number ( void * ip)
static

Return the number of axes of the BaseAccelerometer.

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

Definition at line 98 of file lis3dsh.c.

References LIS3DSH_ACC_NUMBER_OF_AXES.

◆ acc_read_raw()

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

Retrieves raw data from the BaseAccelerometer.

Note
This data is retrieved from MEMS register without any algebraical manipulation.
The axes array must be at least the same size of the BaseAccelerometer axes number.
Parameters
[in]ippointer to BaseAccelerometer 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 120 of file lis3dsh.c.

References LIS3DSH_ACC_NUMBER_OF_AXES, LIS3DSH_AD_OUT_X_L, LIS3DSH_READY, lis3dshSPIReadRegister(), MSG_OK, objGetInstance, osalDbgAssert, osalDbgCheck, SPI_READY, spiAcquireBus(), spiReleaseBus(), and spiStart().

Referenced by acc_read_cooked().

Here is the call graph for this function:

◆ acc_read_cooked()

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

Retrieves cooked data from the BaseAccelerometer.

Note
This data is manipulated according to the formula cooked = (raw * sensitivity) - bias.
Final data is expressed as milli-G.
The axes array must be at least the same size of the BaseAccelerometer axes number.
Parameters
[in]ippointer to BaseAccelerometer 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 176 of file lis3dsh.c.

References acc_read_raw(), LIS3DSH_ACC_NUMBER_OF_AXES, LIS3DSH_READY, objGetInstance, osalDbgAssert, and osalDbgCheck.

Here is the call graph for this function:

◆ acc_set_bias()

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

Set bias values for the BaseAccelerometer.

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

Definition at line 209 of file lis3dsh.c.

References LIS3DSH_ACC_NUMBER_OF_AXES, LIS3DSH_READY, MSG_OK, objGetInstance, osalDbgAssert, and osalDbgCheck.

◆ acc_reset_bias()

msg_t acc_reset_bias ( void * ip)
static

Reset bias values for the BaseAccelerometer.

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

Definition at line 238 of file lis3dsh.c.

References LIS3DSH_ACC_BIAS, LIS3DSH_ACC_NUMBER_OF_AXES, LIS3DSH_READY, MSG_OK, objGetInstance, osalDbgAssert, and osalDbgCheck.

◆ acc_set_sensivity()

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

Set sensitivity values for the BaseAccelerometer.

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

Definition at line 268 of file lis3dsh.c.

References LIS3DSH_ACC_NUMBER_OF_AXES, LIS3DSH_READY, MSG_OK, objGetInstance, osalDbgAssert, and osalDbgCheck.

◆ acc_reset_sensivity()

msg_t acc_reset_sensivity ( void * ip)
static

Reset sensitivity values for the BaseAccelerometer.

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

Definition at line 297 of file lis3dsh.c.

References FALSE, LIS3DSH_ACC_FS_16G, LIS3DSH_ACC_FS_2G, LIS3DSH_ACC_FS_4G, LIS3DSH_ACC_FS_6G, LIS3DSH_ACC_FS_8G, LIS3DSH_ACC_NUMBER_OF_AXES, LIS3DSH_ACC_SENS_16G, LIS3DSH_ACC_SENS_2G, LIS3DSH_ACC_SENS_4G, LIS3DSH_ACC_SENS_6G, LIS3DSH_ACC_SENS_8G, LIS3DSH_READY, MSG_OK, MSG_RESET, objGetInstance, osalDbgAssert, and osalDbgCheck.

◆ acc_set_full_scale()

msg_t acc_set_full_scale ( LIS3DSHDriver * devp,
lis3dsh_acc_fs_t fs )
static

Changes the LIS3DSHDriver accelerometer 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 LIS3DSHDriver interface.
[in]fsnew fullscale value.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.
MSG_RESETotherwise.

Definition at line 346 of file lis3dsh.c.

References LIS3DSH_ACC_16G, LIS3DSH_ACC_2G, LIS3DSH_ACC_4G, LIS3DSH_ACC_6G, LIS3DSH_ACC_8G, LIS3DSH_ACC_FS_16G, LIS3DSH_ACC_FS_2G, LIS3DSH_ACC_FS_4G, LIS3DSH_ACC_FS_6G, LIS3DSH_ACC_FS_8G, LIS3DSH_ACC_NUMBER_OF_AXES, LIS3DSH_AD_CTRL_REG5, LIS3DSH_CTRL_REG5_FS_MASK, LIS3DSH_READY, lis3dshSPIReadRegister(), lis3dshSPIWriteRegister(), MSG_OK, MSG_RESET, osalDbgAssert, osalDbgCheck, SPI_READY, spiAcquireBus(), spiReleaseBus(), and spiStart().

Here is the call graph for this function:

◆ lis3dshObjectInit()

void lis3dshObjectInit ( LIS3DSHDriver * devp)

Initializes an instance.

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

Definition at line 453 of file lis3dsh.c.

References LIS3DSHDriver::acc_if, LIS3DSH_ACC_NUMBER_OF_AXES, LIS3DSH_STOP, BaseAccelerometer::vmt, LIS3DSHDriver::vmt, vmt_accelerometer, and vmt_device.

◆ lis3dshStart()

void lis3dshStart ( LIS3DSHDriver * devp,
const LIS3DSHConfig * config )

◆ lis3dshStop()

void lis3dshStop ( LIS3DSHDriver * devp)

Deactivates the LIS3DSH Complex Driver peripheral.

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

Definition at line 618 of file lis3dsh.c.

References LIS3DSH_AD_CTRL_REG4, LIS3DSH_READY, LIS3DSH_STOP, lis3dshSPIWriteRegister(), osalDbgAssert, osalDbgCheck, spiAcquireBus(), spiReleaseBus(), spiStart(), and spiStop().

Here is the call graph for this function:

Variable Documentation

◆ vmt_device

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

Definition at line 431 of file lis3dsh.c.

◆ vmt_accelerometer

const struct BaseAccelerometerVMT vmt_accelerometer
static
Initial value:
= {
sizeof(struct LIS3DSHVMT*),
}
static size_t acc_get_axes_number(void *ip)
Return the number of axes of the BaseAccelerometer.
Definition adxl317.c:115
static msg_t acc_reset_sensivity(void *ip)
Reset sensitivity values for the BaseAccelerometer.
Definition adxl317.c:310
static msg_t acc_set_bias(void *ip, float *bp)
Set bias values for the BaseAccelerometer.
Definition adxl317.c:222
static msg_t acc_reset_bias(void *ip)
Reset bias values for the BaseAccelerometer.
Definition adxl317.c:251
static msg_t acc_set_sensivity(void *ip, float *sp)
Set sensitivity values for the BaseAccelerometer.
Definition adxl317.c:281
static msg_t acc_read_cooked(void *ip, float axes[])
Retrieves cooked data from the BaseAccelerometer.
Definition adxl317.c:185
static msg_t acc_read_raw(void *ip, int32_t axes[])
Retrieves raw data from the BaseAccelerometer.
Definition adxl317.c:137
LIS3DSH virtual methods table.
Definition lis3dsh.h:516

Definition at line 436 of file lis3dsh.c.