I have an Intel galileo board, that communicates with a shield over SPI. I'm porting an Arduino library for the shield to use the MRAA SPI library instead of the arduino SPI library. I've a question.
According to the above link (MRAA SPI library)
- Instead of
SPI.begin()
in the shield library I'm guessing that I replace this directly withspi = mraa_spi_init(0);
Question where do I putmraa_spi_context spi;
In the library's .cpp file or .h file? Or do I put it inmain()
?
Thank you