ChibiOS 21.11.4

Detailed Description

Collaboration diagram for ADXL355:

ADXL355 data structures and types

enum  adxl355_acc_fs_t { ADXL355_ACC_FS_2G = 0x01 , ADXL355_ACC_FS_4G = 0x02 , ADXL355_ACC_FS_8G = 0x03 }
 ADXL355 full scale. More...
enum  adxl355_acc_odr_t {
  ADXL355_ACC_ODR_4000HZ = 0x00 , ADXL355_ACC_ODR_2000HZ = 0x01 , ADXL355_ACC_ODR_1000HZ = 0x02 , ADXL355_ACC_ODR_500HZ = 0x03 ,
  ADXL355_ACC_ODR_250HZ = 0x04 , ADXL355_ACC_ODR_125HZ = 0x06 , ADXL355_ACC_ODR_62P5HZ = 0x06 , ADXL355_ACC_ODR_31P25HZ = 0x07 ,
  ADXL355_ACC_ODR_15P625HZ = 0x08 , ADXL355_ACC_ODR_7P913HZ = 0x09 , ADXL355_ACC_ODR_3P906HZ = 0x0A
}
 ADXL355 output data rate. More...
enum  adxl355_acc_hp_t {
  ADXL355_ACC_HP_DISABLED = 0x00 , ADXL355_ACC_HP_LEV_1 = 0x10 , ADXL355_ACC_HP_LEV_2 = 0x20 , ADXL355_ACC_HP_LEV_3 = 0x30 ,
  ADXL355_ACC_HP_LEV_4 = 0x40 , ADXL355_ACC_HP_LEV_5 = 0x50 , ADXL355_ACC_HP_LEV_6 = 0x60
}
 ADXL355 HP filter. More...
enum  adxl355_state_t { ADXL355_UNINIT = 0 , ADXL355_STOP = 1 , ADXL355_READY = 2 }
 Driver state machine possible states. More...
typedef struct ADXL355Driver ADXL355Driver
 Structure representing a ADXL355 driver.
#define _adxl355_methods_alone
 ADXL355 specific methods.
#define _adxl355_methods
 ADXL355 specific methods with inherited ones.
#define _adxl355_data
 ADXL355Driver specific data.

Version identification

#define EX_ADXL355_VERSION   "1.1.0"
 ADXL355 driver version string.
#define EX_ADXL355_MAJOR   1
 ADXL355 driver version major number.
#define EX_ADXL355_MINOR   1
 ADXL355 driver version minor number.
#define EX_ADXL355_PATCH   0
 ADXL355 driver version patch number.
#define ADXL355_ACC_NUMBER_OF_AXES   3U
 ADXL355 accelerometer subsystem characteristics.
#define ADXL355_ACC_2G   2.048f
#define ADXL355_ACC_4G   4.096f
#define ADXL355_ACC_8G   8.0192f
#define ADXL355_ACC_SENS_2G   0.003906f
#define ADXL355_ACC_SENS_4G   0.007813f
#define ADXL355_ACC_SENS_8G   0.015625f
#define ADXL355_ACC_BIAS   0.0f

ADXL355 communication interfaces related bit masks

#define ADXL355_DI_MASK   0xFF
#define ADXL355_DI(n)
#define ADXL355_AD_MASK   0xFE
#define ADXL355_RW   (1 << 0)
#define ADXL355_AD(n)

ADXL355 register addresses

#define ADXL355_AD_DEVID_AD   0x00
#define ADXL355_AD_DEVID_MST   0x01
#define ADXL355_AD_PARTID   0x02
#define ADXL355_AD_REVID   0x03
#define ADXL355_AD_STATUS   0x04
#define ADXL355_AD_FIFO_ENTRIES   0x05
#define ADXL355_AD_TEMP2   0x06
#define ADXL355_AD_TEMP1   0x07
#define ADXL355_AD_XDATA3   0x08
#define ADXL355_AD_XDATA2   0x09
#define ADXL355_AD_XDATA1   0x0A
#define ADXL355_AD_YDATA3   0x0B
#define ADXL355_AD_YDATA2   0x0C
#define ADXL355_AD_YDATA1   0x0D
#define ADXL355_AD_ZDATA3   0x0E
#define ADXL355_AD_ZDATA2   0x0F
#define ADXL355_AD_ZDATA1   0x10
#define ADXL355_AD_FIFO_DATA   0x11
#define ADXL355_AD_OFFSET_X_H   0x1E
#define ADXL355_AD_OFFSET_X_L   0x1F
#define ADXL355_AD_OFFSET_Y_H   0x20
#define ADXL355_AD_OFFSET_Y_L   0x21
#define ADXL355_AD_OFFSET_Z_H   0x22
#define ADXL355_AD_OFFSET_Z_L   0x23
#define ADXL355_AD_ACT_EN   0x24
#define ADXL355_AD_ACT_THRES_L   0x25
#define ADXL355_AD_ACT_THRES_H   0x26
#define ADXL355_AD_ACT_COUNTER   0x27
#define ADXL355_AD_FILTER   0x28
#define ADXL355_AD_FIFO_SAMPLES   0x29
#define ADXL355_AD_INT_MAP   0x2A
#define ADXL355_AD_SYNC   0x2B
#define ADXL355_AD_RANGE   0x2C
#define ADXL355_AD_POWER_CTL   0x2D
#define ADXL355_AD_SELF_TEST   0x2E
#define ADXL355_AD_RESET   0x2F

