sparkfun/spi/spi_port_edison.cpp
// configurePort() only handles the parts which must be handled apart from
//  the message struct.
configurePort() only handles the parts which must be handled apart from
the message struct.
configurePort () only handles the parts which must be handled apart from the message struct .
void spiPort::configurePort()
{
	if (_portOwner == NULL)
	{
		return;
	}
	int temp = 0;
 	if (_portOwner->doLSBFirst()) 
	{
		temp = SPI_LSB_FIRST;
		ioctl(_spiFile, SPI_IOC_WR_LSB_FIRST, &temp);
	}
	else
  {	
    temp = 0;
		ioctl(_spiFile, SPI_IOC_WR_LSB_FIRST, &temp);
	}
  temp = _portOwner->getSPIMode();
	ioctl(_spiFile, SPI_IOC_WR_MODE, &temp);
}
void spiPort :: configurePort ( ) { if ( _portOwner == NULL ) { return ; } int temp = 0 ; if ( _portOwner -> doLSBFirst ( ) ) { temp = SPI_LSB_FIRST ; ioctl ( _spiFile , SPI_IOC_WR_LSB_FIRST , & temp ) ; } else { temp = 0 ; ioctl ( _spiFile , SPI_IOC_WR_LSB_FIRST , & temp ) ; } temp = _portOwner -> getSPIMode ( ) ; ioctl ( _spiFile , SPI_IOC_WR_MODE , & temp ) ; }
configurePort() only handles the parts which must be handled apart from
the message struct.
configurePort () only handles the parts which must be handled apart from the message struct .
// We'll make a little temp variable to transmit the various mode info to  //  the SPI driver. // The boolean lsbfirst is a rare case where the bit order should be  //  reversed during transmission; it corresponds to the SPI_LSB_FIRST //  constant in the spidev.h file.