Ttelmah Guest
|
|
Posted: Sat Aug 09, 2008 2:59 pm |
|
|
No.
First thing to remember, is that SPI, is a bi-directional interface, so the idea of just 'receiving' something like a string, isn't really logical. Most devices require communications in each direction, to control what is going on.
However if you are just using your own pair of devices, and want to receive a 'string', then simply look at input.c, and the function 'get_string'. Simply copy this, and substitute the spi function for the getc. For a master, use spi_read(0), so a 'dummy' byte is clocked over the interface, or for a slave device, just using spi_read. Get rid of the putc's (these are designed to allow 'backspace' to be handled), and you have a routine to handle the reception of a CR terminated 'string'.
Best Wishes |
|