From 8f5d8626ff7be8237e227d18f8151a8ad1f72f43 Mon Sep 17 00:00:00 2001 From: Vasil Zlatanov Date: Wed, 3 May 2017 22:49:09 +0100 Subject: Add SPI initialasation class --- src/spi_init.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/spi_init.h (limited to 'src') diff --git a/src/spi_init.h b/src/spi_init.h new file mode 100644 index 0000000..e87568a --- /dev/null +++ b/src/spi_init.h @@ -0,0 +1,14 @@ +#define D_MOSI_PIN p5 +#define D_CLK_PIN p7 +#define D_DC_PIN p8 +#define D_RST_PIN p9 +#define D_CS_PIN p10 + +//an SPI sub-class that sets up format and clock speed +class SPInit:public SPI { +public: + SPInit(PinName mosi, PinName miso, PinName clk):SPI(mosi, miso, clk) { + format(8, 3); + frequency(2000000); + }; +}; -- cgit v1.2.3-54-g00ecf