ADXL355 Device Identifier

#define ADXL355_DEVID_MST   0x1D

ADXL355_FILTER register bits definitions

#define ADXL355_FILTER_MASK   0x7F
#define ADXL355_FILTER_ORD_LPF_0   (1 << 0)
#define ADXL355_FILTER_ORD_LPF_1   (1 << 1)
#define ADXL355_FILTER_ORD_LPF_2   (1 << 2)
#define ADXL355_FILTER_ORD_LPF_3   (1 << 3)
#define ADXL355_FILTER_HPF_CORNER_0   (1 << 4)
#define ADXL355_FILTER_HPF_CORNER_1   (1 << 5)
#define ADXL355_FILTER_HPF_CORNER_2   (1 << 6)

ADXL355_FIFO_SAMPLES register bits definitions

#define ADXL355_FIFO_SAMPLES_MASK   0x7F
#define ADXL355_FIFO_SAMPLES_BIT_0   (1 << 0)
#define ADXL355_FIFO_SAMPLES_BIT_1   (1 << 1)
#define ADXL355_FIFO_SAMPLES_BIT_2   (1 << 2)
#define ADXL355_FIFO_SAMPLES_BIT_3   (1 << 3)
#define ADXL355_FIFO_SAMPLES_BIT_4   (1 << 4)
#define ADXL355_FIFO_SAMPLES_BIT_5   (1 << 5)
#define ADXL355_FIFO_SAMPLES_BIT_6   (1 << 6)

ADXL355_INT_MAP register bits definitions

#define ADXL355_INT_MAP_MASK   0xFF
#define ADXL355_INT_MAP_RDY_EN1   (1 << 0)
#define ADXL355_INT_MAP_FULL_EN1   (1 << 1)
#define ADXL355_INT_MAP_OVR_EN1   (1 << 2)
#define ADXL355_INT_MAP_ACT_EN1   (1 << 3)
#define ADXL355_INT_MAP_RDY_EN2   (1 << 4)
#define ADXL355_INT_MAP_FULL_EN2   (1 << 5)
#define ADXL355_INT_MAP_OVR_EN2   (1 << 6)
#define ADXL355_INT_MAP_ACT_EN2   (1 << 7)

ADXL355_SYNC register bits definitions

#define ADXL355_SYNC_MASK   0x07
#define ADXL355_SYNC_EXT_SYNC_0   (1 << 0)
#define ADXL355_SYNC_EXT_SYNC_1   (1 << 1)
#define ADXL355_SYNC_EXT_CLK   (1 << 2)

ADXL355_RANGE register bits definitions

#define ADXL355_RANGE_MASK   0xC3
#define ADXL355_RANGE_RANGE_MASK   0x03
#define ADXL355_RANGE_RANGE_1   (1 << 1)
#define ADXL355_RANGE_RANGE_1   (1 << 1)
#define ADXL355_RANGE_RANGE_0   (1 << 0)
#define ADXL355_RANGE_INT_POL   (1 << 6)
#define ADXL355_RANGE_I2C_HS   (1 << 7)

ADXL355_POWER_CTL register bits definitions

#define ADXL355_POWER_CTL_MASK   0x07
#define ADXL355_POWER_CTL_STANDBY   (1 << 0)
#define ADXL355_POWER_CTL_TEMP_OFF   (1 << 1)
#define ADXL355_POWER_CTL_DRDY_OFF   (1 << 2)

ADXL355_SELT_TEST register bits definitions

#define ADXL355_SELF_TEST_MASK   0x03
#define ADXL355_SELF_TEST_ST1   (1 << 0)
#define ADXL355_SELF_TEST_ST2   (1 << 1)

Configuration options

#define ADXL355_USE_SPI   TRUE
 ADXL355 SPI interface switch.
#define ADXL355_SHARED_SPI   FALSE
 ADXL355 shared SPI switch.
#define ADXL355_USE_I2C   FALSE
 ADXL355 I2C interface switch.
#define ADXL355_SHARED_I2C   FALSE
 ADXL355 shared I2C switch.
#define ADXL355_USE_ADVANCED   FALSE
 ADXL355 advanced configurations switch.
#define ADXL355_COMM_BUFF_SIZE   32
 ADXL355 internal communication buffer sizes.

Data Structures

struct  ADXL355Config
 ADXL355 configuration structure. More...
struct  ADXL355VMT
 ADXL355 virtual methods table. More...
struct  ADXL355Driver
 ADXL355 3-axis accelerometer class. More...

Macros

#define adxl355AccelerometerGetAxesNumber(devp)
 Return the number of axes of the BaseAccelerometer.
#define adxl355AccelerometerReadRaw(devp, axes)
 Retrieves raw data from the BaseAccelerometer.
#define adxl355AccelerometerReadCooked(devp, axes)
 Retrieves cooked data from the BaseAccelerometer.
#define adxl355AccelerometerSetBias(devp, bp)
 Set bias values for the BaseAccelerometer.
#define adxl355AccelerometerResetBias(devp)
 Reset bias values for the BaseAccelerometer.
#define adxl355AccelerometerSetSensitivity(devp, sp)
 Set sensitivity values for the BaseAccelerometer.
