XenevaOS
Loading...
Searching...
No Matches
uart.h
Go to the documentation of this file.
1
30#ifndef __UART_H__
31#define __UART_H__
32
33#include <aa64hcode.h>
34#include <stdint.h>
35#include <aurora.h>
36#include <Board/imx8mp/imx8mp.h>
37
38#define UART_DR 0x00
39#define UART_FR 0x18
40#define UART_IBRD 0x24
41#define UART_FBRD 0x28
42#define UART_LCR_H 0x2C
43#define UART_CR 0x30
44#define UART_IMSC 0x38
45#define UART_ICR 0x44
46
47#define UART_FR_TXFF (1<<5)
48#define UART_FR_RXFE (1<<4)
49
50#define UART_CR_UARTEN (1<<0)
51#define UART_CR_TXE (1<<8)
52#define UART_CR_RXE (1<<9)
53
54
55#define UART_LCR_H_WLEN_8BIT (0x3 << 5)
56#define UART_LCR_H_FEN (1<<4)
57
58#define UART_IMSC_RXIM (1<<4)
59#define UART_IMSC_RTIM (1 << 6)
60
61#define UART0_BASE UART0
62
63
64extern void UARTInitialize();
65
66
67/*
68 * uartPutc --serial output interface
69 * @param s -- String
70 */
71extern void uartPutc(char c);
72
73/*
74 * uartPuts --serial output interface
75 * @param s -- String
76 */
77extern void uartPuts(const char* s);
78
79extern bool is_uart_initialized();
80
81/*
82 * UARTDebugOut -- standard text printing function
83 * for early kernel using UART
84 * @param text -- text to output
85 */
86AU_EXTERN AU_EXPORT void UARTDebugOut(const char* format, ...);
87#endif
#define AU_EXTERN
Definition aurora.h:50
#define AU_EXPORT
Definition aurora.h:38
void uartPuts(const char *s)
uartPuts –serial output interface
Definition uart.c:108
void UARTInitialize()
UARTInitialize – initialize uart serial output.
Definition uart.c:55
void uartPutc(char c)
uartPutc – put a single character to uart
Definition uart.c:88
bool is_uart_initialized()
Definition uart.c:80
AU_EXTERN AU_EXPORT void UARTDebugOut(const char *format,...)