Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a small addition to the existing pin macros that allows an application using libopeninv to drive bus based I/O, which may be on SPI,LIN,CAN,I2C etc., using the existing digio API eg
In order for this to be enabled, first create a busio.h/cpp file in your libopeninv project and include the drivers for the BUS device of interest.
A minimal example of a busio.h/cpp implementation that exposes the MCP2515 GPIO to digio is available here
Then, adding pins is done in digio_prj.h in the usual way, eg
(Note that the bus type relates to the physical device that provides the interface; its just an enum that allows the code to dispatch pin commands to the right handler.)
Adding support for other devices or busses is by expanding the relevant enums
and adding the corresponding Configure() and set()/get() handlers.
The implementation has no effect on existing I/O, but obviously this is not as fast as direct GPIO as it is over a bus.
Nonetheless, on SPI an MCP2515 output pin can be toggled in ~10us.