-
Notifications
You must be signed in to change notification settings - Fork 108
PinMux
Due to size and spec restrictions, is common to have a physical I/O pin shared by the different I/O protocols provided by IoT boards. When that is the case, in order to make use of a given pin, it is necessary to execute some additional steps to configure the pin to work on the desired mode.
Since the multiplexer implementation differs a lot between boards, it would be practically impossible to add support for all. Instead, entry points were added in Soletta's I/O APIs that allows the execution of board specific code to do the necessary setup. The board specific code is provided through a special kind of module in Soletta that is called 'pinmux module'. This way, the multiplexer code needed for new boards can be fully developed and maintained in external repositories. All it is needed is to implement pinmux module API, install the module in the corrected path and provide Soletta with means to detected the board that will be explained below.
See Board-Detection for detailed info about the detection process.
Board's name is then used to search for it's module. First, in the built-in modules list and then for <DESTDIR>/lib/soletta/modules/pin-mux/<board_name>.so
.
The interface that needs to be implement by a pinmux module can be found in 'sol-pin-mux-modules.h' file. A convenience macro is provided to make easier to declare the correct symbol that is needed so the module can be successfully loaded by Soletta library.