Alexander von Gluck IV c76127fade arm uart: First work towards Amba serial driver
* Move Raspberry Pi board over to Amba driver
* Add initial set of registers and values
* Few small style cleanups
2012-05-06 19:30:43 -05:00

47 lines
811 B
C

/*
* Copyright 2011-2012 Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* Alexander von Gluck, kallisti5@unixzen.com
*/
#ifndef __DEV_UART_H
#define __DEV_UART_H
#include <sys/types.h>
#include "uart_8250.h"
#include "uart_pl011.h"
#ifdef __cplusplus
extern "C" {
#endif
struct uart_info {
addr_t base;
// Pointers to functions based on port type
void (*init)(addr_t base);
void (*init_early)(void);
void (*init_port)(addr_t base, uint baud);
int (*putchar)(addr_t base, char c);
int (*getchar)(addr_t base, bool wait);
void (*flush_tx)(addr_t base);
void (*flush_rx)(addr_t base);
};
uart_info* uart_create(void);
void uart_destroy();
addr_t uart_base_port(int port);
addr_t uart_debug_port(void);
#ifdef __cplusplus
}
#endif
#endif