Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Switch SPI Clock Polarity Before Receive

I am interfacing nrf52832 with TI TRF7960A using SDK 14.2.0

According to Application Report (http://www.ti.com/lit/an/sloa140a/sloa140a.pdf) ,

when receive data, SPI mode must change from mode-1 to mode-0.

This is how MSP430 do

SPI_sendByte(*pui8Buffer);

#if (TRF79xxA_VERSION == 60)
	UCB0CTL1 |= UCSWRST;
	UCB0CTL0 &= ~UCCKPH;					// Switch Clock Polarity for Read (TRF7960A)
	UCB0CTL1 &= ~UCSWRST;
#endif

	while(ui8Length-- > 0)
	{
		*pui8Buffer = SPI_receiveByte();
		pui8Buffer++;
	}
	while(UCB0STAT & UCBUSY)
	{
	}

#if (TRF79xxA_VERSION == 60)
	UCB0CTL0 |= UCCKPH;						// Switch Clock Polarity back
#endif
	SLAVE_SELECT_HIGH; 						// Stop SPI Mode

Is there a function in SPI Master driver that able to switch polarity before read?

Many thanks for the assistance.

Regards,

Leo

Related