* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-
+
/**
* Spi implementation using a USCI device. When being used as a SPI slave, the
* CSn interface should be wired to the chip select driven by the SPI master so
*
* @author R. Steve McKown <rsmckown@gmail.com>
*/
-
+
generic module Msp430SpiP(uint16_t blockSize) {
provides {
interface SpiByte;
if (end > m_len)
end = m_len;
+ waitOnTx(); /* Don't assume that the last tx is done already */
call Registers.setTxbuf(m_txBuf ? m_txBuf[m_pos] : 0);
while (++m_pos < end) {
waitOnRx();
default async command const msp430_usci_spi_t* Configure.get()
{
- const static msp430_usci_spi_t def = {
+ const static msp430_usci_spi_t def = {
ctl0: UCSYNC | UCMODE_0 | UCMST, /* 3-pin SPI mode 0, LSB first */
ctl1: UCSWRST | UCSSEL_3, /* SPI clock source is SMCLK */
brx: 10, /* SPI clock=SMCLK/10; ~105KHz if SMCLK=1MHz */
async event void Interrupts.i2cStop() {}
async event void Interrupts.i2cCal() {}
async event void Interrupts.brk() {}
- async event void Interrupts.i2cNak() {}
+ async event void Interrupts.i2cNack() {}
default async command bool CSn.get() { return FALSE; }
}