no-OS
Classes | Macros | Functions
adxl362.h File Reference

Header file of ADXL362 Driver. More...

#include <stdint.h>
#include "no-os/spi.h"
Include dependency graph for adxl362.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  adxl362_dev
 ADXL362 Device structure. More...
 
struct  adxl362_init_param
 Structure holding the parameters for ADXL362 device initialization. More...
 

Macros

#define ADXL362_WRITE_REG   0x0A
 
#define ADXL362_READ_REG   0x0B
 
#define ADXL362_WRITE_FIFO   0x0D
 
#define ADXL362_REG_DEVID_AD   0x00
 
#define ADXL362_REG_DEVID_MST   0x01
 
#define ADXL362_REG_PARTID   0x02
 
#define ADXL362_REG_REVID   0x03
 
#define ADXL362_REG_XDATA   0x08
 
#define ADXL362_REG_YDATA   0x09
 
#define ADXL362_REG_ZDATA   0x0A
 
#define ADXL362_REG_STATUS   0x0B
 
#define ADXL362_REG_FIFO_L   0x0C
 
#define ADXL362_REG_FIFO_H   0x0D
 
#define ADXL362_REG_XDATA_L   0x0E
 
#define ADXL362_REG_XDATA_H   0x0F
 
#define ADXL362_REG_YDATA_L   0x10
 
#define ADXL362_REG_YDATA_H   0x11
 
#define ADXL362_REG_ZDATA_L   0x12
 
#define ADXL362_REG_ZDATA_H   0x13
 
#define ADXL362_REG_TEMP_L   0x14
 
#define ADXL362_REG_TEMP_H   0x15
 
#define ADXL362_REG_SOFT_RESET   0x1F
 
#define ADXL362_REG_THRESH_ACT_L   0x20
 
#define ADXL362_REG_THRESH_ACT_H   0x21
 
#define ADXL362_REG_TIME_ACT   0x22
 
#define ADXL362_REG_THRESH_INACT_L   0x23
 
#define ADXL362_REG_THRESH_INACT_H   0x24
 
#define ADXL362_REG_TIME_INACT_L   0x25
 
#define ADXL362_REG_TIME_INACT_H   0x26
 
#define ADXL362_REG_ACT_INACT_CTL   0x27
 
#define ADXL362_REG_FIFO_CTL   0x28
 
#define ADXL362_REG_FIFO_SAMPLES   0x29
 
#define ADXL362_REG_INTMAP1   0x2A
 
#define ADXL362_REG_INTMAP2   0x2B
 
#define ADXL362_REG_FILTER_CTL   0x2C
 
#define ADXL362_REG_POWER_CTL   0x2D
 
#define ADXL362_REG_SELF_TEST   0x2E
 
#define ADXL362_STATUS_ERR_USER_REGS   (1 << 7)
 
#define ADXL362_STATUS_AWAKE   (1 << 6)
 
#define ADXL362_STATUS_INACT   (1 << 5)
 
#define ADXL362_STATUS_ACT   (1 << 4)
 
#define ADXL362_STATUS_FIFO_OVERRUN   (1 << 3)
 
#define ADXL362_STATUS_FIFO_WATERMARK   (1 << 2)
 
#define ADXL362_STATUS_FIFO_RDY   (1 << 1)
 
#define ADXL362_STATUS_DATA_RDY   (1 << 0)
 
#define ADXL362_ACT_INACT_CTL_LINKLOOP(x)   (((x) & 0x3) << 4)
 
#define ADXL362_ACT_INACT_CTL_INACT_REF   (1 << 3)
 
#define ADXL362_ACT_INACT_CTL_INACT_EN   (1 << 2)
 
#define ADXL362_ACT_INACT_CTL_ACT_REF   (1 << 1)
 
#define ADXL362_ACT_INACT_CTL_ACT_EN   (1 << 0)
 
