pic32/libraries/DSPI/DSPI.cpp
/* ------------------------------------------------------------ */
/*				Data Transfer Functions							*/
/* ------------------------------------------------------------ */
/***	DSPI::transfer
**
**	Parameters:
**		bVal	- byte/word to send
**
**	Return Value:
**		returns byte/word received from the slave
**
**	Errors:
**		none
**
**	Description:
**		Send the specified byte to the SPI slave device, returning
**		the byte received from the slave device.
*/
Data Transfer Functions

:transfer

bVal    - byte/word to send

Return Value:
returns byte/word received from the slave

none

Send the specified byte to the SPI slave device, returning
the byte received from the slave device.
Data Transfer Functions : transfer bVal - byte / word to send Return Value : returns byte / word received from the slave none Send the specified byte to the SPI slave device returning the byte received from the slave device .
uint32_t
DSPI::transfer(uint32_t bVal) {
	while ((pspi->sxStat.reg & (1 << _SPISTAT_SPITBE)) == 0) {
	}
	pspi->sxBuf.reg = bVal;
	while ((pspi->sxStat.reg & (1 << _SPISTAT_SPIRBF)) == 0) {
	}
	return pspi->sxBuf.reg;
}
uint32_t DSPI :: transfer ( uint32_t bVal ) { while ( ( pspi -> sxStat . reg & ( 1 << _SPISTAT_SPITBE ) ) == 0 ) { } pspi -> sxBuf . reg = bVal ; while ( ( pspi -> sxStat . reg & ( 1 << _SPISTAT_SPIRBF ) ) == 0 ) { } return pspi -> sxBuf . reg ; }
Data Transfer Functions
Data Transfer Functions