RobotSimulation/pick_and_place/ROS/src/niryo_one_ros/mcp_can_rpi/src/mcp_can_rpi.cpp
bool MCP_CAN::setupSpi()
{
#ifdef __arm__
	int result_spi = wiringPiSPISetup(spi_channel, spi_baudrate);
    printf("Started SPI : %d\n", result_spi);
    if (result_spi < 0) {
        return false;
    }
    nanosleep((const struct timespec[]){{0, 500000L}}, NULL);
    return true;
#else
    printf("Can't use SPI on non-ARM processor");
    return false;
#endif
}
/*********************************************************************************************************
** Function name:           setupSpi
** Descriptions:            Setups spi communication on Raspberry Pi (using wiringPi)
*********************************************************************************************************/
Function name:           setupSpi
Descriptions:            Setups spi communication on Raspberry Pi (using wiringPi)
Function name : setupSpi Descriptions : Setups spi communication on Raspberry Pi ( using wiringPi )
bool MCP_CAN::setupSpi()
{
#ifdef __arm__
	int result_spi = wiringPiSPISetup(spi_channel, spi_baudrate);
    printf("Started SPI : %d\n", result_spi);
    if (result_spi < 0) {
        return false;
    }
    nanosleep((const struct timespec[]){{0, 500000L}}, NULL);
    return true;
#else
    printf("Can't use SPI on non-ARM processor");
    return false;
#endif
}
bool MCP_CAN :: setupSpi ( ) { #ifdef __arm__ int result_spi = wiringPiSPISetup ( spi_channel , spi_baudrate ) ; printf ( " \n " , result_spi ) ; if ( result_spi < 0 ) { return false ; } nanosleep ( ( const struct timespec [ ] ) { { 0 , 500000L } } , NULL ) ; return true ; #else printf ( " " ) ; return false ; #endif }
Function name:           setupSpi
Descriptions:            Setups spi communication on Raspberry Pi (using wiringPi)
Function name : setupSpi Descriptions : Setups spi communication on Raspberry Pi ( using wiringPi )