I’m trying to write a library to carry out SPI communication using the Arduino Portenta H7 Lite. The SPI initialiser is complaining about the parameters, giving the error invalid conversion from 'unsigned int' to 'PinName' when initialising SPI, when I attempt to initialise it in my function below.
The error persists if I use the numbers of the pins (ie SPI(D8, D10, D9, D7), or just numbers, which the PA_x values are enums for.
One fix I found here: https://github.com/jandelgado/jled/issues/53 suggests putting #undef __MBED__ in the file, which does work… but as mentioned in the github issue might cause problems down the line, and generally seems like a bit of a hacky fix.
Does anyone know what input I can provide to the function to make it work, and without having to undefine MBED?
That’s a good point! The board lists digital pins D7-D10 as SPI 1 interfaces - I’m not sure how the arduino pins will match up with the STM pins, so I’ll have to have a look at the datasheet for it. That said, I don’t think the issue is that it’s not a valid pin for SPI, the error looks more like it’s unhappy at the type passed into the function (i think)?
My hunch is that there’s some conflict between the Arduino SPI library and the mbed library