Platform drivers for Mbed.

Dependents:   EVAL-CN0535-FMCZ EVAL-CN0535-FMCZ EVAL-AD568x-AD569x EVAL-AD7606 ... more

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers uart_extra.h Source File

uart_extra.h

Go to the documentation of this file.
00001 /***************************************************************************//**
00002  *   @file     uart_extra.h
00003  *   @brief:   Header containing extra types required for UART interface
00004 ********************************************************************************
00005  * Copyright (c) 2021 Analog Devices, Inc.
00006  * All rights reserved.
00007  *
00008  * This software is proprietary to Analog Devices, Inc. and its licensors.
00009  * By using this software you agree to the terms of the associated
00010  * Analog Devices Software License Agreement.
00011 *******************************************************************************/
00012 
00013 #ifndef UART_EXTRA_H
00014 #define UART_EXTRA_H
00015 
00016 // Platform support needs to be C-compatible to work with other drivers
00017 #ifdef __cplusplus
00018 extern "C"
00019 {
00020 #endif
00021 
00022 /******************************************************************************/
00023 /***************************** Include Files **********************************/
00024 /******************************************************************************/
00025 #include <stdio.h>
00026 #include <stdbool.h>
00027 
00028 /******************************************************************************/
00029 /********************** Macros and Constants Definitions **********************/
00030 /******************************************************************************/
00031 
00032 /******************************************************************************/
00033 /********************** Variables and User defined data types *****************/
00034 /******************************************************************************/
00035 
00036 /*
00037  * Note: The structure members are not strongly typed, as this file is included
00038  *       in application specific '.c' files. The mbed code structure does not
00039  *       allow inclusion of mbed driver files (e.g. mbed.h) into '.c' files.
00040  *       All the members are hence typecasted to mbed specific type during
00041  *       uart init and read/write operations.
00042  **/
00043 
00044 /**
00045  * @struct mbed_uart_init_param
00046  * @brief Structure holding the UART init parameters for mbed platform.
00047  */
00048 typedef struct {
00049     bool virtual_com_enable;    /* Flag that enables the selection between
00050                                  * Virtual COM Port Or standard UART link */
00051     uint8_t uart_tx_pin;        /* UART Transmit Pin (only for UART comm) */
00052     uint8_t uart_rx_pin;        /* UART Receive Pin (only for UART comm) */
00053     uint16_t vendor_id;         /* USB VCOM Vendor ID (only for USB Virtual comm) */
00054     uint16_t product_id;        /* USB VCOM Product ID (only for USB Virtual comm) */
00055     char *serial_number;        /* USB VCOM serial number (only for USB Virtual comm) */
00056 } mbed_uart_init_param;
00057 
00058 /**
00059  * @struct mbed_uart_desc
00060  * @brief UART specific descriptor for the mbed platform.
00061  */
00062 typedef struct {
00063     void *uart_port;            /* UART port instance */
00064     bool virtual_com_enable;    /* Flag that enables the selection between
00065                                  * Virtual COM Port Or standard UART link */
00066 } mbed_uart_desc;
00067 
00068 /******************************************************************************/
00069 /************************ Functions Declarations ******************************/
00070 /******************************************************************************/
00071 
00072 
00073 #ifdef __cplusplus // Closing extern c
00074 }
00075 #endif
00076 
00077 #endif /* UART_EXTRA_H */