From 07301042f904d7467b4ed052f70fb18262a50839 Mon Sep 17 00:00:00 2001 From: Thomas Klaehn Date: Sat, 28 Mar 2020 08:45:36 +0100 Subject: [PATCH] Add nrf52 spi driver abstraction --- include/spi.h | 5 +++++ src/platform/nrf52/spi.c | 2 -- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/include/spi.h b/include/spi.h index 0b68c32..9ae98d6 100644 --- a/include/spi.h +++ b/include/spi.h @@ -1,3 +1,6 @@ +#ifndef __NRF52_SPI_H__ +#define __NRF52_SPI_H__ + int spi_open(const struct driver *drv); int spi_close(const struct driver *drv); @@ -16,3 +19,5 @@ static const struct driver_fp spi_fp = { .write = spi_write, .ioctl = NULL }; + +#endif diff --git a/src/platform/nrf52/spi.c b/src/platform/nrf52/spi.c index cbcea76..419e8d1 100644 --- a/src/platform/nrf52/spi.c +++ b/src/platform/nrf52/spi.c @@ -8,7 +8,6 @@ static inline int spi_transfer(uint32_t t); - int spi_open(const struct driver *drv) { assert(NULL != drv); @@ -59,4 +58,3 @@ static inline int spi_transfer(uint32_t t) } r = NRF_SPI0->RXD; // in return (int)r; -}