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;
bool GetDigitalOut(uint32_t channel)
Definition: DriverStation.cpp:383
Definition: DashboardBase.h:13
float GetAnalogIn(uint32_t channel)
Definition: DriverStation.cpp:306
uint32_t GetLocation()
Definition: DriverStation.cpp:466
void InDisabled(bool entering)
Definition: DriverStation.h:83
float GetBatteryVoltage()
Definition: DriverStation.cpp:208
uint32_t GetPacketNumber()
Definition: DriverStation.cpp:443
short GetStickButtons(uint32_t stick)
Definition: DriverStation.cpp:275
void SetData()
Definition: DriverStation.cpp:182
float GetStickAxis(uint32_t stick, uint32_t axis)
Definition: DriverStation.cpp:227
bool IsFMSAttached()
Definition: DriverStation.cpp:432
bool IsNewControlData()
Definition: DriverStation.cpp:422
void SetDigitalOut(uint32_t channel, bool value)
Definition: DriverStation.cpp:362
void InAutonomous(bool entering)
Definition: DriverStation.h:87
bool GetDigitalIn(uint32_t channel)
Definition: DriverStation.cpp:338
Definition: SensorBase.h:20
Definition: DriverStationEnhancedIO.h:29
static DriverStation * GetInstance()
Definition: DriverStation.cpp:145
double GetMatchTime()
Definition: DriverStation.cpp:492
void GetData()
Definition: DriverStation.cpp:159
uint16_t GetTeamNumber()
Definition: DriverStation.cpp:503
Definition: Dashboard.h:20
void WaitForData()
Definition: DriverStation.cpp:477
Alliance GetAlliance()
Definition: DriverStation.cpp:453
void InTest(bool entering)
Definition: DriverStation.h:95
void InOperatorControl(bool entering)
Definition: DriverStation.h:91
DriverStation()
Definition: DriverStation.cpp:31
Definition: AnalogChannel.h:29
Definition: DriverStation.h:21