LibDriver ADXL345  2.0.0
ADXL345 full-featured driver
adxl345 basic driver function

adxl345 basic driver modules More...

Data Structures

struct  adxl345_handle_s
 adxl345 handle structure definition More...
 
struct  adxl345_info_s
 adxl345 information structure definition More...
 

Typedefs

typedef struct adxl345_handle_s adxl345_handle_t
 adxl345 handle structure definition More...
 
typedef struct adxl345_info_s adxl345_info_t
 adxl345 information structure definition More...
 

Enumerations

enum  adxl345_interface_t { ADXL345_INTERFACE_IIC = 0x00 , ADXL345_INTERFACE_SPI = 0x01 }
 adxl345 interface enumeration definition More...
 
enum  adxl345_address_t { ADXL345_ADDRESS_ALT_0 = 0xA6 , ADXL345_ADDRESS_ALT_1 = 0x3A }
 adxl345 address enumeration definition More...
 
enum  adxl345_bool_t { ADXL345_BOOL_FALSE = 0x00 , ADXL345_BOOL_TRUE = 0x01 }
 adxl345 bool enumeration definition More...
 
enum  adxl345_coupled_t { ADXL345_COUPLED_DC = 0x00 , ADXL345_COUPLED_AC = 0x01 }
 adxl345 coupled enumeration definition More...
 
enum  adxl345_action_inaction_t {
  ADXL345_ACTION_X = 0x06 , ADXL345_ACTION_Y = 0x05 , ADXL345_ACTION_Z = 0x04 , ADXL345_INACTION_X = 0x02 ,
  ADXL345_INACTION_Y = 0x01 , ADXL345_INACTION_Z = 0x00
}
 adxl345 action inaction enumeration definition More...
 
enum  adxl345_tap_axis_t { ADXL345_TAP_AXIS_X = 0x02 , ADXL345_TAP_AXIS_Y = 0x01 , ADXL345_TAP_AXIS_Z = 0x00 }
 adxl345 tap axis enumeration definition More...
 
enum  adxl345_action_tap_status_t {
  ADXL345_ACTION_TAP_STATUS_ACT_X = (1 << 6) , ADXL345_ACTION_TAP_STATUS_ACT_Y = (1 << 5) , ADXL345_ACTION_TAP_STATUS_ACT_Z = (1 << 4) , ADXL345_ACTION_TAP_STATUS_ASLEEP = (1 << 3) ,
  ADXL345_ACTION_TAP_STATUS_TAP_X = (1 << 2) , ADXL345_ACTION_TAP_STATUS_TAP_Y = (1 << 1) , ADXL345_ACTION_TAP_STATUS_TAP_Z = (1 << 0)
}
 adxl345 action tap status enumeration definition More...
 
enum  adxl345_rate_t {
  ADXL345_RATE_0P1 = 0x00 , ADXL345_RATE_0P2 = 0x01 , ADXL345_RATE_0P39 = 0x02 , ADXL345_RATE_0P78 = 0x03 ,
  ADXL345_RATE_1P56 = 0x04 , ADXL345_RATE_3P13 = 0x05 , ADXL345_RATE_6P25 = 0x06 , ADXL345_RATE_12P5 = 0x07 ,
  ADXL345_RATE_25 = 0x08 , ADXL345_RATE_50 = 0x09 , ADXL345_RATE_100 = 0x0A , ADXL345_RATE_200 = 0x0B ,
  ADXL345_RATE_400 = 0x0C , ADXL345_RATE_800 = 0x0D , ADXL345_RATE_1600 = 0x0E , ADXL345_RATE_3200 = 0x0F ,
  ADXL345_LOW_POWER_RATE_12P5 = 0x17 , ADXL345_LOW_POWER_RATE_25 = 0x18 , ADXL345_LOW_POWER_RATE_50 = 0x19 , ADXL345_LOW_POWER_RATE_100 = 0x1A ,
  ADXL345_LOW_POWER_RATE_200 = 0x1B , ADXL345_LOW_POWER_RATE_400 = 0x1C
}
 adxl345 rate enumeration definition More...
 
enum  adxl345_spi_wire_t { ADXL345_SPI_WIRE_4 = 0x00 , ADXL345_SPI_WIRE_3 = 0x01 }
 adxl345 spi wire enumeration definition More...
 
enum  adxl345_justify_t { ADXL345_JUSTIFY_RIGHT = 0x00 , ADXL345_JUSTIFY_LEFT = 0x01 }
 adxl345 justify enumeration definition More...
 
enum  adxl345_range_t { ADXL345_RANGE_2G = 0x00 , ADXL345_RANGE_4G = 0x01 , ADXL345_RANGE_8G = 0x02 , ADXL345_RANGE_16G = 0x03 }
 adxl345 range enumeration definition More...
 
enum  adxl345_sleep_frequency_t { ADXL345_SLEEP_FREQUENCY_8HZ = 0x00 , ADXL345_SLEEP_FREQUENCY_4HZ = 0x01 , ADXL345_SLEEP_FREQUENCY_2HZ = 0x02 , ADXL345_SLEEP_FREQUENCY_1HZ = 0x03 }
 adxl345 sleep frequency enumeration definition More...
 
enum  adxl345_mode_t { ADXL345_MODE_BYPASS = 0x00 , ADXL345_MODE_FIFO = 0x01 , ADXL345_MODE_STREAM = 0x02 , ADXL345_MODE_TRIGGER = 0x03 }
 adxl345 mode enumeration definition More...
 
enum  adxl345_trigger_status_t { ADXL345_TRIGGER_NOT_OCCURRED = 0x00 , ADXL345_TRIGGER_OCCURRED = 0x01 }
 adxl345 trigger status enumeration definition More...
 

Functions

uint8_t adxl345_info (adxl345_info_t *info)
 get chip's information More...
 
uint8_t adxl345_init (adxl345_handle_t *handle)
 initialize the chip More...
 
uint8_t adxl345_deinit (adxl345_handle_t *handle)
 close the chip More...
 
uint8_t adxl345_set_interface (adxl345_handle_t *handle, adxl345_interface_t interface)
 set the chip interface More...
 
uint8_t adxl345_get_interface (adxl345_handle_t *handle, adxl345_interface_t *interface)
 get the chip interface More...
 
uint8_t adxl345_set_addr_pin (adxl345_handle_t *handle, adxl345_address_t addr_pin)
 set the iic address pin More...
 
uint8_t adxl345_get_addr_pin (adxl345_handle_t *handle, adxl345_address_t *addr_pin)
 get the iic address pin More...
 
uint8_t adxl345_read (adxl345_handle_t *handle, int16_t(*raw)[3], float(*g)[3], uint16_t *len)
 read the data More...
 
uint8_t adxl345_irq_handler (adxl345_handle_t *handle)
 irq handler More...
 
uint8_t adxl345_set_tap_threshold (adxl345_handle_t *handle, uint8_t threshold)
 set the tap threshold More...
 
uint8_t adxl345_get_tap_threshold (adxl345_handle_t *handle, uint8_t *threshold)
 get the tap threshold More...
 
uint8_t adxl345_tap_threshold_convert_to_register (adxl345_handle_t *handle, float g, uint8_t *reg)
 convert the tap threshold to the register raw data More...
 
uint8_t adxl345_tap_threshold_convert_to_data (adxl345_handle_t *handle, uint8_t reg, float *g)
 convert the register raw data to the tap threshold More...
 
uint8_t adxl345_set_offset (adxl345_handle_t *handle, int8_t x, int8_t y, int8_t z)
 set the axis offset More...
 
uint8_t adxl345_get_offset (adxl345_handle_t *handle, int8_t *x, int8_t *y, int8_t *z)
 get the axis offset More...
 
uint8_t adxl345_offset_convert_to_register (adxl345_handle_t *handle, float g, int8_t *reg)
 convert the offset to the register raw data More...
 
uint8_t adxl345_offset_convert_to_data (adxl345_handle_t *handle, int8_t reg, float *g)
 convert the register raw data to the offset More...
 
uint8_t adxl345_set_duration (adxl345_handle_t *handle, uint8_t t)
 set the duration More...
 
uint8_t adxl345_get_duration (adxl345_handle_t *handle, uint8_t *t)
 get the duration More...
 
uint8_t adxl345_duration_convert_to_register (adxl345_handle_t *handle, uint32_t us, uint8_t *reg)
 convert the duration to the register raw data More...
 
uint8_t adxl345_duration_convert_to_data (adxl345_handle_t *handle, uint8_t reg, uint32_t *us)
 convert the register raw data to the duration More...
 
uint8_t adxl345_set_latent (adxl345_handle_t *handle, uint8_t t)
 set the latent More...
 
uint8_t adxl345_get_latent (adxl345_handle_t *handle, uint8_t *t)
 get the latent More...
 
uint8_t adxl345_latent_convert_to_register (adxl345_handle_t *handle, float ms, uint8_t *reg)
 convert the latent to the register raw data More...
 
uint8_t adxl345_latent_convert_to_data (adxl345_handle_t *handle, uint8_t reg, float *ms)
 convert the register raw data to the latent More...
 
uint8_t adxl345_set_window (adxl345_handle_t *handle, uint8_t t)
 set the window More...
 
uint8_t adxl345_get_window (adxl345_handle_t *handle, uint8_t *t)
 get the window More...
 
uint8_t adxl345_window_convert_to_register (adxl345_handle_t *handle, float ms, uint8_t *reg)
 convert the window time to the register raw data More...
 
uint8_t adxl345_window_convert_to_data (adxl345_handle_t *handle, uint8_t reg, float *ms)
 convert the register raw data to the window time More...
 
uint8_t adxl345_set_action_threshold (adxl345_handle_t *handle, uint8_t threshold)
 set the action threshold More...
 
uint8_t adxl345_get_action_threshold (adxl345_handle_t *handle, uint8_t *threshold)
 get the action threshold More...
 
uint8_t adxl345_action_threshold_convert_to_register (adxl345_handle_t *handle, float g, uint8_t *reg)
 convert the action threshold to the register raw data More...
 
uint8_t adxl345_action_threshold_convert_to_data (adxl345_handle_t *handle, uint8_t reg, float *g)
 convert the register raw data to the action threshold More...
 
uint8_t adxl345_set_inaction_threshold (adxl345_handle_t *handle, uint8_t threshold)
 set the inaction threshold More...
 
uint8_t adxl345_get_inaction_threshold (adxl345_handle_t *handle, uint8_t *threshold)
 get the inaction threshold More...
 
uint8_t adxl345_inaction_threshold_convert_to_register (adxl345_handle_t *handle, float g, uint8_t *reg)
 convert the inaction threshold to the register raw data More...
 
uint8_t adxl345_inaction_threshold_convert_to_data (adxl345_handle_t *handle, uint8_t reg, float *g)
 convert the register raw data to the inaction threshold More...
 
uint8_t adxl345_set_inaction_time (adxl345_handle_t *handle, uint8_t t)
 set the inaction time More...
 
uint8_t adxl345_get_inaction_time (adxl345_handle_t *handle, uint8_t *t)
 get the inaction time More...
 
uint8_t adxl345_inaction_time_convert_to_register (adxl345_handle_t *handle, uint8_t s, uint8_t *reg)
 convert the inaction time to the register raw data More...
 
uint8_t adxl345_inaction_time_convert_to_data (adxl345_handle_t *handle, uint8_t reg, uint8_t *s)
 convert the register raw data to the inaction time More...
 
uint8_t adxl345_set_action_inaction (adxl345_handle_t *handle, adxl345_action_inaction_t type, adxl345_bool_t enable)
 enable or disable the action or inaction More...
 
uint8_t adxl345_get_action_inaction (adxl345_handle_t *handle, adxl345_action_inaction_t type, adxl345_bool_t *enable)
 get the action or inaction status More...
 
uint8_t adxl345_set_action_coupled (adxl345_handle_t *handle, adxl345_coupled_t coupled)
 set the action coupled More...
 
uint8_t adxl345_get_action_coupled (adxl345_handle_t *handle, adxl345_coupled_t *coupled)
 get the action coupled More...
 
uint8_t adxl345_set_inaction_coupled (adxl345_handle_t *handle, adxl345_coupled_t coupled)
 set the inaction coupled More...
 
uint8_t adxl345_get_inaction_coupled (adxl345_handle_t *handle, adxl345_coupled_t *coupled)
 get the inaction coupled More...
 
uint8_t adxl345_set_free_fall_threshold (adxl345_handle_t *handle, uint8_t threshold)
 set the free fall threshold More...
 
uint8_t adxl345_get_free_fall_threshold (adxl345_handle_t *handle, uint8_t *threshold)
 get the free fall threshold More...
 
uint8_t adxl345_free_fall_threshold_convert_to_register (adxl345_handle_t *handle, float g, uint8_t *reg)
 convert the free fall threshold to the register raw data More...
 
uint8_t adxl345_free_fall_threshold_convert_to_data (adxl345_handle_t *handle, uint8_t reg, float *g)
 convert the register raw data to the free fall threshold More...
 
uint8_t adxl345_set_free_fall_time (adxl345_handle_t *handle, uint8_t t)
 set the free fall time More...
 
uint8_t adxl345_get_free_fall_time (adxl345_handle_t *handle, uint8_t *t)
 get the free fall time More...
 
uint8_t adxl345_free_fall_time_convert_to_register (adxl345_handle_t *handle, uint16_t ms, uint8_t *reg)
 convert the free fall time to the register raw data More...
 
uint8_t adxl345_free_fall_time_convert_to_data (adxl345_handle_t *handle, uint8_t reg, uint16_t *ms)
 convert the register raw data to the free fall time More...
 
uint8_t adxl345_set_tap_axis (adxl345_handle_t *handle, adxl345_tap_axis_t axis, adxl345_bool_t enable)
 enable or disable the tap axis More...
 
uint8_t adxl345_get_tap_axis (adxl345_handle_t *handle, adxl345_tap_axis_t axis, adxl345_bool_t *enable)
 get the tap axis status More...
 
uint8_t adxl345_set_tap_suppress (adxl345_handle_t *handle, adxl345_bool_t enable)
 enable or disable the tap suppress More...
 
