k-chow/k/serial.h

27 lines
487 B
C

#ifndef SERIAL_H
#define SERIAL_H
#define COM1 0x3f8
#define COM2 0x2f8
#define COM3 0x3e8
#define COM4 0x2e8
#define ENABLE_TRANSMITTER (0x1 << 1)
#define FIFO 0x1
#define TRIGGER_LVL_14 (0x3 << 6)
#define CLEAR_TRANSMIT_FIFO (0x1 << 2)
#define CLEAR_RECEIVE_FIFO (0x1 << 1)
#define NO_PARITY 0x0
#define EIGHT_BITS_LENGTH 0x3
#define DLAB (0x1 << 7)
#define EMPTY_TRANSMITTER (0x1 << 5)
void init_serial(void);
int write(const char *buf, size_t count);
#endif /* SERIAL_H */