21 #ifndef ARCH_USART_HPP_INCLUDED 22 #define ARCH_USART_HPP_INCLUDED 25 #include "../../../common/usart.hpp" 31 template<
typename gpio_type,
unsigned gpio_alt_func_num >
32 struct usart_gpio_rx_resources {
34 typename gpio_type::resources,
35 typename gpio_type::resistor::floating,
36 typename gpio_type::mode::alternate_function,
37 typename gpio_type::template alt_func_num< gpio_alt_func_num >
40 template<
unsigned gpio_alt_func_num >
41 struct usart_gpio_rx_resources< void, gpio_alt_func_num > {
45 template<
typename gpio_type, freq_t gpio_speed,
unsigned gpio_alt_func_num >
46 struct usart_gpio_tx_resources {
48 typename gpio_type::resources,
49 typename gpio_type::output_type::push_pull,
50 typename gpio_type::resistor::floating,
51 typename gpio_type::template speed< gpio_speed >,
52 typename gpio_type::mode::alternate_function,
53 typename gpio_type::template alt_func_num< gpio_alt_func_num >
56 template< freq_t gpio_speed,
unsigned gpio_alt_func_num >
57 struct usart_gpio_tx_resources< void, gpio_speed, gpio_alt_func_num > {
65 typename system_clock_type,
66 typename gpio_rx_type,
67 typename gpio_tx_type,
74 static constexpr
unsigned gpio_alt_func_num = (usart_no <= 3) ? 7 : 8;
80 typename mpl::usart_gpio_rx_resources< gpio_rx_type, gpio_alt_func_num >::type,
81 typename mpl::usart_gpio_tx_resources< gpio_tx_type, gpio_tx_speed, gpio_alt_func_num >::type
88 #endif // ARCH_USART_HPP_INCLUDED typelist< typename base_type::resources, typename mpl::usart_gpio_rx_resources< gpio_rx_type, gpio_alt_func_num >::type, typename mpl::usart_gpio_tx_resources< gpio_tx_type, gpio_tx_speed, gpio_alt_func_num >::type > resources
Definition: usart.hpp:82
typename mpl::make_typelist< sane_typelist<>, Tp... >::type typelist
static constexpr freq_t mhz(unsigned long long x)