Add a driver for the new IMU

Redo how zeroing works for the old one too.

This also forced me to update the ahal SPI library to a slightly pared
down version of what WPILib master has.

Change-Id: I631ff230c053c6256325ab6f4e532ca90c901424
diff --git a/frc971/wpilib/BUILD b/frc971/wpilib/BUILD
index 48fda81..18a1775 100644
--- a/frc971/wpilib/BUILD
+++ b/frc971/wpilib/BUILD
@@ -89,6 +89,8 @@
     hdrs = [
         "gyro_interface.h",
     ],
+    # This library uses some deprecated parts of the SPI API.
+    copts = ["-Wno-deprecated-declarations"],
     restricted_to = ["//tools:roborio"],
     deps = [
         "//aos/logging",
@@ -265,6 +267,26 @@
 )
 
 cc_library(
+    name = "ADIS16470",
+    srcs = [
+        "ADIS16470.cc",
+    ],
+    hdrs = [
+        "ADIS16470.h",
+    ],
+    restricted_to = ["//tools:roborio"],
+    deps = [
+        ":fpga_time_conversion",
+        ":imu_fbs",
+        "//aos/events:event_loop",
+        "//aos/time",
+        "//third_party:wpilib",
+        "@com_github_google_glog//:glog",
+        "@com_google_absl//absl/types:span",
+    ],
+)
+
+cc_library(
     name = "ADIS16448",
     srcs = [
         "ADIS16448.cc",
@@ -272,15 +294,17 @@
     hdrs = [
         "ADIS16448.h",
     ],
+    # This library uses some deprecated parts of the SPI API.
+    copts = ["-Wno-deprecated-declarations"],
     restricted_to = ["//tools:roborio"],
     deps = [
+        ":fpga_time_conversion",
         ":imu_fbs",
         ":spi_rx_clearer",
         "//aos:init",
         "//aos/events:event_loop",
         "//aos/events:shm_event_loop",
         "//aos/logging",
-        "//aos/robot_state:robot_state_fbs",
         "//aos/time",
         "//frc971/zeroing:averager",
         "//third_party:wpilib",
@@ -327,6 +351,7 @@
         ":dma",
         ":dma_edge_counting",
         ":encoder_and_potentiometer",
+        ":fpga_time_conversion",
         ":wpilib_interface",
         "//aos:init",
         "//aos/events:event_loop",
@@ -356,3 +381,20 @@
         "//third_party:wpilib",
     ],
 )
+
+cc_library(
+    name = "fpga_time_conversion",
+    srcs = [
+        "fpga_time_conversion.cc",
+    ],
+    hdrs = [
+        "fpga_time_conversion.h",
+    ],
+    restricted_to = ["//tools:roborio"],
+    deps = [
+        "//aos/time",
+        "//aos/util:compiler_memory_barrier",
+        "//third_party:wpilib",
+        "@com_github_google_glog//:glog",
+    ],
+)