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.
spi_slave.cpp
- Committer:
- eguliyev
- Date:
- 2019-05-29
- Revision:
- 0:99e31762ab2f
File content as of revision 0:99e31762ab2f:
#include "mbed.h"
#include "spi_slave.h"
SPISlave slave(PC_1,PC_2,PB_10,PB_12);
void SLV_INIT(){
slave.format(8,0);
slave.frequency(1000000);
}
void SLV_SEND(char msb_data, char mib_data, char lsb_data){
if(slave.receive()){
slave.reply(msb_data);
slave.reply(mib_data);
slave.reply(lsb_data);
}
}