blob: 8ae1e36c1b5917cc4f79eb07e5579e03cf78ee4c [file] [log] [blame]
// Copyright 2018 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <stdint.h>
#include "debug.h"
#define UART_THR (0x0) // TX Buffer Register (write-only)
#define UART_LSR (0x14) // Line Status Register
#define UART_LSR_THRE (1 << 5)
#define UARTREG(reg) (*(volatile uint32_t*)(0x11005000 + (reg)))
void uart_pputc(char c) {
while (!(UARTREG(UART_LSR) & UART_LSR_THRE))
;
UARTREG(UART_THR) = c;
}