Alexander von Gluck IV 917e9be1a6 arm uart: Complete redesign of ARM uart code
* Add nested function wrappers to allow usage of other
  uart drivers depending on board. We may want to use this
  on other platforms at some point (haha, maybe)
2012-05-06 17:03:33 -05:00

46 lines
781 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"
#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 (*putc)(addr_t base, char c);
int (*getc)(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