37#ifndef DRIVER_ADXL362_H
38#define DRIVER_ADXL362_H
258#define DRIVER_ADXL362_LINK_INIT(HANDLE, STRUCTURE) memset(HANDLE, 0, sizeof(STRUCTURE))
266#define DRIVER_ADXL362_LINK_SPI_INIT(HANDLE, FUC) (HANDLE)->spi_init = FUC
274#define DRIVER_ADXL362_LINK_SPI_DEINIT(HANDLE, FUC) (HANDLE)->spi_deinit = FUC
282#define DRIVER_ADXL362_LINK_SPI_READ(HANDLE, FUC) (HANDLE)->spi_read = FUC
290#define DRIVER_ADXL362_LINK_SPI_READ_ADDRESS16(HANDLE, FUC) (HANDLE)->spi_read_address16 = FUC
298#define DRIVER_ADXL362_LINK_SPI_WRITE_ADDRESS16(HANDLE, FUC) (HANDLE)->spi_write_address16 = FUC
306#define DRIVER_ADXL362_LINK_DELAY_MS(HANDLE, FUC) (HANDLE)->delay_ms = FUC
314#define DRIVER_ADXL362_LINK_DEBUG_PRINT(HANDLE, FUC) (HANDLE)->debug_print = FUC
322#define DRIVER_ADXL362_LINK_RECEIVE_CALLBACK(HANDLE, FUC) (HANDLE)->receive_callback = FUC
uint8_t adxl362_get_wake_up(adxl362_handle_t *handle, adxl362_bool_t *enable)
get the chip wake up status
adxl362_detect_mode_t
adxl362 detect mode enumeration definition
uint8_t adxl362_get_interrupt_pin1_map(adxl362_handle_t *handle, adxl362_interrupt_map_t map, adxl362_bool_t *enable)
get the interrupt pin1 map
uint8_t adxl362_inactivity_threshold_convert_to_data(adxl362_handle_t *handle, uint16_t reg, float *g)
convert the register raw data to the inactivity threshold
adxl362_fifo_mode_t
adxl362 fifo mode enumeration definition
uint8_t adxl362_set_range(adxl362_handle_t *handle, adxl362_range_t range)
set the measurement range
uint8_t adxl362_get_self_test(adxl362_handle_t *handle, adxl362_bool_t *enable)
get the self test status
uint8_t adxl362_read_8msb(adxl362_handle_t *handle, int8_t raw[3], float g[3])
read the data with eight most significant bits
uint8_t adxl362_set_interrupt_pin2_map(adxl362_handle_t *handle, adxl362_interrupt_map_t map, adxl362_bool_t enable)
set the interrupt pin2 map
uint8_t adxl362_get_noise_mode(adxl362_handle_t *handle, adxl362_noise_mode_t *mode)
get the noise mode
uint8_t adxl362_get_fifo_mode(adxl362_handle_t *handle, adxl362_fifo_mode_t *mode)
get the fifo mode
adxl362_bandwidth_t
adxl362 bandwidth enumeration definition
uint8_t adxl362_get_fifo_sample(adxl362_handle_t *handle, uint16_t *sample)
get the fifo sample
uint8_t adxl362_inactivity_time_convert_to_data(adxl362_handle_t *handle, uint16_t reg, float *ms)
convert the register raw data to the inactivity time
uint8_t adxl362_set_inactivity_detect_trigger(adxl362_handle_t *handle, adxl362_detect_trigger_t trigger)
set the inactivity detect trigger mode
uint8_t adxl362_set_fifo_sample(adxl362_handle_t *handle, uint16_t sample)
set the fifo sample
uint8_t adxl362_set_inactivity_time(adxl362_handle_t *handle, uint16_t tim)
set the inactivity time
struct adxl362_info_s adxl362_info_t
adxl362 information structure definition
uint8_t adxl362_set_fifo_mode(adxl362_handle_t *handle, adxl362_fifo_mode_t mode)
set the fifo mode
uint8_t adxl362_get_detect_mode(adxl362_handle_t *handle, adxl362_detect_mode_t *mode)
get the detect mode
uint8_t adxl362_info(adxl362_info_t *info)
get chip's information
adxl362_odr_t
adxl362 odr enumeration definition
uint8_t adxl362_set_self_test(adxl362_handle_t *handle, adxl362_bool_t enable)
enable or disable the self test
adxl362_interrupt_map_t
adxl362 interrupt map enumeration definition
adxl362_mode_t
adxl362 mode enumeration definition
uint8_t adxl362_init(adxl362_handle_t *handle)
initialize the chip
uint8_t adxl362_set_detect_mode(adxl362_handle_t *handle, adxl362_detect_mode_t mode)
set the detect mode
struct adxl362_frame_s adxl362_frame_t
adxl362 frame structure definition
uint8_t adxl362_get_activity_time(adxl362_handle_t *handle, uint8_t *tim)
get the activity time
uint8_t adxl362_set_interrupt_pin2_active_level(adxl362_handle_t *handle, adxl362_interrupt_pin_level_t level)
set the interrupt pin2 active level
struct adxl362_handle_s adxl362_handle_t
adxl362 handle structure definition
uint8_t adxl362_get_interrupt_pin2_active_level(adxl362_handle_t *handle, adxl362_interrupt_pin_level_t *level)
get the interrupt pin2 active level
uint8_t adxl362_get_odr(adxl362_handle_t *handle, adxl362_odr_t *odr)
get the output data rate
uint8_t adxl362_set_wake_up(adxl362_handle_t *handle, adxl362_bool_t enable)
enable or disable chip wake up
uint8_t adxl362_get_inactivity_threshold(adxl362_handle_t *handle, uint16_t *threshold)
get the inactivity threshold
uint8_t adxl362_set_inactivity_threshold(adxl362_handle_t *handle, uint16_t threshold)
set the inactivity threshold
adxl362_status_t
adxl362 status enumeration definition
uint8_t adxl362_get_bandwidth(adxl362_handle_t *handle, adxl362_bandwidth_t *bandwidth)
get the filter bandwidth
uint8_t adxl362_read(adxl362_handle_t *handle, int16_t raw[3], float g[3])
read the data
uint8_t adxl362_get_inactivity(adxl362_handle_t *handle, adxl362_bool_t *enable)
get the inactivity status
uint8_t adxl362_set_interrupt_pin1_map(adxl362_handle_t *handle, adxl362_interrupt_map_t map, adxl362_bool_t enable)
set the interrupt pin1 map
uint8_t adxl362_get_inactivity_detect_trigger(adxl362_handle_t *handle, adxl362_detect_trigger_t *trigger)
get the inactivity detect trigger mode
uint8_t adxl362_set_noise_mode(adxl362_handle_t *handle, adxl362_noise_mode_t mode)
set the noise mode
uint8_t adxl362_set_activity_threshold(adxl362_handle_t *handle, uint16_t threshold)
set the activity threshold
uint8_t adxl362_activity_threshold_convert_to_register(adxl362_handle_t *handle, float g, uint16_t *reg)
convert the activity threshold to the register raw data
uint8_t adxl362_set_activity_time(adxl362_handle_t *handle, uint8_t tim)
set the activity time
uint8_t adxl362_get_mode(adxl362_handle_t *handle, adxl362_mode_t *mode)
get the chip mode
uint8_t adxl362_read_fifo(adxl362_handle_t *handle, adxl362_frame_t *frame, uint16_t *frame_len)
read data from the fifo
uint8_t adxl362_get_auto_sleep(adxl362_handle_t *handle, adxl362_bool_t *enable)
get the auto sleep status
adxl362_noise_mode_t
adxl362 noise mode enumeration definition
uint8_t adxl362_set_interrupt_pin1_active_level(adxl362_handle_t *handle, adxl362_interrupt_pin_level_t level)
set the interrupt pin1 active level
uint8_t adxl362_get_fifo_counter(adxl362_handle_t *handle, uint16_t *counter)
get the fifo counter
uint8_t adxl362_get_fifo_temperature(adxl362_handle_t *handle, adxl362_bool_t *enable)
get the fifo temperature status
uint8_t adxl362_get_activity_detect_trigger(adxl362_handle_t *handle, adxl362_detect_trigger_t *trigger)
get the activity detect trigger mode
uint8_t adxl362_get_revision(adxl362_handle_t *handle, uint8_t *id)
get the chip revision
uint8_t adxl362_inactivity_time_convert_to_register(adxl362_handle_t *handle, float ms, uint16_t *reg)
convert the inactivity time to the register raw data
uint8_t adxl362_set_fifo_temperature(adxl362_handle_t *handle, adxl362_bool_t enable)
enable or disable saving temperature data to fifo
uint8_t adxl362_get_inactivity_time(adxl362_handle_t *handle, uint16_t *tim)
get the inactivity time
adxl362_bool_t
adxl362 bool enumeration definition
uint8_t adxl362_set_activity_detect_trigger(adxl362_handle_t *handle, adxl362_detect_trigger_t trigger)
set the activity detect trigger mode
adxl362_range_t
adxl362 range enumeration definition
uint8_t adxl362_set_interrupt_pin1_as_external_clock(adxl362_handle_t *handle, adxl362_bool_t enable)
enable or disable interrupt pin1 as the external clock
uint8_t adxl362_irq_handler(adxl362_handle_t *handle)
irq handler
adxl362_detect_trigger_t
adxl362 detect trigger enumeration definition
uint8_t adxl362_set_mode(adxl362_handle_t *handle, adxl362_mode_t mode)
set the chip mode
uint8_t adxl362_get_interrupt_pin1_active_level(adxl362_handle_t *handle, adxl362_interrupt_pin_level_t *level)
get the interrupt pin1 active level
uint8_t adxl362_get_activity(adxl362_handle_t *handle, adxl362_bool_t *enable)
get the activity status
uint8_t adxl362_set_inactivity(adxl362_handle_t *handle, adxl362_bool_t enable)
enable or disable inactivity
adxl362_interrupt_pin_level_t
adxl362 interrupt pin level enumeration definition
uint8_t adxl362_activity_time_convert_to_register(adxl362_handle_t *handle, float ms, uint8_t *reg)
convert the activity time to the register raw data
adxl362_frame_type_t
adxl362 frame type enumeration definition
uint8_t adxl362_get_interrupt_pin1_as_external_clock(adxl362_handle_t *handle, adxl362_bool_t *enable)
get the interrupt pin1 as the external clock status
uint8_t adxl362_inactivity_threshold_convert_to_register(adxl362_handle_t *handle, float g, uint16_t *reg)
convert the inactivity threshold to the register raw data
uint8_t adxl362_get_interrupt_pin2_as_external_sampling_trigger(adxl362_handle_t *handle, adxl362_bool_t *enable)
get the interrupt pin2 as the external sampling trigger status
uint8_t adxl362_set_interrupt_pin2_as_external_sampling_trigger(adxl362_handle_t *handle, adxl362_bool_t enable)
enable or disable interrupt pin2 as the external sampling trigger
uint8_t adxl362_get_status(adxl362_handle_t *handle, uint8_t *status)
get the chip status
uint8_t adxl362_set_activity(adxl362_handle_t *handle, adxl362_bool_t enable)
enable or disable activity
uint8_t adxl362_soft_reset(adxl362_handle_t *handle)
soft reset
uint8_t adxl362_set_auto_sleep(adxl362_handle_t *handle, adxl362_bool_t enable)
enable or disable auto sleep
uint8_t adxl362_get_range(adxl362_handle_t *handle, adxl362_range_t *range)
get the measurement range
uint8_t adxl362_get_activity_threshold(adxl362_handle_t *handle, uint16_t *threshold)
get the activity threshold
uint8_t adxl362_get_interrupt_pin2_map(adxl362_handle_t *handle, adxl362_interrupt_map_t map, adxl362_bool_t *enable)
get the interrupt pin2 map
uint8_t adxl362_read_temperature(adxl362_handle_t *handle, int16_t *raw, float *temp)
read the temperature
uint8_t adxl362_activity_threshold_convert_to_data(adxl362_handle_t *handle, uint16_t reg, float *g)
convert the register raw data to the activity threshold
uint8_t adxl362_set_bandwidth(adxl362_handle_t *handle, adxl362_bandwidth_t bandwidth)
set the filter bandwidth
uint8_t adxl362_deinit(adxl362_handle_t *handle)
close the chip
uint8_t adxl362_activity_time_convert_to_data(adxl362_handle_t *handle, uint8_t reg, float *ms)
convert the register raw data to the activity time
uint8_t adxl362_set_odr(adxl362_handle_t *handle, adxl362_odr_t odr)
set the output data rate
@ ADXL362_DETECT_MODE_LINK
@ ADXL362_DETECT_MODE_LOOP
@ ADXL362_DETECT_MODE_BOTH
@ ADXL362_FIFO_MODE_OLDEST_SAVED
@ ADXL362_FIFO_MODE_DISABLE
@ ADXL362_FIFO_MODE_TRIGGERED
@ ADXL362_FIFO_MODE_STREAM
@ ADXL362_BANDWIDTH_ODR_DIV_2
@ ADXL362_BANDWIDTH_ODE_DIV_4
@ ADXL362_INTERRUPT_MAP_FIFO_READY
@ ADXL362_INTERRUPT_MAP_ACT
@ ADXL362_INTERRUPT_MAP_FIFO_OVERRUN
@ ADXL362_INTERRUPT_MAP_FIFO_WATERMARK
@ ADXL362_INTERRUPT_MAP_DATA_READY
@ ADXL362_INTERRUPT_MAP_AWAKE
@ ADXL362_INTERRUPT_MAP_INACT
@ ADXL362_MODE_MEASUREMENT
@ ADXL362_STATUS_DATA_READY
@ ADXL362_STATUS_FIFO_OVERRUN
@ ADXL362_STATUS_FIFO_READY
@ ADXL362_STATUS_ERR_USER_REGS
@ ADXL362_STATUS_FIFO_WATERMARK
@ ADXL362_NOISE_MODE_LOW_NOISE
@ ADXL362_NOISE_MODE_ULTRA_LOW_NOISE
@ ADXL362_NOISE_MODE_NORMAL
@ ADXL362_DETECT_TRIGGER_ABSOLUTE
@ ADXL362_DETECT_TRIGGER_REFERENCED
@ ADXL362_INTERRUPT_PIN_LOW
@ ADXL362_INTERRUPT_PIN_HIGH
@ ADXL362_FRAME_TYPE_TEMP
uint8_t adxl362_get_reg(adxl362_handle_t *handle, uint8_t reg, uint8_t *buf, uint16_t len)
get the chip register
uint8_t adxl362_get_fifo(adxl362_handle_t *handle, uint8_t *buf, uint16_t len)
read from fifo
uint8_t adxl362_set_reg(adxl362_handle_t *handle, uint8_t reg, uint8_t *buf, uint16_t len)
set the chip register
adxl362 frame structure definition
adxl362_frame_type_t type
adxl362 handle structure definition
uint8_t(* spi_init)(void)
void(* delay_ms)(uint32_t ms)
void(* receive_callback)(uint8_t type)
void(* debug_print)(const char *const fmt,...)
uint8_t(* spi_write_address16)(uint16_t addr, uint8_t *buf, uint16_t len)
uint8_t(* spi_read_address16)(uint16_t addr, uint8_t *buf, uint16_t len)
uint8_t(* spi_deinit)(void)
uint8_t(* spi_read)(uint8_t addr, uint8_t *buf, uint16_t len)
adxl362 information structure definition
float supply_voltage_max_v
char manufacturer_name[32]
float supply_voltage_min_v