diff options
Diffstat (limited to 'tool/mbed/mbed-sdk/libraries/tests/mbed/spi/main.cpp')
-rw-r--r-- | tool/mbed/mbed-sdk/libraries/tests/mbed/spi/main.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tool/mbed/mbed-sdk/libraries/tests/mbed/spi/main.cpp b/tool/mbed/mbed-sdk/libraries/tests/mbed/spi/main.cpp new file mode 100644 index 0000000000..ce571cf1d9 --- /dev/null +++ b/tool/mbed/mbed-sdk/libraries/tests/mbed/spi/main.cpp @@ -0,0 +1,16 @@ +#include "mbed.h" + +SPI spi(p11, p12, p13); +DigitalOut latchpin(p10); + +int main() { + spi.format(8, 0); + spi.frequency(16 * 1000 * 1000); + + latchpin = 0; + while (1) { + latchpin = 1; + spi.write(0); + latchpin = 0; + } +} |