USRP Hardware Driver and USRP Manual  Version: 4.4.0.HEAD-0-g5fac246b
UHD and USRP Manual
spi_getter_iface.hpp
Go to the documentation of this file.
1 //
2 // Copyright 2021 Ettus Research, a National Instruments Brand
3 //
4 // SPDX-License-Identifier: GPL-3.0-or-later
5 //
6 
7 #pragma once
8 
9 #include <uhd/config.hpp>
11 #include <uhd/types/serial.hpp>
12 #include <memory>
13 
14 namespace uhd { namespace features {
15 
21 {
23  uint8_t periph_cs;
24 
26  uint8_t periph_sdi;
27 
29  uint8_t periph_sdo;
30 
32  uint8_t periph_clk;
33 };
34 
38 {
39 public:
40  using sptr = std::shared_ptr<spi_getter_iface>;
41 
43  {
45  }
46 
47  std::string get_feature_name() const
48  {
49  return "SPI Getter Interface";
50  }
51 
52  virtual ~spi_getter_iface() = default;
53 
57  virtual uhd::spi_iface::sptr get_spi_ref(
58  const std::vector<uhd::features::spi_periph_config_t>& spi_periph_config)
59  const = 0;
60 };
61 
62 }} // namespace uhd::features
uhd::features::spi_periph_config_t::periph_sdi
uint8_t periph_sdi
Indicates which GPIO line to use for the SDI signal.
Definition: spi_getter_iface.hpp:26
discoverable_feature.hpp
uhd::features::spi_getter_iface::get_feature_name
std::string get_feature_name() const
Returns a human-readable string name of this feature.
Definition: spi_getter_iface.hpp:47
uhd::features::spi_getter_iface::get_feature_id
static discoverable_feature::feature_id_t get_feature_id()
Definition: spi_getter_iface.hpp:42
config.hpp
uhd::features::spi_periph_config_t::periph_clk
uint8_t periph_clk
Indicates which GPIO line to use for the SCLK signal.
Definition: spi_getter_iface.hpp:32
uhd::features::spi_periph_config_t::periph_sdo
uint8_t periph_sdo
Indicates which GPIO line to use for the SDO signal.
Definition: spi_getter_iface.hpp:29
UHD_API
#define UHD_API
Definition: config.h:87
uhd::features::spi_getter_iface
Definition: spi_getter_iface.hpp:37
uhd::features::discoverable_feature::SPI_GETTER_IFACE
@ SPI_GETTER_IFACE
Definition: discoverable_feature.hpp:40
uhd::features::discoverable_feature::feature_id_t
feature_id_t
An enum of all features supported by the driver. When creating a new.
Definition: discoverable_feature.hpp:32
uhd
Definition: build_info.hpp:12
uhd::features::spi_periph_config_t
Definition: spi_getter_iface.hpp:20
serial.hpp
uhd::features::discoverable_feature
Definition: discoverable_feature.hpp:25
uhd::features::discoverable_feature::sptr
std::shared_ptr< discoverable_feature > sptr
Definition: discoverable_feature.hpp:28
uhd::features::spi_periph_config_t::periph_cs
uint8_t periph_cs
Indicates which GPIO line to use for the CS signal.
Definition: spi_getter_iface.hpp:23
uhd::spi_iface::sptr
std::shared_ptr< spi_iface > sptr
Definition: serial.hpp:124