1 /***************************************************************************//**
\r
3 * @brief Provide stdio retargeting configuration parameters.
\r
5 *******************************************************************************
\r
7 * <b>(C) Copyright 2014 Silicon Labs, http://www.silabs.com</b>
\r
8 *******************************************************************************
\r
10 * This file is licensed under the Silabs License Agreement. See the file
\r
11 * "Silabs_License_Agreement.txt" for details. Before using this software for
\r
12 * any purpose, you must agree to the terms of that agreement.
\r
14 ******************************************************************************/
\r
16 #ifndef __SILICON_LABS_RETARGETSERIALCONFIG_H__
\r
17 #define __SILICON_LABS_RETARGETSERIALCONFIG_H__
\r
21 /***************************************************************************//**
\r
23 * When retargeting serial output the user can choose which peripheral
\r
24 * to use as the serial output device. This choice is made by configuring
\r
25 * one or more of the following defines: RETARGET_USART0, RETARGET_LEUART0,
\r
28 * This table shows the supported configurations and the resulting serial
\r
31 * +----------------------------------------------------------------------+
\r
32 * | Defines | Serial Output (Locations) |
\r
33 * |----------------------------------------------------------------------+
\r
34 * | None | USART0 (Rx #0, Tx #0) |
\r
35 * | RETARGET_USART0 | USART0 (Rx #0, Tx #0) |
\r
36 * | RETARGET_VCOM | VCOM using USART0 |
\r
37 * | RETARGET_LEUART0 | LEUART0 (Rx #0, Tx #0) |
\r
38 * | RETARGET_LEUART0 and RETARGET_VCOM | VCOM using LEUART0 |
\r
39 * +----------------------------------------------------------------------+
\r
41 * Note that the default configuration is the same as RETARGET_USART0.
\r
43 ******************************************************************************/
\r
45 #if !defined(RETARGET_USART0) && \
\r
46 !defined(RETARGET_LEUART0)
\r
47 #define RETARGET_USART0 /* Use USART0 by default. */
\r
50 #if defined(RETARGET_USART0)
\r
51 #define RETARGET_IRQ_NAME USART0_RX_IRQHandler /* UART IRQ Handler */
\r
52 #define RETARGET_CLK cmuClock_USART0 /* HFPER Clock */
\r
53 #define RETARGET_IRQn USART0_RX_IRQn /* IRQ number */
\r
54 #define RETARGET_UART USART0 /* UART instance */
\r
55 #define RETARGET_TX USART_Tx /* Set TX to USART_Tx */
\r
56 #define RETARGET_RX USART_Rx /* Set RX to USART_Rx */
\r
57 #define RETARGET_TX_LOCATION _USART_ROUTELOC0_TXLOC_LOC0 /* Location of of USART TX pin */
\r
58 #define RETARGET_RX_LOCATION _USART_ROUTELOC0_RXLOC_LOC0 /* Location of of USART RX pin */
\r
59 #define RETARGET_TXPORT gpioPortA /* UART transmission port */
\r
60 #define RETARGET_TXPIN 0 /* UART transmission pin */
\r
61 #define RETARGET_RXPORT gpioPortA /* UART reception port */
\r
62 #define RETARGET_RXPIN 1 /* UART reception pin */
\r
63 #define RETARGET_USART 1 /* Includes em_usart.h */
\r
65 #elif defined(RETARGET_LEUART0)
\r
66 #define RETARGET_IRQ_NAME LEUART0_IRQHandler /* LEUART IRQ Handler */
\r
67 #define RETARGET_CLK cmuClock_LEUART0 /* HFPER Clock */
\r
68 #define RETARGET_IRQn LEUART0_IRQn /* IRQ number */
\r
69 #define RETARGET_UART LEUART0 /* LEUART instance */
\r
70 #define RETARGET_TX LEUART_Tx /* Set TX to LEUART_Tx */
\r
71 #define RETARGET_RX LEUART_Rx /* Set RX to LEUART_Rx */
\r
72 #define RETARGET_TX_LOCATION _LEUART_ROUTELOC0_TXLOC_LOC0 /* Location of of LEUART TX pin */
\r
73 #define RETARGET_RX_LOCATION _LEUART_ROUTELOC0_RXLOC_LOC0 /* Location of of LEUART RX pin */
\r
74 #define RETARGET_TXPORT gpioPortA /* LEUART transmission port */
\r
75 #define RETARGET_TXPIN 0 /* LEUART transmission pin */
\r
76 #define RETARGET_RXPORT gpioPortA /* LEUART reception port */
\r
77 #define RETARGET_RXPIN 1 /* LEUART reception pin */
\r
78 #define RETARGET_LEUART 1 /* Includes em_leuart.h */
\r
81 #error "Illegal USART selection."
\r
84 #if defined(RETARGET_VCOM)
\r
85 #define RETARGET_PERIPHERAL_ENABLE() \
\r
86 GPIO_PinModeSet(BSP_BCC_ENABLE_PORT, \
\r
87 BSP_BCC_ENABLE_PIN, \
\r
91 #define RETARGET_PERIPHERAL_ENABLE()
\r