#define adxl355AccelerometerResetSensitivity(devp)
 Reset sensitivity values for the BaseAccelerometer.
#define adxl355AccelerometerSetFullScale(devp, fs)
 Changes the ADXL355Driver accelerometer fullscale value.

Functions

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 (ADXL355Driver *devp, adxl355_acc_fs_t fs)
 Changes the ADXL355Driver accelerometer fullscale value.
void adxl355SPIReadRegister (ADXL355Driver *devp, uint8_t reg, size_t n, uint8_t *b)
 Reads a generic register value using SPI.
void adxl355SPIWriteRegister (ADXL355Driver *devp, uint8_t reg, size_t n, uint8_t *b)
 Writes a value into a generic register using SPI.
void adxl355ObjectInit (ADXL355Driver *devp, uint8_t *txbp, uint8_t *rxbp)
 Initializes an instance.
void adxl355Start (ADXL355Driver *devp, const ADXL355Config *config)
 Configures and activates ADXL355 Complex Driver peripheral.
void adxl355Stop (ADXL355Driver *devp)
 Deactivates the ADXL355 Complex Driver peripheral.

Variables

static const struct ADXL355VMT vmt_device
static const struct BaseAccelerometerVMT vmt_accelerometer

Macro Definition Documentation

◆ EX_ADXL355_VERSION

#define EX_ADXL355_VERSION   "1.1.0"

ADXL355 driver version string.

Definition at line 46 of file adxl355.h.

◆ EX_ADXL355_MAJOR

#define EX_ADXL355_MAJOR   1

ADXL355 driver version major number.

Definition at line 51 of file adxl355.h.

◆ EX_ADXL355_MINOR

#define EX_ADXL355_MINOR   1

ADXL355 driver version minor number.

Definition at line 56 of file adxl355.h.

◆ EX_ADXL355_PATCH

#define EX_ADXL355_PATCH   0

ADXL355 driver version patch number.

Definition at line 61 of file adxl355.h.

◆ ADXL355_ACC_NUMBER_OF_AXES

#define ADXL355_ACC_NUMBER_OF_AXES   3U

ADXL355 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 adxl355.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(), adxl355ObjectInit(), and adxl355Start().

◆ ADXL355_ACC_2G

#define ADXL355_ACC_2G   2.048f

Definition at line 74 of file adxl355.h.

Referenced by acc_set_full_scale(), and adxl355Start().

◆ ADXL355_ACC_4G

#define ADXL355_ACC_4G   4.096f

Definition at line 75 of file adxl355.h.

Referenced by acc_set_full_scale(), and adxl355Start().

◆ ADXL355_ACC_8G

#define ADXL355_ACC_8G   8.0192f

Definition at line 76 of file adxl355.h.

Referenced by acc_set_full_scale(), and adxl355Start().

◆ ADXL355_ACC_SENS_2G

#define ADXL355_ACC_SENS_2G   0.003906f

Definition at line 78 of file adxl355.h.

Referenced by acc_reset_sensivity(), and adxl355Start().

◆ ADXL355_ACC_SENS_4G

#define ADXL355_ACC_SENS_4G   0.007813f

Definition at line 79 of file adxl355.h.

Referenced by acc_reset_sensivity(), and adxl355Start().

◆ ADXL355_ACC_SENS_8G

#define ADXL355_ACC_SENS_8G   0.015625f

Definition at line 80 of file adxl355.h.

Referenced by acc_reset_sensivity(), and adxl355Start().

◆ ADXL355_ACC_BIAS

#define ADXL355_ACC_BIAS   0.0f

Definition at line 82 of file adxl355.h.

Referenced by acc_reset_bias(), and adxl355Start().

◆ ADXL355_DI_MASK

#define ADXL355_DI_MASK   0xFF

Definition at line 89 of file adxl355.h.

◆ ADXL355_DI

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

Definition at line 90 of file adxl355.h.

◆ ADXL355_AD_MASK

#define ADXL355_AD_MASK   0xFE

Definition at line 91 of file adxl355.h.

◆ ADXL355_RW

#define ADXL355_RW   (1 << 0)

Definition at line 92 of file adxl355.h.

Referenced by adxl355SPIReadRegister().

◆ ADXL355_AD

#define ADXL355_AD ( n)
Value:
(1 << (n + 1))

Definition at line 93 of file adxl355.h.

◆ ADXL355_AD_DEVID_AD

#define ADXL355_AD_DEVID_AD   0x00

Definition at line 100 of file adxl355.h.

◆ ADXL355_AD_DEVID_MST

#define ADXL355_AD_DEVID_MST   0x01

Definition at line 101 of file adxl355.h.

Referenced by adxl355Start().

◆ ADXL355_AD_PARTID

#define ADXL355_AD_PARTID   0x02

Definition at line 102 of file adxl355.h.

◆ ADXL355_AD_REVID

#define ADXL355_AD_REVID   0x03

Definition at line 103 of file adxl355.h.

◆ ADXL355_AD_STATUS

#define ADXL355_AD_STATUS   0x04

Definition at line 104 of file adxl355.h.

◆ ADXL355_AD_FIFO_ENTRIES

#define ADXL355_AD_FIFO_ENTRIES   0x05

Definition at line 105 of file adxl355.h.

◆ ADXL355_AD_TEMP2

#define ADXL355_AD_TEMP2   0x06

