1 //*****************************************************************************
\r
3 // uart.h - Defines and Macros for the UART.
\r
5 // Copyright (c) 2005,2006 Luminary Micro, Inc. All rights reserved.
\r
7 // Software License Agreement
\r
9 // Luminary Micro, Inc. (LMI) is supplying this software for use solely and
\r
10 // exclusively on LMI's Stellaris Family of microcontroller products.
\r
12 // The software is owned by LMI and/or its suppliers, and is protected under
\r
13 // applicable copyright laws. All rights are reserved. Any use in violation
\r
14 // of the foregoing restrictions may subject the user to criminal sanctions
\r
15 // under applicable laws, as well as to civil liability for the breach of the
\r
16 // terms and conditions of this license.
\r
18 // THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
\r
19 // OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
\r
20 // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
\r
21 // LMI SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR
\r
22 // CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
\r
24 // This is part of revision 635 of the Stellaris Driver Library.
\r
26 //*****************************************************************************
\r
36 //*****************************************************************************
\r
38 // Values that can be passed to UARTIntEnable, UARTIntDisable, and UARTIntClear
\r
39 // as the ulIntFlags parameter, and returned from UARTIntStatus.
\r
41 //*****************************************************************************
\r
42 #define UART_INT_OE 0x400 // Overrun Error Interrupt Mask
\r
43 #define UART_INT_BE 0x200 // Break Error Interrupt Mask
\r
44 #define UART_INT_PE 0x100 // Parity Error Interrupt Mask
\r
45 #define UART_INT_FE 0x080 // Framing Error Interrupt Mask
\r
46 #define UART_INT_RT 0x040 // Receive Timeout Interrupt Mask
\r
47 #define UART_INT_TX 0x020 // Transmit Interrupt Mask
\r
48 #define UART_INT_RX 0x010 // Receive Interrupt Mask
\r
50 //*****************************************************************************
\r
52 // Values that can be passed to UARTConfigSet as the ulConfig parameter and
\r
53 // returned by UARTConfigGet in the pulConfig parameter. Additionally, the
\r
54 // UART_CONFIG_PAR_* subset can be passed to UARTParityModeSet as the ulParity
\r
55 // parameter, and are returned by UARTParityModeGet.
\r
57 //*****************************************************************************
\r
58 #define UART_CONFIG_WLEN_8 0x00000060 // 8 bit data
\r
59 #define UART_CONFIG_WLEN_7 0x00000040 // 7 bit data
\r
60 #define UART_CONFIG_WLEN_6 0x00000020 // 6 bit data
\r
61 #define UART_CONFIG_WLEN_5 0x00000000 // 5 bit data
\r
62 #define UART_CONFIG_STOP_ONE 0x00000000 // One stop bit
\r
63 #define UART_CONFIG_STOP_TWO 0x00000008 // Two stop bits
\r
64 #define UART_CONFIG_PAR_NONE 0x00000000 // No parity
\r
65 #define UART_CONFIG_PAR_EVEN 0x00000006 // Even parity
\r
66 #define UART_CONFIG_PAR_ODD 0x00000002 // Odd parity
\r
67 #define UART_CONFIG_PAR_ONE 0x00000086 // Parity bit is one
\r
68 #define UART_CONFIG_PAR_ZERO 0x00000082 // Parity bit is zero
\r
70 //*****************************************************************************
\r
72 // API Function prototypes
\r
74 //*****************************************************************************
\r
75 extern void UARTParityModeSet(unsigned long ulBase, unsigned long ulParity);
\r
76 extern unsigned long UARTParityModeGet(unsigned long ulBase);
\r
77 extern void UARTConfigSet(unsigned long ulBase, unsigned long ulBaud,
\r
78 unsigned long ulConfig);
\r
79 extern void UARTConfigGet(unsigned long ulBase, unsigned long *pulBaud,
\r
80 unsigned long *pulConfig);
\r
81 extern void UARTEnable(unsigned long ulBase);
\r
82 extern void UARTDisable(unsigned long ulBase);
\r
83 extern tBoolean UARTCharsAvail(unsigned long ulBase);
\r
84 extern tBoolean UARTSpaceAvail(unsigned long ulBase);
\r
85 extern long UARTCharNonBlockingGet(unsigned long ulBase);
\r
86 extern long UARTCharGet(unsigned long ulBase);
\r
87 extern tBoolean UARTCharNonBlockingPut(unsigned long ulBase,
\r
88 unsigned char ucData);
\r
89 extern void UARTCharPut(unsigned long ulBase, unsigned char ucData);
\r
90 extern void UARTBreakCtl(unsigned long ulBase, tBoolean bBreakState);
\r
91 extern void UARTIntRegister(unsigned long ulBase, void(*pfnHandler)(void));
\r
92 extern void UARTIntUnregister(unsigned long ulBase);
\r
93 extern void UARTIntEnable(unsigned long ulBase, unsigned long ulIntFlags);
\r
94 extern void UARTIntDisable(unsigned long ulBase, unsigned long ulIntFlags);
\r
95 extern unsigned long UARTIntStatus(unsigned long ulBase, tBoolean bMasked);
\r
96 extern void UARTIntClear(unsigned long ulBase, unsigned long ulIntFlags);
\r
102 #endif // __UART_H__
\r