2 * Copyright (c) 2007, Takahide Matsutsuka.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above
11 * copyright notice, this list of conditions and the following
12 * disclaimer in the documentation and/or other materials provided
13 * with the distribution.
14 * 3. The name of the author may not be used to endorse or promote
15 * products derived from this software without specific prior
18 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
19 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
22 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
24 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 * $Id: rs232.h,v 1.4 2007/09/29 03:58:38 matsutsuka Exp $
35 * This is RS-232C process based on polling.
37 * Takahide Matsutsuka <markn@markn.org>
44 * Implement the following methods for each platform.
48 * An architecture-depend implementation of RS-232C initialization.
50 void rs232_arch_init(unsigned long ubr
);
53 * An architecture-depend implementation of RS-232C polling.
54 * @return character, stat == zero if no input.
56 unsigned char rs232_arch_poll(unsigned char* stat
);
59 * An architecture-depend implementation of RS-232C writing a byte.
61 void rs232_arch_writeb(unsigned char ch
);
63 PROCESS_NAME(rs232_process
);
66 * if you want to use simple serial communication,
67 * define RS232_CONF_CALLBACK as serial_input_byte.
68 * The default is SLIP.
70 #ifdef RS232_CONF_CALLBACK
71 #define RS232_CALLBACK RS232_CONF_CALLBACK
72 #else /* RS232_CONF_CALLBACK */
73 #define RS232_CALLBACK slip_input_byte
74 #endif /* RS232_CONF_CALLBACK */
76 #ifdef RS232_CONF_BUFISZE
77 #define RS232_BUFSIZE RS232_CONF_BUFISZE
78 #else /* RS232_CONF_BUFISZE */
79 #define RS232_BUFSIZE 64
80 #endif /* RS232_CONF_BUFISZE */
82 #ifdef RS232_CONF_BAUD_RATE
83 #define RS232_BAUD_RATE RS232_CONF_BAUD_RATE
84 #else /* RS232_CONF_BAUD_RATE */
85 #define RS232_BAUD_RATE 9600
86 #endif /* RS232_CONF_BAUD_RATE */
88 #endif /* __RS232_H__ */