2020-12-26 14:12:05 -08:00
|
|
|
// Copyright (c) FIRST and other WPILib contributors.
|
|
|
|
|
// Open Source Software; you can modify and/or share it under the terms of
|
|
|
|
|
// the WPILib BSD license file in the root directory of this project.
|
2017-08-18 21:35:53 -07:00
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2020-06-27 22:11:24 -07:00
|
|
|
#include "hal/simulation/AnalogTriggerData.h"
|
|
|
|
|
#include "hal/simulation/SimDataValue.h"
|
2017-08-18 21:35:53 -07:00
|
|
|
|
|
|
|
|
namespace hal {
|
|
|
|
|
class AnalogTriggerData {
|
2018-09-03 16:08:07 -07:00
|
|
|
HAL_SIMDATAVALUE_DEFINE_NAME(Initialized)
|
|
|
|
|
HAL_SIMDATAVALUE_DEFINE_NAME(TriggerLowerBound)
|
|
|
|
|
HAL_SIMDATAVALUE_DEFINE_NAME(TriggerUpperBound)
|
|
|
|
|
HAL_SIMDATAVALUE_DEFINE_NAME(TriggerMode)
|
2017-08-18 21:35:53 -07:00
|
|
|
|
2018-09-03 16:08:07 -07:00
|
|
|
static LLVM_ATTRIBUTE_ALWAYS_INLINE HAL_Value
|
|
|
|
|
MakeTriggerModeValue(HALSIM_AnalogTriggerMode value) {
|
2019-09-23 23:28:49 -07:00
|
|
|
return HAL_MakeEnum(value);
|
2018-09-03 16:08:07 -07:00
|
|
|
}
|
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{0};
|
|
|
|
|
SimDataValue<double, HAL_MakeDouble, GetTriggerLowerBoundName>
|
|
|
|
|
triggerLowerBound{0};
|
|
|
|
|
SimDataValue<double, HAL_MakeDouble, GetTriggerUpperBoundName>
|
|
|
|
|
triggerUpperBound{0};
|
2018-09-03 16:08:07 -07:00
|
|
|
SimDataValue<HALSIM_AnalogTriggerMode, MakeTriggerModeValue,
|
|
|
|
|
GetTriggerModeName>
|
|
|
|
|
triggerMode{static_cast<HALSIM_AnalogTriggerMode>(0)};
|
2020-07-04 10:10:43 -07:00
|
|
|
std::atomic<int32_t> inputPort;
|
2017-08-18 21:35:53 -07:00
|
|
|
|
|
|
|
|
virtual void ResetData();
|
|
|
|
|
};
|
2017-12-10 19:38:53 -08:00
|
|
|
extern AnalogTriggerData* SimAnalogTriggerData;
|
2017-08-18 21:35:53 -07:00
|
|
|
} // namespace hal
|