mirror of
https://review.haiku-os.org/haiku
synced 2025-02-04 04:35:57 +01:00
917e9be1a6
* 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)
46 lines
781 B
C
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
|