#define ADXL362_MODE_DEFAULT   0
 
#define ADXL362_MODE_LINK   1
 
#define ADXL362_MODE_LOOP   3
 
#define ADXL362_FIFO_CTL_AH   (1 << 3)
 
#define ADXL362_FIFO_CTL_FIFO_TEMP   (1 << 2)
 
#define ADXL362_FIFO_CTL_FIFO_MODE(x)   (((x) & 0x3) << 0)
 
#define ADXL362_FIFO_DISABLE   0
 
#define ADXL362_FIFO_OLDEST_SAVED   1
 
#define ADXL362_FIFO_STREAM   2
 
#define ADXL362_FIFO_TRIGGERED   3
 
#define ADXL362_INTMAP1_INT_LOW   (1 << 7)
 
#define ADXL362_INTMAP1_AWAKE   (1 << 6)
 
#define ADXL362_INTMAP1_INACT   (1 << 5)
 
#define ADXL362_INTMAP1_ACT   (1 << 4)
 
#define ADXL362_INTMAP1_FIFO_OVERRUN   (1 << 3)
 
#define ADXL362_INTMAP1_FIFO_WATERMARK   (1 << 2)
 
#define ADXL362_INTMAP1_FIFO_READY   (1 << 1)
 
#define ADXL362_INTMAP1_DATA_READY   (1 << 0)
 
#define ADXL362_INTMAP2_INT_LOW   (1 << 7)
 
#define ADXL362_INTMAP2_AWAKE   (1 << 6)
 
#define ADXL362_INTMAP2_INACT   (1 << 5)
 
#define ADXL362_INTMAP2_ACT   (1 << 4)
 
#define ADXL362_INTMAP2_FIFO_OVERRUN   (1 << 3)
 
#define ADXL362_INTMAP2_FIFO_WATERMARK   (1 << 2)
 
#define ADXL362_INTMAP2_FIFO_READY   (1 << 1)
 
#define ADXL362_INTMAP2_DATA_READY   (1 << 0)
 
#define ADXL362_FILTER_CTL_RANGE(x)   (((x) & 0x3) << 6)
 
#define ADXL362_FILTER_CTL_RES   (1 << 5)
 
#define ADXL362_FILTER_CTL_HALF_BW   (1 << 4)
 
#define ADXL362_FILTER_CTL_EXT_SAMPLE   (1 << 3)
 
#define ADXL362_FILTER_CTL_ODR(x)   (((x) & 0x7) << 0)
 
#define ADXL362_RANGE_2G   0 /* +/-2 g */
 
#define ADXL362_RANGE_4G   1 /* +/-4 g */
 
#define ADXL362_RANGE_8G   2 /* +/-8 g */
 
#define ADXL362_ODR_12_5_HZ   0 /* 12.5 Hz */
 
#define ADXL362_ODR_25_HZ   1 /* 25 Hz */
 
#define ADXL362_ODR_50_HZ   2 /* 50 Hz */
 
#define ADXL362_ODR_100_HZ   3 /* 100 Hz */
 
#define ADXL362_ODR_200_HZ   4 /* 200 Hz */
 
#define ADXL362_ODR_400_HZ   5 /* 400 Hz */
 
#define ADXL362_POWER_CTL_RES   (1 << 7)
 
#define ADXL362_POWER_CTL_EXT_CLK   (1 << 6)
 
#define ADXL362_POWER_CTL_LOW_NOISE(x)   (((x) & 0x3) << 4)
 
#define ADXL362_POWER_CTL_WAKEUP   (1 << 3)
 
#define ADXL362_POWER_CTL_AUTOSLEEP   (1 << 2)
 
#define ADXL362_POWER_CTL_MEASURE(x)   (((x) & 0x3) << 0)
 
#define ADXL362_NOISE_MODE_NORMAL   0
 
#define ADXL362_NOISE_MODE_LOW   1
 
