diff options
Diffstat (limited to 'app/pins.h')
-rw-r--r-- | app/pins.h | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -1,4 +1,9 @@ +#define MAP_AF_100(a, af) do { \ + gpio_mode_setup( a ## _PORT, GPIO_MODE_AF, GPIO_PUPD_NONE, a ); \ + gpio_set_output_options( a ## _PORT, GPIO_OTYPE_PP, GPIO_OSPEED_100MHZ, a); \ + gpio_set_af( a ## _PORT, af, a); \ + } while (0) #define MAP_AF(a, af) do { \ gpio_mode_setup( a ## _PORT, GPIO_MODE_AF, GPIO_PUPD_NONE, a ); \ @@ -24,10 +29,14 @@ gpio_set_output_options( a ## _PORT, GPIO_OTYPE_PP, GPIO_OSPEED_50MHZ, a); \ } while (0) +#define MAP_OUTPUT_PP_PU(a) do { \ + gpio_mode_setup( a ## _PORT, GPIO_MODE_OUTPUT, GPIO_PUPD_PULLUP, a ); \ + gpio_set_output_options( a ## _PORT, GPIO_OTYPE_PP, GPIO_OSPEED_50MHZ, a); \ + } while (0) #define MAP_OUTPUT_OD(a) do { \ gpio_mode_setup( a ## _PORT, GPIO_MODE_OUTPUT, GPIO_PUPD_PULLUP, a ); \ - gpio_set_output_options( a ## _PORT, GPIO_OTYPE_PP, GPIO_OSPEED_50MHZ, a); \ + gpio_set_output_options( a ## _PORT, GPIO_OTYPE_OD, GPIO_OSPEED_50MHZ, a); \ } while (0) |