From dda1e4cf280ed5e842e1e571e92e5468cdab3be9 Mon Sep 17 00:00:00 2001 From: Andy Killorin <37423245+Speedy6451@users.noreply.github.com> Date: Fri, 14 Mar 2025 09:32:47 -0400 Subject: [PATCH] added some registers --- src/lib.rs | 2 ++ src/registers.rs | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 src/registers.rs diff --git a/src/lib.rs b/src/lib.rs index 8dc00eb..d94d171 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -9,6 +9,8 @@ const DELTA_ANGLE_RANGE: f32 = 720.; #[cfg(feature = "ADIS1647x-3")] const DELTA_ANGLE_RANGE: f32 = 2160.; +pub mod registers; + pub struct ADIS16475 where T: SpiBus { bus: T, } diff --git a/src/registers.rs b/src/registers.rs new file mode 100644 index 0000000..ec808d8 --- /dev/null +++ b/src/registers.rs @@ -0,0 +1,39 @@ +//! register map, more information in Table 8 of the +//! [datasheet](https://wiki.analog.com/resources/eval/user-guides/inertial-mems/imu/adis1647x-pcb?doc=adis16475.pdf#%5B%7B%22num%22%3A92%2C%22gen%22%3A0%7D%2C%7B%22name%22%3A%22XYZ%22%7D%2C52%2C693%2C0%5D) + +/// u16: Output, system error flags +pub const DIAG_STAT: u8 = 0x02; + +pub const X_GYRO: u8 = 0x04; +pub const Y_GYRO: u8 = 0x08; +pub const Z_GYRO: u8 = 0x0C; + +pub const X_ACCL: u8 = 0x10; +pub const Y_ACCL: u8 = 0x14; +pub const Z_ACCL: u8 = 0x18; + +/// u16 +pub const TEMP: u8 = 0x1C; + +pub const X_DELTANG: u8 = 0x24; +pub const Y_DELTANG: u8 = 0x28; +pub const Z_DELTANG: u8 = 0x2C; + +pub const X_DELTVEL: u8 = 0x30; +pub const Y_DELTVEL: u8 = 0x34; +pub const Z_DELTVEL: u8 = 0x38; + +/// u16: Control, Bartlett window FIR filter +pub const FLIT_CTRL: u8 = 0x5C; +/// u16: Measurement range (model specific) identifier +pub const RANG_MDL: u8 = 0x5E; +/// u16: Control, input/output and other miscellaneous options +pub const MSC_CTRL: u8 = 0x60; +/// u16: Control, scale factor for input clock, pulse per second (PPS) mode +pub const UP_SCALE: u8 = 0x62; +/// u16: Control, decimation filter (output data rate) +pub const DEC_RATE: u8 = 0x64; +/// u16: Control, bias estimation period +pub const NULL_CNFG: u8 = 0x66; +/// u16: Control, global commands +pub const GLOB_CMD: u8 = 0x68;