no-OS
mbed_uart.h
Go to the documentation of this file.
1 /***************************************************************************/
38 #ifndef MBED_UART_H_
39 #define MBED_UART_H_
40 
41 // Platform support needs to be C-compatible to work with other drivers
42 #ifdef __cplusplus
43 extern "C"
44 {
45 #endif
46 
47 /******************************************************************************/
48 /***************************** Include Files **********************************/
49 /******************************************************************************/
50 #include <stdio.h>
51 #include <stdbool.h>
52 
53 /******************************************************************************/
54 /********************** Variables and User defined data types *****************/
55 /******************************************************************************/
56 
57 /*
58  * Note: The structure members are not strongly typed, as this file is included
59  * in application specific '.c' files. The mbed code structure does not
60  * allow inclusion of mbed driver files (e.g. mbed.h) into '.c' files.
61  * All the members are hence typecasted to mbed specific type during
62  * uart init and read/write operations.
63  **/
64 
70  bool virtual_com_enable; /* To enable the selection between
71  * Virtual COM Port Or standard UART link */
72  uint16_t uart_tx_pin; /* UART Transmit Pin (only for UART comm) */
73  uint16_t uart_rx_pin; /* UART Receive Pin (only for UART comm) */
74  uint16_t vendor_id; /* USB VCOM Vendor ID (only for USB Virtual comm) */
75  uint16_t product_id; /* USB VCOM Product ID (only for USB Virtual comm) */
76  char *serial_number; /* USB VCOM serial number (only for USB Virtual comm) */
77  bool is_console_stdio_port; /* Set the UART/USB port for console stdio operation */
78 };
79 
85  void *uart_port; /* UART port instance */
86  bool virtual_com_enable; /* To enable the selection between Virtual COM Port
87  * Or standard UART link */
88  bool is_console_stdio_port; /* Set the UART/USB port for console stdio operation */
89 };
90 
91 /******************************************************************************/
92 /************************ Functions Declarations ******************************/
93 /******************************************************************************/
94 
95 #ifdef __cplusplus // Closing extern c
96 }
97 #endif
98 
99 #endif /* MBED_UART_H_ */
mbed_uart_init_param::uart_tx_pin
uint16_t uart_tx_pin
Definition: mbed_uart.h:72
mbed_uart_init_param::product_id
uint16_t product_id
Definition: mbed_uart.h:75
mbed_uart_init_param::vendor_id
uint16_t vendor_id
Definition: mbed_uart.h:74
mbed_uart_desc::uart_port
void * uart_port
Definition: mbed_uart.h:85
mbed_uart_desc::is_console_stdio_port
bool is_console_stdio_port
Definition: mbed_uart.h:88
mbed_uart_desc
UART specific descriptor for the mbed platform.
Definition: mbed_uart.h:84
mbed_uart_init_param::is_console_stdio_port
bool is_console_stdio_port
Definition: mbed_uart.h:77
mbed_uart_init_param::serial_number
char * serial_number
Definition: mbed_uart.h:76
mbed_uart_init_param::uart_rx_pin
uint16_t uart_rx_pin
Definition: mbed_uart.h:73
mbed_uart_desc::virtual_com_enable
bool virtual_com_enable
Definition: mbed_uart.h:86
mbed_uart_init_param
Structure holding the UART init parameters for mbed platform.
Definition: mbed_uart.h:69
mbed_uart_init_param::virtual_com_enable
bool virtual_com_enable
Definition: mbed_uart.h:70