Now you can download a copy of these docs so you can use them offline! Download now
AnalogChannel.h
1 /*----------------------------------------------------------------------------*/
2 /* Copyright (c) FIRST 2008. All Rights Reserved. */
3 /* Open Source Software - may be modified and shared by FRC teams. The code */
4 /* must be accompanied by the FIRST BSD license file in $(WIND_BASE)/WPILib. */
5 /*----------------------------------------------------------------------------*/
6 
7 #ifndef ANALOG_CHANNEL_H_
8 #define ANALOG_CHANNEL_H_
9 
10 #include "ChipObject.h"
11 #include "SensorBase.h"
12 #include "PIDSource.h"
13 #include "LiveWindow/LiveWindowSendable.h"
14 
15 class AnalogModule;
16 
29 class AnalogChannel : public SensorBase, public PIDSource, public LiveWindowSendable
30 {
31 public:
32  static const uint8_t kAccumulatorModuleNumber = 1;
33  static const uint32_t kAccumulatorNumChannels = 2;
34  static const uint32_t kAccumulatorChannels[kAccumulatorNumChannels];
35 
36  AnalogChannel(uint8_t moduleNumber, uint32_t channel);
37  explicit AnalogChannel(uint32_t channel);
38  virtual ~AnalogChannel();
39 
41 
42  int16_t GetValue();
43  int32_t GetAverageValue();
44 
45  float GetVoltage();
46  float GetAverageVoltage();
47 
48  uint8_t GetModuleNumber();
49  uint32_t GetChannel();
50 
51  void SetAverageBits(uint32_t bits);
52  uint32_t GetAverageBits();
53  void SetOversampleBits(uint32_t bits);
54  uint32_t GetOversampleBits();
55 
56  uint32_t GetLSBWeight();
57  int32_t GetOffset();
58 
59  bool IsAccumulatorChannel();
60  void InitAccumulator();
61  void SetAccumulatorInitialValue(INT64 value);
62  void ResetAccumulator();
63  void SetAccumulatorCenter(int32_t center);
64  void SetAccumulatorDeadband(int32_t deadband);
65  INT64 GetAccumulatorValue();
66  uint32_t GetAccumulatorCount();
67  void GetAccumulatorOutput(INT64 *value, uint32_t *count);
68  void SetVoltageForPID(bool shouldUseVoltageForPID);
69 
70  double PIDGet();
71 
72  void UpdateTable();
73  void StartLiveWindowMode();
74  void StopLiveWindowMode();
75  std::string GetSmartDashboardType();
76  void InitTable(ITable *subTable);
77  ITable * GetTable();
78 
79 private:
80  void InitChannel(uint8_t moduleNumber, uint32_t channel);
81  uint32_t m_channel;
82  AnalogModule *m_module;
83  tAccumulator *m_accumulator;
84  INT64 m_accumulatorOffset;
85  bool m_shouldUseVoltageForPID;
86 
87  ITable *m_table;
88 };
89 
90 #endif
void StartLiveWindowMode()
int32_t GetAverageValue()
void GetAccumulatorOutput(INT64 *value, uint32_t *count)
uint32_t GetChannel()
void InitTable(ITable *subTable)
void StopLiveWindowMode()
AnalogChannel(uint8_t moduleNumber, uint32_t channel)
void SetAccumulatorDeadband(int32_t deadband)
void SetAccumulatorInitialValue(INT64 value)
Definition: ITable.h:26
uint8_t GetModuleNumber()
uint32_t GetOversampleBits()
int32_t GetOffset()
INT64 GetAccumulatorValue()
void SetVoltageForPID(bool shouldUseVoltageForPID)
int16_t GetValue()
float GetAverageVoltage()
AnalogModule * GetModule()
bool IsAccumulatorChannel()
uint32_t GetAccumulatorCount()
std::string GetSmartDashboardType()
void ResetAccumulator()
ITable * GetTable()
virtual ~AnalogChannel()
void InitAccumulator()
uint32_t GetAverageBits()
void SetAccumulatorCenter(int32_t center)
uint32_t GetLSBWeight()
void SetAverageBits(uint32_t bits)
void SetOversampleBits(uint32_t bits)

Generated on Sat Apr 26 2014 12:26:45 for WPILibC++ by doxygen 1.8.6