uint8_t adxl345_get_tap_suppress (adxl345_handle_t *handle, adxl345_bool_t *enable)
 get the tap suppress status More...
 
uint8_t adxl345_get_tap_status (adxl345_handle_t *handle, uint8_t *status)
 get the tap status More...
 
uint8_t adxl345_set_rate (adxl345_handle_t *handle, adxl345_rate_t rate)
 set the sampling rate More...
 
uint8_t adxl345_get_rate (adxl345_handle_t *handle, adxl345_rate_t *rate)
 get the sampling rate More...
 
uint8_t adxl345_set_self_test (adxl345_handle_t *handle, adxl345_bool_t enable)
 enable or disable the self test More...
 
uint8_t adxl345_get_self_test (adxl345_handle_t *handle, adxl345_bool_t *enable)
 get the self test status More...
 
uint8_t adxl345_set_spi_wire (adxl345_handle_t *handle, adxl345_spi_wire_t wire)
 set the chip spi wire More...
 
uint8_t adxl345_get_spi_wire (adxl345_handle_t *handle, adxl345_spi_wire_t *wire)
 get the chip spi wire More...
 
uint8_t adxl345_set_full_resolution (adxl345_handle_t *handle, adxl345_bool_t enable)
 enable or disable the full resolution More...
 
uint8_t adxl345_get_full_resolution (adxl345_handle_t *handle, adxl345_bool_t *enable)
 get the full resolution status More...
 
uint8_t adxl345_set_justify (adxl345_handle_t *handle, adxl345_justify_t enable)
 enable or disable the justify More...
 
uint8_t adxl345_get_justify (adxl345_handle_t *handle, adxl345_justify_t *enable)
 get the justify status More...
 
uint8_t adxl345_set_range (adxl345_handle_t *handle, adxl345_range_t range)
 set the chip range More...
 
uint8_t adxl345_get_range (adxl345_handle_t *handle, adxl345_range_t *range)
 get the chip range More...
 
uint8_t adxl345_set_mode (adxl345_handle_t *handle, adxl345_mode_t mode)
 set the chip mode More...
 
uint8_t adxl345_get_mode (adxl345_handle_t *handle, adxl345_mode_t *mode)
 get the chip mode More...
 
uint8_t adxl345_set_trigger_pin (adxl345_handle_t *handle, adxl345_interrupt_pin_t pin)
 set the trigger pin More...
 
uint8_t adxl345_get_trigger_pin (adxl345_handle_t *handle, adxl345_interrupt_pin_t *pin)
 get the trigger pin More...
 
uint8_t adxl345_get_trigger_status (adxl345_handle_t *handle, adxl345_trigger_status_t *status)
 get the trigger status More...
 
uint8_t adxl345_set_link_activity_inactivity (adxl345_handle_t *handle, adxl345_bool_t enable)
 enable or disable the activity and inactivity linking More...
 
uint8_t adxl345_get_link_activity_inactivity (adxl345_handle_t *handle, adxl345_bool_t *enable)
 get the activity and inactivity linking status More...
 
uint8_t adxl345_set_auto_sleep (adxl345_handle_t *handle, adxl345_bool_t enable)
 enable or disable the auto sleep More...
 
uint8_t adxl345_get_auto_sleep (adxl345_handle_t *handle, adxl345_bool_t *enable)
 get the auto sleep status More...
 
uint8_t adxl345_set_measure (adxl345_handle_t *handle, adxl345_bool_t enable)
 enable or disable the measure More...
 
uint8_t adxl345_get_measure (adxl345_handle_t *handle, adxl345_bool_t *enable)
 get the measure status More...
 
uint8_t adxl345_set_sleep (adxl345_handle_t *handle, adxl345_bool_t enable)
 enable or disable the sleep mode More...
 
uint8_t adxl345_get_sleep (adxl345_handle_t *handle, adxl345_bool_t *enable)
 get the sleep mode status More...
 
uint8_t adxl345_set_sleep_frequency (adxl345_handle_t *handle, adxl345_sleep_frequency_t sleep_frequency)
 set the sleep frequency More...
 
uint8_t adxl345_get_sleep_frequency (adxl345_handle_t *handle, adxl345_sleep_frequency_t *sleep_frequency)
 get the sleep frequency More...
 

Detailed Description

adxl345 basic driver modules

Typedef Documentation

◆ adxl345_handle_t

adxl345 handle structure definition

◆ adxl345_info_t

adxl345 information structure definition

Enumeration Type Documentation

◆ adxl345_action_inaction_t

adxl345 action inaction enumeration definition

Enumerator
ADXL345_ACTION_X 

x axis action

ADXL345_ACTION_Y 

y axis action

ADXL345_ACTION_Z 

z axis action

ADXL345_INACTION_X 

x axis inaction

ADXL345_INACTION_Y 

y axis inaction

ADXL345_INACTION_Z 

z axis inaction

Definition at line 99 of file driver_adxl345.h.

◆ adxl345_action_tap_status_t

adxl345 action tap status enumeration definition

Enumerator
ADXL345_ACTION_TAP_STATUS_ACT_X 

x axis action status

ADXL345_ACTION_TAP_STATUS_ACT_Y 

y axis action status

ADXL345_ACTION_TAP_STATUS_ACT_Z 

z axis action status

ADXL345_ACTION_TAP_STATUS_ASLEEP 

asleep status

ADXL345_ACTION_TAP_STATUS_TAP_X 

x axis tap status

ADXL345_ACTION_TAP_STATUS_TAP_Y 

y axis tap status

ADXL345_ACTION_TAP_STATUS_TAP_Z 

z axis tap status

Definition at line 122 of file driver_adxl345.h.

◆ adxl345_address_t

adxl345 address enumeration definition

Enumerator
ADXL345_ADDRESS_ALT_0 

addr pin connected to the GND

ADXL345_ADDRESS_ALT_1 

addr pin connected to the VCC

Definition at line 72 of file driver_adxl345.h.

◆ adxl345_bool_t

adxl345 bool enumeration definition

Enumerator
ADXL345_BOOL_FALSE 

false

ADXL345_BOOL_TRUE 

true

Definition at line 81 of file driver_adxl345.h.

◆ adxl345_coupled_t

adxl345 coupled enumeration definition

Enumerator
ADXL345_COUPLED_DC 

DC coupled

ADXL345_COUPLED_AC 

AC coupled

Definition at line 90 of file driver_adxl345.h.

◆ adxl345_interface_t

adxl345 interface enumeration definition

Enumerator
ADXL345_INTERFACE_IIC 

iic interface function

ADXL345_INTERFACE_SPI 

spi interface function

Definition at line 63 of file driver_adxl345.h.

◆ adxl345_justify_t

adxl345 justify enumeration definition

Enumerator
ADXL345_JUSTIFY_RIGHT 

right justify

ADXL345_JUSTIFY_LEFT 

left justify

Definition at line 174 of file driver_adxl345.h.

◆ adxl345_mode_t

adxl345 mode enumeration definition

Enumerator
ADXL345_MODE_BYPASS 

bypass mode

ADXL345_MODE_FIFO 

fifo mode

ADXL345_MODE_STREAM 

