Max OS 0.3
Loading...
Searching...
No Matches
MaxOS::hardwarecommunication::Port8BitSlow Class Reference

Handles 8 bit ports (slow) More...

#include <port.h>

Inheritance diagram for MaxOS::hardwarecommunication::Port8BitSlow:
MaxOS::hardwarecommunication::Port8Bit MaxOS::hardwarecommunication::Port

Public Member Functions

 Port8BitSlow (uint16_t port_number)
 Construct a new Port object for ports handling 8 bit read/writes (slow)
 
void write (uint8_t data) final
 write a byte to the port (slow)
 
- Public Member Functions inherited from MaxOS::hardwarecommunication::Port8Bit
 Port8Bit (uint16_t port_number)
 Construct a new Port object for ports handling 8 bit read/writes.
 
virtual uint8_t read ()
 read a byte from the port
 

Additional Inherited Members

- Protected Member Functions inherited from MaxOS::hardwarecommunication::Port
 Port (uint16_t port_number)
 Construct a new Port object.
 
- Protected Attributes inherited from MaxOS::hardwarecommunication::Port
uint16_t m_port_number
 The port to write to / read from.
 

Detailed Description

Handles 8 bit ports (slow)

Definition at line 45 of file port.h.

Constructor & Destructor Documentation

◆ Port8BitSlow()

Port8BitSlow::Port8BitSlow ( uint16_t  port_number)
explicit

Construct a new Port object for ports handling 8 bit read/writes (slow)

Parameters
port_numberThe IO port number

Definition at line 63 of file port.cpp.

64: Port8Bit(port_number) {
65}

Member Function Documentation

◆ write()

void Port8BitSlow::write ( uint8_t  data)
finalvirtual

write a byte to the port (slow)

Parameters
datathe byte to write

Reimplemented from MaxOS::hardwarecommunication::Port8Bit.

Definition at line 74 of file port.cpp.

74 {
75
76 asm volatile("outb %0, %1\njmp 1f\n1: jmp 1f\n1:" : : "a" (data), "Nd" (m_port_number));
77}
uint16_t m_port_number
The port to write to / read from.
Definition port.h:22

References MaxOS::hardwarecommunication::Port::m_port_number.


The documentation for this class was generated from the following files: