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  uint16_t uart_tx_pin; /* UART Transmit Pin (only for UART comm) */
71  uint16_t uart_rx_pin; /* UART Receive Pin (only for UART comm) */
72  uint16_t vendor_id; /* USB VCOM Vendor ID (only for USB Virtual comm) */
73  uint16_t product_id; /* USB VCOM Product ID (only for USB Virtual comm) */
74  char *serial_number; /* USB VCOM serial number (only for USB Virtual comm) */
75  bool is_console_stdio_port; /* Set the UART/USB port for console stdio operation */
76 };
77 
83  void *uart_port; /* UART port instance */
84  bool virtual_com_enable; /* To set port for console stdio operation */
85  bool is_console_stdio_port; /* Set the UART/USB port for console stdio operation */
86 };
87 
91 extern const struct no_os_uart_platform_ops mbed_uart_ops;
92 
97 
98 /******************************************************************************/
99 /************************ Functions Declarations ******************************/
100 /******************************************************************************/
101 
102 #ifdef __cplusplus // Closing extern c
103 }
104 #endif
105 
106 #endif /* MBED_UART_H_ */
no_os_uart_platform_ops
Structure holding UART function pointers that point to the platform specific function.
Definition: no_os_uart.h:161
mbed_uart_init_param::uart_tx_pin
uint16_t uart_tx_pin
Definition: mbed_uart.h:70
mbed_uart_init_param::product_id
uint16_t product_id
Definition: mbed_uart.h:73
mbed_uart_init_param::vendor_id
uint16_t vendor_id
Definition: mbed_uart.h:72
mbed_uart_ops
const struct no_os_uart_platform_ops mbed_uart_ops
Mbed platform specific UART platform ops structure.
mbed_uart_desc::uart_port
void * uart_port
Definition: mbed_uart.h:83
mbed_uart_desc::is_console_stdio_port
bool is_console_stdio_port
Definition: mbed_uart.h:85
mbed_uart_desc
UART specific descriptor for the mbed platform.
Definition: mbed_uart.h:82
mbed_uart_init_param::is_console_stdio_port
bool is_console_stdio_port
Definition: mbed_uart.h:75
mbed_virtual_com_ops
const struct no_os_uart_platform_ops mbed_virtual_com_ops
Mbed platform specific VCOM platform ops structure.
mbed_uart_init_param::serial_number
char * serial_number
Definition: mbed_uart.h:74
mbed_uart_init_param::uart_rx_pin
uint16_t uart_rx_pin
Definition: mbed_uart.h:71
mbed_uart_desc::virtual_com_enable
bool virtual_com_enable
Definition: mbed_uart.h:84
mbed_uart_init_param
Structure holding the UART init parameters for mbed platform.
Definition: mbed_uart.h:69