stream mode

ADXL345_MODE_TRIGGER 

trigger mode

Definition at line 205 of file driver_adxl345.h.

◆ adxl345_range_t

adxl345 range enumeration definition

Enumerator
ADXL345_RANGE_2G 

±2G

ADXL345_RANGE_4G 

±4G

ADXL345_RANGE_8G 

±8G

ADXL345_RANGE_16G 

±16G

Definition at line 183 of file driver_adxl345.h.

◆ adxl345_rate_t

adxl345 rate enumeration definition

Enumerator
ADXL345_RATE_0P1 

0.1Hz

ADXL345_RATE_0P2 

0.2Hz

ADXL345_RATE_0P39 

0.39Hz

ADXL345_RATE_0P78 

0.78Hz

ADXL345_RATE_1P56 

1.56Hz

ADXL345_RATE_3P13 

3.13Hz

ADXL345_RATE_6P25 

6.25Hz

ADXL345_RATE_12P5 

12.5Hz

ADXL345_RATE_25 

25Hz

ADXL345_RATE_50 

50Hz

ADXL345_RATE_100 

100Hz

ADXL345_RATE_200 

200Hz

ADXL345_RATE_400 

400Hz

ADXL345_RATE_800 

800Hz

ADXL345_RATE_1600 

1600Hz

ADXL345_RATE_3200 

3200Hz

ADXL345_LOW_POWER_RATE_12P5 

low power 12.5Hz

ADXL345_LOW_POWER_RATE_25 

low power 25Hz

ADXL345_LOW_POWER_RATE_50 

low power 50Hz

ADXL345_LOW_POWER_RATE_100 

low power 100Hz

ADXL345_LOW_POWER_RATE_200 

low power 200Hz

ADXL345_LOW_POWER_RATE_400 

low power 400Hz

Definition at line 136 of file driver_adxl345.h.

◆ adxl345_sleep_frequency_t

adxl345 sleep frequency enumeration definition

Enumerator
ADXL345_SLEEP_FREQUENCY_8HZ 

sleep 8Hz

ADXL345_SLEEP_FREQUENCY_4HZ 

sleep 4Hz

ADXL345_SLEEP_FREQUENCY_2HZ 

sleep 2Hz

ADXL345_SLEEP_FREQUENCY_1HZ 

sleep 1Hz

Definition at line 194 of file driver_adxl345.h.

◆ adxl345_spi_wire_t

adxl345 spi wire enumeration definition

Enumerator
ADXL345_SPI_WIRE_4 

wire 4

ADXL345_SPI_WIRE_3 

wire 3

Definition at line 165 of file driver_adxl345.h.

◆ adxl345_tap_axis_t

adxl345 tap axis enumeration definition

Enumerator
ADXL345_TAP_AXIS_X 

x axis tap

ADXL345_TAP_AXIS_Y 

y axis tap

ADXL345_TAP_AXIS_Z 

z axis tap

Definition at line 112 of file driver_adxl345.h.

◆ adxl345_trigger_status_t

adxl345 trigger status enumeration definition

Enumerator
ADXL345_TRIGGER_NOT_OCCURRED 

not occurred

ADXL345_TRIGGER_OCCURRED 

occurred

Definition at line 216 of file driver_adxl345.h.

Function Documentation

◆ adxl345_action_threshold_convert_to_data()

uint8_t adxl345_action_threshold_convert_to_data ( adxl345_handle_t handle,
uint8_t  reg,
float *  g 
)

convert the register raw data to the action threshold

Parameters
[in]*handlepointer to an adxl345 handle structure
[in]regregister raw data
[out]*gpointer to an action threshold buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 915 of file driver_adxl345.c.

◆ adxl345_action_threshold_convert_to_register()

uint8_t adxl345_action_threshold_convert_to_register ( adxl345_handle_t handle,
float  g,
uint8_t *  reg 
)

convert the action threshold to the register raw data

Parameters
[in]*handlepointer to an adxl345 handle structure
[in]gaction threshold
[out]*regpointer to a register raw buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 888 of file driver_adxl345.c.

◆ adxl345_deinit()

uint8_t adxl345_deinit ( adxl345_handle_t handle)

close the chip

Parameters
[in]*handlepointer to an adxl345 handle structure
Returns
status code
  • 0 success
  • 1 iic or spi deinit failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 power down failed
Note
none

Definition at line 3277 of file driver_adxl345.c.

◆ adxl345_duration_convert_to_data()

uint8_t adxl345_duration_convert_to_data ( adxl345_handle_t handle,
uint8_t  reg,
uint32_t *  us 
)

convert the register raw data to the duration

Parameters
[in]*handlepointer to an adxl345 handle structure
[in]regregister raw data
[out]*uspointer to a duration buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 603 of file driver_adxl345.c.

◆ adxl345_duration_convert_to_register()

uint8_t adxl345_duration_convert_to_register ( adxl345_handle_t handle,
uint32_t  us,
uint8_t *  reg 
)

convert the duration to the register raw data

Parameters
[in]*handlepointer to an adxl345 handle structure
[in]usduration
[out]*regpointer to a register raw buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 576 of file driver_adxl345.c.

◆ adxl345_free_fall_threshold_convert_to_data()

uint8_t adxl345_free_fall_threshold_convert_to_data ( adxl345_handle_t handle,
uint8_t  reg,
float *  g 
)

convert the register raw data to the free fall threshold

Parameters
[in]*handlepointer to an adxl345 handle structure
[in]regregister raw data
[out]*gpointer to a free fall threshold buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1451 of file driver_adxl345.c.

◆ adxl345_free_fall_threshold_convert_to_register()

uint8_t adxl345_free_fall_threshold_convert_to_register ( adxl345_handle_t handle,
float  g,
uint8_t *  reg 
)

convert the free fall threshold to the register raw data

Parameters
[in]*handlepointer to an adxl345 handle structure
[in]gfree fall threshold
[out]*regpointer to a register raw buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1424 of file driver_adxl345.c.

◆ adxl345_free_fall_time_convert_to_data()

uint8_t adxl345_free_fall_time_convert_to_data ( adxl345_handle_t handle,
uint8_t  reg,
uint16_t *  ms 
)

convert the register raw data to the free fall time

Parameters
[in]*handlepointer to an adxl345 handle structure
[in]regregister raw data
[out]*mspointer to a free fall time buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1555 of file driver_adxl345.c.

◆ adxl345_free_fall_time_convert_to_register()

uint8_t adxl345_free_fall_time_convert_to_register ( adxl345_handle_t handle,
uint16_t  ms,
uint8_t *  reg 
)

convert the free fall time to the register raw data

Parameters
[in]*handlepointer to an adxl345 handle structure
[in]msfree fall time
[out]*regpointer to a register raw buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1528 of file driver_adxl345.c.

◆ adxl345_get_action_coupled()

uint8_t adxl345_get_action_coupled ( adxl345_handle_t handle,
adxl345_coupled_t coupled 
)

get the action coupled

Parameters
[in]*handlepointer to an adxl345 handle structure
[out]*coupledpointer to an action coupled buffer
Returns
status code
  • 0 success
  • 1 get action coupled failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1263 of file driver_adxl345.c.

