FreeNOS
i8250.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2009 Niek Linnenbank
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef __SERVER_SERIAL_I8250_H
19#define __SERVER_SERIAL_I8250_H
20
21#include <Macros.h>
22#include <Types.h>
23#include "SerialDevice.h"
24
36class i8250 : public SerialDevice
37{
38 private:
39
60
61 public:
62
69 i8250(const u32 irq, const u16 base);
70
77
85 virtual FileSystem::Result interrupt(const Size vector);
86
97 virtual FileSystem::Result read(IOBuffer & buffer,
98 Size & size,
99 const Size offset);
100
111 virtual FileSystem::Result write(IOBuffer & buffer,
112 Size & size,
113 const Size offset);
114};
115
121#endif /* __SERVER_SERIAL_I8250_H */
Abstract Input/Output buffer.
Definition IOBuffer.h:38
Provides sequential byte stream of incoming (RX) and outgoing (TX) data.
i8250 serial UART.
Definition i8250.h:37
Constants
Constants used to communicate with the UART.
Definition i8250.h:44
@ BAUDRATE
Definition i8250.h:58
@ DIVISORHIGH
Definition i8250.h:48
@ MODEMCONTROL
Definition i8250.h:54
@ FIFOCONTROL
Definition i8250.h:52
@ DIVISORLOW
Definition i8250.h:47
@ TXREADY
Definition i8250.h:56
@ LINECONTROL
Definition i8250.h:53
@ DLAB
Definition i8250.h:57
@ LINESTATUS
Definition i8250.h:55
@ RXREADY
Definition i8250.h:49
@ IRQSTATUS
Definition i8250.h:51
@ RECEIVE
Definition i8250.h:46
@ TRANSMIT
Definition i8250.h:45
@ IRQCONTROL
Definition i8250.h:50
virtual FileSystem::Result read(IOBuffer &buffer, Size &size, const Size offset)
Read bytes from the device.
Definition i8250.cpp:78
virtual FileSystem::Result initialize()
Initializes the i8250 serial UART.
Definition i8250.cpp:36
virtual FileSystem::Result write(IOBuffer &buffer, Size &size, const Size offset)
Write bytes to the device.
Definition i8250.cpp:104
virtual FileSystem::Result interrupt(const Size vector)
Called when an interrupt has been triggered for this device.
Definition i8250.cpp:72
unsigned int u32
Unsigned 32-bit number.
Definition Types.h:53
unsigned short u16
Unsigned 16-bit number.
Definition Types.h:56
unsigned int Size
Any sane size indicator cannot go negative.
Definition Types.h:128
Result
Result code for filesystem Actions.
Definition FileSystem.h:53