• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /**
2  * @file
3  *
4  * Generic UART line setting values. These are shared between UEFI and the SCP.
5  *
6  * @xrefitem bom "File Content Label" "Release Content"
7  * @e project:      STYX
8  * @e sub-project:  (TBD)
9  * @e \$Revision$        @e  \$Date$
10  *
11  **/
12 /*****************************************************************************
13  *
14  *  Copyright 2015 - 2016 ADVANCED MICRO DEVICES, INC.  All Rights Reserved.
15  *
16  *  This program and the accompanying materials are licensed and made available
17  *  under the terms and conditions of the BSD License which accompanies this
18  *  distribution. The full text of the license may be found at
19  *  http://opensource.org/licenses/bsd-license.php
20  *
21  *  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
22  *  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR
23  *  IMPLIED.
24  *
25  * ***************************************************************************
26  **/
27 
28 #ifndef _UART_LINE_SETTINGS_H_
29 #define _UART_LINE_SETTINGS_H_
30 
31 //#########################################################################
32 //#########################################################################
33 //#########################################################################
34 //        NOTE: This file shared between SCP and UEFI, make sure all     //
35 //              changes are reflected in both copies.                    //
36 //#########################################################################
37 //#########################################################################
38 //#########################################################################
39 
40 
41 /// UART Baudrate enum
42 typedef enum {
43   /// This subset is defined/used in UEFI
44   UART_BAUDRATE_9600    = 9600,       ///< 9600 Baudrate
45   UART_BAUDRATE_19200   = 19200,      ///< 19200 Baudrate
46   UART_BAUDRATE_38400   = 38400,      ///< 38400 Baudrate
47   UART_BAUDRATE_57600   = 57600,      ///< 57600 Baudrate
48   UART_BAUDRATE_115200  = 115200,     ///< 115200 Baudrate
49 
50   /// These could be used within the SCP.
51   UART_BAUDRATE_110     = 110,        ///< 110 Baudrate
52   UART_BAUDRATE_300     = 300,        ///< 300 Baudrate
53   UART_BAUDRATE_600     = 600,        ///< 600 Baudrate
54   UART_BAUDRATE_1200    = 1200,       ///< 1200 Baudrate
55   UART_BAUDRATE_2400    = 2400,       ///< 2400 Baudrate
56   UART_BAUDRATE_4800    = 4800,       ///< 4800 Baudrate
57   UART_BAUDRATE_14400   = 14400,      ///< 14400 Baudrate
58   UART_BAUDRATE_230400  = 230400,     ///< 230400 Baudrate
59   UART_BAUDRATE_460800  = 460800,     ///< 460800 Baudrate
60   UART_BAUDRATE_921600  = 921600,     ///< 921600 Baudrate
61 } UART_BAUDRATE;
62 
63 /// UART Parity enum
64 typedef enum {
65   DEFAULT_PARITY = 0,                 ///< Default Parity
66   NO_PARITY,                          ///< No Parity
67   EVEN_PARITY,                        ///< Even Parity
68   ODD_PARITY,                         ///< Odd Parity
69   MARK_PARITY,                        ///< Mark Parity
70   SPACE_PARITY                        ///< Space Parity
71 } UART_PARITY;
72 
73 /// UART Stop Bit enum
74 typedef enum {
75   UART_STOP_BIT_0 = 0,                 ///< No Stop Bits
76   UART_STOP_BIT_1,                     ///< One Stop Bit
77   UART_STOP_BIT_1_5,                   ///< One and One Half Stop bits
78   UART_STOP_BIT_2                      ///< Two Stop Bits
79 } UART_STOP_BITS;
80 
81 /// UART Data Length enum
82 typedef enum {
83   UART_DATA_BITS_5 = 5,                ///< Five Data Bits
84   UART_DATA_BITS_6,                    ///< Six Data Bits
85   UART_DATA_BITS_7,                    ///< Seven Data Bits
86   UART_DATA_BITS_8,                    ///< Eight Data Bits
87 } UART_DATA_BITS;
88 
89 /// UART Line Settings structure
90 typedef struct _UART_LINE_SETTINGS {
91   UART_BAUDRATE   BaudRate;            ///< UART Baudrate
92   UART_DATA_BITS  DataBits;            ///< UART Data Bits
93   UART_PARITY     Parity;              ///< UART Parity
94   UART_STOP_BITS  StopBits;            ///< UART Stop Bits
95 } UART_LINE_SETTINGS;
96 
97 #endif /* _UART_LINE_SETTINGS_H_ */
98