#define ADXL362_NOISE_MODE_ULTRALOW   2
 
#define ADXL362_MEASURE_STANDBY   0
 
#define ADXL362_MEASURE_ON   2
 
#define ADXL362_SELF_TEST_ST   (1 << 0)
 
#define ADXL362_DEVICE_AD   0xAD
 
#define ADXL362_DEVICE_MST   0x1D
 
#define ADXL362_PART_ID   0xF2
 
#define ADXL362_RESET_KEY   0x52
 

Functions

int32_t adxl362_init (struct adxl362_dev **device, struct adxl362_init_param init_param)
 Initializes communication with the device and checks if the part is present by reading the device id. More...
 
int32_t adxl362_remove (struct adxl362_dev *dev)
 Free the resources allocated by adxl362_init(). More...
 
void adxl362_set_register_value (struct adxl362_dev *dev, uint16_t register_value, uint8_t register_address, uint8_t bytes_number)
 Writes data into a register. More...
 
void adxl362_get_register_value (struct adxl362_dev *dev, uint8_t *read_data, uint8_t register_address, uint8_t bytes_number)
 Performs a burst read of a specified number of registers. More...
 
void adxl362_get_fifo_value (struct adxl362_dev *dev, uint8_t *buffer, uint16_t bytes_number)
 Reads multiple bytes from the device's FIFO buffer. More...
 
void adxl362_software_reset (struct adxl362_dev *dev)
 Resets the device via SPI communication bus. More...
 
void adxl362_set_power_mode (struct adxl362_dev *dev, uint8_t pwr_mode)
 Places the device into standby/measure mode. More...
 
void adxl362_set_range (struct adxl362_dev *dev, uint8_t g_range)
 Selects the measurement range. More...
 
void adxl362_set_output_rate (struct adxl362_dev *dev, uint8_t out_rate)
 Selects the Output Data Rate of the device. More...
 
void adxl362_get_xyz (struct adxl362_dev *dev, int16_t *x, int16_t *y, int16_t *z)
 Reads the 3-axis raw data from the accelerometer. More...
 
void adxl362_get_g_xyz (struct adxl362_dev *dev, float *x, float *y, float *z)
 Reads the 3-axis raw data from the accelerometer and converts it to g. More...
 
float adxl362_read_temperature (struct adxl362_dev *dev)
 Reads the temperature of the device. More...
 
void adxl362_fifo_setup (struct adxl362_dev *dev, uint8_t mode, uint16_t water_mark_lvl, uint8_t en_temp_read)
 Configures the FIFO feature. More...
 
void adxl362_setup_activity_detection (struct adxl362_dev *dev, uint8_t ref_or_abs, uint16_t threshold, uint8_t time)
 Configures activity detection. More...
 
void adxl362_setup_inactivity_detection (struct adxl362_dev *dev, uint8_t ref_or_abs, uint16_t threshold, uint16_t time)
 Configures inactivity detection. More...
 

Detailed Description

Header file of ADXL362 Driver.

Author
DNechita(Dan.N.nosp@m.echi.nosp@m.ta@an.nosp@m.alog.nosp@m..com)

Copyright 2012(c) Analog Devices, Inc.

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Macro Definition Documentation

◆ ADXL362_ACT_INACT_CTL_ACT_EN

#define ADXL362_ACT_INACT_CTL_ACT_EN   (1 << 0)

◆ ADXL362_ACT_INACT_CTL_ACT_REF

#define ADXL362_ACT_INACT_CTL_ACT_REF   (1 << 1)

◆ ADXL362_ACT_INACT_CTL_INACT_EN

#define ADXL362_ACT_INACT_CTL_INACT_EN   (1 << 2)

◆ ADXL362_ACT_INACT_CTL_INACT_REF

#define ADXL362_ACT_INACT_CTL_INACT_REF   (1 << 3)

◆ ADXL362_ACT_INACT_CTL_LINKLOOP

