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