aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbryan newbold <bnewbold@robocracy.org>2014-05-07 17:10:59 -0400
committerbnewbold <bnewbold@robocracy.org>2015-03-01 21:42:26 -0800
commit90a83152875fbdb8b7e4d4bf79164b4bcc88421e (patch)
tree1bf112961e74a8fcf22ce2a9a9fb6b23da123729
parent5d07a44ad304f088ba2bb680c1842d0a0705b7c6 (diff)
downloadlibrambutan-90a83152875fbdb8b7e4d4bf79164b4bcc88421e.tar.gz
librambutan-90a83152875fbdb8b7e4d4bf79164b4bcc88421e.zip
stm32f401c_discovery: disable on-board SPI1 MEMS Gyro by default
Signed-off-by: bryan newbold <bnewbold@robocracy.org>
-rw-r--r--wirish/boards/stm32f401c_discovery/board.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/wirish/boards/stm32f401c_discovery/board.cpp b/wirish/boards/stm32f401c_discovery/board.cpp
index fcbda7b..9eae1c2 100644
--- a/wirish/boards/stm32f401c_discovery/board.cpp
+++ b/wirish/boards/stm32f401c_discovery/board.cpp
@@ -45,11 +45,15 @@
// or setup() are called.
//
// If there's nothing special you need done, feel free to leave this
-// function out, as we do here.
-/*
+// function out.
void boardInit(void) {
+ // Disable on-board MEMS Gycroscope by pulling PE3 high (nCS line).
+ // If this isn't done, use of SPI peripheral 1 will fail mysteriously due
+ // to the Gyro writing to MISO.
+ // To re-enable and use the gyro, pull PE3 (D67) low in setup().
+ gpio_set_mode(GPIOE, 3, GPIO_MODE_OUTPUT);
+ gpio_write_bit(GPIOE, 3, 1);
}
-*/
// Pin map: this lets the basic I/O functions (digitalWrite(),
// analogRead(), pwmWrite()) translate from pin numbers to STM32