Kenji Arai / mbed-os_TYBLE16

Dependents:   TYBLE16_simple_data_logger TYBLE16_MP3_Air

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers greentea_serial.cpp Source File

greentea_serial.cpp

00001 #include "greentea-client/greentea_serial.h"
00002 
00003 #if DEVICE_SERIAL
00004 
00005 /**
00006  * Macros for setting console flow control.
00007  */
00008 #define CONSOLE_FLOWCONTROL_RTS     1
00009 #define CONSOLE_FLOWCONTROL_CTS     2
00010 #define CONSOLE_FLOWCONTROL_RTSCTS  3
00011 #define mbed_console_concat_(x) CONSOLE_FLOWCONTROL_##x
00012 #define mbed_console_concat(x) mbed_console_concat_(x)
00013 #define CONSOLE_FLOWCONTROL mbed_console_concat(MBED_CONF_TARGET_CONSOLE_UART_FLOW_CONTROL)
00014 
00015 SingletonPtr<GreenteaSerial> greentea_serial;
00016 
00017 GreenteaSerial::GreenteaSerial() : mbed::RawSerial(USBTX, USBRX, MBED_CONF_PLATFORM_STDIO_BAUD_RATE) {
00018 #if   CONSOLE_FLOWCONTROL == CONSOLE_FLOWCONTROL_RTS
00019     set_flow_control(SerialBase::RTS, STDIO_UART_RTS, NC);
00020 #elif CONSOLE_FLOWCONTROL == CONSOLE_FLOWCONTROL_CTS
00021     set_flow_control(SerialBase::CTS, NC, STDIO_UART_CTS);
00022 #elif CONSOLE_FLOWCONTROL == CONSOLE_FLOWCONTROL_RTSCTS
00023     set_flow_control(SerialBase::RTSCTS, STDIO_UART_RTS, STDIO_UART_CTS);
00024 #endif
00025 }
00026 
00027 #endif