36 palSetPadMode(port, gpios, PAL_MODE_OUTPUT_PUSHPULL);
43 palSetPadMode(port, gpios, PAL_MODE_INPUT);
50 palSetPadMode(port, gpios, PAL_MODE_INPUT_PULLUP);
57 palSetPadMode(port, gpios, PAL_MODE_INPUT_PULLDOWN);
71 #elif defined(STM32F4) || defined(STM32F7)
74 palSetPadMode(port, pin, PAL_MODE_ALTERNATE(af));
77 palSetPadMode(port, pin, PAL_MODE_OUTPUT_PUSHPULL);
79 palSetPadMode(port, pin, PAL_MODE_INPUT);
89 palSetPadMode(port, pin, PAL_MODE_INPUT_ANALOG);
void gpio_setup_pin_af(ioportid_t port, uint16_t pin, uint8_t af, bool is_output)
Setup a gpio for input or output with alternate function.
Some architecture independent helper functions for GPIOs.
void gpio_setup_output(ioportid_t port, uint16_t gpios)
Setup one or more pins of the given GPIO port as outputs.
void gpio_setup_input_pullup(ioportid_t port, uint16_t gpios)
Setup one or more pins of the given GPIO port as inputs with pull up resistor enabled.
void gpio_setup_pin_analog(ioportid_t port, uint16_t pin)
Setup a gpio for analog use.
void gpio_setup_input_pulldown(ioportid_t port, uint16_t gpios)
Setup one or more pins of the given GPIO port as inputs with pull down resistors enabled.
void gpio_setup_input(ioportid_t port, uint16_t gpios)
Setup one or more pins of the given GPIO port as inputs.