mingw: make simavr compilable with MinGW
[simavr] / simavr / sim / avr_lin.h
1 /*
2         avr_lin.h
3
4         Copyright 2008, 2011 Michel Pollet <buserror@gmail.com>
5         Copyright 2011 Markus Lampert  <mlampert@telus.net>
6
7         This file is part of simavr.
8
9         simavr is free software: you can redistribute it and/or modify
10         it under the terms of the GNU General Public License as published by
11         the Free Software Foundation, either version 3 of the License, or
12         (at your option) any later version.
13
14         simavr is distributed in the hope that it will be useful,
15         but WITHOUT ANY WARRANTY; without even the implied warranty of
16         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17         GNU General Public License for more details.
18
19         You should have received a copy of the GNU General Public License
20         along with simavr.  If not, see <http://www.gnu.org/licenses/>.
21  */
22
23 #ifndef __AVR_LIN_H__
24 #define __AVR_LIN_H__
25
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29
30 #include "sim_avr.h"
31 #include "avr_uart.h"
32
33 typedef struct avr_lin_t {
34         avr_io_t io;
35
36         avr_io_addr_t r_linbtr;
37         avr_io_addr_t r_linbrrh, r_linbrrl;
38
39         avr_regbit_t lena;
40         avr_regbit_t ldisr;
41         avr_regbit_t lbt;
42
43         avr_uart_t uart;  // used when LIN controller is setup as a UART
44 } avr_lin_t;
45
46 void
47 avr_lin_init(
48                 avr_t *avr,
49                 avr_lin_t *port);
50
51 #ifdef __cplusplus
52 };
53 #endif
54
55 #endif /* __AVR_LIN_H__ */