stm32l4: add pinconf for USARTs

Add the pin configuration of the USARTs.

Change-Id: Idf7a18b6eab95c61870ad4850c9eafb1fdcab03d
Signed-off-by: Fabien Parent <fparent@baylibre.com>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
Neil Armstrong 2016-10-04 14:11:50 +02:00 committed by Kumar Gala
commit d4b69847a8

View file

@ -24,10 +24,48 @@
#include <pinmux/stm32/pinmux_stm32.h>
#include <drivers/clock_control/stm32_clock_control.h>
static const stm32_pin_func_t pin_pa9_funcs[] = {
[STM32L4X_PINMUX_FUNC_PA9_USART1_TX - 1] =
STM32L4X_PIN_CONFIG_PUSH_PULL,
};
static const stm32_pin_func_t pin_pa10_funcs[] = {
[STM32L4X_PINMUX_FUNC_PA10_USART1_RX - 1] =
STM32L4X_PIN_CONFIG_BIAS_HIGH_IMPEDANCE,
};
static const stm32_pin_func_t pin_pa2_funcs[] = {
[STM32L4X_PINMUX_FUNC_PA2_USART2_TX - 1] =
STM32L4X_PIN_CONFIG_PUSH_PULL,
};
static const stm32_pin_func_t pin_pa3_funcs[] = {
[STM32L4X_PINMUX_FUNC_PA3_USART2_RX - 1] =
STM32L4X_PIN_CONFIG_BIAS_HIGH_IMPEDANCE,
};
static const stm32_pin_func_t pin_pb10_funcs[] = {
[STM32L4X_PINMUX_FUNC_PB10_USART3_TX - 1] =
STM32L4X_PIN_CONFIG_PUSH_PULL,
};
static const stm32_pin_func_t pin_pb11_funcs[] = {
[STM32L4X_PINMUX_FUNC_PB11_USART3_RX - 1] =
STM32L4X_PIN_CONFIG_BIAS_HIGH_IMPEDANCE,
};
/**
* @brief pin configuration
*/
static const struct stm32_pinmux_conf pins[] = {
STM32_PIN_CONF(STM32_PIN_PA2, pin_pa2_funcs),
STM32_PIN_CONF(STM32_PIN_PA3, pin_pa3_funcs),
STM32_PIN_CONF(STM32_PIN_PA9, pin_pa9_funcs),
STM32_PIN_CONF(STM32_PIN_PA10, pin_pa10_funcs),
STM32_PIN_CONF(STM32_PIN_PB6, pin_pb6_funcs),
STM32_PIN_CONF(STM32_PIN_PB7, pin_pb7_funcs),
STM32_PIN_CONF(STM32_PIN_PB10, pin_pb10_funcs),
STM32_PIN_CONF(STM32_PIN_PB11, pin_pb11_funcs),
};
int stm32_get_pin_config(int pin, int func)