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
|
|
|
|
|
|
2025-11-07 19:56:21 -05:00
|
|
|
#include "wpi/hal/simulation/PWMData.h"
|
|
|
|
|
#include "wpi/hal/simulation/SimDataValue.h"
|
2017-08-18 21:35:53 -07:00
|
|
|
|
|
|
|
|
namespace hal {
|
|
|
|
|
class PWMData {
|
2018-09-03 16:08:07 -07:00
|
|
|
HAL_SIMDATAVALUE_DEFINE_NAME(Initialized)
|
2023-06-22 19:43:16 -07:00
|
|
|
HAL_SIMDATAVALUE_DEFINE_NAME(PulseMicrosecond)
|
2025-03-20 19:23:22 -07:00
|
|
|
HAL_SIMDATAVALUE_DEFINE_NAME(OutputPeriod)
|
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};
|
2025-03-20 19:23:22 -07:00
|
|
|
std::atomic<HAL_SimDeviceHandle> simDevice;
|
2023-06-22 19:43:16 -07:00
|
|
|
SimDataValue<int32_t, HAL_MakeInt, GetPulseMicrosecondName> pulseMicrosecond{
|
|
|
|
|
0};
|
2025-03-20 19:23:22 -07:00
|
|
|
SimDataValue<int32_t, HAL_MakeInt, GetOutputPeriodName> outputPeriod{0};
|
2017-08-18 21:35:53 -07:00
|
|
|
|
|
|
|
|
virtual void ResetData();
|
|
|
|
|
};
|
2017-12-10 19:38:53 -08:00
|
|
|
extern PWMData* SimPWMData;
|
2017-08-18 21:35:53 -07:00
|
|
|
} // namespace hal
|