no-OS
mbed_uart.h
Go to the documentation of this file.
1 /***************************************************************************/
32 #ifndef MBED_UART_H_
33 #define MBED_UART_H_
34 
35 // Platform support needs to be C-compatible to work with other drivers
36 #ifdef __cplusplus
37 extern "C"
38 {
39 #endif
40 
41 /******************************************************************************/
42 /***************************** Include Files **********************************/
43 /******************************************************************************/
44 #include <stdio.h>
45 #include <stdbool.h>
46 
47 /******************************************************************************/
48 /********************** Variables and User defined data types *****************/
49 /******************************************************************************/
50 
51 /*
52  * Note: The structure members are not strongly typed, as this file is included
53  * in application specific '.c' files. The mbed code structure does not
54  * allow inclusion of mbed driver files (e.g. mbed.h) into '.c' files.
55  * All the members are hence typecasted to mbed specific type during
56  * uart init and read/write operations.
57  **/
58 
64  uint16_t uart_tx_pin; /* UART Transmit Pin (only for UART comm) */
65  uint16_t uart_rx_pin; /* UART Receive Pin (only for UART comm) */
66  uint16_t vendor_id; /* USB VCOM Vendor ID (only for USB Virtual comm) */
67  uint16_t product_id; /* USB VCOM Product ID (only for USB Virtual comm) */
68  char *serial_number; /* USB VCOM serial number (only for USB Virtual comm) */
69  bool is_console_stdio_port; /* Set the UART/USB port for console stdio operation */
70 };
71 
77  void *uart_port; /* UART port instance */
78  bool virtual_com_enable; /* To set port for console stdio operation */
79  bool is_console_stdio_port; /* Set the UART/USB port for console stdio operation */
80 };
81 
85 extern const struct no_os_uart_platform_ops mbed_uart_ops;
86 
91 
92 /******************************************************************************/
93 /************************ Functions Declarations ******************************/
94 /******************************************************************************/
95 
96 #ifdef __cplusplus // Closing extern c
97 }
98 #endif
99 
100 #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:155
mbed_uart_init_param::uart_tx_pin
uint16_t uart_tx_pin
Definition: mbed_uart.h:64
mbed_uart_init_param::product_id
uint16_t product_id
Definition: mbed_uart.h:67
mbed_uart_init_param::vendor_id
uint16_t vendor_id
Definition: mbed_uart.h:66
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:77
mbed_uart_desc::is_console_stdio_port
bool is_console_stdio_port
Definition: mbed_uart.h:79
mbed_uart_desc
UART specific descriptor for the mbed platform.
Definition: mbed_uart.h:76
mbed_uart_init_param::is_console_stdio_port
bool is_console_stdio_port
Definition: mbed_uart.h:69
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:68
mbed_uart_init_param::uart_rx_pin
uint16_t uart_rx_pin
Definition: mbed_uart.h:65
mbed_uart_desc::virtual_com_enable
bool virtual_com_enable
Definition: mbed_uart.h:78
mbed_uart_init_param
Structure holding the UART init parameters for mbed platform.
Definition: mbed_uart.h:63