#define ADXL362_ACT_INACT_CTL_LINKLOOP (   x)    (((x) & 0x3) << 4)

◆ ADXL362_DEVICE_AD

#define ADXL362_DEVICE_AD   0xAD

◆ ADXL362_DEVICE_MST

#define ADXL362_DEVICE_MST   0x1D

◆ ADXL362_FIFO_CTL_AH

#define ADXL362_FIFO_CTL_AH   (1 << 3)

◆ ADXL362_FIFO_CTL_FIFO_MODE

#define ADXL362_FIFO_CTL_FIFO_MODE (   x)    (((x) & 0x3) << 0)

◆ ADXL362_FIFO_CTL_FIFO_TEMP

#define ADXL362_FIFO_CTL_FIFO_TEMP   (1 << 2)

◆ ADXL362_FIFO_DISABLE

#define ADXL362_FIFO_DISABLE   0

◆ ADXL362_FIFO_OLDEST_SAVED

#define ADXL362_FIFO_OLDEST_SAVED   1

◆ ADXL362_FIFO_STREAM

#define ADXL362_FIFO_STREAM   2

◆ ADXL362_FIFO_TRIGGERED

#define ADXL362_FIFO_TRIGGERED   3

◆ ADXL362_FILTER_CTL_EXT_SAMPLE

#define ADXL362_FILTER_CTL_EXT_SAMPLE   (1 << 3)

◆ ADXL362_FILTER_CTL_HALF_BW

#define ADXL362_FILTER_CTL_HALF_BW   (1 << 4)

◆ ADXL362_FILTER_CTL_ODR

#define ADXL362_FILTER_CTL_ODR (   x)    (((x) & 0x7) << 0)

◆ ADXL362_FILTER_CTL_RANGE

#define ADXL362_FILTER_CTL_RANGE (   x)    (((x) & 0x3) << 6)

◆ ADXL362_FILTER_CTL_RES

#define ADXL362_FILTER_CTL_RES   (1 << 5)

◆ ADXL362_INTMAP1_ACT

#define ADXL362_INTMAP1_ACT   (1 << 4)

◆ ADXL362_INTMAP1_AWAKE

#define ADXL362_INTMAP1_AWAKE   (1 << 6)

◆ ADXL362_INTMAP1_DATA_READY

#define ADXL362_INTMAP1_DATA_READY   (1 << 0)

◆ ADXL362_INTMAP1_FIFO_OVERRUN

#define ADXL362_INTMAP1_FIFO_OVERRUN   (1 << 3)

◆ ADXL362_INTMAP1_FIFO_READY

#define ADXL362_INTMAP1_FIFO_READY   (1 << 1)

◆ ADXL362_INTMAP1_FIFO_WATERMARK

#define ADXL362_INTMAP1_FIFO_WATERMARK   (1 << 2)

◆ ADXL362_INTMAP1_INACT

#define ADXL362_INTMAP1_INACT   (1 << 5)

◆ ADXL362_INTMAP1_INT_LOW

#define ADXL362_INTMAP1_INT_LOW   (1 << 7)

◆ ADXL362_INTMAP2_ACT

#define ADXL362_INTMAP2_ACT   (1 << 4)

◆ ADXL362_INTMAP2_AWAKE

#define ADXL362_INTMAP2_AWAKE   (1 << 6)

◆ ADXL362_INTMAP2_DATA_READY

#define ADXL362_INTMAP2_DATA_READY   (1 << 0)

◆ ADXL362_INTMAP2_FIFO_OVERRUN

#define ADXL362_INTMAP2_FIFO_OVERRUN   (1 << 3)

◆ ADXL362_INTMAP2_FIFO_READY

#define ADXL362_INTMAP2_FIFO_READY   (1 << 1)

◆ ADXL362_INTMAP2_FIFO_WATERMARK

#define ADXL362_INTMAP2_FIFO_WATERMARK   (1 << 2)

