1 #pragma once 2 #include <nlohmann/json.hpp> 3 4 namespace pcie_device 5 { 6 // clang-format off 7 8 enum class PCIeTypes{ 9 Invalid, 10 Gen1, 11 Gen2, 12 Gen3, 13 Gen4, 14 Gen5, 15 }; 16 17 enum class DeviceType{ 18 Invalid, 19 SingleFunction, 20 MultiFunction, 21 Simulated, 22 Retimer, 23 }; 24 25 enum class SlotType{ 26 Invalid, 27 FullLength, 28 HalfLength, 29 LowProfile, 30 Mini, 31 M2, 32 OEM, 33 OCP3Small, 34 OCP3Large, 35 U2, 36 }; 37 38 enum class LaneSplittingType{ 39 Invalid, 40 None, 41 Bridged, 42 Bifurcated, 43 }; 44 45 NLOHMANN_JSON_SERIALIZE_ENUM(PCIeTypes, { 46 {PCIeTypes::Invalid, "Invalid"}, 47 {PCIeTypes::Gen1, "Gen1"}, 48 {PCIeTypes::Gen2, "Gen2"}, 49 {PCIeTypes::Gen3, "Gen3"}, 50 {PCIeTypes::Gen4, "Gen4"}, 51 {PCIeTypes::Gen5, "Gen5"}, 52 }); 53 54 NLOHMANN_JSON_SERIALIZE_ENUM(DeviceType, { 55 {DeviceType::Invalid, "Invalid"}, 56 {DeviceType::SingleFunction, "SingleFunction"}, 57 {DeviceType::MultiFunction, "MultiFunction"}, 58 {DeviceType::Simulated, "Simulated"}, 59 {DeviceType::Retimer, "Retimer"}, 60 }); 61 62 NLOHMANN_JSON_SERIALIZE_ENUM(SlotType, { 63 {SlotType::Invalid, "Invalid"}, 64 {SlotType::FullLength, "FullLength"}, 65 {SlotType::HalfLength, "HalfLength"}, 66 {SlotType::LowProfile, "LowProfile"}, 67 {SlotType::Mini, "Mini"}, 68 {SlotType::M2, "M2"}, 69 {SlotType::OEM, "OEM"}, 70 {SlotType::OCP3Small, "OCP3Small"}, 71 {SlotType::OCP3Large, "OCP3Large"}, 72 {SlotType::U2, "U2"}, 73 }); 74 75 NLOHMANN_JSON_SERIALIZE_ENUM(LaneSplittingType, { 76 {LaneSplittingType::Invalid, "Invalid"}, 77 {LaneSplittingType::None, "None"}, 78 {LaneSplittingType::Bridged, "Bridged"}, 79 {LaneSplittingType::Bifurcated, "Bifurcated"}, 80 }); 81 82 } 83 // clang-format on 84