Definition at line 106 of file adxl355.h.

◆ ADXL355_AD_TEMP1

#define ADXL355_AD_TEMP1   0x07

Definition at line 107 of file adxl355.h.

◆ ADXL355_AD_XDATA3

#define ADXL355_AD_XDATA3   0x08

Definition at line 108 of file adxl355.h.

Referenced by acc_read_raw().

◆ ADXL355_AD_XDATA2

#define ADXL355_AD_XDATA2   0x09

Definition at line 109 of file adxl355.h.

◆ ADXL355_AD_XDATA1

#define ADXL355_AD_XDATA1   0x0A

Definition at line 110 of file adxl355.h.

◆ ADXL355_AD_YDATA3

#define ADXL355_AD_YDATA3   0x0B

Definition at line 111 of file adxl355.h.

◆ ADXL355_AD_YDATA2

#define ADXL355_AD_YDATA2   0x0C

Definition at line 112 of file adxl355.h.

◆ ADXL355_AD_YDATA1

#define ADXL355_AD_YDATA1   0x0D

Definition at line 113 of file adxl355.h.

◆ ADXL355_AD_ZDATA3

#define ADXL355_AD_ZDATA3   0x0E

Definition at line 114 of file adxl355.h.

◆ ADXL355_AD_ZDATA2

#define ADXL355_AD_ZDATA2   0x0F

Definition at line 115 of file adxl355.h.

◆ ADXL355_AD_ZDATA1

#define ADXL355_AD_ZDATA1   0x10

Definition at line 116 of file adxl355.h.

◆ ADXL355_AD_FIFO_DATA

#define ADXL355_AD_FIFO_DATA   0x11

Definition at line 117 of file adxl355.h.

◆ ADXL355_AD_OFFSET_X_H

#define ADXL355_AD_OFFSET_X_H   0x1E

Definition at line 118 of file adxl355.h.

◆ ADXL355_AD_OFFSET_X_L

#define ADXL355_AD_OFFSET_X_L   0x1F

Definition at line 119 of file adxl355.h.

◆ ADXL355_AD_OFFSET_Y_H

#define ADXL355_AD_OFFSET_Y_H   0x20

Definition at line 120 of file adxl355.h.

◆ ADXL355_AD_OFFSET_Y_L

#define ADXL355_AD_OFFSET_Y_L   0x21

Definition at line 121 of file adxl355.h.

◆ ADXL355_AD_OFFSET_Z_H

#define ADXL355_AD_OFFSET_Z_H   0x22

Definition at line 122 of file adxl355.h.

◆ ADXL355_AD_OFFSET_Z_L

#define ADXL355_AD_OFFSET_Z_L   0x23

Definition at line 123 of file adxl355.h.

◆ ADXL355_AD_ACT_EN

#define ADXL355_AD_ACT_EN   0x24

Definition at line 124 of file adxl355.h.

◆ ADXL355_AD_ACT_THRES_L

#define ADXL355_AD_ACT_THRES_L   0x25

Definition at line 125 of file adxl355.h.

◆ ADXL355_AD_ACT_THRES_H

#define ADXL355_AD_ACT_THRES_H   0x26

Definition at line 126 of file adxl355.h.

◆ ADXL355_AD_ACT_COUNTER

#define ADXL355_AD_ACT_COUNTER   0x27

Definition at line 127 of file adxl355.h.

◆ ADXL355_AD_FILTER

#define ADXL355_AD_FILTER   0x28

Definition at line 128 of file adxl355.h.

Referenced by adxl355Start().

◆ ADXL355_AD_FIFO_SAMPLES

#define ADXL355_AD_FIFO_SAMPLES   0x29

Definition at line 129 of file adxl355.h.

◆ ADXL355_AD_INT_MAP

#define ADXL355_AD_INT_MAP   0x2A

Definition at line 130 of file adxl355.h.

◆ ADXL355_AD_SYNC

#define ADXL355_AD_SYNC   0x2B

Definition at line 131 of file adxl355.h.

◆ ADXL355_AD_RANGE

#define ADXL355_AD_RANGE   0x2C

Definition at line 132 of file adxl355.h.

Referenced by acc_set_full_scale(), and adxl355Start().

◆ ADXL355_AD_POWER_CTL

#define ADXL355_AD_POWER_CTL   0x2D

Definition at line 133 of file adxl355.h.

Referenced by adxl355Start(), and adxl355Stop().

◆ ADXL355_AD_SELF_TEST

#define ADXL355_AD_SELF_TEST   0x2E

Definition at line 134 of file adxl355.h.

◆ ADXL355_AD_RESET

#define ADXL355_AD_RESET   0x2F

Definition at line 135 of file adxl355.h.

◆ ADXL355_DEVID_MST

#define ADXL355_DEVID_MST   0x1D

Definition at line 142 of file adxl355.h.

Referenced by adxl355Start().

◆ ADXL355_FILTER_MASK

#define ADXL355_FILTER_MASK   0x7F

Definition at line 149 of file adxl355.h.

◆ ADXL355_FILTER_ORD_LPF_0

#define ADXL355_FILTER_ORD_LPF_0   (1 << 0)

Definition at line 150 of file adxl355.h.

◆ ADXL355_FILTER_ORD_LPF_1

#define ADXL355_FILTER_ORD_LPF_1   (1 << 1)