◆ ADXL362_INTMAP2_INACT

#define ADXL362_INTMAP2_INACT   (1 << 5)

◆ ADXL362_INTMAP2_INT_LOW

#define ADXL362_INTMAP2_INT_LOW   (1 << 7)

◆ ADXL362_MEASURE_ON

#define ADXL362_MEASURE_ON   2

◆ ADXL362_MEASURE_STANDBY

#define ADXL362_MEASURE_STANDBY   0

◆ ADXL362_MODE_DEFAULT

#define ADXL362_MODE_DEFAULT   0

◆ ADXL362_MODE_LINK

#define ADXL362_MODE_LINK   1

◆ ADXL362_MODE_LOOP

#define ADXL362_MODE_LOOP   3

◆ ADXL362_NOISE_MODE_LOW

#define ADXL362_NOISE_MODE_LOW   1

◆ ADXL362_NOISE_MODE_NORMAL

#define ADXL362_NOISE_MODE_NORMAL   0

◆ ADXL362_NOISE_MODE_ULTRALOW

#define ADXL362_NOISE_MODE_ULTRALOW   2

◆ ADXL362_ODR_100_HZ

#define ADXL362_ODR_100_HZ   3 /* 100 Hz */

◆ ADXL362_ODR_12_5_HZ

#define ADXL362_ODR_12_5_HZ   0 /* 12.5 Hz */

◆ ADXL362_ODR_200_HZ

#define ADXL362_ODR_200_HZ   4 /* 200 Hz */

◆ ADXL362_ODR_25_HZ

#define ADXL362_ODR_25_HZ   1 /* 25 Hz */

◆ ADXL362_ODR_400_HZ

#define ADXL362_ODR_400_HZ   5 /* 400 Hz */

◆ ADXL362_ODR_50_HZ

#define ADXL362_ODR_50_HZ   2 /* 50 Hz */

◆ ADXL362_PART_ID

#define ADXL362_PART_ID   0xF2

◆ ADXL362_POWER_CTL_AUTOSLEEP

#define ADXL362_POWER_CTL_AUTOSLEEP   (1 << 2)

◆ ADXL362_POWER_CTL_EXT_CLK

#define ADXL362_POWER_CTL_EXT_CLK   (1 << 6)

◆ ADXL362_POWER_CTL_LOW_NOISE

#define ADXL362_POWER_CTL_LOW_NOISE (   x)    (((x) & 0x3) << 4)

◆ ADXL362_POWER_CTL_MEASURE

#define ADXL362_POWER_CTL_MEASURE (   x)    (((x) & 0x3) << 0)

◆ ADXL362_POWER_CTL_RES

#define ADXL362_POWER_CTL_RES   (1 << 7)

◆ ADXL362_POWER_CTL_WAKEUP

#define ADXL362_POWER_CTL_WAKEUP   (1 << 3)

◆ ADXL362_RANGE_2G

#define ADXL362_RANGE_2G   0 /* +/-2 g */

◆ ADXL362_RANGE_4G

#define ADXL362_RANGE_4G   1 /* +/-4 g */

◆ ADXL362_RANGE_8G

#define ADXL362_RANGE_8G   2 /* +/-8 g */

◆ ADXL362_READ_REG

#define ADXL362_READ_REG   0x0B

◆ ADXL362_REG_ACT_INACT_CTL

#define ADXL362_REG_ACT_INACT_CTL   0x27

◆ ADXL362_REG_DEVID_AD

#define ADXL362_REG_DEVID_AD   0x00

◆ ADXL362_REG_DEVID_MST

#define ADXL362_REG_DEVID_MST   0x01

◆ ADXL362_REG_FIFO_CTL

#define ADXL362_REG_FIFO_CTL   0x28

◆ ADXL362_REG_FIFO_H

#define ADXL362_REG_FIFO_H   0x0D

