RobotSimulation/pick_and_place/ROS/src/niryo_one_ros/mcp_can_rpi/src/mcp_can_rpi.cpp
MCP_CAN::MCP_CAN(int spi_channel, int spi_baudrate, INT8U gpio_can_interrupt)
{
    this->spi_channel = spi_channel;
    this->spi_baudrate = spi_baudrate;
    this->gpio_can_interrupt = gpio_can_interrupt;
    
    delay_spi_can.tv_sec = 0;
    delay_spi_can.tv_nsec = 5000L; // wait 5 microseconds between 2 spi transfers
}
/*********************************************************************************************************
** Function name:           MCP_CAN
** Descriptions:            Public function to declare CAN class and the /CS pin.
*********************************************************************************************************/
Function name:           MCP_CAN
Descriptions:            Public function to declare CAN class and the /CS pin.
Function name : MCP_CAN Descriptions : Public function to declare CAN class and the / CS pin .
MCP_CAN::MCP_CAN(int spi_channel, int spi_baudrate, INT8U gpio_can_interrupt)
{
    this->spi_channel = spi_channel;
    this->spi_baudrate = spi_baudrate;
    this->gpio_can_interrupt = gpio_can_interrupt;
    delay_spi_can.tv_sec = 0;
    delay_spi_can.tv_nsec = 5000L; 
}
MCP_CAN :: MCP_CAN ( int spi_channel , int spi_baudrate , INT8U gpio_can_interrupt ) { this -> spi_channel = spi_channel ; this -> spi_baudrate = spi_baudrate ; this -> gpio_can_interrupt = gpio_can_interrupt ; delay_spi_can . tv_sec = 0 ; delay_spi_can . tv_nsec = 5000L ; }
Function name:           MCP_CAN
Descriptions:            Public function to declare CAN class and the /CS pin.
Function name : MCP_CAN Descriptions : Public function to declare CAN class and the / CS pin .
// wait 5 microseconds between 2 spi transfers