no-OS
Loading...
Searching...
No Matches
adis16607.c File Reference

Implementation of adis16607.c. More...

#include "adis.h"
#include "adis_internals.h"
#include "adis16607.h"
#include "no_os_units.h"
#include "no_os_delay.h"
#include <string.h>
Include dependency graph for adis16607.c:

Macros

#define ADIS16607_MSG_SIZE_16_BIT_BURST   28 /* in bytes: DIAG(2) + 12*2 + TEMP(2) + DATA_CNTR(2) + CRC(2) */
 
#define ADIS16607_MSG_SIZE_32_BIT_BURST   52 /* in bytes: 12*4 + TEMP(2) + DATA_CNTR(2) + CHECKSUM(2) */
 
#define ADIS16607_READ_BURST_DATA_CMD_SIZE   4
 
#define ADIS16607_READ_BURST_DATA_CMD_MSB   0x85
 
#define ADIS16607_USER_FIFO_CFG_REG   0x35
 
#define ADIS16607_FIFO_THR_MASK   NO_OS_GENMASK(10, 0)
 
#define ADIS16607_FIFO_DATA_REG   0x29
 
#define ADIS16607_FIFO_CH_INDEX_REG   0x2A
 
#define ADIS16607_FIFO_DATA_CMD   0xA9 /* FIFO_DATA (0x29) | read bit (0x80) */
 
#define ADIS16607_DIGITAL_STATUS_REG   0x4E
 
#define ADIS16607_BOOTLOADER_BUSY_MASK   NO_OS_BIT(0)
 
#define ADIS16607_SELF_TEST_REG(x)
 
#define ADIS16607_ST2_SELF_TEST_FORCE_MASK   NO_OS_BIT(7)
 
#define ADIS16607_ACCEL_XY_DELTA_CHECK_VAL_MAX   260
 
#define ADIS16607_ACCEL_Z_DELTA_CHECK_VAL_MAX   4000
 
#define ADIS16607_GYRO_DELTA_CHECK_VAL_MAX   2600
 
#define ADIS16607_LOCK_SPI_FULLDUPLEX   0xB3B3
 
#define ADIS16607_SPI_FULLDUPLEX_REG   0x31
 
#define ADIS16607_LOCK_SPI_HALFDUPLEX   0xB4B4
 
#define ADIS16607_SPI_HALFDUPLEX_REG   0x32
 
#define ADIS16607_GPIO_INIT_RESETB_ACTIVE   0x01
 
#define ADIS16607_GPIO_INIT_DATA_READY_ACTIVE   0x200
 

Functions

int adis16607_fifo_enable (struct adis_dev *adis, bool enable, uint16_t thr, bool burst32)
 Enable or disable FIFO mode.
 
int adis16607_fifo_pop (struct adis_dev *adis, struct adis_burst_data *data)
 Pop one sample from the FIFO.
 

Variables

const struct adis_chip_info adis16607_chip_info
 

Detailed Description

Implementation of adis16607.c.

Author
Radu Sabau (radu..nosp@m.saba.nosp@m.u@ana.nosp@m.log..nosp@m.com)

Copyright 2026(c) Analog Devices, Inc.

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

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of Analog Devices, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES, INC. “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 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

◆ ADIS16607_ACCEL_XY_DELTA_CHECK_VAL_MAX

#define ADIS16607_ACCEL_XY_DELTA_CHECK_VAL_MAX   260

◆ ADIS16607_ACCEL_Z_DELTA_CHECK_VAL_MAX

#define ADIS16607_ACCEL_Z_DELTA_CHECK_VAL_MAX   4000

◆ ADIS16607_BOOTLOADER_BUSY_MASK

#define ADIS16607_BOOTLOADER_BUSY_MASK   NO_OS_BIT(0)

◆ ADIS16607_DIGITAL_STATUS_REG

#define ADIS16607_DIGITAL_STATUS_REG   0x4E

◆ ADIS16607_FIFO_CH_INDEX_REG

#define ADIS16607_FIFO_CH_INDEX_REG   0x2A

◆ ADIS16607_FIFO_DATA_CMD

#define ADIS16607_FIFO_DATA_CMD   0xA9 /* FIFO_DATA (0x29) | read bit (0x80) */

◆ ADIS16607_FIFO_DATA_REG

#define ADIS16607_FIFO_DATA_REG   0x29

◆ ADIS16607_FIFO_THR_MASK

#define ADIS16607_FIFO_THR_MASK   NO_OS_GENMASK(10, 0)

◆ ADIS16607_GPIO_INIT_DATA_READY_ACTIVE

#define ADIS16607_GPIO_INIT_DATA_READY_ACTIVE   0x200

