summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/spi_init.h14
1 files changed, 14 insertions, 0 deletions
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);
+ };
+};