diff options
author | Ashish Chaudhari <ashish@ettus.com> | 2019-05-25 00:14:36 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2019-11-26 11:49:20 -0800 |
commit | b4bc85ac972b2e4f3e8e0b092947267f9f8aeee4 (patch) | |
tree | f3128013bf71d44ece3b408db6a03177c6fd5f56 /host/lib/include/uhdlib/rfnoc/rfnoc_common.hpp | |
parent | 1e65500d791461be9aa7a2d2646d463f536f49e3 (diff) | |
download | uhd-b4bc85ac972b2e4f3e8e0b092947267f9f8aeee4.tar.gz uhd-b4bc85ac972b2e4f3e8e0b092947267f9f8aeee4.tar.bz2 uhd-b4bc85ac972b2e4f3e8e0b092947267f9f8aeee4.zip |
rfnoc: Moved chdr types/packet class out of chdr dir
- Moved chdr_packet and chdr_types from rfnoc/chdr to rfnoc and updated
all references
- Moved non-CHDR definitions to rfnoc_common.hpp
Diffstat (limited to 'host/lib/include/uhdlib/rfnoc/rfnoc_common.hpp')
-rw-r--r-- | host/lib/include/uhdlib/rfnoc/rfnoc_common.hpp | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/host/lib/include/uhdlib/rfnoc/rfnoc_common.hpp b/host/lib/include/uhdlib/rfnoc/rfnoc_common.hpp new file mode 100644 index 000000000..1fee0d40e --- /dev/null +++ b/host/lib/include/uhdlib/rfnoc/rfnoc_common.hpp @@ -0,0 +1,59 @@ +// +// Copyright 2019 Ettus Research, a National Instruments Brand +// +// SPDX-License-Identifier: GPL-3.0-or-later +// + +#ifndef INCLUDED_RFNOC_RFNOC_COMMON_HPP +#define INCLUDED_RFNOC_RFNOC_COMMON_HPP + +#include <memory> + +namespace uhd { namespace rfnoc { + +//---------------------------------------------- +// Types +//---------------------------------------------- + +//! Type that indicates the CHDR Width in bits +enum chdr_w_t { CHDR_W_64 = 0, CHDR_W_128 = 1, CHDR_W_256 = 2, CHDR_W_512 = 3 }; +//! Conversion from chdr_w_t to a number of bits +constexpr size_t chdr_w_to_bits(chdr_w_t chdr_w) +{ + switch (chdr_w) { + case CHDR_W_64: + return 64; + case CHDR_W_128: + return 128; + case CHDR_W_256: + return 256; + case CHDR_W_512: + return 512; + default: + return 0; + } +} + +//! Device ID Type +using device_id_t = uint16_t; +//! Stream Endpoint Instance Number Type +using sep_inst_t = uint16_t; +//! Stream Endpoint Physical Address Type +using sep_addr_t = std::pair<device_id_t, sep_inst_t>; +//! Stream Endpoint ID Type +using sep_id_t = uint16_t; + +//! Type of data carried by the stream endpoint +enum class sep_type_t { CTRL, DATA }; + + +//---------------------------------------------- +// Constants +//---------------------------------------------- + +constexpr uint16_t RFNOC_PROTO_VER = 0x0100; + + +}} // namespace uhd::rfnoc + +#endif /* INCLUDED_RFNOC_RFNOC_COMMON_HPP */ |