Definition at line 151 of file adxl355.h.

◆ ADXL355_FILTER_ORD_LPF_2

#define ADXL355_FILTER_ORD_LPF_2   (1 << 2)

Definition at line 152 of file adxl355.h.

◆ ADXL355_FILTER_ORD_LPF_3

#define ADXL355_FILTER_ORD_LPF_3   (1 << 3)

Definition at line 153 of file adxl355.h.

◆ ADXL355_FILTER_HPF_CORNER_0

#define ADXL355_FILTER_HPF_CORNER_0   (1 << 4)

Definition at line 154 of file adxl355.h.

◆ ADXL355_FILTER_HPF_CORNER_1

#define ADXL355_FILTER_HPF_CORNER_1   (1 << 5)

Definition at line 155 of file adxl355.h.

◆ ADXL355_FILTER_HPF_CORNER_2

#define ADXL355_FILTER_HPF_CORNER_2   (1 << 6)

Definition at line 156 of file adxl355.h.

◆ ADXL355_FIFO_SAMPLES_MASK

#define ADXL355_FIFO_SAMPLES_MASK   0x7F

Definition at line 163 of file adxl355.h.

◆ ADXL355_FIFO_SAMPLES_BIT_0

#define ADXL355_FIFO_SAMPLES_BIT_0   (1 << 0)

Definition at line 164 of file adxl355.h.

◆ ADXL355_FIFO_SAMPLES_BIT_1

#define ADXL355_FIFO_SAMPLES_BIT_1   (1 << 1)

Definition at line 165 of file adxl355.h.

◆ ADXL355_FIFO_SAMPLES_BIT_2

#define ADXL355_FIFO_SAMPLES_BIT_2   (1 << 2)

Definition at line 166 of file adxl355.h.

◆ ADXL355_FIFO_SAMPLES_BIT_3

#define ADXL355_FIFO_SAMPLES_BIT_3   (1 << 3)

Definition at line 167 of file adxl355.h.

◆ ADXL355_FIFO_SAMPLES_BIT_4

#define ADXL355_FIFO_SAMPLES_BIT_4   (1 << 4)

Definition at line 168 of file adxl355.h.

◆ ADXL355_FIFO_SAMPLES_BIT_5

#define ADXL355_FIFO_SAMPLES_BIT_5   (1 << 5)

Definition at line 169 of file adxl355.h.

◆ ADXL355_FIFO_SAMPLES_BIT_6

#define ADXL355_FIFO_SAMPLES_BIT_6   (1 << 6)

Definition at line 170 of file adxl355.h.

◆ ADXL355_INT_MAP_MASK

#define ADXL355_INT_MAP_MASK   0xFF

Definition at line 177 of file adxl355.h.

◆ ADXL355_INT_MAP_RDY_EN1

#define ADXL355_INT_MAP_RDY_EN1   (1 << 0)

Definition at line 178 of file adxl355.h.

◆ ADXL355_INT_MAP_FULL_EN1

#define ADXL355_INT_MAP_FULL_EN1   (1 << 1)

Definition at line 179 of file adxl355.h.

◆ ADXL355_INT_MAP_OVR_EN1

#define ADXL355_INT_MAP_OVR_EN1   (1 << 2)

Definition at line 180 of file adxl355.h.

◆ ADXL355_INT_MAP_ACT_EN1

#define ADXL355_INT_MAP_ACT_EN1   (1 << 3)

Definition at line 181 of file adxl355.h.

◆ ADXL355_INT_MAP_RDY_EN2

#define ADXL355_INT_MAP_RDY_EN2   (1 << 4)

Definition at line 182 of file adxl355.h.

◆ ADXL355_INT_MAP_FULL_EN2

#define ADXL355_INT_MAP_FULL_EN2   (1 << 5)

Definition at line 183 of file adxl355.h.

◆ ADXL355_INT_MAP_OVR_EN2

#define ADXL355_INT_MAP_OVR_EN2   (1 << 6)

Definition at line 184 of file adxl355.h.

◆ ADXL355_INT_MAP_ACT_EN2

#define ADXL355_INT_MAP_ACT_EN2   (1 << 7)

Definition at line 185 of file adxl355.h.

◆ ADXL355_SYNC_MASK

#define ADXL355_SYNC_MASK   0x07

Definition at line 192 of file adxl355.h.

◆ ADXL355_SYNC_EXT_SYNC_0

#define ADXL355_SYNC_EXT_SYNC_0   (1 << 0)

Definition at line 193 of file adxl355.h.

◆ ADXL355_SYNC_EXT_SYNC_1

#define ADXL355_SYNC_EXT_SYNC_1   (1 << 1)

Definition at line 194 of file adxl355.h.

◆ ADXL355_SYNC_EXT_CLK

#define ADXL355_SYNC_EXT_CLK   (1 << 2)

Definition at line 195 of file adxl355.h.

◆ ADXL355_RANGE_MASK

#define ADXL355_RANGE_MASK   0xC3

Definition at line 202 of file adxl355.h.

◆ ADXL355_RANGE_RANGE_MASK

#define ADXL355_RANGE_RANGE_MASK   0x03

Definition at line 203 of file adxl355.h.

Referenced by acc_set_full_scale().

◆ ADXL355_RANGE_RANGE_1 [1/2]

#define ADXL355_RANGE_RANGE_1   (1 << 1)