◆ ADXL362_REG_FIFO_L

#define ADXL362_REG_FIFO_L   0x0C

◆ ADXL362_REG_FIFO_SAMPLES

#define ADXL362_REG_FIFO_SAMPLES   0x29

◆ ADXL362_REG_FILTER_CTL

#define ADXL362_REG_FILTER_CTL   0x2C

◆ ADXL362_REG_INTMAP1

#define ADXL362_REG_INTMAP1   0x2A

◆ ADXL362_REG_INTMAP2

#define ADXL362_REG_INTMAP2   0x2B

◆ ADXL362_REG_PARTID

#define ADXL362_REG_PARTID   0x02

◆ ADXL362_REG_POWER_CTL

#define ADXL362_REG_POWER_CTL   0x2D

◆ ADXL362_REG_REVID

#define ADXL362_REG_REVID   0x03

◆ ADXL362_REG_SELF_TEST

#define ADXL362_REG_SELF_TEST   0x2E

◆ ADXL362_REG_SOFT_RESET

#define ADXL362_REG_SOFT_RESET   0x1F

◆ ADXL362_REG_STATUS

#define ADXL362_REG_STATUS   0x0B

◆ ADXL362_REG_TEMP_H

#define ADXL362_REG_TEMP_H   0x15

◆ ADXL362_REG_TEMP_L

#define ADXL362_REG_TEMP_L   0x14

◆ ADXL362_REG_THRESH_ACT_H

#define ADXL362_REG_THRESH_ACT_H   0x21

◆ ADXL362_REG_THRESH_ACT_L

#define ADXL362_REG_THRESH_ACT_L   0x20

◆ ADXL362_REG_THRESH_INACT_H

#define ADXL362_REG_THRESH_INACT_H   0x24

◆ ADXL362_REG_THRESH_INACT_L

#define ADXL362_REG_THRESH_INACT_L   0x23

◆ ADXL362_REG_TIME_ACT

#define ADXL362_REG_TIME_ACT   0x22

◆ ADXL362_REG_TIME_INACT_H

#define ADXL362_REG_TIME_INACT_H   0x26

◆ ADXL362_REG_TIME_INACT_L

#define ADXL362_REG_TIME_INACT_L   0x25

◆ ADXL362_REG_XDATA

#define ADXL362_REG_XDATA   0x08

◆ ADXL362_REG_XDATA_H

#define ADXL362_REG_XDATA_H   0x0F

◆ ADXL362_REG_XDATA_L

#define ADXL362_REG_XDATA_L   0x0E

◆ ADXL362_REG_YDATA

#define ADXL362_REG_YDATA   0x09

◆ ADXL362_REG_YDATA_H

#define ADXL362_REG_YDATA_H   0x11

◆ ADXL362_REG_YDATA_L

#define ADXL362_REG_YDATA_L   0x10

◆ ADXL362_REG_ZDATA

#define ADXL362_REG_ZDATA   0x0A

◆ ADXL362_REG_ZDATA_H

#define ADXL362_REG_ZDATA_H   0x13

◆ ADXL362_REG_ZDATA_L

#define ADXL362_REG_ZDATA_L   0x12

◆ ADXL362_RESET_KEY

#define ADXL362_RESET_KEY   0x52

◆ ADXL362_SELF_TEST_ST

#define ADXL362_SELF_TEST_ST   (1 << 0)

◆ ADXL362_STATUS_ACT

#define ADXL362_STATUS_ACT   (1 << 4)

◆ ADXL362_STATUS_AWAKE

#define ADXL362_STATUS_AWAKE   (1 << 6)

◆ ADXL362_STATUS_DATA_RDY

#define ADXL362_STATUS_DATA_RDY   (1 << 0)

◆ ADXL362_STATUS_ERR_USER_REGS

#define ADXL362_STATUS_ERR_USER_REGS   (1 << 7)

