Abstracts access to the I/O address space.
More...
#include <ioport.h>
|
| IOPort (uint16_t addr) |
| Constructor.
|
|
void | outb (uint8_t val) const |
| Write one byte to the I/O port.
|
|
void | outw (uint16_t val) const |
| Write one word (2 bytes) to the I/O port.
|
|
uint8_t | inb () const |
| Read one byte from the I/O port.
|
|
uint16_t | inw () const |
| Read one word (2 bytes) from the I/O port.
|
|
|
uint16_t | address |
| Address in I/O address space.
|
|
Abstracts access to the I/O address space.
x86 PCs have a separated I/O address space that is accessible only via the machine instructions in
and out
. An IOPort object encapsulates the corresponding address in the I/O address space and can be used for byte or word-wise reading or writing.
◆ IOPort()
IOPort::IOPort |
( |
uint16_t |
addr | ) |
|
|
inlineexplicit |
Constructor.
- Parameters
-
addr | Address from the I/O address space |
◆ inb()
uint8_t IOPort::inb |
( |
| ) |
const |
|
inline |
Read one byte from the I/O port.
- Returns
- Read byte
◆ inw()
uint16_t IOPort::inw |
( |
| ) |
const |
|
inline |
Read one word (2 bytes) from the I/O port.
- Returns
- Read word (2 bytes)
◆ outb()
void IOPort::outb |
( |
uint8_t |
val | ) |
const |
|
inline |
Write one byte to the I/O port.
- Parameters
-
val | The value to be written |
◆ outw()
void IOPort::outw |
( |
uint16_t |
val | ) |
const |
|
inline |
Write one word (2 bytes) to the I/O port.
- Parameters
-
val | The value to be written |
◆ address
Address in I/O address space.
The documentation for this class was generated from the following file: