leaflabs/libmaple — pull request #55 by pmp0x (2012-09-03 21:17:50+00:00)
Title: Changes in the SPI write function to wait for an empty TXR-Flag

Changed the write function to wait for an empty transmit (TXE) Flag (as
described in manual on p 684). Now the HardwareSPI can use this function
without the workaround. BUT it has to read the RX-Buffer after the
transmit (if we are in full-duplex-mode) because the Slave "sends"
0xFF. If we don't read it the receive buffer will uphold the arbitrary
data and will return it (0xFF) on an attempt to read it

Signed-off-by: Marcus Putz marcus.putz@gmail.com