123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149 |
- // // ******************************************************************
- // // /\ /| @File ProtocolEnums.h
- // // \ V/ @Brief
- // // | "") @Author lijinwen, ghz005@uni-trend.com.cn
- // // / | @Creation 2024-05-16
- // // / \\ @Modified 2024-05-16
- // // *(__\_\
- // // ******************************************************************
- #pragma once
- #include <iostream>
- #include <unordered_map>
- namespace Protocol
- {
- // 公共枚举,表示解码的状态
- enum class ProtocolStatus: int32_t
- {
- Success,
- QuantizeFailure,
- QuantizeInProgress,
- DecodeFailure,
- DecodeInProgress,
- Canceled
- };
- enum class Edge: int32_t
- {
- None,
- Falling,
- Rise,
- };
- enum class ProtocolClass: int32_t
- {
- Other,
- Serial,
- Parallel,
- };
- enum class SignalType: int32_t
- {
- SingleEnded,
- Diff
- };
- enum class MSBOrLSB: int32_t
- {
- MSB,
- LSB
- };
- enum class Polarity: int32_t
- {
- None,
- Pos,
- Neg
- };
- // 枚举类,定义了支持的串行通信协议类型。
- enum class SerialProtocolType : int32_t
- {
- Close = 0,
- // 表示没有协议
- RS232,
- // RS232 协议
- I2C,
- // I2C 协议
- SPI,
- // SPI 协议
- CAN,
- // CAN 协议
- CAN_FD,
- // CAN with Flexible Data-Rate 协议
- LIN,
- // LIN 协议
- FlexRay,
- // FlexRay 通信协议
- AudioBus,
- // 音频总线协议
- MIL,
- // MIL-STD-1553 协议
- ARINC429,
- // ARINC429 航空电子协议
- USB,
- // USB 通用串行总线协议
- SENT,
- // 单边电流传输协议
- SPMI,
- // 串行外围设备多路传输接口
- Ethernet,
- // 以太网协议
- CXPI,
- // CXPI 协议
- NFC,
- // 近场通信协议
- PD,
- // 电力传输协议
- NRZ,
- // 非归零编码
- Manchester,
- // 曼彻斯特编码
- DigRF_3G,
- // 数字射频3G协议
- DigRF_V4,
- // 数字射频V4协议
- Common_8b10b,
- // 8b/10b编码
- JTAG,
- // 联合测试行动组协议
- SATA,
- // 串行ATA接口
- PCIe,
- // 外围设备互连高速扩展协议
- // 如果有新的协议类型,可以继续添加如下:
- // NewProtocolTypeX, // 新的协议类型X
- // ...
- };
- //
- // std::unordered_map<SerialProtocolType, std::string> protocolTypeAliases = {
- // {SerialProtocolType::Close, "Close"},
- // {SerialProtocolType::RS232, "RS232"},
- // {SerialProtocolType::I2C, "I2C"},
- // {SerialProtocolType::SPI, "SPI"},
- // {SerialProtocolType::CAN, "CAN"},
- // {SerialProtocolType::CAN_FD, "CAN-FD"},
- // {SerialProtocolType::LIN, "LIN"},
- // {SerialProtocolType::FlexRay, "FlexRay"},
- // {SerialProtocolType::AudioBus, "AudioBus"},
- // {SerialProtocolType::MIL, "MIL-STD-1553"},
- // {SerialProtocolType::ARINC429, "ARINC429"},
- // {SerialProtocolType::USB, "USB"},
- // {SerialProtocolType::SENT, "SENT"},
- // {SerialProtocolType::SPMI, "SPMI"},
- // {SerialProtocolType::Ethernet, "Ethernet"},
- // {SerialProtocolType::CXPI, "CXPI"},
- // {SerialProtocolType::NFC, "NFC"},
- // {SerialProtocolType::PD, "PD"},
- // {SerialProtocolType::NRZ, "NRZ"},
- // {SerialProtocolType::Manchester, "Manchester"},
- // {SerialProtocolType::DigRF_3G, "DigRF-3G"},
- // {SerialProtocolType::DigRF_V4, "DigRF-V4"},
- // {SerialProtocolType::Common_8b10b, "Common-8b10b"},
- // {SerialProtocolType::JTAG, "JTAG"},
- // {SerialProtocolType::SATA, "SATA"},
- // {SerialProtocolType::PCIe, "PCIe"}
- // };
- }
|