#include <stdbool.h>
#include <stdint.h>
#include <sys/kassert.h>
#include <sys/irq.h>
#include "ioport.h"
#include "sercons.h"
Go to the source code of this file.
◆ COM1_BASE
◆ COM1_IRQ
◆ COM2_BASE
◆ COM2_IRQ
◆ COM3_BASE
◆ COM3_IRQ
◆ COM4_BASE
◆ COM4_IRQ
◆ UART_LCR_8N1
#define UART_LCR_8N1 0x03 |
◆ UART_LCR_DLAB
#define UART_LCR_DLAB 0x80 |
◆ UART_OFFSET_DATA
#define UART_OFFSET_DATA 0 /* Data Register */ |
◆ UART_OFFSET_DIVHI
#define UART_OFFSET_DIVHI 1 |
◆ UART_OFFSET_DIVLO
#define UART_OFFSET_DIVLO 0 /* Divisors DLAB == 1 */ |
◆ UART_OFFSET_IER
#define UART_OFFSET_IER 1 /* Interrupt Enable Register */ |
◆ UART_OFFSET_IIR
#define UART_OFFSET_IIR 2 /* Interrupt Identification & FIFO Control */ |
◆ UART_OFFSET_LCR
#define UART_OFFSET_LCR 3 /* Line Control Register */ |
◆ UART_OFFSET_LSR
#define UART_OFFSET_LSR 5 /* Line Status Register */ |
◆ UART_OFFSET_MCR
#define UART_OFFSET_MCR 4 /* Modem Control Register */ |
◆ UART_OFFSET_MSR
#define UART_OFFSET_MSR 6 /* Modem Status Register */ |
◆ UART_OFFSET_SR
#define UART_OFFSET_SR 7 /* Scratch Register */ |
◆ Serial_Getc()
Definition at line 78 of file sercons.c.
79{
81 {
82
83 }
85}
static INLINE uint8_t inb(uint16_t port)
◆ Serial_HasData()
◆ Serial_Init()
void Serial_Init |
( |
void |
| ) |
|
Definition at line 40 of file sercons.c.
41{
44
45
47
48
53
54
57}
static INLINE void outb(uint16_t port, uint8_t data)
#define UART_OFFSET_DIVLO
◆ Serial_Interrupt()
void Serial_Interrupt |
( |
void * |
arg | ) |
|
Definition at line 68 of file sercons.c.
69{
71}
int kprintf(const char *fmt,...)
◆ Serial_LateInit()
void Serial_LateInit |
( |
void |
| ) |
|
Definition at line 59 of file sercons.c.
60{
64
66}
void IRQ_Register(int irq, struct IRQHandler *h)
static IRQHandler handler
void Serial_Interrupt(void *arg)
◆ Serial_Putc()
void Serial_Putc |
( |
char |
ch | ) |
|
Definition at line 87 of file sercons.c.
88{
90 {
91
92 }
94
95 if (ch == '\b') {
99 }
100}
void Serial_Putc(char ch)
◆ Serial_Puts()
void Serial_Puts |
( |
const char * |
str | ) |
|
Definition at line 102 of file sercons.c.
103{
104 const char *p = str;
105 while (*p != '\0')
107}
◆ base
◆ handler
◆ irq