ArvernOS
|
#include <stdint.h>
Macros | |
#define | SERIAL_COM1 0x3F8 |
#define | SERIAL_LINE_ENABLE_DLAB 0x80 |
#define | SERIAL_SPEED_115200 1 |
115200 bauds. | |
#define | SERIAL_SPEED_57600 2 |
57600 bauds. | |
#define | SERIAL_SPEED_38400 3 |
38400 bauds. | |
Functions | |
void | serial_init (uint16_t com, uint16_t speed) |
void | serial_print (uint16_t com, const char *str) |
void | serial_write (uint16_t com, char c) |
#define SERIAL_COM1 0x3F8 |
All the I/O ports are calculated relative to the data port. This is because all serial ports (COM1, COM2, COM3, COM4) have their ports in the same order, but they start at different values.
#define SERIAL_LINE_ENABLE_DLAB 0x80 |
Tells the serial port to expect first the highest 8 bits on the data port, then the lowest 8 bits will follow.
void serial_init | ( | uint16_t | com, |
uint16_t | speed ) |
Initializes the serial driver.
com | a serial port number |
speed | the serial speed to use |
void serial_print | ( | uint16_t | com, |
const char * | str ) |
Prints a string to the serial port.
com | a serial port number |
str | the string to print to the serial port |
void serial_write | ( | uint16_t | com, |
char | c ) |
Prints a character to the serial port.
com | a serial port number |
c | the character to print to the serial port |