Loading...
Searching...
No Matches
spi_getter_iface.hpp
Go to the documentation of this file.
//
// Copyright 2021 Ettus Research, a National Instruments Brand
//
// SPDX-License-Identifier: GPL-3.0-or-later
//
#pragma once
#include <uhd/config.hpp>
#include <uhd/features/discoverable_feature.hpp>
#include <uhd/types/serial.hpp>
#include <memory>
namespace uhd { namespace features {
struct UHD_API spi_periph_config_t
{
uint8_t periph_cs;
uint8_t periph_sdi;
uint8_t periph_sdo;
uint8_t periph_clk;
};
class UHD_API spi_getter_iface : public discoverable_feature
{
public:
using sptr = std::shared_ptr<spi_getter_iface>;
static discoverable_feature::feature_id_t get_feature_id()
{
return discoverable_feature::SPI_GETTER_IFACE;
}
std::string get_feature_name() const
{
return "SPI Getter Interface";
}
virtual ~spi_getter_iface() = default;
virtual uhd::spi_iface::sptr get_spi_ref(
const std::vector<uhd::features::spi_periph_config_t>& spi_periph_config)
const = 0;
};
}} // namespace uhd::features
uhd::features::discoverable_feature
Definition discoverable_feature.hpp:26
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::features::discoverable_feature::SPI_GETTER_IFACE
@ SPI_GETTER_IFACE
Definition discoverable_feature.hpp:40
uhd::features::spi_getter_iface
Definition spi_getter_iface.hpp:38
uhd::features::spi_getter_iface::~spi_getter_iface
virtual ~spi_getter_iface()=default
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
uhd::features::spi_getter_iface::sptr
std::shared_ptr< spi_getter_iface > sptr
Definition spi_getter_iface.hpp:40
uhd::features::spi_getter_iface::get_spi_ref
virtual uhd::spi_iface::sptr get_spi_ref(const std::vector< uhd::features::spi_periph_config_t > &spi_periph_config) const =0
uhd::spi_iface::sptr
std::shared_ptr< spi_iface > sptr
Definition serial.hpp:125
UHD_API
#define UHD_API
Definition config.h:87
config.hpp
discoverable_feature.hpp
uhd::features
Definition adc_self_calibration_iface.hpp:16
uhd
Definition build_info.hpp:12
serial.hpp
uhd::features::spi_periph_config_t
Definition spi_getter_iface.hpp:21
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::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
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::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