libmaple/stm32f2-f4/usart.c
gpio_af usart_get_af(usart_dev *dev) {
    switch (dev->clk_id) {
    case RCC_USART1:
    case RCC_USART2:
    case RCC_USART3:
        return GPIO_AF_USART_1_2_3;
    case RCC_UART4:
    case RCC_UART5:
    case RCC_USART6:
        return GPIO_AF_USART_4_5_6;
    default:
        ASSERT(0);              /* Can't happen */
        return (gpio_af)-1;
    }
}
/**
 * @brief Get GPIO alternate function mode for a USART.
 * @param dev USART whose gpio_af to get.
 * @return gpio_af corresponding to dev.
 */
@brief Get GPIO alternate function mode for a USART.
@param dev USART whose gpio_af to get.
@return gpio_af corresponding to dev.
@brief Get GPIO alternate function mode for a USART . @param dev USART whose gpio_af to get . @return gpio_af corresponding to dev .
gpio_af usart_get_af(usart_dev *dev) {
    switch (dev->clk_id) {
    case RCC_USART1:
    case RCC_USART2:
    case RCC_USART3:
        return GPIO_AF_USART_1_2_3;
    case RCC_UART4:
    case RCC_UART5:
    case RCC_USART6:
        return GPIO_AF_USART_4_5_6;
    default:
        ASSERT(0);              
        return (gpio_af)-1;
    }
}
gpio_af usart_get_af ( usart_dev * dev ) { switch ( dev -> clk_id ) { case RCC_USART1 : case RCC_USART2 : case RCC_USART3 : return GPIO_AF_USART_1_2_3 ; case RCC_UART4 : case RCC_UART5 : case RCC_USART6 : return GPIO_AF_USART_4_5_6 ; default : ASSERT ( 0 ) ; return ( gpio_af ) - 1 ; } }
@brief Get GPIO alternate function mode for a USART.
@brief Get GPIO alternate function mode for a USART .
/* Can't happen */