Austin Schuh | b402fd4 | 2019-04-13 00:02:53 -0700 | [diff] [blame] | 1 | #ifndef MOTORS_PISTOL_GRIP_CONTROLLER_ADC_H_ |
| 2 | #define MOTORS_PISTOL_GRIP_CONTROLLER_ADC_H_ |
| 3 | |
| 4 | #include "motors/util.h" |
| 5 | |
| 6 | namespace frc971 { |
| 7 | namespace motors { |
| 8 | |
| 9 | struct SmallAdcReadings { |
| 10 | uint16_t currents[3]; |
| 11 | }; |
| 12 | |
| 13 | struct SmallInitReadings { |
| 14 | uint16_t motor0_abs; |
| 15 | uint16_t motor1_abs; |
| 16 | uint16_t wheel_abs; |
| 17 | }; |
| 18 | |
| 19 | // Initializes the ADC. |
| 20 | void AdcInitSmall(); |
| 21 | |
| 22 | // Reads motor 0. |
| 23 | SmallAdcReadings AdcReadSmall0(const DisableInterrupts &); |
| 24 | |
| 25 | // Reads motor 1. |
| 26 | SmallAdcReadings AdcReadSmall1(const DisableInterrupts &); |
| 27 | |
| 28 | // Reads the absolute encoder values for initialization. |
| 29 | SmallInitReadings AdcReadSmallInit(const DisableInterrupts &); |
| 30 | |
| 31 | } // namespace motors |
| 32 | } // namespace frc971 |
| 33 | |
| 34 | #endif // MOTORS_PISTOL_GRIP_CONTROLLER_ADC_H_ |