pic32/libraries/DSPI/DSPI.cpp
/* ------------------------------------------------------------ */
/***	DSPI::doDspiInterrupt
**
**	Parameters:
**		none
**
**	Return Value:
**		none
**
**	Errors:
**		none
**
**	Description:
**		This function is called by the interrupt service routine
**		to handle SPI interrupts for this SPI port. It should only
**		be entered while performing an interrupt driven data
**		transfer operation.
*/


none

Return Value:
none

none

This function is called by the interrupt service routine
to handle SPI interrupts for this SPI port. It should only
be entered while performing an interrupt driven data
transfer operation.
none Return Value : none none This function is called by the interrupt service routine to handle SPI interrupts for this SPI port . It should only be entered while performing an interrupt driven data transfer operation .
void
DSPI::doDspiInterrupt() {
	uint8_t		bTmp;
	uint32_t	regIfs;
	regIfs = pregIfs->reg;
	if ((regIfs & bitErr) != 0) {
		fRov = 1;				
		pspi->sxStat.clr = (1 << _SPISTAT_SPIROV);	
		pregIfs->clr = bitErr;
	}
	if ((regIfs & bitRx) != 0) {
		bTmp = pspi->sxBuf.reg;		
		cbCur -= 1;					
		if (pbRcvCur != 0) {
			*pbRcvCur++ = bTmp;		
		}
		if (cbCur > 0) {
			bTmp = (pbSndCur != 0) ? *pbSndCur++ : bPad;
			pspi->sxBuf.reg = bTmp;
		}
		pregIfs->clr = bitRx;		
	}
}
void DSPI :: doDspiInterrupt ( ) { uint8_t bTmp ; uint32_t regIfs ; regIfs = pregIfs -> reg ; if ( ( regIfs & bitErr ) != 0 ) { fRov = 1 ; pspi -> sxStat . clr = ( 1 << _SPISTAT_SPIROV ) ; pregIfs -> clr = bitErr ; } if ( ( regIfs & bitRx ) != 0 ) { bTmp = pspi -> sxBuf . reg ; cbCur -= 1 ; if ( pbRcvCur != 0 ) { * pbRcvCur ++ = bTmp ; } if ( cbCur > 0 ) { bTmp = ( pbSndCur != 0 ) ? * pbSndCur ++ : bPad ; pspi -> sxBuf . reg = bTmp ; } pregIfs -> clr = bitRx ; } }
DSPI::doDspiInterrupt
DSPI :: doDspiInterrupt
/* Get the interrupt flag status.
	*/ /* Check for and handle overrun error interrupt.
	*/ // set the receive overflow error flag; //clear status bit /* Check for and handle receive interrupt.
	*/ /* Get the received character.
		*/ //read next byte from SPI controller //count this byte as received /* Are we storing it? pbRcvCur is 0 if we are sending only
		** and ignoring the received data.
		*/ //store the received byte into output buffer /* Send the next byte to the slave. pbSndCur is 0 if we are
		** receiving only. In this case send the pad byte.
		*/ //clear the receive interrupt flag