mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-18 19:13:51 +01:00
This commit introduces a more robust GPIO mocking mechanism by utilizing a 2-dimensional array. Each element of the array holds a gpio_mock_t structure describing a pin's attributes such as value, mode, flank, interruption callback, and callback argument. This enhancement allows for the arbitrary simulation of GPIOs across various microcontroller architectures using the current API, while maintaining consistency through the use of the GPIO_PIN macro. Additionally, it should be noted that only the maximum number of ports and maximum number of pins can be altered according to the context. The implemented API in gpio_mock.c remains rudimentary, providing no validation but fulfilling the required functions. However, it remains customizable as all its functions are marked as weak. Signed-off-by: Gilles DOFFE <g.doffe@gmail.com>