|
17 | 17 | * @warning This API is not stable yet and intended for internal use only |
18 | 18 | * as of now. |
19 | 19 | * |
| 20 | + * # General |
| 21 | + * |
| 22 | + * Ports and pin numbers are not always internally defined as the same numbers |
| 23 | + * that you would expect them to be. Therefore it is highly recommended to call |
| 24 | + * the low level functions like gpio_ll_init or gpio_ll_query_conf with the |
| 25 | + * gpio_get_port and gpio_get_pin_num functions instead of directly setting |
| 26 | + * port or pin numbers. Using the helper functions will assure reliable |
| 27 | + * operation on all platforms and GPIO banks. |
| 28 | + * |
20 | 29 | * # Design Goals |
21 | 30 | * |
22 | 31 | * This API aims to provide low-level access to GPIOs with as little |
@@ -821,11 +830,31 @@ static inline void gpio_ll_write(gpio_port_t port, uword_t state); |
821 | 830 |
|
822 | 831 | /** |
823 | 832 | * @brief Extract the `gpio_port_t` from a `gpio_t` |
| 833 | + * |
| 834 | + * CPU specific implementation to return the GPIO port for a given |
| 835 | + * GPIO pin. |
| 836 | + * |
| 837 | + * @param[in] pin GPIO pin structure, usually defined with the GPIO_PIN macro |
| 838 | + * |
| 839 | + * @return GPIO port |
| 840 | + * |
824 | 841 | */ |
825 | 842 | static inline gpio_port_t gpio_get_port(gpio_t pin); |
826 | 843 |
|
827 | 844 | /** |
828 | 845 | * @brief Extract the pin number from a `gpio_t` |
| 846 | + * |
| 847 | + * CPU specific implementation to return the internal pin number for a |
| 848 | + * given GPIO pin. |
| 849 | + * |
| 850 | + * @note The actual, internal pin numbers are not always directly related to |
| 851 | + * their name. For example on some microcontrollers as the nRF52, |
| 852 | + * the distinction between P0 and P1 pins is made by a bit that is set |
| 853 | + * in the pin numbers. |
| 854 | + * |
| 855 | + * @param[in] pin GPIO pin structure, usually defined with the GPIO_PIN macro |
| 856 | + * |
| 857 | + * @return Internal pin number |
829 | 858 | */ |
830 | 859 | static inline uint8_t gpio_get_pin_num(gpio_t pin); |
831 | 860 |
|
|
0 commit comments