00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045 #ifndef _M68HC11_PORTS_H
00046 #define _M68HC11_PORTS_H
00047
00048
00049
00050 #include <asm-m68hc12/ports_def.h>
00051
00052
00053 unsigned short get_timer_counter (void);
00054 void set_timer_counter (unsigned short value);
00055 void cop_reset (void);
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082 extern inline unsigned short
00083 get_timer_counter (void)
00084 {
00085 return ((unsigned volatile short*) &_io_ports[TCNTH])[0];
00086 }
00087
00088 extern inline void
00089 set_timer_counter (unsigned short value)
00090 {
00091 ((unsigned volatile short*) &_io_ports[TCNTH])[0] = value;
00092 }
00093
00094
00095
00096 extern inline void
00097 cop_reset (void)
00098 {
00099 _io_ports[ARMCOP] = 0x55;
00100 _io_ports[ARMCOP] = 0xAA;
00101 }
00102
00103
00104 #if 0
00105
00106 extern inline void
00107 timer_acknowledge (void)
00108 {
00109 _io_ports[TFLG2] = 0x80;
00110 }
00111
00112
00113 extern inline void
00114 timer_initialize_rate (unsigned char divisor)
00115 {
00116 _io_ports[M6811_TMSK2] = M6811_RTII | divisor;
00117 }
00118
00119 extern inline void
00120 cop_optional_reset (void)
00121 {
00122 #if defined(M6811_USE_COP) && M6811_USE_COP == 1
00123 cop_reset ();
00124 #endif
00125 }
00126
00127
00128 extern inline void
00129 set_bus_expanded (void)
00130 {
00131 _io_ports[M6811_HPRIO] |= M6811_MDA;
00132 }
00133
00134
00135
00136 extern inline void
00137 set_bus_single_chip (void)
00138 {
00139 _io_ports[M6811_HPRIO] &= ~M6811_MDA;
00140 }
00141
00142 extern inline unsigned short
00143 get_input_capture_1 (void)
00144 {
00145 return ((unsigned volatile short*) &_io_ports[M6811_TIC1_H])[0];
00146 }
00147
00148 extern inline void
00149 set_input_capture_1 (unsigned short value)
00150 {
00151 ((unsigned volatile short*) &_io_ports[M6811_TIC1_H])[0] = value;
00152 }
00153
00154 extern inline unsigned short
00155 get_input_capture_2 (void)
00156 {
00157 return ((unsigned volatile short*) &_io_ports[M6811_TIC2_H])[0];
00158 }
00159
00160 extern inline void
00161 set_input_capture_2 (unsigned short value)
00162 {
00163 ((unsigned volatile short*) &_io_ports[M6811_TIC2_H])[0] = value;
00164 }
00165
00166 extern inline unsigned short
00167 get_input_capture_3 (void)
00168 {
00169 return ((unsigned volatile short*) &_io_ports[M6811_TIC3_H])[0];
00170 }
00171
00172 extern inline void
00173 set_input_capture_3 (unsigned short value)
00174 {
00175 ((unsigned volatile short*) &_io_ports[M6811_TIC3_H])[0] = value;
00176 }
00177
00178
00179 extern inline unsigned short
00180 get_output_compare_1 (void)
00181 {
00182 return ((unsigned volatile short*) &_io_ports[M6811_TOC1_H])[0];
00183 }
00184
00185 extern inline void
00186 set_output_compare_1 (unsigned short value)
00187 {
00188 ((unsigned volatile short*) &_io_ports[M6811_TOC1_H])[0] = value;
00189 }
00190
00191 extern inline unsigned short
00192 get_output_compare_2 (void)
00193 {
00194 return ((unsigned volatile short*) &_io_ports[M6811_TOC2_H])[0];
00195 }
00196
00197 extern inline void
00198 set_output_compare_2 (unsigned short value)
00199 {
00200 ((unsigned volatile short*) &_io_ports[M6811_TOC2_H])[0] = value;
00201 }
00202
00203 extern inline unsigned short
00204 get_output_compare_3 (void)
00205 {
00206 return ((unsigned volatile short*) &_io_ports[M6811_TOC3_H])[0];
00207 }
00208
00209 extern inline void
00210 set_output_compare_3 (unsigned short value)
00211 {
00212 ((unsigned volatile short*) &_io_ports[M6811_TOC3_H])[0] = value;
00213 }
00214
00215 extern inline unsigned short
00216 get_output_compare_4 (void)
00217 {
00218 return ((unsigned volatile short*) &_io_ports[M6811_TOC4_H])[0];
00219 }
00220
00221 extern inline void
00222 set_output_compare_4 (unsigned short value)
00223 {
00224 ((unsigned volatile short*) &_io_ports[M6811_TOC4_H])[0] = value;
00225 }
00226
00227 extern inline unsigned short
00228 get_output_compare_5 (void)
00229 {
00230 return ((unsigned volatile short*) &_io_ports[M6811_TOC5_H])[0];
00231 }
00232
00233 extern inline void
00234 set_output_compare_5 (unsigned short value)
00235 {
00236 ((unsigned volatile short*) &_io_ports[M6811_TOC5_H])[0] = value;
00237 }
00238
00239 #endif
00240
00241
00242
00243
00244 #endif
00245