2017-08-18 21:35:53 -07:00
|
|
|
/*----------------------------------------------------------------------------*/
|
2019-09-23 23:28:49 -07:00
|
|
|
/* Copyright (c) 2017-2019 FIRST. All Rights Reserved. */
|
2017-08-18 21:35:53 -07:00
|
|
|
/* 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
|
|
|
|
|
|
2018-07-20 00:03:45 -07:00
|
|
|
#include "mockdata/AnalogInData.h"
|
2018-09-03 16:08:07 -07:00
|
|
|
#include "mockdata/SimDataValue.h"
|
2017-08-18 21:35:53 -07:00
|
|
|
|
|
|
|
|
namespace hal {
|
|
|
|
|
class AnalogInData {
|
2018-09-03 16:08:07 -07:00
|
|
|
HAL_SIMDATAVALUE_DEFINE_NAME(Initialized)
|
|
|
|
|
HAL_SIMDATAVALUE_DEFINE_NAME(AverageBits)
|
|
|
|
|
HAL_SIMDATAVALUE_DEFINE_NAME(OversampleBits)
|
|
|
|
|
HAL_SIMDATAVALUE_DEFINE_NAME(Voltage)
|
|
|
|
|
HAL_SIMDATAVALUE_DEFINE_NAME(AccumulatorInitialized)
|
|
|
|
|
HAL_SIMDATAVALUE_DEFINE_NAME(AccumulatorValue)
|
|
|
|
|
HAL_SIMDATAVALUE_DEFINE_NAME(AccumulatorCount)
|
|
|
|
|
HAL_SIMDATAVALUE_DEFINE_NAME(AccumulatorCenter)
|
|
|
|
|
HAL_SIMDATAVALUE_DEFINE_NAME(AccumulatorDeadband)
|
2017-08-18 21:35:53 -07:00
|
|
|
|
2018-09-03 16:08:07 -07:00
|
|
|
public:
|
2019-09-23 23:28:49 -07:00
|
|
|
SimDataValue<HAL_Bool, HAL_MakeBoolean, GetInitializedName> initialized{
|
|
|
|
|
false};
|
|
|
|
|
SimDataValue<int32_t, HAL_MakeInt, GetAverageBitsName> averageBits{7};
|
|
|
|
|
SimDataValue<int32_t, HAL_MakeInt, GetOversampleBitsName> oversampleBits{0};
|
|
|
|
|
SimDataValue<double, HAL_MakeDouble, GetVoltageName> voltage{0.0};
|
|
|
|
|
SimDataValue<HAL_Bool, HAL_MakeBoolean, GetAccumulatorInitializedName>
|
2018-09-03 16:08:07 -07:00
|
|
|
accumulatorInitialized{false};
|
2019-09-23 23:28:49 -07:00
|
|
|
SimDataValue<int64_t, HAL_MakeLong, GetAccumulatorValueName> accumulatorValue{
|
|
|
|
|
0};
|
|
|
|
|
SimDataValue<int64_t, HAL_MakeLong, GetAccumulatorCountName> accumulatorCount{
|
|
|
|
|
0};
|
|
|
|
|
SimDataValue<int32_t, HAL_MakeInt, GetAccumulatorCenterName>
|
|
|
|
|
accumulatorCenter{0};
|
|
|
|
|
SimDataValue<int32_t, HAL_MakeInt, GetAccumulatorDeadbandName>
|
2018-09-03 16:08:07 -07:00
|
|
|
accumulatorDeadband{0};
|
2017-08-18 21:35:53 -07:00
|
|
|
|
|
|
|
|
virtual void ResetData();
|
|
|
|
|
};
|
2017-12-10 19:38:53 -08:00
|
|
|
extern AnalogInData* SimAnalogInData;
|
2017-08-18 21:35:53 -07:00
|
|
|
} // namespace hal
|