◆ ADIS16607_GPIO_INIT_RESETB_ACTIVE

#define ADIS16607_GPIO_INIT_RESETB_ACTIVE   0x01

◆ ADIS16607_GYRO_DELTA_CHECK_VAL_MAX

#define ADIS16607_GYRO_DELTA_CHECK_VAL_MAX   2600

◆ ADIS16607_LOCK_SPI_FULLDUPLEX

#define ADIS16607_LOCK_SPI_FULLDUPLEX   0xB3B3

◆ ADIS16607_LOCK_SPI_HALFDUPLEX

#define ADIS16607_LOCK_SPI_HALFDUPLEX   0xB4B4

◆ ADIS16607_MSG_SIZE_16_BIT_BURST

#define ADIS16607_MSG_SIZE_16_BIT_BURST   28 /* in bytes: DIAG(2) + 12*2 + TEMP(2) + DATA_CNTR(2) + CRC(2) */

◆ ADIS16607_MSG_SIZE_32_BIT_BURST

#define ADIS16607_MSG_SIZE_32_BIT_BURST   52 /* in bytes: 12*4 + TEMP(2) + DATA_CNTR(2) + CHECKSUM(2) */

◆ ADIS16607_READ_BURST_DATA_CMD_MSB

#define ADIS16607_READ_BURST_DATA_CMD_MSB   0x85

◆ ADIS16607_READ_BURST_DATA_CMD_SIZE

#define ADIS16607_READ_BURST_DATA_CMD_SIZE   4

◆ ADIS16607_SELF_TEST_REG

#define ADIS16607_SELF_TEST_REG ( x)
Value:
((x) + 0x23)

◆ ADIS16607_SPI_FULLDUPLEX_REG

#define ADIS16607_SPI_FULLDUPLEX_REG   0x31

◆ ADIS16607_SPI_HALFDUPLEX_REG

#define ADIS16607_SPI_HALFDUPLEX_REG   0x32

◆ ADIS16607_ST2_SELF_TEST_FORCE_MASK

#define ADIS16607_ST2_SELF_TEST_FORCE_MASK   NO_OS_BIT(7)

◆ ADIS16607_USER_FIFO_CFG_REG

#define ADIS16607_USER_FIFO_CFG_REG   0x35

Function Documentation

◆ adis16607_fifo_enable()

int adis16607_fifo_enable ( struct adis_dev * adis,
bool enable,
uint16_t thr,
bool burst32 )

Enable or disable FIFO mode.

Parameters
adis- The adis device.
enable- True to enable FIFO, false to disable.
thr- FIFO watermark threshold (1-1024). Ignored if enable is false.
burst32- True for 32-bit burst mode, false for 16-bit. Ignored if enable is false.
Returns
0 in case of success, error code otherwise.

◆ adis16607_fifo_pop()

int adis16607_fifo_pop ( struct adis_dev * adis,
struct adis_burst_data * data )

Pop one sample from the FIFO.

Parameters
adis- The adis device.
data- The burst read data structure to be populated.
Returns
0 in case of success, error code otherwise.

For I2C and SPI Half-Duplex: uses burst read with FIFO_DATA command. For SPI Full-Duplex: issues repeated read commands to FIFO_DATA register. Note: burst32 mode is configured via adis16607_fifo_enable().

Variable Documentation

◆ adis16607_chip_info

const struct adis_chip_info adis16607_chip_info
Initial value:
= {
.field_map = &adis16607_def,
.sync_clk_freq_limits = adis16607_sync_clk_freq_limits,
.sampling_clk_limits = adis16607_sampling_clk_limits,
.timeouts = &adis16607_timeouts,
.read_delay = 0,
.write_delay = 0,
.cs_change_delay = 0,
.has_lock = true,
.dec_rate_max = 0xFFFF,
.sync_mode_max = ADIS_SYNC_SCALED,
.int_clk = 8000,
.initial_startup = &adis16607_initial_startup,
.snsr_self_test = &adis16607_snsr_self_test,
.get_scale = &adis16607_get_scale,
.get_offset = &adis16607_get_offset,
.read_burst_data = &adis16607_read_burst_data,
.read_sync_mode = &adis16607_read_sync_mode,
.write_sync_mode = &adis16607_write_sync_mode,
.read_reg = &adis16607_read_reg,
.write_reg = &adis16607_write_reg,
}
#define ADIS_SYNC_SCALED
Definition adis.h:33
#define ADIS_HAS_BURST_DELTA_DATA
Definition adis_internals.h:16
#define ADIS_HAS_FIFO
Definition adis_internals.h:17
#define ADIS_HAS_BURST32
Definition adis_internals.h:15