Split out ADC code into a separate file for pistol grip
Change-Id: Ie6401ef3fbfd1c33f7e46532a9624acb78a97bc6
diff --git a/motors/pistol_grip/controller_adc.h b/motors/pistol_grip/controller_adc.h
new file mode 100644
index 0000000..867807c
--- /dev/null
+++ b/motors/pistol_grip/controller_adc.h
@@ -0,0 +1,34 @@
+#ifndef MOTORS_PISTOL_GRIP_CONTROLLER_ADC_H_
+#define MOTORS_PISTOL_GRIP_CONTROLLER_ADC_H_
+
+#include "motors/util.h"
+
+namespace frc971 {
+namespace motors {
+
+struct SmallAdcReadings {
+ uint16_t currents[3];
+};
+
+struct SmallInitReadings {
+ uint16_t motor0_abs;
+ uint16_t motor1_abs;
+ uint16_t wheel_abs;
+};
+
+// Initializes the ADC.
+void AdcInitSmall();
+
+// Reads motor 0.
+SmallAdcReadings AdcReadSmall0(const DisableInterrupts &);
+
+// Reads motor 1.
+SmallAdcReadings AdcReadSmall1(const DisableInterrupts &);
+
+// Reads the absolute encoder values for initialization.
+SmallInitReadings AdcReadSmallInit(const DisableInterrupts &);
+
+} // namespace motors
+} // namespace frc971
+
+#endif // MOTORS_PISTOL_GRIP_CONTROLLER_ADC_H_