◆ adxl345_get_action_inaction()

uint8_t adxl345_get_action_inaction ( adxl345_handle_t handle,
adxl345_action_inaction_t  type,
adxl345_bool_t enable 
)

get the action or inaction status

Parameters
[in]*handlepointer to an adxl345 handle structure
[in]typeaction or inaction type
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get action inaction failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1189 of file driver_adxl345.c.

◆ adxl345_get_action_threshold()

uint8_t adxl345_get_action_threshold ( adxl345_handle_t handle,
uint8_t *  threshold 
)

get the action threshold

Parameters
[in]*handlepointer to an adxl345 handle structure
[out]*thresholdpointer to an action threshold buffer
Returns
status code
  • 0 success
  • 1 get action threshold failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 863 of file driver_adxl345.c.

◆ adxl345_get_addr_pin()

uint8_t adxl345_get_addr_pin ( adxl345_handle_t handle,
adxl345_address_t addr_pin 
)

get the iic address pin

Parameters
[in]*handlepointer to an adxl345 handle structure
[out]*addr_pinpointer to an address pin buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
Note
none

Definition at line 243 of file driver_adxl345.c.

◆ adxl345_get_auto_sleep()

uint8_t adxl345_get_auto_sleep ( adxl345_handle_t handle,
adxl345_bool_t enable 
)

get the auto sleep status

Parameters
[in]*handlepointer to an adxl345 handle structure
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get auto sleep failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2859 of file driver_adxl345.c.

◆ adxl345_get_duration()

uint8_t adxl345_get_duration ( adxl345_handle_t handle,
uint8_t *  t 
)

get the duration

Parameters
[in]*handlepointer to an adxl345 handle structure
[out]*tpointer to a duration buffer
Returns
status code
  • 0 success
  • 1 get duration failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 551 of file driver_adxl345.c.

◆ adxl345_get_free_fall_threshold()

uint8_t adxl345_get_free_fall_threshold ( adxl345_handle_t handle,
uint8_t *  threshold 
)

get the free fall threshold

Parameters
[in]*handlepointer to an adxl345 handle structure
[out]*thresholdpointer to a free fall threshold buffer
Returns
status code
  • 0 success
  • 1 get free fall threshold failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1399 of file driver_adxl345.c.

◆ adxl345_get_free_fall_time()

uint8_t adxl345_get_free_fall_time ( adxl345_handle_t handle,
uint8_t *  t 
)

get the free fall time

Parameters
[in]*handlepointer to an adxl345 handle structure
[out]*tpointer to a free fall time buffer
Returns
status code
  • 0 success
  • 1 get free fall time failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1503 of file driver_adxl345.c.

◆ adxl345_get_full_resolution()

uint8_t adxl345_get_full_resolution ( adxl345_handle_t handle,
adxl345_bool_t enable 
)

get the full resolution status

Parameters
[in]*handlepointer to an adxl345 handle structure
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get full resolution failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2267 of file driver_adxl345.c.

◆ adxl345_get_inaction_coupled()

uint8_t adxl345_get_inaction_coupled ( adxl345_handle_t handle,
adxl345_coupled_t coupled 
)

get the inaction coupled

Parameters
[in]*handlepointer to an adxl345 handle structure
[out]*coupledpointer to an inaction coupled buffer
Returns
status code
  • 0 success
  • 1 get inaction coupled failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1337 of file driver_adxl345.c.

◆ adxl345_get_inaction_threshold()

uint8_t adxl345_get_inaction_threshold ( adxl345_handle_t handle,
uint8_t *  threshold 
)

get the inaction threshold

Parameters
[in]*handlepointer to an adxl345 handle structure
[out]*thresholdpointer to an inaction threshold buffer
Returns
status code
  • 0 success
  • 1 get inaction threshold failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 967 of file driver_adxl345.c.

◆ adxl345_get_inaction_time()

uint8_t adxl345_get_inaction_time ( adxl345_handle_t handle,
uint8_t *  t 
)

get the inaction time

Parameters
[in]*handlepointer to an adxl345 handle structure
[out]*tpointer to an inaction time buffer
Returns
status code
  • 0 success
  • 1 get inaction time failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1071 of file driver_adxl345.c.

◆ adxl345_get_interface()

uint8_t adxl345_get_interface ( adxl345_handle_t handle,
adxl345_interface_t interface 
)

get the chip interface

Parameters
[in]*handlepointer to an adxl345 handle structure
[out]*interfacepointer to a chip interface buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
Note
none

Definition at line 201 of file driver_adxl345.c.

◆ adxl345_get_justify()

uint8_t adxl345_get_justify ( adxl345_handle_t handle,
adxl345_justify_t enable 
)

get the justify status

Parameters
[in]*handlepointer to an adxl345 handle structure
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get justify failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2341 of file driver_adxl345.c.

◆ adxl345_get_latent()

uint8_t adxl345_get_latent ( adxl345_handle_t handle,
uint8_t *  t 
)

get the latent

Parameters
[in]*handlepointer to an adxl345 handle structure
[out]*tpointer to a latent time buffer
Returns
status code
  • 0 success
  • 1 get latent failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 655 of file driver_adxl345.c.

◆ adxl345_get_link_activity_inactivity()

uint8_t adxl345_get_link_activity_inactivity ( adxl345_handle_t handle,
adxl345_bool_t enable 
)

get the activity and inactivity linking status

Parameters
[in]*handlepointer to an adxl345 handle structure
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get link activity inactivity failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2785 of file driver_adxl345.c.

◆ adxl345_get_measure()

uint8_t adxl345_get_measure ( adxl345_handle_t handle,
adxl345_bool_t enable 
)

get the measure status

Parameters
[in]*handlepointer to an adxl345 handle structure
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get measure failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2933 of file driver_adxl345.c.

◆ adxl345_get_mode()

uint8_t adxl345_get_mode ( adxl345_handle_t handle,
adxl345_mode_t mode 
)

get the chip mode

Parameters
[in]*handlepointer to an adxl345 handle structure
[out]*modepointer to a chip mode buffer
Returns
status code
  • 0 success
  • 1 get mode failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2489 of file driver_adxl345.c.

◆ adxl345_get_offset()

uint8_t adxl345_get_offset ( adxl345_handle_t handle,
int8_t *  x,
int8_t *  y,
int8_t *  z 
)

get the axis offset

Parameters
[in]*handlepointer to an adxl345 handle structure
[out]*xpointer to an x axis offset
[out]*ypointer to a y axis offset
[out]*zpointer to a z axis offset
Returns
status code
  • 0 success
  • 1 get offset failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 423 of file driver_adxl345.c.

◆ adxl345_get_range()

uint8_t adxl345_get_range ( adxl345_handle_t handle,
adxl345_range_t range 
)

get the chip range

Parameters
[in]*handlepointer to an adxl345 handle structure
[out]*rangepointer to a measurement range buffer
Returns
status code
  • 0 success
  • 1 get range failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2415 of file driver_adxl345.c.

◆ adxl345_get_rate()

