AT25040 Driver
API reference
Loading...
Searching...
No Matches
at25040_spi_interface.hpp
Go to the documentation of this file.
1#pragma once
6#include <cstddef>
7#include <cstdint>
8#include <type_traits>
9#include <utility>
10
11namespace at25040 {
12
19template <typename Derived>
21public:
22 bool transfer(const uint8_t* tx, uint8_t* rx, std::size_t len, uint32_t timeout_ms) {
23 return static_cast<Derived*>(this)->transfer(tx, rx, len, timeout_ms);
24 }
25
26 SpiInterface(const SpiInterface&) = delete;
28
29protected:
30 SpiInterface() = default;
33 ~SpiInterface() = default;
34};
35
36namespace detail {
37
39template <typename T, typename = void>
40struct HasDelayUs : std::false_type {};
41template <typename T>
42struct HasDelayUs<T, std::void_t<decltype(std::declval<T&>().delay_us(uint32_t{0}))>>
43 : std::true_type {};
44
45} // namespace detail
46
47} // namespace at25040
Definition at25040_spi_interface.hpp:20
SpiInterface & operator=(SpiInterface &&)=default
bool transfer(const uint8_t *tx, uint8_t *rx, std::size_t len, uint32_t timeout_ms)
Definition at25040_spi_interface.hpp:22
SpiInterface(SpiInterface &&)=default
SpiInterface & operator=(const SpiInterface &)=delete
SpiInterface(const SpiInterface &)=delete
Definition at25040.hpp:23
Definition at25040_spi_interface.hpp:40