OSDN Git Service

[SCHEMATIC] Modify SW/MW/LW Preamp, insert galbanic-isolator replace of common-mode...
[openi2cradio/OpenI2CRadio.git] / euart.h
1 /*
2  * OpenI2CRADIO
3  * EUSART Handler
4  * Copyright (C) 2013-06-20 K.Ohta <whatisthis.sowhat ai gmail.com>
5  *
6  *  This program is free software; you can redistribute it and/or modify
7  *  it under the terms of the GNU General Public License as published by
8  *  the Free Software Foundation; either version 2,
9  *  or (at your option) any later version.
10  *  This library / program is distributed in the hope that it will be useful,
11  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13  *  See the GNU General Public License for more details.
14  *
15  *  You should have received a copy of the GNU General Public License
16  *  along with this library; see the file COPYING. If not, write to the
17  *  Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
18  *  MA 02110-1301, USA.
19  *
20  *  As a special exception, if you link this(includeed from sdcc) library
21  *  with other files, some of which are compiled with SDCC,
22  *  to produce an executable, this library does not by itself cause
23  *  the resulting executable to be covered by the GNU General Public License.
24  *  This exception does not however invalidate any other reasons why
25  *  the executable file might be covered by the GNU General Public License.
26  */
27
28 #ifndef EUART_H
29 #define EUART_H
30
31 #ifdef  __cplusplus
32 extern "C" {
33 #endif
34
35 #define UART_BUF_SIZE 256
36 #define UART_CH_XOFF 19
37 #define UART_CH_XON 17
38 #define UART_FRAMEERROR 0x01
39 #define UART_OVERFLOW 0x02
40 #define UART_TIMEOUT 0x04
41 #define UART_WAKEUP 0x80
42 #define UART_RTSIN PORTDbits.RD3
43 #define UART_CTSOUT PORTCbits.RC5
44    
45 extern void uart_sleep(void);
46 extern void uart_wakeup(void);
47 extern void uart_init(void);
48 extern void uart_inthdr_rx(void);
49 extern unsigned char uart_pullchar(void);
50 extern unsigned char uart_pushchar(unsigned char c, unsigned int timeout);
51 extern void uart_pushxon(unsigned int timeout);
52 extern void uart_pushxoff(unsigned int timeout);
53 extern void uart_break(void);
54 extern unsigned char uart_getstat(void);
55
56 #ifdef  __cplusplus
57 }
58 #endif
59
60 #endif  /* EUART_H */
61