haiku/headers/private/kernel/arch/arm/arch_uart_pl011.h
Alexander von Gluck IV d637e0bec1 system/kernel: Rework uart management
Change-Id: I6cb31760519c8ba4542d217d6e68439602eda558
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4356
Reviewed-by: Jessica Hamilton <jessica.l.hamilton@gmail.com>
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
2021-08-20 03:03:25 +00:00

50 lines
857 B
C++

/*
* Copyright 2011-2021 Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* Alexander von Gluck, kallisti5@unixzen.com
*/
#ifndef __DEV_UART_PL011_H
#define __DEV_UART_PL011_H
#include <sys/types.h>
#include <SupportDefs.h>
#include <arch/generic/debug_uart.h>
#define UART_KIND_PL011 "pl011"
class ArchUARTPL011 : public DebugUART {
public:
ArchUARTPL011(addr_t base, int64 clock);
~ArchUARTPL011();
void InitEarly();
void InitPort(uint32 baud);
void Enable();
void Disable();
int PutChar(char c);
int GetChar(bool wait);
void FlushTx();
void FlushRx();
private:
void Out32(int reg, uint32 value);
uint32 In32(int reg);
virtual void Barrier();
};
ArchUARTPL011 *arch_get_uart_pl011(addr_t base, int64 clock);
#endif