You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
426 B
26 lines
426 B
#ifndef _SPI_HPP_
|
|
#define _SPI_HPP_
|
|
|
|
#include <stdint.h>
|
|
|
|
template <typename Derived>
|
|
struct SPI
|
|
{
|
|
uint8_t trx_u8(const uint8_t& data)
|
|
{
|
|
return static_cast<Derived*>(this)->trx_u8Impl(data);
|
|
}
|
|
|
|
void tx(const uint8_t& data)
|
|
{
|
|
static_cast<Derived*>(this)->txImpl(data);
|
|
}
|
|
|
|
uint8_t rx()
|
|
{
|
|
return static_cast<Derived*>(this)->rxImpl();
|
|
}
|
|
};
|
|
|
|
#endif // _SPI_HPP_
|