Wiki

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
resources:tools-software:uc-drivers:adxl372 [13 Feb 2018 11:10] Stefan Poparesources:tools-software:uc-drivers:adxl372 [19 Nov 2018 12:56] – Updated the downloads link Stefan Popa
Line 45: Line 45:
 |<code c>int32_t adxl372_set_act_proc_mode(adxl372_dev *dev, adxl372_act_proc_mode mode)</code>| Link/Loop Activity Processing.| |<code c>int32_t adxl372_set_act_proc_mode(adxl372_dev *dev, adxl372_act_proc_mode mode)</code>| Link/Loop Activity Processing.|
 |<code c>int32_t adxl372_set_bandwidth(adxl372_dev *dev, adxl372_bandwidth bw)</code>| Select the desired output signal bandwidth.| |<code c>int32_t adxl372_set_bandwidth(adxl372_dev *dev, adxl372_bandwidth bw)</code>| Select the desired output signal bandwidth.|
 +|<code c>int32_t adxl372_set_autosleep(adxl372_dev *dev, bool enable)</code>| Autosleep. When set to 1, autosleep is enabled, and the device enters wake-up mode automatically upon detection of inactivity.|
 +|<code c>int32_t adxl372_set_op_mode(adxl372_dev *dev, adxl372_op_mode op_mode)</code>| Set the mode of operation.|
 +|<code c>int32_t adxl372_set_activity_threshold(adxl372_dev *dev, adxl372_th_activity act, uint16_t thresh, bool referenced, bool enable)</code>| Set the threshold for activity detection for all 3-axis|
 +|<code c>int32_t adxl372_spi_write_mask(adxl372_dev *dev, uint8_t reg_addr, uint32_t mask, uint8_t data)</code>| SPI write to device using a mask.|
 +|<code c>int32_t adxl372_spi_reg_write(adxl372_dev *dev, uint8_t reg_addr, uint8_t reg_data)</code>| Write to device.|
 +|<code c>int32_t adxl372_spi_reg_read_multiple(adxl372_dev *dev, uint8_t reg_addr, uint8_t *reg_data, uint16_t count)</code>| Multibyte read from device. A register read begins with the address and autoincrements for each aditional byte in the transfer.|
 +|<code c>int32_t adxl372_spi_reg_read(adxl372_dev *dev, uint8_t reg_addr, uint8_t *reg_data)</code>| Read from device.|
 +
 +==== Types Declarations ====
 +|<code c>
 +typedef enum {
 + ADXL372_X_AXIS,
 + ADXL372_Y_AXIS,
 + ADXL372_Z_AXIS
 +} adxl372_axis;
 +
 +typedef enum {
 + ADXL372_STANDBY,
 + ADXL372_WAKE_UP,
 + ADXL372_INSTANT_ON,
 + ADXL372_FULL_BW_MEASUREMENT
 +} adxl372_op_mode;
 +
 +typedef enum {
 + ADXL372_BW_200HZ,
 + ADXL372_BW_400HZ,
 + ADXL372_BW_800HZ,
 + ADXL372_BW_1600HZ,
 + ADXL372_BW_3200HZ
 +} adxl372_bandwidth;
 +
 +typedef enum {
 + ADXL372_DEFAULT,
 + ADXL372_LINKED,
 + ADXL372_LOOPED
 +} adxl372_act_proc_mode;
 +
 +typedef enum {
 + ADXL372_ODR_400HZ,
 + ADXL372_ODR_800HZ,
 + ADXL372_ODR_1600HZ,
 + ADXL372_ODR_3200HZ,
 + ADXL372_ODR_6400HZ
 +} adxl372_odr;
 +
 +typedef enum {
 + ADXL372_INSTANT_ON_LOW_TH,
 + ADXL372_INSTANT_ON_HIGH_TH
 +} adxl372_instant_on_th_mode;
 +
 +typedef enum {
 + ADXL372_WUR_52ms,
 + ADXL372_WUR_104ms,
 + ADXL372_WUR_208ms,
 + ADXL372_WUR_512ms,
 + ADXL372_WUR_2048ms,
 + ADXL372_WUR_4096ms,
 + ADXL372_WUR_8192ms,
 + ADXL372_WUR_24576ms
 +} adxl372_wakeup_rate;
 +
 +typedef enum {
 + ADXL372_ACTIVITY,
 + ADXL372_ACTIVITY2,
 + ADXL372_INACTIVITY
 +} adxl372_th_activity;
 +
 +typedef enum {
 + ADXL372_FILTER_SETTLE_370,
 + ADXL372_FILTER_SETTLE_16
 +} adxl372_filter_settle;
 +
 +typedef enum {
 + ADXL372_XYZ_FIFO,
 + ADXL372_X_FIFO,
 + ADXL372_Y_FIFO,
 + ADXL372_XY_FIFO,
 + ADXL372_Z_FIFO,
 + ADXL372_XZ_FIFO,
 + ADXL372_YZ_FIFO,
 + ADXL372_XYZ_PEAK_FIFO,
 +} adxl372_fifo_format;
 +
 +typedef enum {
 + ADXL372_FIFO_BYPASSED,
 + ADXL372_FIFO_STREAMED,
 + ADXL372_FIFO_TRIGGERED,
 + ADXL372_FIFO_OLD_SAVED
 +} adxl372_fifo_mode;
 +
 +typedef struct {
 + adxl372_fifo_mode fifo_mode;
 + adxl372_fifo_format fifo_format;
 + uint16_t fifo_samples;
 +} adxl372_fifo_config;
 +
 +typedef struct {
 + uint16_t thresh;
 + bool referenced;
 + bool enable;
 +} adxl372_activity_threshold;
 +
 +typedef struct {
 + uint16_t x;
 + uint16_t y;
 + uint16_t z;
 +} adxl372_xyz_accel_data;
 +
 +typedef struct {
 + bool data_rdy;
 + bool fifo_rdy;
 + bool fifo_full;
 + bool fifo_ovr;
 + bool inactivity;
 + bool activity;
 + bool awake;
 + bool low_operation;
 +} adxl372_irq_config;
 +
 +typedef struct {
 + /* SPI */
 + spi_desc *spi_desc;
 + /* GPIO */
 + gpio_desc *gpio_int1;
 + gpio_desc *gpio_int2;
 + /* Device Settings */
 + adxl372_bandwidth bw;
 + adxl372_odr odr;
 + adxl372_wakeup_rate wur;
 + adxl372_act_proc_mode act_proc_mode;
 + adxl372_instant_on_th_mode th_mode;
 + adxl372_fifo_config fifo_config;
 +} adxl372_dev;
 +
 +typedef struct {
 + /* SPI */
 + spi_init_param spi_init;
 + /* GPIO */
 + int8_t gpio_int1;
 + int8_t gpio_int2;
 + /* Device Settings */
 + adxl372_bandwidth bw;
 + adxl372_odr odr;
 + adxl372_wakeup_rate wur;
 + adxl372_act_proc_mode act_proc_mode;
 + adxl372_instant_on_th_mode th_mode;
 + adxl372_activity_threshold activity_th;
 + adxl372_activity_threshold activity2_th;
 + adxl372_activity_threshold inactivity_th;
 + uint8_t activity_time;
 + uint16_t inactivity_time;
 + adxl372_filter_settle filter_settle;
 + adxl372_fifo_config fifo_config;
 + adxl372_irq_config int1_config;
 + adxl372_irq_config int2_config;
 + adxl372_op_mode op_mode;
 +} adxl372_init_param;
 +</code>|
 +===== No-OS Downloads =====
 +<WRAP round download 50%>
 +  * {{https://github.com/analogdevicesinc/no-OS/tree/master/drivers/adxl372|adxl372 source and header files.}}
 +</WRAP>
resources/tools-software/uc-drivers/adxl372.txt · Last modified: 22 Jul 2019 09:57 by Andrei Drimbarean