Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Fork of SPI_master_lpc11u53 by
Revision 5:5db204c0979d, committed 2015-04-03
- Comitter:
- gabriel4211
- Date:
- Fri Apr 03 13:27:50 2015 +0000
- Parent:
- 4:995eae7f13f4
- Commit message:
- random tinkering
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Wed Apr 01 13:03:01 2015 +0000 +++ b/main.cpp Fri Apr 03 13:27:50 2015 +0000 @@ -15,13 +15,16 @@ //ssel seems to work, data = ff :( //frdm - spi1 -SPI spi(D11, D12, D13); // mosi, miso, sclk -DigitalOut cs(D10); +//SPI spi(D11, D12, D13); // mosi, miso, sclk +//DigitalOut cs(D10); + +SPI spi(PTA16, PTA17, PTA15); // mosi, miso, sclk +DigitalOut cs(PTA14); int main() { - - spi.format(8,1); //not usefull results + cs = 1; + spi.format(8,3); //not usefull results spi.frequency(1000000); //spi.frequency(4000000); uint8_t i; @@ -37,16 +40,16 @@ for (i = 0; i < 10; i++) { cs = 0; - spi.write(i); + uint8_t garbage = spi.write(i); cs = 1; - wait_ms(100); + wait_ms(10); cs = 0; - uint8_t response = spi.write(0xFF); + uint8_t response = spi.write(0xFA); cs = 1; - printf("send: %x received: %x\r\n", i, response); + printf("send: %x received: %x garb: %x \r\n", i, response, garbage); if(response == i + 0x10) { success++;