mbed library sources

Dependents:   frdm_kl05z_gpio_test

Fork of mbed-src by mbed official

Committer:
mbed_official
Date:
Tue May 27 10:00:08 2014 +0100
Revision:
216:577900467c9e
Parent:
166:cb4253f91ada
Child:
227:7bd0639b8911
Synchronized with git revision 1cdfe81b13a631cf282176dd176df20a6ebbc297

Full URL: https://github.com/mbedmicro/mbed/commit/1cdfe81b13a631cf282176dd176df20a6ebbc297/

[NUCLEO_xxx] Update xxx_free() functions + typo

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 76:aeb1df146756 1 /* mbed Microcontroller Library
mbed_official 76:aeb1df146756 2 *******************************************************************************
mbed_official 76:aeb1df146756 3 * Copyright (c) 2014, STMicroelectronics
mbed_official 76:aeb1df146756 4 * All rights reserved.
mbed_official 76:aeb1df146756 5 *
mbed_official 76:aeb1df146756 6 * Redistribution and use in source and binary forms, with or without
mbed_official 76:aeb1df146756 7 * modification, are permitted provided that the following conditions are met:
mbed_official 76:aeb1df146756 8 *
mbed_official 76:aeb1df146756 9 * 1. Redistributions of source code must retain the above copyright notice,
mbed_official 76:aeb1df146756 10 * this list of conditions and the following disclaimer.
mbed_official 76:aeb1df146756 11 * 2. Redistributions in binary form must reproduce the above copyright notice,
mbed_official 76:aeb1df146756 12 * this list of conditions and the following disclaimer in the documentation
mbed_official 76:aeb1df146756 13 * and/or other materials provided with the distribution.
mbed_official 76:aeb1df146756 14 * 3. Neither the name of STMicroelectronics nor the names of its contributors
mbed_official 76:aeb1df146756 15 * may be used to endorse or promote products derived from this software
mbed_official 76:aeb1df146756 16 * without specific prior written permission.
mbed_official 76:aeb1df146756 17 *
mbed_official 76:aeb1df146756 18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
mbed_official 76:aeb1df146756 19 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
mbed_official 76:aeb1df146756 20 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
mbed_official 76:aeb1df146756 21 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
mbed_official 76:aeb1df146756 22 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
mbed_official 76:aeb1df146756 23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
mbed_official 76:aeb1df146756 24 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
mbed_official 76:aeb1df146756 25 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
mbed_official 76:aeb1df146756 26 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
mbed_official 76:aeb1df146756 27 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
mbed_official 76:aeb1df146756 28 *******************************************************************************
mbed_official 76:aeb1df146756 29 */
mbed_official 76:aeb1df146756 30 #include "serial_api.h"
mbed_official 166:cb4253f91ada 31
mbed_official 166:cb4253f91ada 32 #if DEVICE_SERIAL
mbed_official 166:cb4253f91ada 33
mbed_official 76:aeb1df146756 34 #include "cmsis.h"
mbed_official 76:aeb1df146756 35 #include "pinmap.h"
mbed_official 76:aeb1df146756 36 #include "error.h"
mbed_official 76:aeb1df146756 37 #include <string.h>
mbed_official 76:aeb1df146756 38
mbed_official 76:aeb1df146756 39 static const PinMap PinMap_UART_TX[] = {
mbed_official 164:90c6009cba07 40 {PA_2, UART_2, STM_PIN_DATA(GPIO_Mode_AF, GPIO_OType_PP, GPIO_PuPd_UP, GPIO_AF_1)},
mbed_official 76:aeb1df146756 41 {PA_9, UART_1, STM_PIN_DATA(GPIO_Mode_AF, GPIO_OType_PP, GPIO_PuPd_UP, GPIO_AF_1)},
mbed_official 164:90c6009cba07 42 {PB_6, UART_1, STM_PIN_DATA(GPIO_Mode_AF, GPIO_OType_PP, GPIO_PuPd_UP, GPIO_AF_0)},
mbed_official 76:aeb1df146756 43 {NC, NC, 0}
mbed_official 76:aeb1df146756 44 };
mbed_official 76:aeb1df146756 45
mbed_official 76:aeb1df146756 46 static const PinMap PinMap_UART_RX[] = {
mbed_official 216:577900467c9e 47 {PA_3, UART_2, STM_PIN_DATA(GPIO_Mode_AF, GPIO_OType_PP, GPIO_PuPd_UP, GPIO_AF_1)},
mbed_official 76:aeb1df146756 48 {PA_10, UART_1, STM_PIN_DATA(GPIO_Mode_AF, GPIO_OType_PP, GPIO_PuPd_UP, GPIO_AF_1)},
mbed_official 164:90c6009cba07 49 {PA_15, UART_2, STM_PIN_DATA(GPIO_Mode_AF, GPIO_OType_PP, GPIO_PuPd_UP, GPIO_AF_1)},
mbed_official 164:90c6009cba07 50 {PB_7, UART_1, STM_PIN_DATA(GPIO_Mode_AF, GPIO_OType_PP, GPIO_PuPd_UP, GPIO_AF_0)},
mbed_official 76:aeb1df146756 51 {NC, NC, 0}
mbed_official 76:aeb1df146756 52 };
mbed_official 76:aeb1df146756 53
mbed_official 76:aeb1df146756 54 #define UART_NUM (2)
mbed_official 76:aeb1df146756 55
mbed_official 76:aeb1df146756 56 static uint32_t serial_irq_ids[UART_NUM] = {0};
mbed_official 76:aeb1df146756 57
mbed_official 76:aeb1df146756 58 static uart_irq_handler irq_handler;
mbed_official 76:aeb1df146756 59
mbed_official 76:aeb1df146756 60 int stdio_uart_inited = 0;
mbed_official 76:aeb1df146756 61 serial_t stdio_uart;
mbed_official 76:aeb1df146756 62
mbed_official 76:aeb1df146756 63 static void init_usart(serial_t *obj) {
mbed_official 76:aeb1df146756 64 USART_TypeDef *usart = (USART_TypeDef *)(obj->uart);
mbed_official 76:aeb1df146756 65 USART_InitTypeDef USART_InitStructure;
mbed_official 216:577900467c9e 66
mbed_official 76:aeb1df146756 67 USART_Cmd(usart, DISABLE);
mbed_official 76:aeb1df146756 68
mbed_official 76:aeb1df146756 69 USART_InitStructure.USART_BaudRate = obj->baudrate;
mbed_official 76:aeb1df146756 70 USART_InitStructure.USART_WordLength = obj->databits;
mbed_official 76:aeb1df146756 71 USART_InitStructure.USART_StopBits = obj->stopbits;
mbed_official 76:aeb1df146756 72 USART_InitStructure.USART_Parity = obj->parity;
mbed_official 76:aeb1df146756 73 USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None;
mbed_official 76:aeb1df146756 74 USART_InitStructure.USART_Mode = USART_Mode_Rx | USART_Mode_Tx;
mbed_official 76:aeb1df146756 75 USART_Init(usart, &USART_InitStructure);
mbed_official 216:577900467c9e 76
mbed_official 76:aeb1df146756 77 USART_Cmd(usart, ENABLE);
mbed_official 76:aeb1df146756 78 }
mbed_official 76:aeb1df146756 79
mbed_official 216:577900467c9e 80 void serial_init(serial_t *obj, PinName tx, PinName rx) {
mbed_official 76:aeb1df146756 81 // Determine the UART to use (UART_1, UART_2, ...)
mbed_official 76:aeb1df146756 82 UARTName uart_tx = (UARTName)pinmap_peripheral(tx, PinMap_UART_TX);
mbed_official 76:aeb1df146756 83 UARTName uart_rx = (UARTName)pinmap_peripheral(rx, PinMap_UART_RX);
mbed_official 216:577900467c9e 84
mbed_official 76:aeb1df146756 85 // Get the peripheral name (UART_1, UART_2, ...) from the pin and assign it to the object
mbed_official 76:aeb1df146756 86 obj->uart = (UARTName)pinmap_merge(uart_tx, uart_rx);
mbed_official 76:aeb1df146756 87
mbed_official 76:aeb1df146756 88 if (obj->uart == (UARTName)NC) {
mbed_official 76:aeb1df146756 89 error("Serial pinout mapping failed");
mbed_official 76:aeb1df146756 90 }
mbed_official 76:aeb1df146756 91
mbed_official 76:aeb1df146756 92 // Enable USART clock
mbed_official 76:aeb1df146756 93 if (obj->uart == UART_1) {
mbed_official 216:577900467c9e 94 RCC_APB2PeriphClockCmd(RCC_APB2Periph_USART1, ENABLE);
mbed_official 216:577900467c9e 95 obj->index = 0;
mbed_official 76:aeb1df146756 96 }
mbed_official 76:aeb1df146756 97 if (obj->uart == UART_2) {
mbed_official 216:577900467c9e 98 RCC_APB1PeriphClockCmd(RCC_APB1Periph_USART2, ENABLE);
mbed_official 216:577900467c9e 99 obj->index = 1;
mbed_official 76:aeb1df146756 100 }
mbed_official 216:577900467c9e 101
mbed_official 76:aeb1df146756 102 // Configure the UART pins
mbed_official 76:aeb1df146756 103 pinmap_pinout(tx, PinMap_UART_TX);
mbed_official 76:aeb1df146756 104 pinmap_pinout(rx, PinMap_UART_RX);
mbed_official 76:aeb1df146756 105 pin_mode(tx, PullUp);
mbed_official 76:aeb1df146756 106 pin_mode(rx, PullUp);
mbed_official 77:b5886236e6f0 107
mbed_official 76:aeb1df146756 108 // Configure UART
mbed_official 76:aeb1df146756 109 obj->baudrate = 9600;
mbed_official 76:aeb1df146756 110 obj->databits = USART_WordLength_8b;
mbed_official 76:aeb1df146756 111 obj->stopbits = USART_StopBits_1;
mbed_official 216:577900467c9e 112 obj->parity = USART_Parity_No;
mbed_official 216:577900467c9e 113
mbed_official 216:577900467c9e 114 obj->pin_tx = tx;
mbed_official 216:577900467c9e 115 obj->pin_rx = rx;
mbed_official 76:aeb1df146756 116
mbed_official 76:aeb1df146756 117 init_usart(obj);
mbed_official 76:aeb1df146756 118
mbed_official 76:aeb1df146756 119 // For stdio management
mbed_official 76:aeb1df146756 120 if (obj->uart == STDIO_UART) {
mbed_official 76:aeb1df146756 121 stdio_uart_inited = 1;
mbed_official 76:aeb1df146756 122 memcpy(&stdio_uart, obj, sizeof(serial_t));
mbed_official 76:aeb1df146756 123 }
mbed_official 216:577900467c9e 124
mbed_official 76:aeb1df146756 125 }
mbed_official 76:aeb1df146756 126
mbed_official 76:aeb1df146756 127 void serial_free(serial_t *obj) {
mbed_official 216:577900467c9e 128 // Reset UART and disable clock
mbed_official 216:577900467c9e 129 if (obj->uart == UART_1) {
mbed_official 216:577900467c9e 130 RCC_APB2PeriphResetCmd(RCC_APB2Periph_USART1, ENABLE);
mbed_official 216:577900467c9e 131 RCC_APB2PeriphResetCmd(RCC_APB2Periph_USART1, DISABLE);
mbed_official 216:577900467c9e 132 RCC_APB2PeriphClockCmd(RCC_APB2Periph_USART1, DISABLE);
mbed_official 216:577900467c9e 133 }
mbed_official 216:577900467c9e 134 if (obj->uart == UART_2) {
mbed_official 216:577900467c9e 135 RCC_APB1PeriphResetCmd(RCC_APB1Periph_USART2, ENABLE);
mbed_official 216:577900467c9e 136 RCC_APB1PeriphResetCmd(RCC_APB1Periph_USART2, DISABLE);
mbed_official 216:577900467c9e 137 RCC_APB1PeriphClockCmd(RCC_APB1Periph_USART2, DISABLE);
mbed_official 216:577900467c9e 138 }
mbed_official 216:577900467c9e 139
mbed_official 216:577900467c9e 140 // Configure GPIOs
mbed_official 216:577900467c9e 141 pin_function(obj->pin_tx, STM_PIN_DATA(GPIO_Mode_IN, 0, GPIO_PuPd_NOPULL, 0xFF));
mbed_official 216:577900467c9e 142 pin_function(obj->pin_rx, STM_PIN_DATA(GPIO_Mode_IN, 0, GPIO_PuPd_NOPULL, 0xFF));
mbed_official 216:577900467c9e 143
mbed_official 76:aeb1df146756 144 serial_irq_ids[obj->index] = 0;
mbed_official 76:aeb1df146756 145 }
mbed_official 76:aeb1df146756 146
mbed_official 76:aeb1df146756 147 void serial_baud(serial_t *obj, int baudrate) {
mbed_official 76:aeb1df146756 148 obj->baudrate = baudrate;
mbed_official 76:aeb1df146756 149 init_usart(obj);
mbed_official 76:aeb1df146756 150 }
mbed_official 76:aeb1df146756 151
mbed_official 76:aeb1df146756 152 void serial_format(serial_t *obj, int data_bits, SerialParity parity, int stop_bits) {
mbed_official 76:aeb1df146756 153 if (data_bits == 8) {
mbed_official 76:aeb1df146756 154 obj->databits = USART_WordLength_8b;
mbed_official 216:577900467c9e 155 } else {
mbed_official 76:aeb1df146756 156 obj->databits = USART_WordLength_9b;
mbed_official 76:aeb1df146756 157 }
mbed_official 76:aeb1df146756 158
mbed_official 76:aeb1df146756 159 switch (parity) {
mbed_official 216:577900467c9e 160 case ParityOdd:
mbed_official 216:577900467c9e 161 case ParityForced0:
mbed_official 216:577900467c9e 162 obj->parity = USART_Parity_Odd;
mbed_official 216:577900467c9e 163 break;
mbed_official 216:577900467c9e 164 case ParityEven:
mbed_official 216:577900467c9e 165 case ParityForced1:
mbed_official 216:577900467c9e 166 obj->parity = USART_Parity_Even;
mbed_official 216:577900467c9e 167 break;
mbed_official 216:577900467c9e 168 default: // ParityNone
mbed_official 216:577900467c9e 169 obj->parity = USART_Parity_No;
mbed_official 216:577900467c9e 170 break;
mbed_official 76:aeb1df146756 171 }
mbed_official 216:577900467c9e 172
mbed_official 76:aeb1df146756 173 if (stop_bits == 2) {
mbed_official 76:aeb1df146756 174 obj->stopbits = USART_StopBits_2;
mbed_official 216:577900467c9e 175 } else {
mbed_official 76:aeb1df146756 176 obj->stopbits = USART_StopBits_1;
mbed_official 76:aeb1df146756 177 }
mbed_official 76:aeb1df146756 178
mbed_official 76:aeb1df146756 179 init_usart(obj);
mbed_official 76:aeb1df146756 180 }
mbed_official 76:aeb1df146756 181
mbed_official 76:aeb1df146756 182 /******************************************************************************
mbed_official 76:aeb1df146756 183 * INTERRUPTS HANDLING
mbed_official 76:aeb1df146756 184 ******************************************************************************/
mbed_official 76:aeb1df146756 185
mbed_official 76:aeb1df146756 186 // not api
mbed_official 76:aeb1df146756 187 static void uart_irq(USART_TypeDef* usart, int id) {
mbed_official 76:aeb1df146756 188 if (serial_irq_ids[id] != 0) {
mbed_official 76:aeb1df146756 189 if (USART_GetITStatus(usart, USART_IT_TC) != RESET) {
mbed_official 76:aeb1df146756 190 irq_handler(serial_irq_ids[id], TxIrq);
mbed_official 76:aeb1df146756 191 USART_ClearITPendingBit(usart, USART_IT_TC);
mbed_official 76:aeb1df146756 192 }
mbed_official 76:aeb1df146756 193 if (USART_GetITStatus(usart, USART_IT_RXNE) != RESET) {
mbed_official 76:aeb1df146756 194 irq_handler(serial_irq_ids[id], RxIrq);
mbed_official 76:aeb1df146756 195 USART_ClearITPendingBit(usart, USART_IT_RXNE);
mbed_official 76:aeb1df146756 196 }
mbed_official 76:aeb1df146756 197 }
mbed_official 76:aeb1df146756 198 }
mbed_official 76:aeb1df146756 199
mbed_official 216:577900467c9e 200 static void uart1_irq(void) {
mbed_official 216:577900467c9e 201 uart_irq((USART_TypeDef*)UART_1, 0);
mbed_official 216:577900467c9e 202 }
mbed_official 216:577900467c9e 203 static void uart2_irq(void) {
mbed_official 216:577900467c9e 204 uart_irq((USART_TypeDef*)UART_2, 1);
mbed_official 216:577900467c9e 205 }
mbed_official 76:aeb1df146756 206
mbed_official 76:aeb1df146756 207 void serial_irq_handler(serial_t *obj, uart_irq_handler handler, uint32_t id) {
mbed_official 76:aeb1df146756 208 irq_handler = handler;
mbed_official 76:aeb1df146756 209 serial_irq_ids[obj->index] = id;
mbed_official 76:aeb1df146756 210 }
mbed_official 76:aeb1df146756 211
mbed_official 76:aeb1df146756 212 void serial_irq_set(serial_t *obj, SerialIrq irq, uint32_t enable) {
mbed_official 76:aeb1df146756 213 IRQn_Type irq_n = (IRQn_Type)0;
mbed_official 76:aeb1df146756 214 uint32_t vector = 0;
mbed_official 76:aeb1df146756 215 USART_TypeDef *usart = (USART_TypeDef *)(obj->uart);
mbed_official 76:aeb1df146756 216
mbed_official 76:aeb1df146756 217 if (obj->uart == UART_1) {
mbed_official 216:577900467c9e 218 irq_n = USART1_IRQn;
mbed_official 216:577900467c9e 219 vector = (uint32_t)&uart1_irq;
mbed_official 76:aeb1df146756 220 }
mbed_official 216:577900467c9e 221
mbed_official 76:aeb1df146756 222 if (obj->uart == UART_2) {
mbed_official 216:577900467c9e 223 irq_n = USART2_IRQn;
mbed_official 216:577900467c9e 224 vector = (uint32_t)&uart2_irq;
mbed_official 76:aeb1df146756 225 }
mbed_official 216:577900467c9e 226
mbed_official 76:aeb1df146756 227 if (enable) {
mbed_official 216:577900467c9e 228
mbed_official 76:aeb1df146756 229 if (irq == RxIrq) {
mbed_official 76:aeb1df146756 230 USART_ITConfig(usart, USART_IT_RXNE, ENABLE);
mbed_official 216:577900467c9e 231 } else { // TxIrq
mbed_official 76:aeb1df146756 232 USART_ITConfig(usart, USART_IT_TC, ENABLE);
mbed_official 216:577900467c9e 233 }
mbed_official 216:577900467c9e 234
mbed_official 76:aeb1df146756 235 NVIC_SetVector(irq_n, vector);
mbed_official 76:aeb1df146756 236 NVIC_EnableIRQ(irq_n);
mbed_official 216:577900467c9e 237
mbed_official 76:aeb1df146756 238 } else { // disable
mbed_official 216:577900467c9e 239
mbed_official 76:aeb1df146756 240 int all_disabled = 0;
mbed_official 216:577900467c9e 241
mbed_official 76:aeb1df146756 242 if (irq == RxIrq) {
mbed_official 76:aeb1df146756 243 USART_ITConfig(usart, USART_IT_RXNE, DISABLE);
mbed_official 76:aeb1df146756 244 // Check if TxIrq is disabled too
mbed_official 76:aeb1df146756 245 if ((usart->CR1 & USART_CR1_TXEIE) == 0) all_disabled = 1;
mbed_official 216:577900467c9e 246 } else { // TxIrq
mbed_official 76:aeb1df146756 247 USART_ITConfig(usart, USART_IT_TXE, DISABLE);
mbed_official 76:aeb1df146756 248 // Check if RxIrq is disabled too
mbed_official 216:577900467c9e 249 if ((usart->CR1 & USART_CR1_RXNEIE) == 0) all_disabled = 1;
mbed_official 76:aeb1df146756 250 }
mbed_official 216:577900467c9e 251
mbed_official 76:aeb1df146756 252 if (all_disabled) NVIC_DisableIRQ(irq_n);
mbed_official 216:577900467c9e 253
mbed_official 216:577900467c9e 254 }
mbed_official 76:aeb1df146756 255 }
mbed_official 76:aeb1df146756 256
mbed_official 76:aeb1df146756 257 /******************************************************************************
mbed_official 76:aeb1df146756 258 * READ/WRITE
mbed_official 76:aeb1df146756 259 ******************************************************************************/
mbed_official 76:aeb1df146756 260
mbed_official 76:aeb1df146756 261 int serial_getc(serial_t *obj) {
mbed_official 76:aeb1df146756 262 USART_TypeDef *usart = (USART_TypeDef *)(obj->uart);
mbed_official 76:aeb1df146756 263 while (!serial_readable(obj));
mbed_official 76:aeb1df146756 264 return (int)(USART_ReceiveData(usart));
mbed_official 76:aeb1df146756 265 }
mbed_official 76:aeb1df146756 266
mbed_official 76:aeb1df146756 267 void serial_putc(serial_t *obj, int c) {
mbed_official 76:aeb1df146756 268 USART_TypeDef *usart = (USART_TypeDef *)(obj->uart);
mbed_official 76:aeb1df146756 269 while (!serial_writable(obj));
mbed_official 76:aeb1df146756 270 USART_SendData(usart, (uint16_t)c);
mbed_official 76:aeb1df146756 271 }
mbed_official 76:aeb1df146756 272
mbed_official 76:aeb1df146756 273 int serial_readable(serial_t *obj) {
mbed_official 76:aeb1df146756 274 int status;
mbed_official 76:aeb1df146756 275 USART_TypeDef *usart = (USART_TypeDef *)(obj->uart);
mbed_official 76:aeb1df146756 276 // Check if data is received
mbed_official 76:aeb1df146756 277 status = ((USART_GetFlagStatus(usart, USART_FLAG_RXNE) != RESET) ? 1 : 0);
mbed_official 76:aeb1df146756 278 return status;
mbed_official 76:aeb1df146756 279 }
mbed_official 76:aeb1df146756 280
mbed_official 76:aeb1df146756 281 int serial_writable(serial_t *obj) {
mbed_official 76:aeb1df146756 282 int status;
mbed_official 76:aeb1df146756 283 USART_TypeDef *usart = (USART_TypeDef *)(obj->uart);
mbed_official 76:aeb1df146756 284 // Check if data is transmitted
mbed_official 76:aeb1df146756 285 status = ((USART_GetFlagStatus(usart, USART_FLAG_TXE) != RESET) ? 1 : 0);
mbed_official 76:aeb1df146756 286 return status;
mbed_official 76:aeb1df146756 287 }
mbed_official 76:aeb1df146756 288
mbed_official 76:aeb1df146756 289 void serial_clear(serial_t *obj) {
mbed_official 76:aeb1df146756 290 USART_TypeDef *usart = (USART_TypeDef *)(obj->uart);
mbed_official 76:aeb1df146756 291 USART_ClearFlag(usart, USART_FLAG_TXE);
mbed_official 76:aeb1df146756 292 USART_ClearFlag(usart, USART_FLAG_RXNE);
mbed_official 76:aeb1df146756 293 }
mbed_official 76:aeb1df146756 294
mbed_official 76:aeb1df146756 295 void serial_pinout_tx(PinName tx) {
mbed_official 76:aeb1df146756 296 pinmap_pinout(tx, PinMap_UART_TX);
mbed_official 76:aeb1df146756 297 }
mbed_official 76:aeb1df146756 298
mbed_official 76:aeb1df146756 299 void serial_break_set(serial_t *obj) {
mbed_official 76:aeb1df146756 300 }
mbed_official 76:aeb1df146756 301
mbed_official 76:aeb1df146756 302 void serial_break_clear(serial_t *obj) {
mbed_official 76:aeb1df146756 303 }
mbed_official 166:cb4253f91ada 304
mbed_official 166:cb4253f91ada 305 #endif