Definition at line 204 of file adxl355.h.

◆ ADXL355_RANGE_RANGE_1 [2/2]

#define ADXL355_RANGE_RANGE_1   (1 << 1)

Definition at line 204 of file adxl355.h.

◆ ADXL355_RANGE_RANGE_0

#define ADXL355_RANGE_RANGE_0   (1 << 0)

Definition at line 205 of file adxl355.h.

◆ ADXL355_RANGE_INT_POL

#define ADXL355_RANGE_INT_POL   (1 << 6)

Definition at line 207 of file adxl355.h.

◆ ADXL355_RANGE_I2C_HS

#define ADXL355_RANGE_I2C_HS   (1 << 7)

Definition at line 208 of file adxl355.h.

Referenced by adxl355Start().

◆ ADXL355_POWER_CTL_MASK

#define ADXL355_POWER_CTL_MASK   0x07

Definition at line 215 of file adxl355.h.

◆ ADXL355_POWER_CTL_STANDBY

#define ADXL355_POWER_CTL_STANDBY   (1 << 0)

Definition at line 216 of file adxl355.h.

◆ ADXL355_POWER_CTL_TEMP_OFF

#define ADXL355_POWER_CTL_TEMP_OFF   (1 << 1)

Definition at line 217 of file adxl355.h.

◆ ADXL355_POWER_CTL_DRDY_OFF

#define ADXL355_POWER_CTL_DRDY_OFF   (1 << 2)

Definition at line 218 of file adxl355.h.

◆ ADXL355_SELF_TEST_MASK

#define ADXL355_SELF_TEST_MASK   0x03

Definition at line 225 of file adxl355.h.

◆ ADXL355_SELF_TEST_ST1

#define ADXL355_SELF_TEST_ST1   (1 << 0)

Definition at line 226 of file adxl355.h.

◆ ADXL355_SELF_TEST_ST2

#define ADXL355_SELF_TEST_ST2   (1 << 1)

Definition at line 227 of file adxl355.h.

◆ ADXL355_USE_SPI

#define ADXL355_USE_SPI   TRUE

ADXL355 SPI interface switch.

If set to TRUE the support for SPI is included.

Note
The default is TRUE.

Definition at line 244 of file adxl355.h.

◆ ADXL355_SHARED_SPI

#define ADXL355_SHARED_SPI   FALSE

ADXL355 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 254 of file adxl355.h.

◆ ADXL355_USE_I2C

#define ADXL355_USE_I2C   FALSE

ADXL355 I2C interface switch.

If set to TRUE the support for I2C is included.

Note
The default is FALSE.

Definition at line 263 of file adxl355.h.

◆ ADXL355_SHARED_I2C

#define ADXL355_SHARED_I2C   FALSE

ADXL355 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 273 of file adxl355.h.

◆ ADXL355_USE_ADVANCED

#define ADXL355_USE_ADVANCED   FALSE

ADXL355 advanced configurations switch.

If set to TRUE more configurations are available.

Note
The default is FALSE.

Definition at line 282 of file adxl355.h.

◆ ADXL355_COMM_BUFF_SIZE

#define ADXL355_COMM_BUFF_SIZE   32

ADXL355 internal communication buffer sizes.

Definition at line 289 of file adxl355.h.

Referenced by adxl355SPIReadRegister(), and adxl355SPIWriteRegister().

◆ _adxl355_methods_alone

#define _adxl355_methods_alone
Value:
/* Change full scale value of ADXL355 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
adxl355_acc_fs_t
ADXL355 full scale.
Definition adxl355.h:340
ADXL355 3-axis accelerometer class.
Definition adxl355.h:483

ADXL355 specific methods.

Definition at line 437 of file adxl355.h.

◆ _adxl355_methods

#define _adxl355_methods
Value:
_base_object_methods \
_adxl355_methods_alone

ADXL355 specific methods with inherited ones.

Definition at line 445 of file adxl355.h.

◆ _adxl355_data

#define _adxl355_data
Value:
/* Driver state.*/ \
adxl355_state_t state; \
/* Current configuration data.*/ \
const ADXL355Config *config; \
/* Accelerometer subsystem axes number.*/ \
size_t accaxes; \
/* Accelerometer subsystem current sensitivity.*/ \
float accsensitivity[ADXL355_ACC_NUMBER_OF_AXES]; \
/* Accelerometer subsystem current bias .*/ \
float accbias[ADXL355_ACC_NUMBER_OF_AXES]; \
/* Accelerometer subsystem current full scale value.*/ \
float accfullscale; \
/* Accelerometer communication tx buffer pointer.*/ \
uint8_t* commtxp; \
/* Accelerometer communication rx buffer pointer.*/ \
uint8_t* commrxp;
adxl355_state_t
Driver state machine possible states.
Definition adxl355.h:379
#define ADXL355_ACC_NUMBER_OF_AXES
ADXL355 accelerometer subsystem characteristics.
Definition adxl355.h:72
#define _base_sensor_data
BaseSensor specific data.
Definition ex_sensors.h:74
ADXL355 configuration structure.
Definition adxl355.h:388

ADXL355Driver specific data.

Definition at line 461 of file adxl355.h.

◆ adxl355AccelerometerGetAxesNumber

#define adxl355AccelerometerGetAxesNumber ( 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 ADXL355Driver.
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 505 of file adxl355.h.

