Adds RobotController class (#828)

Unifies random functionality from other classes
Deprecates all old functions.
This commit is contained in:
Thad House
2017-12-10 21:52:49 -08:00
committed by Peter Johnson
parent 88a6b4ac38
commit 8b7aa61091
21 changed files with 668 additions and 19 deletions

View File

@@ -0,0 +1,47 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2017 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
/*----------------------------------------------------------------------------*/
#pragma once
#include <stdint.h>
namespace frc {
struct CANStatus {
float percentBusUtilization;
int busOffCount;
int txFullCount;
int receiveErrorCount;
int transmitErrorCount;
};
class RobotController {
public:
RobotController() = delete;
static int GetFPGAVersion();
static int64_t GetFPGARevision();
static uint64_t GetFPGATime();
static bool GetUserButton();
static bool IsSysActive();
static bool IsBrownedOut();
static double GetInputVoltage();
static double GetInputCurrent();
static double GetVoltage3V3();
static double GetCurrent3V3();
static bool GetEnabled3V3();
static int GetFaultCount3V3();
static double GetVoltage5V();
static double GetCurrent5V();
static bool GetEnabled5V();
static int GetFaultCount5V();
static double GetVoltage6V();
static double GetCurrent6V();
static bool GetEnabled6V();
static int GetFaultCount6V();
static CANStatus GetCANStatus();
};
} // namespace frc