Fix serial compilation issues

This commit is contained in:
Alan Carvalho de Assis 2017-04-14 11:42:20 -06:00 committed by Gregory Nutt
parent 879273f63e
commit 4602212612
3 changed files with 65 additions and 38 deletions

View File

@ -0,0 +1,53 @@
/************************************************************************************
* arch/arm/src/stm32f0/chip/stm32f0_pinmap.h
*
* Copyright (C) 2015 Sebastien Lorquet. All rights reserved.
* Author: Sebastien Lorquet <sebastien@lorquet.fr>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
************************************************************************************/
#ifndef __ARCH_ARM_SRC_STM32F0_CHIP_STM32F0_PINMAP_H
#define __ARCH_ARM_SRC_STM32F0_CHIP_STM32F0_PINMAP_H
/************************************************************************************
* Included Files
************************************************************************************/
#include <nuttx/config.h>
#include "chip.h"
#if defined(CONFIG_STM32F0_STM32F05X)
# include "chip/stm32f05xr_pinmap.h"
#else
# error "Unsupported STM32F0 pin map"
#endif
#endif /* __ARCH_ARM_SRC_STM32F0_CHIP_STM32F0_PINMAP_H */

View File

@ -59,14 +59,21 @@
#endif
#include <arch/serial.h>
#include <arch/board/board.h>
#include "chip.h"
#include "stm32f0_uart.h"
//#include "stm32f0_dma.h"
#include "stm32f0_rcc.h"
#include "up_arch.h"
#include "up_internal.h"
#include "chip.h"
#include "stm32f0_gpio.h"
#include "stm32f0_uart.h"
#include "stm32f0_rcc.h"
#include "chip/stm32f0_pinmap.h"
/* board.h should be included last. It may depend on defintions from
* previous header files and it may, in certain cases, override definitions
* provided in previous header files.
*/
#include <arch/board/board.h>
/****************************************************************************
* Pre-processor Definitions

View File

@ -237,38 +237,5 @@
#define BUTTON_USER_BIT (1 << BUTTON_USER)
/* Alternate Pin Functions **********************************************************/
/* The STM32L-Discovery has no on-board RS-232 driver. Further, there are no USART
* pins that do not conflict with the on board resources, in particular, the LCD:
* Most USART pins are available if the LCD is enabled; USART2 may be used if either
* the LCD or the on-board LEDs are disabled.
*
* PA9 USART1_TX LCD glass COM1 P2, pin 22
* PA10 USART1_RX LCD glass COM2 P2, pin 21
* PB6 USART1_TX LED Blue P2, pin 8
* PB7 USART1_RX LED Green P2, pin 7
*
* PA2 USART2_TX LCD SEG1 P1, pin 17
* PA3 USART2_RX LCD SEG2 P1, pin 18
*
* PB10 USART3_TX LCD SEG6 P1, pin 22
* PB11 USART3_RX LCD SEG7 P1, pin 23
* PC10 USART3_TX LCD SEG22 P2, pin 15
* PC11 USART3_RX LCD SEG23 P2, pin 14
*/
/* Select PA9 and PA10 if the LCD is not enabled */
//#define GPIO_USART1_RX GPIO_USART1_RX_1 /* PA10 */
//#define GPIO_USART1_TX GPIO_USART1_TX_1 /* PA9 */
/* This there are no other options for USART1 on this part */
#define GPIO_USART2_RX GPIO_USART2_RX_1 /* PA3 */
#define GPIO_USART2_TX GPIO_USART2_TX_1 /* PA2 */
/* Arbirtrarily select PB10 and PB11 */
#define GPIO_USART3_RX GPIO_USART3_RX_1 /* PB11 */
#define GPIO_USART3_TX GPIO_USART3_TX_1 /* PB10 */
#endif /* __CONFIG_STM32F0DISCOVERY_INCLUDE_BOARD_H */