zhixiong zheng
/
Nucleo_spi_master
TEST SPI
Revision 0:474b52ad82d6, committed 2016-11-16
- Comitter:
- garryzheng
- Date:
- Wed Nov 16 19:49:40 2016 +0000
- Commit message:
- SPI_TEST
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
diff -r 000000000000 -r 474b52ad82d6 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Wed Nov 16 19:49:40 2016 +0000 @@ -0,0 +1,17 @@ +#include "mbed.h" +#define OLED_CSPIN D9 +SPI device(SPI_MOSI, SPI_MISO, SPI_SCK); +DigitalOut OLED_CS(OLED_CSPIN); + +int main() { + int i = 0; + while(1) { + OLED_CS =0; + device.write(0x55); + device.write(i++); + device.write(0xE0); + wait_us(50); + OLED_CS = 1; + } +} + \ No newline at end of file
diff -r 000000000000 -r 474b52ad82d6 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Wed Nov 16 19:49:40 2016 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/0ab6a29f35bf \ No newline at end of file