7 #ifndef __DRIVER_STATION_H__
8 #define __DRIVER_STATION_H__
10 #include "Dashboard.h"
11 #include "DriverStationEnhancedIO.h"
12 #include "SensorBase.h"
15 struct FRCCommonControlData;
24 enum Alliance {kRed, kBlue, kInvalid};
29 static const uint32_t kBatteryModuleNumber = 1;
30 static const uint32_t kBatteryChannel = 8;
31 static const uint32_t kJoystickPorts = 4;
32 static const uint32_t kJoystickAxes = 6;
45 bool IsOperatorControl();
62 Dashboard& GetHighPriorityDashboardPacker() {
return m_dashboardHigh; }
63 Dashboard& GetLowPriorityDashboardPacker() {
return m_dashboardLow; }
70 DashboardBase* GetHighPriorityDashboardPackerInUse() {
return m_dashboardInUseHigh; }
71 DashboardBase* GetLowPriorityDashboardPackerInUse() {
return m_dashboardInUseLow; }
72 void SetHighPriorityDashboardPackerToUse(
DashboardBase* db) { m_dashboardInUseHigh = db; }
73 void SetLowPriorityDashboardPackerToUse(
DashboardBase* db) { m_dashboardInUseLow = db; }
77 void IncrementUpdateNumber() { m_updateNumber++; }
78 SEM_ID GetUserStatusDataSem() {
return m_statusDataSemaphore; }
83 void InDisabled(
bool entering) {m_userInDisabled=entering;}
95 void InTest(
bool entering) {m_userInTest=entering;}
106 static uint8_t m_updateNumber;
108 static constexpr
float kUpdatePeriod = 0.02;
112 struct FRCCommonControlData *m_controlData;
113 uint8_t m_digitalOut;
115 SEM_ID m_statusDataSemaphore;
121 SEM_ID m_newControlData;
122 SEM_ID m_packetDataAvailableSem;
124 SEM_ID m_waitForDataSem;
125 double m_approxMatchTimeOffset;
126 bool m_userInDisabled;
127 bool m_userInAutonomous;
float GetAnalogIn(uint32_t channel)
bool GetDigitalIn(uint32_t channel)
uint32_t GetPacketNumber()
void InOperatorControl(bool entering)
bool GetDigitalOut(uint32_t channel)
void SetDigitalOut(uint32_t channel, bool value)
static DriverStation * GetInstance()
void InDisabled(bool entering)
void InTest(bool entering)
short GetStickButtons(uint32_t stick)
float GetBatteryVoltage()
void InAutonomous(bool entering)
float GetStickAxis(uint32_t stick, uint32_t axis)