From adfb08bc3dce6e5d4f3c4f46b38ddd0667a0f900 Mon Sep 17 00:00:00 2001 From: polymurph Date: Sun, 22 Aug 2021 15:51:53 +0200 Subject: [PATCH] work on spi interface --- interfaces/spi.hpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/interfaces/spi.hpp b/interfaces/spi.hpp index 9ad0fed..96d0a58 100644 --- a/interfaces/spi.hpp +++ b/interfaces/spi.hpp @@ -6,11 +6,20 @@ template struct SPI { - uint8_t trx_u8(const uint8_t& data); + uint8_t trx_u8(const uint8_t& data) + { + return static_cast(this)->trx_u8Impl(data); + } - void tx(const uint8_t& data); + void tx(const uint8_t& data) + { + static_cast(this)->txImpl(data); + } - uint8_t rx(); + uint8_t rx() + { + return static_cast(this)->rxImpl(); + } }; #endif // _SPI_HPP_