◆ ADXL362_STATUS_FIFO_OVERRUN

#define ADXL362_STATUS_FIFO_OVERRUN   (1 << 3)

◆ ADXL362_STATUS_FIFO_RDY

#define ADXL362_STATUS_FIFO_RDY   (1 << 1)

◆ ADXL362_STATUS_FIFO_WATERMARK

#define ADXL362_STATUS_FIFO_WATERMARK   (1 << 2)

◆ ADXL362_STATUS_INACT

#define ADXL362_STATUS_INACT   (1 << 5)

◆ ADXL362_WRITE_FIFO

#define ADXL362_WRITE_FIFO   0x0D

◆ ADXL362_WRITE_REG

#define ADXL362_WRITE_REG   0x0A

Function Documentation

◆ adxl362_fifo_setup()

void adxl362_fifo_setup ( struct adxl362_dev dev,
uint8_t  mode,
uint16_t  water_mark_lvl,
uint8_t  en_temp_read 
)

Configures the FIFO feature.

Configures the FIFO feature.

Parameters
dev- The device structure.
mode- Mode selection. Example: ADXL362_FIFO_DISABLE - FIFO is disabled. ADXL362_FIFO_OLDEST_SAVED - Oldest saved mode. ADXL362_FIFO_STREAM - Stream mode. ADXL362_FIFO_TRIGGERED - Triggered mode.
water_mark_lvl- Specifies the number of samples to store in the FIFO.
en_temp_read- Store Temperature Data to FIFO. Example: 1 - temperature data is stored in the FIFO together with x-, y- and x-axis data. 0 - temperature data is skipped.
Returns
None.

◆ adxl362_get_fifo_value()

void adxl362_get_fifo_value ( struct adxl362_dev dev,
uint8_t *  buffer,
uint16_t  bytes_number 
)

Reads multiple bytes from the device's FIFO buffer.

Reads multiple bytes from the device's FIFO buffer.

Parameters
dev- The device structure.
buffer- Stores the read bytes.
bytes_number- Number of bytes to read.
Returns
None.

◆ adxl362_get_g_xyz()

void adxl362_get_g_xyz ( struct adxl362_dev dev,
float *  x,
float *  y,
float *  z 
)

Reads the 3-axis raw data from the accelerometer and converts it to g.

Reads the 3-axis raw data from the accelerometer and converts it to g.

Parameters
dev- The device structure.
x- Stores the X-axis data.
y- Stores the Y-axis data.
z- Stores the Z-axis data.
Returns
None.

◆ adxl362_get_register_value()

void adxl362_get_register_value ( struct adxl362_dev dev,
uint8_t *  read_data,
uint8_t  register_address,
uint8_t  bytes_number 
)

Performs a burst read of a specified number of registers.

Performs a burst read of a specified number of registers.

Parameters
dev- The device structure.
read_data- The read values are stored in this buffer.
register_address- The start address of the burst read.
bytes_number- Number of bytes to read.
Returns
None.
Here is the caller graph for this function:

◆ adxl362_get_xyz()

void adxl362_get_xyz ( struct adxl362_dev dev,
int16_t *  x,
int16_t *  y,
int16_t *  z 
)

Reads the 3-axis raw data from the accelerometer.

Reads the 3-axis raw data from the accelerometer.

