1 // SPDX-License-Identifier: Apache-2.0 2 // SPDX-FileCopyrightText: Copyright OpenBMC Authors 3 #pragma once 4 #include <nlohmann/json.hpp> 5 6 namespace control 7 { 8 // clang-format off 9 10 enum class ControlType{ 11 Invalid, 12 Temperature, 13 Power, 14 Frequency, 15 FrequencyMHz, 16 Pressure, 17 PressurekPa, 18 Valve, 19 Percent, 20 DutyCycle, 21 }; 22 23 enum class SetPointType{ 24 Invalid, 25 Single, 26 Range, 27 }; 28 29 enum class ControlMode{ 30 Invalid, 31 Automatic, 32 Override, 33 Manual, 34 Disabled, 35 }; 36 37 enum class ImplementationType{ 38 Invalid, 39 Programmable, 40 Direct, 41 Monitored, 42 }; 43 44 NLOHMANN_JSON_SERIALIZE_ENUM(ControlType, { 45 {ControlType::Invalid, "Invalid"}, 46 {ControlType::Temperature, "Temperature"}, 47 {ControlType::Power, "Power"}, 48 {ControlType::Frequency, "Frequency"}, 49 {ControlType::FrequencyMHz, "FrequencyMHz"}, 50 {ControlType::Pressure, "Pressure"}, 51 {ControlType::PressurekPa, "PressurekPa"}, 52 {ControlType::Valve, "Valve"}, 53 {ControlType::Percent, "Percent"}, 54 {ControlType::DutyCycle, "DutyCycle"}, 55 }); 56 57 NLOHMANN_JSON_SERIALIZE_ENUM(SetPointType, { 58 {SetPointType::Invalid, "Invalid"}, 59 {SetPointType::Single, "Single"}, 60 {SetPointType::Range, "Range"}, 61 }); 62 63 NLOHMANN_JSON_SERIALIZE_ENUM(ControlMode, { 64 {ControlMode::Invalid, "Invalid"}, 65 {ControlMode::Automatic, "Automatic"}, 66 {ControlMode::Override, "Override"}, 67 {ControlMode::Manual, "Manual"}, 68 {ControlMode::Disabled, "Disabled"}, 69 }); 70 71 NLOHMANN_JSON_SERIALIZE_ENUM(ImplementationType, { 72 {ImplementationType::Invalid, "Invalid"}, 73 {ImplementationType::Programmable, "Programmable"}, 74 {ImplementationType::Direct, "Direct"}, 75 {ImplementationType::Monitored, "Monitored"}, 76 }); 77 78 } 79 // clang-format on 80