On this page
article
peary/interfaces/SPI_BUS/spi_bus.hpp
peary/interfaces/SPI_BUS/spi_bus.hpp
Peary SPI Bus Interface. More…
Namespaces
| Name |
|---|
| peary |
| peary::interface |
Classes
| Name | |
|---|---|
| class | peary::interface::SPIBusEndpoint SPI bus interface class. |
Detailed Description
Peary SPI Bus Interface.
Copyright: Copyright (c) 2016-2025 CERN and the Peary Caribou authors. This software is distributed under the terms of the LGPL-3.0-only License, copied verbatim in the file “LICENSE.md”. SPDX-License-Identifier: LGPL-3.0-only
Source code
#pragma once
#include "peary/interfaces/SPI/spi.hpp"
namespace peary::interface {
class SPIBusEndpoint : public SPIEndpoint<> {
public:
explicit SPIBusEndpoint(
std::string const& bus, const reg_t address_bits, const data_t data_bits, const bool ws, const bool align_msb);
/* Default destructor for SPIBusEndpoint */
~SPIBusEndpoint() = default;
pair_t write_impl(const pair_t& data) override;
std::vector<pair_t> write_impl(const std::vector<pair_t>& data) override;
vector_t read_impl(const reg_t& reg, const unsigned int length) override;
private:
pair_t access(const bool rw, const pair_t& data);
private:
const uint8_t _address_bits;
const uint8_t _data_bits;
// Masks constants used by the class
const reg_t _address_mask;
const data_t _data_mask;
// Minimum length of the actual SPI frame aligned to 8bits, which can accommodate data
const size_t _length;
const bool _ws;
const bool _align_msb;
}; // class iface_spi_bus
} // namespace peary::interface
Updated on 2026-01-30 at 22:01:05 +0100