spi/spi.hpp

33 lines
405 B
C++
Raw Normal View History

2020-02-21 16:48:31 +01:00
#pragma once
2020-02-21 16:47:47 +01:00
2020-02-21 17:10:49 +01:00
#include "config.hpp"
#include "hardware.hpp"
2022-05-28 15:43:42 +02:00
#include "software.hpp"
2020-02-21 16:49:22 +01:00
2020-02-21 17:10:49 +01:00
#include "../io/io.hpp"
2020-02-21 16:47:47 +01:00
2020-02-21 16:49:22 +01:00
namespace spi {
2020-02-21 17:10:49 +01:00
template <class Driver>
2020-02-21 16:49:22 +01:00
class Spi {
2020-02-21 16:47:47 +01:00
public:
2020-02-21 17:26:14 +01:00
static void init()
{
2020-02-21 17:26:14 +01:00
Driver::init();
2020-02-21 16:47:47 +01:00
}
static uint8_t transfer(uint8_t ui8Data)
{
return Driver::transfer(ui8Data);
2020-02-21 16:47:47 +01:00
}
static void select(bool bSelect)
{
Driver::select(bSelect);
2020-02-21 16:47:47 +01:00
}
2020-02-21 17:26:14 +01:00
private:
};
2020-02-21 16:49:22 +01:00
} // namespace spi