]> git.sur5r.net Git - freertos/blob - Demo/HCS12_GCC_banked/asm-m68hcs12/ports.h
Remove unused variable warning.
[freertos] / Demo / HCS12_GCC_banked / asm-m68hcs12 / ports.h
1 /* m68hc11/ports.h -- Definition of 68HC11 ports\r
2    Copyright 1999, 2000, 2003 Free Software Foundation, Inc.\r
3    Written by Stephane Carrez (stcarrez@nerim.fr)\r
4 \r
5    Modified by Jefferson L Smith, Robotronics Inc.\r
6 \r
7 This file is part of GDB, GAS, and the GNU binutils.\r
8 \r
9 GDB, GAS, and the GNU binutils are free software; you can redistribute\r
10 them and/or modify them under the terms of the GNU General Public\r
11 License as published by the Free Software Foundation; either version\r
12 1, or (at your option) any later version.\r
13 \r
14 GDB, GAS, and the GNU binutils are distributed in the hope that they\r
15 will be useful, but WITHOUT ANY WARRANTY; without even the implied\r
16 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See\r
17 the GNU General Public License for more details.\r
18 \r
19 You should have received a copy of the GNU General Public License\r
20 along with this file; see the file COPYING.  If not, write to the Free\r
21 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */\r
22 \r
23 #ifndef _M68HC11_PORTS_H\r
24 #define _M68HC11_PORTS_H\r
25 \r
26 #include "ports_def.h"\r
27 \r
28 /** Define default SCI port registers */\r
29 #if defined(M6812_DEF_SCI)\r
30 \r
31 #if M6812_DEF_SCI==2\r
32 # define SCI_BASE       SCI2_BASE\r
33 #elif M6812_DEF_SCI==1\r
34 # define SCI_BASE       SCI1_BASE\r
35 #else /* default M6812_DEF_SCI==0 */\r
36 # define SCI_BASE       SCI0_BASE\r
37 #endif /* default M6812_DEF_SCI==0 */\r
38 \r
39 #else  /* M6812_DEF_SCI not defined */\r
40 # define SCI_BASE       SCI0_BASE\r
41 #endif /* M6812_DEF_SCI */\r
42 \r
43 # define SCIBD          PORTIO_16(SCI_BASE + _SCIBD)\r
44 # define SCICR1         PORTIO_8(SCI_BASE + _SCICR1)\r
45 # define SCICR2         PORTIO_8(SCI_BASE + _SCICR2)\r
46 # define SCISR1         PORTIO_8(SCI_BASE + _SCISR1)\r
47 # define SCISR2         PORTIO_8(SCI_BASE + _SCISR2)\r
48 # define SCIDRL         PORTIO_8(SCI_BASE + _SCIDRL)\r
49 \r
50 extern inline unsigned short\r
51 get_timer_counter (void)\r
52 {\r
53   return TCNT;\r
54 }\r
55 \r
56 extern inline void\r
57 set_timer_counter (unsigned short value)\r
58 {\r
59   TCNT = value;\r
60 }\r
61 #if 0\r
62 extern inline unsigned short\r
63 get_input_capture_1 (void)\r
64 {\r
65   return ((unsigned volatile short*) &_io_ports[M6811_TIC1_H])[0];\r
66 }\r
67 \r
68 extern inline void\r
69 set_input_capture_1 (unsigned short value)\r
70 {\r
71   ((unsigned volatile short*) &_io_ports[M6811_TIC1_H])[0] = value;\r
72 }\r
73 \r
74 extern inline unsigned short\r
75 get_input_capture_2 (void)\r
76 {\r
77   return ((unsigned volatile short*) &_io_ports[M6811_TIC2_H])[0];\r
78 }\r
79 \r
80 extern inline void\r
81 set_input_capture_2 (unsigned short value)\r
82 {\r
83   ((unsigned volatile short*) &_io_ports[M6811_TIC2_H])[0] = value;\r
84 }\r
85 \r
86 extern inline unsigned short\r
87 get_input_capture_3 (void)\r
88 {\r
89   return ((unsigned volatile short*) &_io_ports[M6811_TIC3_H])[0];\r
90 }\r
91 \r
92 extern inline void\r
93 set_input_capture_3 (unsigned short value)\r
94 {\r
95   ((unsigned volatile short*) &_io_ports[M6811_TIC3_H])[0] = value;\r
96 }\r
97 \r
98 /* Get output compare 16-bit register.  */\r
99 extern inline unsigned short\r
100 get_output_compare_1 (void)\r
101 {\r
102   return ((unsigned volatile short*) &_io_ports[M6811_TOC1_H])[0];\r
103 }\r
104 \r
105 extern inline void\r
106 set_output_compare_1 (unsigned short value)\r
107 {\r
108   ((unsigned volatile short*) &_io_ports[M6811_TOC1_H])[0] = value;\r
109 }\r
110 \r
111 extern inline unsigned short\r
112 get_output_compare_2 (void)\r
113 {\r
114   return ((unsigned volatile short*) &_io_ports[M6811_TOC2_H])[0];\r
115 }\r
116 \r
117 extern inline void\r
118 set_output_compare_2 (unsigned short value)\r
119 {\r
120   ((unsigned volatile short*) &_io_ports[M6811_TOC2_H])[0] = value;\r
121 }\r
122 \r
123 extern inline unsigned short\r
124 get_output_compare_3 (void)\r
125 {\r
126   return ((unsigned volatile short*) &_io_ports[M6811_TOC3_H])[0];\r
127 }\r
128 \r
129 extern inline void\r
130 set_output_compare_3 (unsigned short value)\r
131 {\r
132   ((unsigned volatile short*) &_io_ports[M6811_TOC3_H])[0] = value;\r
133 }\r
134 \r
135 extern inline unsigned short\r
136 get_output_compare_4 (void)\r
137 {\r
138   return ((unsigned volatile short*) &_io_ports[M6811_TOC4_H])[0];\r
139 }\r
140 \r
141 extern inline void\r
142 set_output_compare_4 (unsigned short value)\r
143 {\r
144   ((unsigned volatile short*) &_io_ports[M6811_TOC4_H])[0] = value;\r
145 }\r
146 \r
147 extern inline unsigned short\r
148 get_output_compare_5 (void)\r
149 {\r
150   return ((unsigned volatile short*) &_io_ports[M6811_TOC5_H])[0];\r
151 }\r
152 \r
153 extern inline void\r
154 set_output_compare_5 (unsigned short value)\r
155 {\r
156   ((unsigned volatile short*) &_io_ports[M6811_TOC5_H])[0] = value;\r
157 }\r
158 \r
159 #endif\r
160 \r
161 /* Reset the COP.  */\r
162 extern inline void\r
163 cop_reset (void)\r
164 {\r
165   ARMCOP = 0x55;\r
166   ARMCOP = 0xAA;\r
167 }\r
168 \r
169 extern inline void\r
170 cop_optional_reset (void)\r
171 {\r
172 #if defined(M6811_USE_COP) && M6811_USE_COP == 1\r
173   cop_reset ();\r
174 #endif\r
175 }\r
176 \r
177 /* Acknowledge the timer interrupt.  */\r
178 extern inline void\r
179 timer_acknowledge (void)\r
180 {\r
181   CRGFLG = RTIF;\r
182 }\r
183 \r
184 /* Initialize the timer.  */\r
185 extern inline void\r
186 timer_initialize_rate (unsigned char divisor)\r
187 {\r
188   RTICTL = divisor;\r
189 }\r
190 \r
191 #endif /* _M68HC11_PORTS_H */\r
192 \r