41 static int16_t gs_raw_test[20][3];
42 static float gs_test[20][3];
744 for (i = 0; i < times; i++)
751 if (
adxl345_read(&gs_handle, (int16_t (*)[3])gs_raw_test, (
float (*)[3])gs_test, (uint16_t *)&len) != 0)
796 for (i = 0; i < times; i++)
803 if (
adxl345_read(&gs_handle, (int16_t (*)[3])gs_raw_test, (
float (*)[3])gs_test, (uint16_t *)&len) != 0)
848 for (i = 0; i < times; i++)
855 if (
adxl345_read(&gs_handle, (int16_t (*)[3])gs_raw_test, (
float (*)[3])gs_test, (uint16_t *)&len) != 0)
900 for (i = 0; i < times; i++)
907 if (
adxl345_read(&gs_handle, (int16_t (*)[3])gs_raw_test, (
float (*)[3])gs_test, (uint16_t *)&len) != 0)
952 for (i = 0; i < times; i++)
959 if (
adxl345_read(&gs_handle, (int16_t (*)[3])gs_raw_test, (
float (*)[3])gs_test, (uint16_t *)&len) != 0)
1025 for (i = 0; i < times; i++)
1032 if (
adxl345_read(&gs_handle, (int16_t (*)[3])gs_raw_test, (
float (*)[3])gs_test, (uint16_t *)&len) != 0)
1077 for (i = 0; i < times; i++)
1084 if (
adxl345_read(&gs_handle, (int16_t (*)[3])gs_raw_test, (
float (*)[3])gs_test, (uint16_t *)&len) != 0)
1129 for (i = 0; i < times; i++)
1136 if (
adxl345_read(&gs_handle, (int16_t (*)[3])gs_raw_test, (
float (*)[3])gs_test, (uint16_t *)&len) != 0)
1181 for (i = 0; i < times; i++)
1188 if (
adxl345_read(&gs_handle, (int16_t (*)[3])gs_raw_test, (
float (*)[3])gs_test, (uint16_t *)&len) != 0)
1233 for (i = 0; i < times; i++)
1240 if (
adxl345_read(&gs_handle, (int16_t (*)[3])gs_raw_test, (
float (*)[3])gs_test, (uint16_t *)&len) != 0)
1295 for (i = 0; i < times; i++)
1302 if (
adxl345_read(&gs_handle, (int16_t (*)[3])gs_raw_test, (
float (*)[3])gs_test, (uint16_t *)&len) != 0)
1347 for (i = 0; i < times; i++)
1354 if (
adxl345_read(&gs_handle, (int16_t (*)[3])gs_raw_test, (
float (*)[3])gs_test, (uint16_t *)&len) != 0)
1399 for (i = 0; i < times; i++)
1406 if (
adxl345_read(&gs_handle, (int16_t (*)[3])gs_raw_test, (
float (*)[3])gs_test, (uint16_t *)&len) != 0)
1451 for (i = 0; i < times; i++)
1458 if (
adxl345_read(&gs_handle, (int16_t (*)[3])gs_raw_test, (
float (*)[3])gs_test, (uint16_t *)&len) != 0)
1503 for (i = 0; i < times; i++)
1510 if (
adxl345_read(&gs_handle, (int16_t (*)[3])gs_raw_test, (
float (*)[3])gs_test, (uint16_t *)&len) != 0)
1555 for (i = 0; i < times; i++)
1562 if (
adxl345_read(&gs_handle, (int16_t (*)[3])gs_raw_test, (
float (*)[3])gs_test, (uint16_t *)&len) != 0)
1607 for (i = 0; i < times; i++)
1614 if (
adxl345_read(&gs_handle, (int16_t (*)[3])gs_raw_test, (
float (*)[3])gs_test, (uint16_t *)&len) != 0)
1659 for (i = 0; i < times; i++)
1666 if (
adxl345_read(&gs_handle, (int16_t (*)[3])gs_raw_test, (
float (*)[3])gs_test, (uint16_t *)&len) != 0)
1711 for (i = 0; i < times; i++)
1718 if (
adxl345_read(&gs_handle, (int16_t (*)[3])gs_raw_test, (
float (*)[3])gs_test, (uint16_t *)&len) != 0)
1763 for (i = 0; i < times; i++)
1770 if (
adxl345_read(&gs_handle, (int16_t (*)[3])gs_raw_test, (
float (*)[3])gs_test, (uint16_t *)&len) != 0)
1815 for (i = 0; i < times; i++)
1822 if (
adxl345_read(&gs_handle, (int16_t (*)[3])gs_raw_test, (
float (*)[3])gs_test, (uint16_t *)&len) != 0)
1867 for (i = 0; i < times; i++)
1874 if (
adxl345_read(&gs_handle, (int16_t (*)[3])gs_raw_test, (
float (*)[3])gs_test, (uint16_t *)&len) != 0)
1919 for (i = 0; i < times; i++)
1926 if (
adxl345_read(&gs_handle, (int16_t (*)[3])gs_raw_test, (
float (*)[3])gs_test, (uint16_t *)&len) != 0)
1971 for (i = 0; i < times; i++)
1978 if (
adxl345_read(&gs_handle, (int16_t (*)[3])gs_raw_test, (
float (*)[3])gs_test, (uint16_t *)&len) != 0)
2023 for (i = 0; i < times; i++)
2030 if (
adxl345_read(&gs_handle, (int16_t (*)[3])gs_raw_test, (
float (*)[3])gs_test, (uint16_t *)&len) != 0)
2075 for (i = 0; i < times; i++)
2082 if (
adxl345_read(&gs_handle, (int16_t (*)[3])gs_raw_test, (
float (*)[3])gs_test, (uint16_t *)&len) != 0)
2127 for (i = 0; i < times; i++)
2134 if (
adxl345_read(&gs_handle, (int16_t (*)[3])gs_raw_test, (
float (*)[3])gs_test, (uint16_t *)&len) != 0)
2179 for (i = 0; i < times; i++)
2186 if (
adxl345_read(&gs_handle, (int16_t (*)[3])gs_raw_test, (
float (*)[3])gs_test, (uint16_t *)&len) != 0)
2231 for (i = 0; i < times; i++)
2236 if (
adxl345_read(&gs_handle, (int16_t (*)[3])gs_raw_test, (
float (*)[3])gs_test, (uint16_t *)&len) != 0)
2281 for (i = 0; i < times; i++)
2288 if (
adxl345_read(&gs_handle, (int16_t (*)[3])gs_raw_test, (
float (*)[3])gs_test, (uint16_t *)&len) != 0)
2333 for (i = 0; i < times; i++)
2340 if (
adxl345_read(&gs_handle, (int16_t (*)[3])gs_raw_test, (
float (*)[3])gs_test, (uint16_t *)&len) != 0)
2385 for (i = 0; i < times; i++)
2392 if (
adxl345_read(&gs_handle, (int16_t (*)[3])gs_raw_test, (
float (*)[3])gs_test, (uint16_t *)&len) != 0)
driver adxl345 read test header file
adxl345_interface_t
adxl345 interface enumeration definition
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
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
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
uint8_t adxl345_set_full_resolution(adxl345_handle_t *handle, adxl345_bool_t enable)
enable or disable the full resolution
uint8_t adxl345_set_inaction_time(adxl345_handle_t *handle, uint8_t t)
set the inaction time
uint8_t adxl345_deinit(adxl345_handle_t *handle)
close the chip
uint8_t adxl345_set_inaction_coupled(adxl345_handle_t *handle, adxl345_coupled_t coupled)
set the inaction coupled
uint8_t adxl345_set_spi_wire(adxl345_handle_t *handle, adxl345_spi_wire_t wire)
set the chip spi wire
uint8_t adxl345_set_measure(adxl345_handle_t *handle, adxl345_bool_t enable)
enable or disable the measure
uint8_t adxl345_set_trigger_pin(adxl345_handle_t *handle, adxl345_interrupt_pin_t pin)
set the trigger pin
uint8_t adxl345_set_link_activity_inactivity(adxl345_handle_t *handle, adxl345_bool_t enable)
enable or disable the activity and inactivity linking
uint8_t adxl345_set_action_threshold(adxl345_handle_t *handle, uint8_t threshold)
set the action threshold
uint8_t adxl345_set_free_fall_threshold(adxl345_handle_t *handle, uint8_t threshold)
set the free fall threshold
uint8_t adxl345_set_sleep(adxl345_handle_t *handle, adxl345_bool_t enable)
enable or disable the sleep mode
uint8_t adxl345_read(adxl345_handle_t *handle, int16_t(*raw)[3], float(*g)[3], uint16_t *len)
read the data
uint8_t adxl345_set_offset(adxl345_handle_t *handle, int8_t x, int8_t y, int8_t z)
set the axis offset
uint8_t adxl345_set_latent(adxl345_handle_t *handle, uint8_t t)
set the latent
uint8_t adxl345_set_rate(adxl345_handle_t *handle, adxl345_rate_t rate)
set the sampling rate
uint8_t adxl345_set_inaction_threshold(adxl345_handle_t *handle, uint8_t threshold)
set the inaction threshold
uint8_t adxl345_set_addr_pin(adxl345_handle_t *handle, adxl345_address_t addr_pin)
set the iic address pin
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
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
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
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
uint8_t adxl345_set_duration(adxl345_handle_t *handle, uint8_t t)
set the duration
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
uint8_t adxl345_set_tap_suppress(adxl345_handle_t *handle, adxl345_bool_t enable)
enable or disable the tap suppress
uint8_t adxl345_set_auto_sleep(adxl345_handle_t *handle, adxl345_bool_t enable)
enable or disable the auto sleep
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
uint8_t adxl345_set_free_fall_time(adxl345_handle_t *handle, uint8_t t)
set the free fall time
uint8_t adxl345_set_window(adxl345_handle_t *handle, uint8_t t)
set the window
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
uint8_t adxl345_set_sleep_frequency(adxl345_handle_t *handle, adxl345_sleep_frequency_t sleep_frequency)
set the sleep frequency
adxl345_address_t
adxl345 address enumeration definition
uint8_t adxl345_latent_convert_to_register(adxl345_handle_t *handle, float ms, uint8_t *reg)
convert the latent to the register raw data
uint8_t adxl345_offset_convert_to_register(adxl345_handle_t *handle, float g, int8_t *reg)
convert the offset to the register raw data
uint8_t adxl345_init(adxl345_handle_t *handle)
initialize the chip
uint8_t adxl345_set_action_coupled(adxl345_handle_t *handle, adxl345_coupled_t coupled)
set the action coupled
uint8_t adxl345_set_justify(adxl345_handle_t *handle, adxl345_justify_t enable)
enable or disable the justify
uint8_t adxl345_set_interface(adxl345_handle_t *handle, adxl345_interface_t interface)
set the chip interface
uint8_t adxl345_set_mode(adxl345_handle_t *handle, adxl345_mode_t mode)
set the chip mode
uint8_t adxl345_info(adxl345_info_t *info)
get chip's information
uint8_t adxl345_set_tap_threshold(adxl345_handle_t *handle, uint8_t threshold)
set the tap threshold
uint8_t adxl345_set_range(adxl345_handle_t *handle, adxl345_range_t range)
set the chip range
@ ADXL345_LOW_POWER_RATE_200
@ ADXL345_LOW_POWER_RATE_12P5
@ ADXL345_LOW_POWER_RATE_100
@ ADXL345_LOW_POWER_RATE_50
@ ADXL345_LOW_POWER_RATE_400
@ ADXL345_LOW_POWER_RATE_25
@ ADXL345_SLEEP_FREQUENCY_1HZ
uint8_t adxl345_set_watermark(adxl345_handle_t *handle, uint8_t level)
set the fifo watermark
uint8_t adxl345_interface_iic_write(uint8_t addr, uint8_t reg, uint8_t *buf, uint16_t len)
interface iic bus write
uint8_t adxl345_interface_spi_deinit(void)
interface spi bus deinit
uint8_t adxl345_interface_iic_deinit(void)
interface iic bus deinit
uint8_t adxl345_interface_spi_read(uint8_t reg, uint8_t *buf, uint16_t len)
interface spi bus read
void adxl345_interface_receive_callback(uint8_t type)
interface receive callback
uint8_t adxl345_interface_iic_init(void)
interface iic bus init
uint8_t adxl345_interface_spi_init(void)
interface spi bus init
uint8_t adxl345_interface_iic_read(uint8_t addr, uint8_t reg, uint8_t *buf, uint16_t len)
interface iic bus read
void adxl345_interface_delay_ms(uint32_t ms)
interface delay ms
void adxl345_interface_debug_print(const char *const fmt,...)
interface print format data
uint8_t adxl345_interface_spi_write(uint8_t reg, uint8_t *buf, uint16_t len)
interface spi bus write
uint8_t adxl345_set_interrupt(adxl345_handle_t *handle, adxl345_interrupt_t type, adxl345_bool_t enable)
enable or disable the interrupt
uint8_t adxl345_set_interrupt_map(adxl345_handle_t *handle, adxl345_interrupt_t type, adxl345_interrupt_pin_t pin)
set the interrupt map
uint8_t adxl345_set_interrupt_active_level(adxl345_handle_t *handle, adxl345_interrupt_active_level_t active_level)
set the interrupt active level
@ ADXL345_INTERRUPT_ACTIVE_LEVEL_LOW
@ ADXL345_INTERRUPT_DATA_READY
@ ADXL345_INTERRUPT_DOUBLE_TAP
@ ADXL345_INTERRUPT_ACTIVITY
@ ADXL345_INTERRUPT_SINGLE_TAP
@ ADXL345_INTERRUPT_INACTIVITY
@ ADXL345_INTERRUPT_WATERMARK
@ ADXL345_INTERRUPT_OVERRUN
@ ADXL345_INTERRUPT_FREE_FALL
#define DRIVER_ADXL345_LINK_SPI_WRITE(HANDLE, FUC)
link spi_write function
#define DRIVER_ADXL345_LINK_SPI_READ(HANDLE, FUC)
link spi_read function
#define DRIVER_ADXL345_LINK_RECEIVE_CALLBACK(HANDLE, FUC)
link receive_callback function
#define DRIVER_ADXL345_LINK_SPI_DEINIT(HANDLE, FUC)
link spi_deinit function
#define DRIVER_ADXL345_LINK_IIC_INIT(HANDLE, FUC)
link iic_init function
#define DRIVER_ADXL345_LINK_INIT(HANDLE, STRUCTURE)
initialize adxl345_handle_t structure
#define DRIVER_ADXL345_LINK_IIC_DEINIT(HANDLE, FUC)
link iic_deinit function
#define DRIVER_ADXL345_LINK_SPI_INIT(HANDLE, FUC)
link spi_init function
#define DRIVER_ADXL345_LINK_DEBUG_PRINT(HANDLE, FUC)
link debug_print function
#define DRIVER_ADXL345_LINK_DELAY_MS(HANDLE, FUC)
link delay_ms function
#define DRIVER_ADXL345_LINK_IIC_WRITE(HANDLE, FUC)
link iic_write function
#define DRIVER_ADXL345_LINK_IIC_READ(HANDLE, FUC)
link iic_read function
uint8_t adxl345_read_test(adxl345_interface_t interface, adxl345_address_t addr_pin, uint32_t times)
read test
adxl345 handle structure definition
adxl345 information structure definition
float supply_voltage_max_v
char manufacturer_name[32]
float supply_voltage_min_v