fix spi baudrate to 6MHz on arm64. H5 can set only 6MHz or 12MHz
authorMiroslav Ondra <ondra@faster.cz>
Mon, 19 Aug 2019 16:23:29 +0000 (18:23 +0200)
committerMiroslav Ondra <ondra@faster.cz>
Mon, 19 Aug 2019 16:23:29 +0000 (18:23 +0200)
modules/unipi/src/unipi_common.h

index 603456b5afe240032df80824c369516b9e683425..5a79c20439bd392ffd8b5a9ae8142fbf26a83c2e 100644 (file)
 #define NEURONSPI_B_PER_WORD                   8
 #define NEURONSPI_DEFAULT_FREQ                 600000
 #define NEURONSPI_COMMON_FREQ                  12000000
-#define NEURONSPI_SLOWER_FREQ                  7500000
+
+#if defined(CONFIG_ARM64)
+/* on NanoPi there are only 12MHz and 6MHz available, not in between */
+   #define NEURONSPI_SLOWER_FREQ                       6000000
+#else
+   #define NEURONSPI_SLOWER_FREQ                       7500000
+#endif
+
 #define NEURONSPI_MAX_TX                               60
 //#define NEURONSPI_MAX_TX                             256
 #define NEURONSPI_MAX_BAUD                             115200