Giuseppe Guida
/
Nucleo_spi_slave
boh
Revision 0:a879d67e88be, committed 2019-05-23
- Comitter:
- giuseppe_guida
- Date:
- Thu May 23 23:24:33 2019 +0000
- Commit message:
- ok;
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 |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu May 23 23:24:33 2019 +0000 @@ -0,0 +1,20 @@ +#include "mbed.h" + +SPISlave slave(SPI_MOSI, SPI_MISO, SPI_SCK, PA_15); //PA_15 è il valore buono per il cs +Serial pc(USBTX,USBRX,9600); + +int main() { + slave.reply(0x00); + int v; + while(1) { + if(slave.receive()){ + v = slave.read(); + //slave.reply(v); + wait(1); + + } + pc.printf("Valore letto: %d\n\r",v); + } +} + + \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu May 23 23:24:33 2019 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/fb8e0ae1cceb \ No newline at end of file