pic32/libraries/DSPI/DSPI.cpp
/* ------------------------------------------------------------ */
/*					Interrupt Driven I/O Functions				*/
/* ------------------------------------------------------------ */
/***	DSPI::intTransfer
**
**	Parameters:
**		cbReq		- number of bytes to transfer
**		pbSnd		- pointer to buffer of bytes to transmit
**		pbRcv		- pointer to buffer to receive return bytes
**
**	Return Value:
**		none
**
**	Errors:
**		Overrun error handled in interrupt service routine
**
**	Description:
**		This function will set up and begin an interrupt driven
**		transfer where the received bytes are stored into a
**		receive buffer.
*/
Interrupt Driven I/O Functions

:intTransfer

cbReq           - number of bytes to transfer
pbSnd           - pointer to buffer of bytes to transmit
pbRcv           - pointer to buffer to receive return bytes

Return Value:
none

Overrun error handled in interrupt service routine

This function will set up and begin an interrupt driven
transfer where the received bytes are stored into a
receive buffer.
Interrupt Driven I / O Functions : intTransfer cbReq - number of bytes to transfer pbSnd - pointer to buffer of bytes to transmit pbRcv - pointer to buffer to receive return bytes Return Value : none Overrun error handled in interrupt service routine This function will set up and begin an interrupt driven transfer where the received bytes are stored into a receive buffer .
void
DSPI::intTransfer(uint16_t cbReq, uint8_t * pbSnd, uint8_t * pbRcv) {
	cbCur = cbReq;
	pbSndCur = pbSnd;
	pbRcvCur = pbRcv;
	while ((pspi->sxStat.reg & (1 << _SPISTAT_SPITBE)) == 0) {
	}
	pspi->sxBuf.reg = *pbSndCur++;
}
void DSPI :: intTransfer ( uint16_t cbReq , uint8_t * pbSnd , uint8_t * pbRcv ) { cbCur = cbReq ; pbSndCur = pbSnd ; pbRcvCur = pbRcv ; while ( ( pspi -> sxStat . reg & ( 1 << _SPISTAT_SPITBE ) ) == 0 ) { } pspi -> sxBuf . reg = * pbSndCur ++ ; }
Interrupt Driven I/O Functions
Interrupt Driven I / O Functions
/* Set up the control variables for the transfer.
	*/ /* Wait for the transmitter to be ready
	*/ /* Send the first byte.
	*/