◆ adxl355AccelerometerReadRaw

#define adxl355AccelerometerReadRaw ( 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 ADXL355Driver.
[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 526 of file adxl355.h.

◆ adxl355AccelerometerReadCooked

#define adxl355AccelerometerReadCooked ( 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 ADXL355Driver.
[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 548 of file adxl355.h.

◆ adxl355AccelerometerSetBias

#define adxl355AccelerometerSetBias ( 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 ADXL355Driver.
[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 565 of file adxl355.h.

◆ adxl355AccelerometerResetBias

#define adxl355AccelerometerResetBias ( 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 ADXL355Driver.
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 580 of file adxl355.h.

◆ adxl355AccelerometerSetSensitivity

#define adxl355AccelerometerSetSensitivity ( 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 ADXL355Driver.
[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 597 of file adxl355.h.

◆ adxl355AccelerometerResetSensitivity

#define adxl355AccelerometerResetSensitivity ( 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 ADXL355Driver.
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 612 of file adxl355.h.

◆ adxl355AccelerometerSetFullScale

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

Changes the ADXL355Driver 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 ADXL355Driver.
[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 630 of file adxl355.h.

Typedef Documentation

◆ ADXL355Driver

typedef struct ADXL355Driver ADXL355Driver

Structure representing a ADXL355 driver.

Definition at line 335 of file adxl355.h.

Enumeration Type Documentation

◆ adxl355_acc_fs_t

ADXL355 full scale.

Enumerator
ADXL355_ACC_FS_2G 

Full scale ±2g.

ADXL355_ACC_FS_4G 

Full scale ±4g.

ADXL355_ACC_FS_8G 

Full scale ±8g.

Definition at line 340 of file adxl355.h.

◆ adxl355_acc_odr_t

ADXL355 output data rate.

Enumerator
ADXL355_ACC_ODR_4000HZ 

ODR 4000 Hz, LP cut-off ODR/4.

ADXL355_ACC_ODR_2000HZ 

ODR 2000 Hz, LP cut-off ODR/4.

ADXL355_ACC_ODR_1000HZ 

ODR 1000 Hz, LP cut-off ODR/4.

ADXL355_ACC_ODR_500HZ 

ODR 500 Hz, LP cut-off ODR/4.

ADXL355_ACC_ODR_250HZ 

ODR 250 Hz, LP cut-off ODR/4.

ADXL355_ACC_ODR_125HZ 

ODR 125 Hz, LP cut-off ODR/4.

ADXL355_ACC_ODR_62P5HZ 

ODR 62.5 Hz, LP cut-off ODR/4.

ADXL355_ACC_ODR_31P25HZ 

ODR 31.25 Hz, LP cut-off ODR/4.

ADXL355_ACC_ODR_15P625HZ 

ODR 15.625 Hz, LP cut-off ODR/4.

ADXL355_ACC_ODR_7P913HZ 

ODR 7.913 Hz, LP cut-off ODR/4.

ADXL355_ACC_ODR_3P906HZ 

ODR 3.906 Hz, LP cut-off ODR/4.

Definition at line 349 of file adxl355.h.

◆ adxl355_acc_hp_t

ADXL355 HP filter.

Enumerator
ADXL355_ACC_HP_DISABLED 

HP disabled.

ADXL355_ACC_HP_LEV_1 

HP cut-off 247 x 10^-3 x ODR.

ADXL355_ACC_HP_LEV_2 

HP cut-off 62.084 x 10^-3 x ODR.

ADXL355_ACC_HP_LEV_3 

HP cut-off 15.545 x 10^-3 x ODR.

ADXL355_ACC_HP_LEV_4 

HP cut-off 3.892 x 10^-3 x ODR.

ADXL355_ACC_HP_LEV_5 

HP cut-off 0.954 x 10^-3 x ODR.

ADXL355_ACC_HP_LEV_6 

HP cut-off 0.238 x 10^-3 x ODR.

Definition at line 366 of file adxl355.h.

◆ adxl355_state_t

Driver state machine possible states.

Enumerator
ADXL355_UNINIT 

Not initialized.

ADXL355_STOP 

Stopped.

ADXL355_READY 

Ready.

Definition at line 379 of file adxl355.h.

Function Documentation

◆ 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 57 of file adxl355.c.

References ADXL355_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 79 of file adxl355.c.

References ADXL355_ACC_NUMBER_OF_AXES, ADXL355_AD_XDATA3, ADXL355_READY, adxl355SPIReadRegister(), 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 137 of file adxl355.c.

References acc_read_raw(), ADXL355_ACC_NUMBER_OF_AXES, ADXL355_READY, MSG_OK, 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 170 of file adxl355.c.

References ADXL355_ACC_NUMBER_OF_AXES, ADXL355_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 199 of file adxl355.c.

References ADXL355_ACC_BIAS, ADXL355_ACC_NUMBER_OF_AXES, ADXL355_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 229 of file adxl355.c.

References ADXL355_ACC_NUMBER_OF_AXES, ADXL355_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 258 of file adxl355.c.

References ADXL355_ACC_FS_2G, ADXL355_ACC_FS_4G, ADXL355_ACC_FS_8G, ADXL355_ACC_NUMBER_OF_AXES, ADXL355_ACC_SENS_2G, ADXL355_ACC_SENS_4G, ADXL355_ACC_SENS_8G, ADXL355_READY, FALSE, MSG_OK, MSG_RESET, objGetInstance, osalDbgAssert, and osalDbgCheck.

◆ acc_set_full_scale()

msg_t acc_set_full_scale ( ADXL355Driver * devp,
adxl355_acc_fs_t fs )
static

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

Definition at line 301 of file adxl355.c.

References ADXL355_ACC_2G, ADXL355_ACC_4G, ADXL355_ACC_8G, ADXL355_ACC_FS_2G, ADXL355_ACC_FS_4G, ADXL355_ACC_FS_8G, ADXL355_ACC_NUMBER_OF_AXES, ADXL355_AD_RANGE, ADXL355_RANGE_RANGE_MASK, ADXL355_READY, adxl355SPIReadRegister(), adxl355SPIWriteRegister(), MSG_OK, MSG_RESET, osalDbgAssert, osalDbgCheck, SPI_READY, spiAcquireBus(), spiReleaseBus(), and spiStart().

Here is the call graph for this function:

◆ adxl355SPIReadRegister()

void adxl355SPIReadRegister ( ADXL355Driver * devp,
uint8_t reg,
size_t n,
uint8_t * b )

Reads a generic register value using SPI.

Precondition
The SPI interface must be initialized and the driver started.
Parameters
[in]devppointer to ADXL355Driver interface.
[in]regstarting register address
[in]nnumber of consecutive registers to read
[in]bpointer to an output buffer.

Definition at line 403 of file adxl355.c.

References ADXL355_COMM_BUFF_SIZE, ADXL355_RW, osalDbgCheck, spiReceive(), spiSelect(), spiSend(), and spiUnselect().

Referenced by acc_read_raw(), acc_set_full_scale(), and adxl355Start().

Here is the call graph for this function:

◆ adxl355SPIWriteRegister()

void adxl355SPIWriteRegister ( ADXL355Driver * devp,
uint8_t reg,
size_t n,
uint8_t * b )

Writes a value into a generic register using SPI.

Precondition
The SPI interface must be initialized and the driver started.
Parameters
[in]devppointer to ADXL355Driver interface.
[in]regstarting register address
[in]nnumber of adjacent registers to write
[in]bpointer to a buffer of values.

Definition at line 432 of file adxl355.c.

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

Referenced by acc_set_full_scale(), adxl355Start(), and adxl355Stop().

Here is the call graph for this function:

◆ adxl355ObjectInit()

void adxl355ObjectInit ( ADXL355Driver * devp,
uint8_t * txbp,
uint8_t * rxbp )

Initializes an instance.

The buffer should be at least large ADXL355_COMM_BUFF_SIZE.

Note
The communication buffer could be used by DMAs.
Parameters
[out]devppointer to the ADXL355Driver object
[in]txbppointer to a buffer used as communication tx buffer
[in]rxbppointer to a buffer used as communication rx buffer
Function Class:
Object or module nitializer function.

Definition at line 463 of file adxl355.c.

References ADXL355Driver::acc_if, ADXL355_ACC_NUMBER_OF_AXES, ADXL355_STOP, ADXL355Driver::vmt, BaseAccelerometer::vmt, vmt_accelerometer, and vmt_device.

◆ adxl355Start()

void adxl355Start ( ADXL355Driver * devp,
const ADXL355Config * config )

Configures and activates ADXL355 Complex Driver peripheral.

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

Definition at line 484 of file adxl355.c.

References ADXL355_ACC_2G, ADXL355_ACC_4G, ADXL355_ACC_8G, ADXL355_ACC_BIAS, ADXL355_ACC_FS_2G, ADXL355_ACC_FS_4G, ADXL355_ACC_FS_8G, ADXL355_ACC_NUMBER_OF_AXES, ADXL355_ACC_SENS_2G, ADXL355_ACC_SENS_4G, ADXL355_ACC_SENS_8G, ADXL355_AD_DEVID_MST, ADXL355_AD_FILTER, ADXL355_AD_POWER_CTL, ADXL355_AD_RANGE, ADXL355_DEVID_MST, ADXL355_RANGE_I2C_HS, ADXL355_READY, ADXL355_STOP, adxl355SPIReadRegister(), adxl355SPIWriteRegister(), FALSE, osalDbgAssert, osalDbgCheck, osalThreadSleepMilliseconds, spiAcquireBus(), spiReleaseBus(), and spiStart().

Here is the call graph for this function:

◆ adxl355Stop()

void adxl355Stop ( ADXL355Driver * devp)

Deactivates the ADXL355 Complex Driver peripheral.

Parameters
[in]devppointer to the ADXL355Driver 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 adxl355.c.

References ADXL355_AD_POWER_CTL, ADXL355_READY, ADXL355_STOP, adxl355SPIWriteRegister(), osalDbgAssert, osalDbgCheck, spiAcquireBus(), spiReleaseBus(), spiStart(), and spiStop().

Here is the call graph for this function:

Variable Documentation

◆ vmt_device

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

Definition at line 378 of file adxl355.c.

◆ vmt_accelerometer

const struct BaseAccelerometerVMT vmt_accelerometer
static
Initial value:
= {
sizeof(struct ADXL355VMT*),
}
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
ADXL355 virtual methods table.
Definition adxl355.h:454

Definition at line 383 of file adxl355.c.