Sog Yang
/
mbed_SPIS_multiByte_example_SOG
Sog update version
Fork of mbed_SPIS_multiByte_example by
Diff: SPISlave_multiByte.h
- Revision:
- 2:c520d7c7739d
- Parent:
- 0:b7415ae44dac
- Child:
- 5:6a1155885fc9
diff -r 58f0712d9aa2 -r c520d7c7739d SPISlave_multiByte.h --- a/SPISlave_multiByte.h Wed May 31 07:39:37 2017 +0000 +++ b/SPISlave_multiByte.h Wed May 31 09:30:53 2017 +0000 @@ -89,11 +89,13 @@ /** Polls the SPI to see if data has been received * + * @param bytes Number of bytes per SPI frame + * * @returns * 0 if no data, * 1 otherwise */ - int receive(void); + int receive(int bytes = 1); /** Retrieve data from receive buffer as slave * @@ -105,9 +107,10 @@ /** Fill the transmission buffer with the value to be written out * as slave on the next received message from the master. * - * @param value the data to be transmitted next + * @param value the data context to be transmitted next + * @param bytes Number of bytes of given value */ - void reply(int value); + void reply(uint8_t *value, int bytes); protected: spi_mb_t _spi;