summaryrefslogtreecommitdiffstats
path: root/arch/x86_64/hal/serial_com.h
blob: cf0badcf58ea0e596b942724e6f5784644c67a5f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#ifndef _JOVE_SERIAL_COM_H
#define _JOVE_SERIAL_COM_H 1

#include <stdint.h>
#include <stddef.h>

#define SERIAL_COM1 0x3F8

#define SERIAL_COM_TR(com) (com)
#define SERIAL_COM_IER(com) (com + 1)
#define SERIAL_COM_II(com) (com + 2)
#define SERIAL_COM_FIFO(com) (com + 2)
#define SERIAL_COM_LCR(com) (com + 3)
#define SERIAL_COM_MCR(com) (com + 4)
#define SERIAL_COM_LSR(com) (com + 5)
#define SERIAL_COM_MSR(com) (com + 6)
#define SERIAL_COM_SR(com) (com + 7)

#define SERIAL_COM_DLAB_BAUD_LO(com) (com)
#define SERIAL_COM_DLAB_BAUD_HI(com) (com + 1)

#ifdef DEBUG_SERIAL

void serial_com_init(void);

int serial_com_write(uint16_t port, const char *s, size_t len);

#endif

#endif