blob: f9ec22a161d3fd1b129b6d00b9ab6bf04e1b186f [file] [log] [blame]
Brian Silverman8d3816a2017-07-03 18:52:15 -07001#ifndef MOTORS_PERIPHERAL_ADC_H_
2#define MOTORS_PERIPHERAL_ADC_H_
3
4#include <stdint.h>
5
Brian Silverman19ea60f2018-01-03 21:43:15 -08006#include "motors/util.h"
7
Brian Silverman8d3816a2017-07-03 18:52:15 -07008namespace frc971 {
9namespace salsa {
10
11struct MediumAdcReadings {
12 uint16_t motor_currents[3][2];
13 uint16_t motor_current_ref;
14 uint16_t input_voltage;
15};
16
Brian Silverman19ea60f2018-01-03 21:43:15 -080017struct SmallAdcReadings {
18 uint16_t currents[3];
19};
Brian Silverman8d3816a2017-07-03 18:52:15 -070020
Brian Silverman19ea60f2018-01-03 21:43:15 -080021struct SmallInitReadings {
22 uint16_t motor0_abs;
23 uint16_t motor1_abs;
24 uint16_t wheel_abs;
25};
26
27void AdcInitMedium();
28void AdcInitSmall();
29
30MediumAdcReadings AdcReadMedium(const DisableInterrupts &);
31SmallAdcReadings AdcReadSmall0(const DisableInterrupts &);
32SmallAdcReadings AdcReadSmall1(const DisableInterrupts &);
33SmallInitReadings AdcReadSmallInit(const DisableInterrupts &);
Brian Silverman8d3816a2017-07-03 18:52:15 -070034
35} // namespace salsa
36} // namespace frc971
37
38#endif // MOTORS_PERIPHERAL_ADC_H_