45

Dependencies:   mbed BufferedSerial LS7366LIB FastPWM

Revision:
0:c21936a3520a
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/spi_setup.h	Mon Mar 23 08:38:40 2020 +0000
@@ -0,0 +1,17 @@
+#include "LS7366.h"
+
+SPI spi1(SPI_MOSI, SPI_MISO, SPI_SCK);
+
+LS7366 encoder1(spi1, ENCODER_CS1);
+LS7366 encoder2(spi1, ENCODER_CS2);
+LS7366 encoder3(spi1, ENCODER_CS3);
+LS7366 encoder4(spi1, ENCODER_CS4);
+LS7366 encoder5(spi1, ENCODER_CS5);
+LS7366 encoder6(spi1, ENCODER_CS6);
+DigitalOut cs(PB_4);
+
+void SPI_INIT()
+{
+    spi1.format(8,0);
+    spi1.frequency(2000000);
+}
\ No newline at end of file