no-OS
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
mbed_uart.h
Go to the documentation of this file.
1/***************************************************************************/
31
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
37extern "C"
38{
39#endif
40
41#include <stdio.h>
42#include <stdbool.h>
43
44/*
45 * Note: The structure members are not strongly typed, as this file is included
46 * in application specific '.c' files. The mbed code structure does not
47 * allow inclusion of mbed driver files (e.g. mbed.h) into '.c' files.
48 * All the members are hence typecasted to mbed specific type during
49 * uart init and read/write operations.
50 **/
51
57 uint16_t uart_tx_pin; /* UART Transmit Pin (only for UART comm) */
58 uint16_t uart_rx_pin; /* UART Receive Pin (only for UART comm) */
59 uint16_t vendor_id; /* USB VCOM Vendor ID (only for USB Virtual comm) */
60 uint16_t product_id; /* USB VCOM Product ID (only for USB Virtual comm) */
61 char *serial_number; /* USB VCOM serial number (only for USB Virtual comm) */
62 bool is_console_stdio_port; /* Set the UART/USB port for console stdio operation */
63};
64
70 void *uart_port; /* UART port instance */
71 bool virtual_com_enable; /* To set port for console stdio operation */
72 bool is_console_stdio_port; /* Set the UART/USB port for console stdio operation */
73};
74
78extern const struct no_os_uart_platform_ops mbed_uart_ops;
79
84
85#ifdef __cplusplus // Closing extern c
86}
87#endif
88
89#endif /* MBED_UART_H_ */
const struct no_os_uart_platform_ops mbed_uart_ops
Mbed platform specific UART platform ops structure.
const struct no_os_uart_platform_ops mbed_virtual_com_ops
Mbed platform specific VCOM platform ops structure.
UART specific descriptor for the mbed platform.
Definition mbed_uart.h:69
bool is_console_stdio_port
Definition mbed_uart.h:72
bool virtual_com_enable
Definition mbed_uart.h:71
void * uart_port
Definition mbed_uart.h:70
Structure holding the UART init parameters for mbed platform.
Definition mbed_uart.h:56
uint16_t vendor_id
Definition mbed_uart.h:59
uint16_t product_id
Definition mbed_uart.h:60
bool is_console_stdio_port
Definition mbed_uart.h:62
char * serial_number
Definition mbed_uart.h:61
uint16_t uart_tx_pin
Definition mbed_uart.h:57
uint16_t uart_rx_pin
Definition mbed_uart.h:58
Structure holding UART function pointers that point to the platform specific function.
Definition no_os_uart.h:143