k-chow/k/serial.h
Julien CLEMENT 202fc190ac feat(serial): add serial initialization and gitignore
Signed-off-by: Julien CLEMENT <julien.clement@epita.fr>
2021-07-12 19:46:21 +02:00

25 lines
449 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)
void serial_init(void);
int write(const char *buf, size_t count);
#endif /* SERIAL_H */