Parameters
dev- The device structure.
x- Stores the X-axis data(as two's complement).
y- Stores the Y-axis data(as two's complement).
z- Stores the Z-axis data(as two's complement).
Returns
None.

◆ adxl362_init()

int32_t adxl362_init ( struct adxl362_dev **  device,
struct adxl362_init_param  init_param 
)

Initializes communication with the device and checks if the part is present by reading the device id.

Initializes the device.

Parameters
device- The device structure.
init_param- The structure that contains the device initial parameters.
Returns
0 - the initialization was successful and the device is present; -1 - an error occurred.

◆ adxl362_read_temperature()

float adxl362_read_temperature ( struct adxl362_dev dev)

Reads the temperature of the device.

Reads the temperature of the device.

Parameters
dev- The device structure.
Returns
temp_celsius - The value of the temperature(degree s Celsius).

◆ adxl362_remove()

int32_t adxl362_remove ( struct adxl362_dev dev)

Free the resources allocated by adxl362_init().

Free the resources allocated by adxl362_init().

Parameters
dev- The device structure.
Returns
ret - The result of the remove procedure.

◆ adxl362_set_output_rate()

void adxl362_set_output_rate ( struct adxl362_dev dev,
uint8_t  out_rate 
)

Selects the Output Data Rate of the device.

Selects the Output Data Rate of the device.

Parameters
dev- The device structure.
out_rate- Output Data Rate option. Example: ADXL362_ODR_12_5_HZ - 12.5Hz ADXL362_ODR_25_HZ - 25Hz ADXL362_ODR_50_HZ - 50Hz ADXL362_ODR_100_HZ - 100Hz ADXL362_ODR_200_HZ - 200Hz ADXL362_ODR_400_HZ - 400Hz
Returns
None.

◆ adxl362_set_power_mode()

void adxl362_set_power_mode ( struct adxl362_dev dev,
uint8_t  pwr_mode 
)

Places the device into standby/measure mode.

Places the device into standby/measure mode.

Parameters
dev- The device structure.
pwr_mode- Power mode. Example: 0 - standby mode. 1 - measure mode.
Returns
None.

◆ adxl362_set_range()

void adxl362_set_range ( struct adxl362_dev dev,
uint8_t  g_range 
)

Selects the measurement range.

Selects the measurement range.

Parameters
dev- The device structure.
g_range- Range option. Example: ADXL362_RANGE_2G - +-2 g ADXL362_RANGE_4G - +-4 g ADXL362_RANGE_8G - +-8 g
Returns
None.

◆ adxl362_set_register_value()

void adxl362_set_register_value ( struct adxl362_dev dev,
uint16_t  register_value,
uint8_t  register_address,
uint8_t  bytes_number 
)

Writes data into a register.

Writes data into a register.

Parameters
dev- The device structure.
register_value- Data value to write.
register_address- Address of the register.
bytes_number- Number of bytes. Accepted values: 0 - 1.
Returns
None.
Here is the caller graph for this function:

◆ adxl362_setup_activity_detection()

void adxl362_setup_activity_detection ( struct adxl362_dev dev,
uint8_t  ref_or_abs,
uint16_t  threshold,
uint8_t  time 
)

Configures activity detection.

Configures activity detection.

Parameters
dev- The device structure.
ref_or_abs- Referenced/Absolute Activity Select. Example: 0 - absolute mode. 1 - referenced mode.
threshold- 11-bit unsigned value that the adxl362 samples are compared to.
time- 8-bit value written to the activity timer register. The amount of time (in seconds) is: time / ODR, where ODR - is the output data rate.
Returns
None.

◆ adxl362_setup_inactivity_detection()

void adxl362_setup_inactivity_detection ( struct adxl362_dev dev,
uint8_t  ref_or_abs,
uint16_t  threshold,
uint16_t  time 
)

Configures inactivity detection.

Configures inactivity detection.

Parameters
dev- The device structure.
ref_or_abs- Referenced/Absolute Inactivity Select. Example: 0 - absolute mode. 1 - referenced mode.
threshold- 11-bit unsigned value that the adxl362 samples are compared to.
time- 16-bit value written to the inactivity timer register. The amount of time (in seconds) is: time / ODR, where ODR - is the output data rate.
Returns
None.

◆ adxl362_software_reset()

void adxl362_software_reset ( struct adxl362_dev dev)

Resets the device via SPI communication bus.

Resets the device via SPI communication bus.

Parameters
dev- The device structure.
Returns
None.