26 lines
543 B
C++
26 lines
543 B
C++
#ifndef __PLATFORM_NRF52_SPI_H__
|
|
#define __PLATFORM_NRF52_SPI_H__
|
|
|
|
#include "gpio_interface.h"
|
|
#include "spi_interface.h"
|
|
|
|
namespace platform::nrf52 {
|
|
|
|
class Spi : public interfaces::SpiInterface
|
|
{
|
|
public:
|
|
Spi(uint32_t instance, uint32_t sck, uint32_t mosi, uint32_t miso, interfaces::GpioInterface & cs);
|
|
~Spi();
|
|
void send(const uint8_t * buffer, uint32_t len) override;
|
|
void recv(uint8_t * buffer, uint32_t len) override;
|
|
|
|
private:
|
|
uint32_t transfer(uint32_t);
|
|
|
|
interfaces::GpioInterface & chip_select;
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|