2013-12-15 18:30:16 -05:00
|
|
|
/*----------------------------------------------------------------------------*/
|
2017-01-01 01:05:57 -07:00
|
|
|
/* Copyright (c) FIRST 2008-2017. All Rights Reserved. */
|
2013-12-15 18:30:16 -05:00
|
|
|
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
2016-01-02 03:02:34 -08:00
|
|
|
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
|
|
|
|
/* the project. */
|
2013-12-15 18:30:16 -05:00
|
|
|
/*----------------------------------------------------------------------------*/
|
2016-01-02 03:02:34 -08:00
|
|
|
|
2014-05-02 17:54:01 -04:00
|
|
|
#pragma once
|
2013-12-15 18:30:16 -05:00
|
|
|
|
2016-06-05 07:33:37 -07:00
|
|
|
#include <stdint.h>
|
|
|
|
|
|
2013-12-15 18:30:16 -05:00
|
|
|
#include "Base.h"
|
2016-05-20 17:30:37 -07:00
|
|
|
#include "ErrorBase.h"
|
2013-12-15 18:30:16 -05:00
|
|
|
|
2016-11-01 22:33:12 -07:00
|
|
|
namespace frc {
|
|
|
|
|
|
2013-12-15 18:30:16 -05:00
|
|
|
/**
|
|
|
|
|
* Base class for all sensors.
|
2015-06-25 15:07:55 -04:00
|
|
|
* Stores most recent status information as well as containing utility functions
|
2016-05-20 17:30:37 -07:00
|
|
|
* for checking channels and error processing.
|
2013-12-15 18:30:16 -05:00
|
|
|
*/
|
2015-06-25 15:07:55 -04:00
|
|
|
class SensorBase : public ErrorBase {
|
|
|
|
|
public:
|
2016-06-30 21:39:09 -07:00
|
|
|
SensorBase() = default;
|
2015-06-24 01:06:29 -07:00
|
|
|
virtual ~SensorBase() = default;
|
2015-07-21 01:23:34 -07:00
|
|
|
|
|
|
|
|
SensorBase(const SensorBase&) = delete;
|
|
|
|
|
SensorBase& operator=(const SensorBase&) = delete;
|
|
|
|
|
|
2016-07-20 22:47:29 -07:00
|
|
|
static int GetDefaultSolenoidModule() { return 0; }
|
|
|
|
|
|
|
|
|
|
static bool CheckSolenoidModule(int moduleNumber);
|
|
|
|
|
static bool CheckDigitalChannel(int channel);
|
|
|
|
|
static bool CheckRelayChannel(int channel);
|
|
|
|
|
static bool CheckPWMChannel(int channel);
|
2016-07-21 23:24:06 -07:00
|
|
|
static bool CheckAnalogInputChannel(int channel);
|
|
|
|
|
static bool CheckAnalogOutputChannel(int channel);
|
2016-07-20 22:47:29 -07:00
|
|
|
static bool CheckSolenoidChannel(int channel);
|
|
|
|
|
static bool CheckPDPChannel(int channel);
|
|
|
|
|
|
|
|
|
|
static const int kDigitalChannels = 26;
|
|
|
|
|
static const int kAnalogInputs = 8;
|
|
|
|
|
static const int kAnalogOutputs = 2;
|
|
|
|
|
static const int kSolenoidChannels = 8;
|
|
|
|
|
static const int kSolenoidModules = 63;
|
|
|
|
|
static const int kPwmChannels = 20;
|
|
|
|
|
static const int kRelayChannels = 8;
|
|
|
|
|
static const int kPDPChannels = 16;
|
2013-12-15 18:30:16 -05:00
|
|
|
};
|
2016-11-01 22:33:12 -07:00
|
|
|
|
|
|
|
|
} // namespace frc
|