Public Types | |
enum | baud_rate_t { baud_rate_50 = 0x0900, baud_rate_75 = 0x0600, baud_rate_110 = 0x0417, baud_rate_150 = 0x0300, baud_rate_300 = 0x0180, baud_rate_600 = 0x00C0, baud_rate_1200 = 0x0060, baud_rate_1800 = 0x0040, baud_rate_2000 = 0x003A, baud_rate_2400 = 0x0030, baud_rate_3600 = 0x0020, baud_rate_4800 = 0x0018, baud_rate_7200 = 0x0010, baud_rate_9600 = 0x000C, baud_rate_19200 = 0x0006, baud_rate_38400 = 0x0003, baud_rate_57600 = 0x0002, baud_rate_115200 = 0x0001 } |
enum | data_bits_t { char_length_5 = 0x00, char_length_6 = 0x01, char_length_7 = 0x02, char_length_8 = 0x03 } |
enum | stop_bits_t { stop_bits_1 = 0x00, stop_bits_2 = 0x04 } |
enum | parity_bits_t { parity_none = 0x00, parity_odd = 0x08, parity_even = 0x18, parity_mark = 0x28, parity_space = 0x38 } |
using | port_type = x64::portio::port_addr_type |
using | value_type = x64::portio::port_8bit_type |
Public Member Functions | |
serial_port_intel_x64 (port_type port=DEFAULT_COM_PORT) noexcept | |
~serial_port_intel_x64 ()=default | |
void | set_baud_rate (baud_rate_t rate) noexcept |
baud_rate_t | baud_rate () const noexcept |
void | set_data_bits (data_bits_t bits) noexcept |
data_bits_t | data_bits () const noexcept |
void | set_stop_bits (stop_bits_t bits) noexcept |
stop_bits_t | stop_bits () const noexcept |
void | set_parity_bits (parity_bits_t bits) noexcept |
parity_bits_t | parity_bits () const noexcept |
port_type | port () const noexcept |
void | write (char c) noexcept |
void | write (const std::string &str) noexcept |
serial_port_intel_x64 (serial_port_intel_x64 &&) noexcept=default | |
serial_port_intel_x64 & | operator= (serial_port_intel_x64 &&) noexcept=default |
serial_port_intel_x64 (const serial_port_intel_x64 &)=delete | |
serial_port_intel_x64 & | operator= (const serial_port_intel_x64 &)=delete |
Static Public Member Functions | |
static serial_port_intel_x64 * | instance () noexcept |
Serial Port (Intel x64)
This class implements the serial device for Intel specific archiectures. All of the serial devices start off with the same default settings (minus the port). There are no checks on the port # (in case a custom port number is needed), and there are no checks to ensure that only one port is used at a time. If custom port settings are required, once the serial port is created, the custom settings can be setup by using the set_xxx functions. The user should ensure that the settings worked by checking the result.
Also note, that by default, a FIFO is used / required, and interrupts are disabled.
Definition at line 74 of file serial_port_intel_x64.h.
Definition at line 78 of file serial_port_intel_x64.h.
Definition at line 79 of file serial_port_intel_x64.h.
Definition at line 81 of file serial_port_intel_x64.h.
Enumerator | |
---|---|
char_length_5 | |
char_length_6 | |
char_length_7 | |
char_length_8 |
Definition at line 103 of file serial_port_intel_x64.h.
Enumerator | |
---|---|
stop_bits_1 | |
stop_bits_2 |
Definition at line 111 of file serial_port_intel_x64.h.
Enumerator | |
---|---|
parity_none | |
parity_odd | |
parity_even | |
parity_mark | |
parity_space |
Definition at line 117 of file serial_port_intel_x64.h.
|
noexcept |
Default Constructor
Definition at line 27 of file serial_port_intel_x64.cpp.
|
default |
Destructor
|
defaultnoexcept |
|
delete |
|
staticnoexcept |
Get Instance
Get an instance to the class.
Definition at line 48 of file serial_port_intel_x64.cpp.
|
noexcept |
Set Baud Rate
Sets the rate at which the serial device will operate. Note that the rate paramter is actually the divisor that is used, and a custom one can be used if desired. If 0 is provided, the default baud rate is used instead.
rate | desired baud rate |
Definition at line 55 of file serial_port_intel_x64.cpp.
|
noexcept |
Buad Rate
Returns the baud rate of the serial device. If the serial device is set to a baud rate that this code does not recognize, unknown is returned.
Definition at line 69 of file serial_port_intel_x64.cpp.
|
noexcept |
Set Data Bits
Sets the size of the data that is transmitted. For more information on the this field, please see http://wiki.osdev.org/Serial_Ports.
bits | the desired data bits |
Definition at line 120 of file serial_port_intel_x64.cpp.
|
noexcept |
Data Bits
Definition at line 131 of file serial_port_intel_x64.cpp.
|
noexcept |
Set Stop Bits
Sets the stop bits used for transmission. For more information on the this field, please see http://wiki.osdev.org/Serial_Ports.
bits | the desired stop bits |
Definition at line 149 of file serial_port_intel_x64.cpp.
|
noexcept |
Stop Bits
Definition at line 160 of file serial_port_intel_x64.cpp.
|
noexcept |
Set Parity Bits
Sets the parity bits used for transmission. For more information on the this field, please see http://wiki.osdev.org/Serial_Ports.
bits | the desired parity bits |
Definition at line 174 of file serial_port_intel_x64.cpp.
|
noexcept |
Parity Bits
Definition at line 185 of file serial_port_intel_x64.cpp.
|
inlinenoexcept |
Port
Definition at line 248 of file serial_port_intel_x64.h.
|
noexcept |
Write Character
Writes a character to the serial device.
c | character to write |
Definition at line 205 of file serial_port_intel_x64.cpp.
|
inlinenoexcept |
Write String
Writes a string to the serial device.
str | string to write |
Definition at line 271 of file serial_port_intel_x64.h.
|
defaultnoexcept |
|
delete |