uint8_t adxl345_get_rate ( adxl345_handle_t handle,
adxl345_rate_t rate 
)

get the sampling rate

Parameters
[in]*handlepointer to an adxl345 handle structure
[out]*ratepointer to a sampling rate buffer
Returns
status code
  • 0 success
  • 1 get rate failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1794 of file driver_adxl345.c.

◆ adxl345_get_self_test()

uint8_t adxl345_get_self_test ( adxl345_handle_t handle,
adxl345_bool_t enable 
)

get the self test status

Parameters
[in]*handlepointer to an adxl345 handle structure
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get self test failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2045 of file driver_adxl345.c.

◆ adxl345_get_sleep()

uint8_t adxl345_get_sleep ( adxl345_handle_t handle,
adxl345_bool_t enable 
)

get the sleep mode status

Parameters
[in]*handlepointer to an adxl345 handle structure
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get sleep failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 3007 of file driver_adxl345.c.

◆ adxl345_get_sleep_frequency()

uint8_t adxl345_get_sleep_frequency ( adxl345_handle_t handle,
adxl345_sleep_frequency_t sleep_frequency 
)

get the sleep frequency

Parameters
[in]*handlepointer to an adxl345 handle structure
[out]*sleep_frequencypointer to a sleep frequency buffer
Returns
status code
  • 0 success
  • 1 get sleep frequency failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 3081 of file driver_adxl345.c.

◆ adxl345_get_spi_wire()

uint8_t adxl345_get_spi_wire ( adxl345_handle_t handle,
adxl345_spi_wire_t wire 
)

get the chip spi wire

Parameters
[in]*handlepointer to an adxl345 handle structure
[out]*wirepointer to a spi wire buffer
Returns
status code
  • 0 success
  • 1 get spi wire failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2119 of file driver_adxl345.c.

◆ adxl345_get_tap_axis()

uint8_t adxl345_get_tap_axis ( adxl345_handle_t handle,
adxl345_tap_axis_t  axis,
adxl345_bool_t enable 
)

get the tap axis status

Parameters
[in]*handlepointer to an adxl345 handle structure
[in]axistap axis
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get tap axis failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1621 of file driver_adxl345.c.

◆ adxl345_get_tap_status()

uint8_t adxl345_get_tap_status ( adxl345_handle_t handle,
uint8_t *  status 
)

get the tap status

Parameters
[in]*handlepointer to an adxl345 handle structure
[out]*statuspointer to a tap status buffer
Returns
status code
  • 0 success
  • 1 get tap status failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1732 of file driver_adxl345.c.

◆ adxl345_get_tap_suppress()

uint8_t adxl345_get_tap_suppress ( adxl345_handle_t handle,
adxl345_bool_t enable 
)

get the tap suppress status

Parameters
[in]*handlepointer to an adxl345 handle structure
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get tap suppress failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1695 of file driver_adxl345.c.

◆ adxl345_get_tap_threshold()

uint8_t adxl345_get_tap_threshold ( adxl345_handle_t handle,
uint8_t *  threshold 
)

get the tap threshold

Parameters
[in]*handlepointer to an adxl345 handle structure
[out]*thresholdpointer to a tap threshold buffer
Returns
status code
  • 0 success
  • 1 get tap threshold failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 291 of file driver_adxl345.c.

◆ adxl345_get_trigger_pin()

uint8_t adxl345_get_trigger_pin ( adxl345_handle_t handle,
adxl345_interrupt_pin_t pin 
)

get the trigger pin

Parameters
[in]*handlepointer to an adxl345 handle structure
[out]*pinpointer to a trigger pin buffer
Returns
status code
  • 0 success
  • 1 get trigger pin failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2563 of file driver_adxl345.c.

◆ adxl345_get_trigger_status()

uint8_t adxl345_get_trigger_status ( adxl345_handle_t handle,
adxl345_trigger_status_t status 
)

get the trigger status

Parameters
[in]*handlepointer to an adxl345 handle structure
[out]*statuspointer to a trigger status buffer
Returns
status code
  • 0 success
  • 1 get trigger status failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2711 of file driver_adxl345.c.

◆ adxl345_get_window()

uint8_t adxl345_get_window ( adxl345_handle_t handle,
uint8_t *  t 
)

get the window

Parameters
[in]*handlepointer to an adxl345 handle structure
[out]*tpointer to a window time buffer
Returns
status code
  • 0 success
  • 1 get window failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 759 of file driver_adxl345.c.

◆ adxl345_inaction_threshold_convert_to_data()

uint8_t adxl345_inaction_threshold_convert_to_data ( adxl345_handle_t handle,
uint8_t  reg,
float *  g 
)

convert the register raw data to the inaction threshold

Parameters
[in]*handlepointer to an adxl345 handle structure
[in]regregister raw data
[out]*gpointer to an inaction threshold buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1019 of file driver_adxl345.c.

◆ adxl345_inaction_threshold_convert_to_register()

uint8_t adxl345_inaction_threshold_convert_to_register ( adxl345_handle_t handle,
float  g,
uint8_t *  reg 
)

convert the inaction threshold to the register raw data

Parameters
[in]*handlepointer to an adxl345 handle structure
[in]ginaction threshold
[out]*regpointer to a register raw buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 992 of file driver_adxl345.c.

◆ adxl345_inaction_time_convert_to_data()

uint8_t adxl345_inaction_time_convert_to_data ( adxl345_handle_t handle,
uint8_t  reg,
uint8_t *  s 
)

convert the register raw data to the inaction time

Parameters
[in]*handlepointer to an adxl345 handle structure
[in]regregister raw data
[out]*spointer to an inaction time buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1123 of file driver_adxl345.c.

◆ adxl345_inaction_time_convert_to_register()

uint8_t adxl345_inaction_time_convert_to_register ( adxl345_handle_t handle,
uint8_t  s,
uint8_t *  reg 
)

convert the inaction time to the register raw data

Parameters
[in]*handlepointer to an adxl345 handle structure
[in]sinaction time
[out]*regpointer to a register raw buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1096 of file driver_adxl345.c.

◆ adxl345_info()

uint8_t adxl345_info ( adxl345_info_t info)

get chip's information

Parameters
[out]*infopointer to an adxl345 info structure
Returns
status code
  • 0 success
  • 2 handle is NULL
Note
none

Definition at line 3912 of file driver_adxl345.c.

◆ adxl345_init()

uint8_t adxl345_init ( adxl345_handle_t handle)

initialize the chip

Parameters
[in]*handlepointer to an adxl345 handle structure
Returns
status code
  • 0 success
  • 1 spi or iic initialization failed
  • 2 handle is NULL
  • 3 linked functions is NULL
  • 4 id is invalid
Note
none

Definition at line 3156 of file driver_adxl345.c.

◆ adxl345_irq_handler()

uint8_t adxl345_irq_handler ( adxl345_handle_t handle)

irq handler

Parameters
[in]*handlepointer to an adxl345 handle structure
Returns
status code
  • 0 success
  • 1 run failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 3770 of file driver_adxl345.c.

◆ adxl345_latent_convert_to_data()

uint8_t adxl345_latent_convert_to_data ( adxl345_handle_t handle,
uint8_t  reg,
float *  ms 
)

convert the register raw data to the latent

Parameters
[in]*handlepointer to an adxl345 handle structure
[in]regregister raw data
[out]*mspointer to a latent buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 707 of file driver_adxl345.c.

◆ adxl345_latent_convert_to_register()

uint8_t adxl345_latent_convert_to_register ( adxl345_handle_t handle,
float  ms,
uint8_t *  reg 
)

convert the latent to the register raw data

Parameters
[in]*handlepointer to an adxl345 handle structure
[in]mstime
[out]*regpointer to a register raw buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 680 of file driver_adxl345.c.

◆ adxl345_offset_convert_to_data()

uint8_t adxl345_offset_convert_to_data ( adxl345_handle_t handle,
int8_t  reg,
float *  g 
)

convert the register raw data to the offset

Parameters
[in]*handlepointer to an adxl345 handle structure
[in]regregister raw data
[out]*gpointer to an offset buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 499 of file driver_adxl345.c.

◆ adxl345_offset_convert_to_register()

uint8_t adxl345_offset_convert_to_register ( adxl345_handle_t handle,
float  g,
int8_t *  reg 
)

convert the offset to the register raw data

Parameters
[in]*handlepointer to an adxl345 handle structure
[in]goffset
[out]*regpointer to a register raw buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 472 of file driver_adxl345.c.

◆ adxl345_read()

uint8_t adxl345_read ( adxl345_handle_t handle,
int16_t(*)  raw[3],
float(*)  g[3],
uint16_t *  len 
)

read the data

Parameters
[in]*handlepointer to an adxl345 handle structure
[out]**rawpointer to a raw data buffer
[out]**gpointer to a converted data buffer
[in,out]*lenpointer to a length buffer
Returns
status code
  • 0 success
  • 1 read failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 3335 of file driver_adxl345.c.

◆ adxl345_set_action_coupled()

uint8_t adxl345_set_action_coupled ( adxl345_handle_t handle,
adxl345_coupled_t  coupled 
)

set the action coupled

Parameters
[in]*handlepointer to an adxl345 handle structure
[in]coupledaction coupled
Returns
status code
  • 0 success
  • 1 set action coupled failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1226 of file driver_adxl345.c.

◆ adxl345_set_action_inaction()

uint8_t adxl345_set_action_inaction ( adxl345_handle_t handle,
adxl345_action_inaction_t  type,
adxl345_bool_t  enable 
)

enable or disable the action or inaction

Parameters
[in]*handlepointer to an adxl345 handle structure
[in]typeaction or inaction type
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set action inaction failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1151 of file driver_adxl345.c.

◆ adxl345_set_action_threshold()

uint8_t adxl345_set_action_threshold ( adxl345_handle_t handle,
uint8_t  threshold 
)

set the action threshold

Parameters
[in]*handlepointer to an adxl345 handle structure
[in]thresholdaction threshold
Returns
status code
  • 0 success
  • 1 set action threshold failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 838 of file driver_adxl345.c.

◆ adxl345_set_addr_pin()

uint8_t adxl345_set_addr_pin ( adxl345_handle_t handle,
adxl345_address_t  addr_pin 
)

set the iic address pin

Parameters
[in]*handlepointer to an adxl345 handle structure
[in]addr_pinaddress pin
Returns
status code
  • 0 success
  • 2 handle is NULL
Note
none

Definition at line 222 of file driver_adxl345.c.

◆ adxl345_set_auto_sleep()

uint8_t adxl345_set_auto_sleep ( adxl345_handle_t handle,
adxl345_bool_t  enable 
)

enable or disable the auto sleep

Parameters
[in]*handlepointer to an adxl345 handle structure
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set auto sleep failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2822 of file driver_adxl345.c.

◆ adxl345_set_duration()

uint8_t adxl345_set_duration ( adxl345_handle_t handle,
uint8_t  t 
)

set the duration

Parameters
[in]*handlepointer to an adxl345 handle structure
[in]tduration
Returns
status code
  • 0 success
  • 1 set duration failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 526 of file driver_adxl345.c.

◆ adxl345_set_free_fall_threshold()

uint8_t adxl345_set_free_fall_threshold ( adxl345_handle_t handle,
uint8_t  threshold 
)

set the free fall threshold

Parameters
[in]*handlepointer to an adxl345 handle structure
[in]thresholdfree fall threshold
Returns
status code
  • 0 success
  • 1 set free fall threshold failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1374 of file driver_adxl345.c.

◆ adxl345_set_free_fall_time()

uint8_t adxl345_set_free_fall_time ( adxl345_handle_t handle,
uint8_t  t 
)

set the free fall time

Parameters
[in]*handlepointer to an adxl345 handle structure
[in]tfree fall time
Returns
status code
  • 0 success
  • 1 set free fall time failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1478 of file driver_adxl345.c.

◆ adxl345_set_full_resolution()

uint8_t adxl345_set_full_resolution ( adxl345_handle_t handle,
adxl345_bool_t  enable 
)

enable or disable the full resolution

Parameters
[in]*handlepointer to an adxl345 handle structure
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set full resolution failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2230 of file driver_adxl345.c.

◆ adxl345_set_inaction_coupled()

uint8_t adxl345_set_inaction_coupled ( adxl345_handle_t handle,
adxl345_coupled_t  coupled 
)

set the inaction coupled

Parameters
[in]*handlepointer to an adxl345 handle structure
[in]coupledinaction coupled
Returns
status code
  • 0 success
  • 1 set inaction coupled failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1300 of file driver_adxl345.c.

◆ adxl345_set_inaction_threshold()

uint8_t adxl345_set_inaction_threshold ( adxl345_handle_t handle,
uint8_t  threshold 
)

set the inaction threshold

Parameters
[in]*handlepointer to an adxl345 handle structure
[in]thresholdinaction threshold
Returns
status code
  • 0 success
  • 1 set inaction threshold failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 942 of file driver_adxl345.c.

◆ adxl345_set_inaction_time()

uint8_t adxl345_set_inaction_time ( adxl345_handle_t handle,
uint8_t  t 
)

set the inaction time

Parameters
[in]*handlepointer to an adxl345 handle structure
[in]tinaction time
Returns
status code
  • 0 success
  • 1 set inaction time failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1046 of file driver_adxl345.c.

◆ adxl345_set_interface()

uint8_t adxl345_set_interface ( adxl345_handle_t handle,
adxl345_interface_t  interface 
)

set the chip interface

Parameters
[in]*handlepointer to an adxl345 handle structure
[in]interfacechip interface
Returns
status code
  • 0 success
  • 2 handle is NULL
Note
none

Definition at line 180 of file driver_adxl345.c.

◆ adxl345_set_justify()

uint8_t adxl345_set_justify ( adxl345_handle_t handle,
adxl345_justify_t  enable 
)

enable or disable the justify

Parameters
[in]*handlepointer to an adxl345 handle structure
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set justify failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2304 of file driver_adxl345.c.

◆ adxl345_set_latent()

uint8_t adxl345_set_latent ( adxl345_handle_t handle,
uint8_t  t 
)

set the latent

Parameters
[in]*handlepointer to an adxl345 handle structure
[in]tlatent time
Returns
status code
  • 0 success
  • 1 set latent failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 630 of file driver_adxl345.c.

◆ adxl345_set_link_activity_inactivity()

uint8_t adxl345_set_link_activity_inactivity ( adxl345_handle_t handle,
adxl345_bool_t  enable 
)

enable or disable the activity and inactivity linking

Parameters
[in]*handlepointer to an adxl345 handle structure
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set link activity inactivity failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2748 of file driver_adxl345.c.

◆ adxl345_set_measure()

uint8_t adxl345_set_measure ( adxl345_handle_t handle,
adxl345_bool_t  enable 
)

enable or disable the measure

Parameters
[in]*handlepointer to an adxl345 handle structure
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set measure failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2896 of file driver_adxl345.c.

◆ adxl345_set_mode()

uint8_t adxl345_set_mode ( adxl345_handle_t handle,
adxl345_mode_t  mode 
)

set the chip mode

Parameters
[in]*handlepointer to an adxl345 handle structure
[in]modechip mode
Returns
status code
  • 0 success
  • 1 set mode failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2452 of file driver_adxl345.c.

◆ adxl345_set_offset()

uint8_t adxl345_set_offset ( adxl345_handle_t handle,
int8_t  x,
int8_t  y,
int8_t  z 
)

set the axis offset

Parameters
[in]*handlepointer to an adxl345 handle structure
[in]xx axis offset
[in]yy axis offset
[in]zz axis offset
Returns
status code
  • 0 success
  • 1 set offset failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 372 of file driver_adxl345.c.

◆ adxl345_set_range()

uint8_t adxl345_set_range ( adxl345_handle_t handle,
adxl345_range_t  range 
)

set the chip range

Parameters
[in]*handlepointer to an adxl345 handle structure
[in]rangemeasurement range
Returns
status code
  • 0 success
  • 1 set range failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2378 of file driver_adxl345.c.

◆ adxl345_set_rate()

uint8_t adxl345_set_rate ( adxl345_handle_t handle,
adxl345_rate_t  rate 
)

set the sampling rate

Parameters
[in]*handlepointer to an adxl345 handle structure
[in]ratesampling rate
Returns
status code
  • 0 success
  • 1 set rate failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1757 of file driver_adxl345.c.

◆ adxl345_set_self_test()

uint8_t adxl345_set_self_test ( adxl345_handle_t handle,
adxl345_bool_t  enable 
)

enable or disable the self test

Parameters
[in]*handlepointer to an adxl345 handle structure
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set self test failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2008 of file driver_adxl345.c.

◆ adxl345_set_sleep()

uint8_t adxl345_set_sleep ( adxl345_handle_t handle,
adxl345_bool_t  enable 
)

enable or disable the sleep mode

Parameters
[in]*handlepointer to an adxl345 handle structure
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set sleep failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2970 of file driver_adxl345.c.

◆ adxl345_set_sleep_frequency()

uint8_t adxl345_set_sleep_frequency ( adxl345_handle_t handle,
adxl345_sleep_frequency_t  sleep_frequency 
)

set the sleep frequency

Parameters
[in]*handlepointer to an adxl345 handle structure
[in]sleep_frequencysleep frequency
Returns
status code
  • 0 success
  • 1 set sleep frequency failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 3044 of file driver_adxl345.c.

◆ adxl345_set_spi_wire()

uint8_t adxl345_set_spi_wire ( adxl345_handle_t handle,
adxl345_spi_wire_t  wire 
)

set the chip spi wire

Parameters
[in]*handlepointer to an adxl345 handle structure
[in]wirespi wire
Returns
status code
  • 0 success
  • 1 set spi wire failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2082 of file driver_adxl345.c.

◆ adxl345_set_tap_axis()

uint8_t adxl345_set_tap_axis ( adxl345_handle_t handle,
adxl345_tap_axis_t  axis,
adxl345_bool_t  enable 
)

enable or disable the tap axis

Parameters
[in]*handlepointer to an adxl345 handle structure
[in]axistap axis
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set tap axis failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1583 of file driver_adxl345.c.

◆ adxl345_set_tap_suppress()

uint8_t adxl345_set_tap_suppress ( adxl345_handle_t handle,
adxl345_bool_t  enable 
)

enable or disable the tap suppress

Parameters
[in]*handlepointer to an adxl345 handle structure
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set tap suppress failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1658 of file driver_adxl345.c.

◆ adxl345_set_tap_threshold()

uint8_t adxl345_set_tap_threshold ( adxl345_handle_t handle,
uint8_t  threshold 
)

set the tap threshold

Parameters
[in]*handlepointer to an adxl345 handle structure
[in]thresholdtap threshold
Returns
status code
  • 0 success
  • 1 set tap threshold failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 266 of file driver_adxl345.c.

◆ adxl345_set_trigger_pin()

uint8_t adxl345_set_trigger_pin ( adxl345_handle_t handle,
adxl345_interrupt_pin_t  pin 
)

set the trigger pin

Parameters
[in]*handlepointer to an adxl345 handle structure
[in]pintrigger pin
Returns
status code
  • 0 success
  • 1 set trigger pin failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2526 of file driver_adxl345.c.

◆ adxl345_set_window()

uint8_t adxl345_set_window ( adxl345_handle_t handle,
uint8_t  t 
)

set the window

Parameters
[in]*handlepointer to an adxl345 handle structure
[in]twindow time
Returns
status code
  • 0 success
  • 1 set window failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 734 of file driver_adxl345.c.

◆ adxl345_tap_threshold_convert_to_data()

uint8_t adxl345_tap_threshold_convert_to_data ( adxl345_handle_t handle,
uint8_t  reg,
float *  g 
)

convert the register raw data to the tap threshold

Parameters
[in]*handlepointer to an adxl345 handle structure
[in]regregister raw data
[out]*gpointer to a tap threshold buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 343 of file driver_adxl345.c.

◆ adxl345_tap_threshold_convert_to_register()

uint8_t adxl345_tap_threshold_convert_to_register ( adxl345_handle_t handle,
float  g,
uint8_t *  reg 
)

convert the tap threshold to the register raw data

Parameters
[in]*handlepointer to an adxl345 handle structure
[in]gtap threshold
[out]*regpointer to a register raw buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 316 of file driver_adxl345.c.

◆ adxl345_window_convert_to_data()

uint8_t adxl345_window_convert_to_data ( adxl345_handle_t handle,
uint8_t  reg,
float *  ms 
)

convert the register raw data to the window time

Parameters
[in]*handlepointer to an adxl345 handle structure
[in]regregister raw data
[out]*mspointer to a window time buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 811 of file driver_adxl345.c.

◆ adxl345_window_convert_to_register()

uint8_t adxl345_window_convert_to_register ( adxl345_handle_t handle,
float  ms,
uint8_t *  reg 
)

convert the window time to the register raw data

Parameters
[in]*handlepointer to an adxl345 handle structure
[in]mswindow time
[out]*regpointer to a register raw buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 784 of file driver_adxl345.c.