From 90a83152875fbdb8b7e4d4bf79164b4bcc88421e Mon Sep 17 00:00:00 2001 From: bryan newbold Date: Wed, 7 May 2014 17:10:59 -0400 Subject: stm32f401c_discovery: disable on-board SPI1 MEMS Gyro by default Signed-off-by: bryan newbold --- wirish/boards/stm32f401c_discovery/board.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'wirish') 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 -- cgit v1.2.3