00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00034 #ifndef _M68HC11_PORTS_H
00035 #define _M68HC11_PORTS_H
00036
00037
00038
00039 extern __inline__ unsigned short
00040 get_timer_counter (void)
00041 {
00042 return ((unsigned volatile short*) &_io_ports[M6812_TCNT])[0];
00043 }
00044
00045 extern __inline__ void
00046 set_timer_counter (unsigned short value)
00047 {
00048 ((unsigned volatile short*) &_io_ports[M6812_TCNT])[0] = value;
00049 }
00050 #if 0
00051 extern __inline__ unsigned short
00052 get_input_capture_1 (void)
00053 {
00054 return ((unsigned volatile short*) &_io_ports[M6811_TIC1_H])[0];
00055 }
00056
00057 extern __inline__ void
00058 set_input_capture_1 (unsigned short value)
00059 {
00060 ((unsigned volatile short*) &_io_ports[M6811_TIC1_H])[0] = value;
00061 }
00062
00063 extern __inline__ unsigned short
00064 get_input_capture_2 (void)
00065 {
00066 return ((unsigned volatile short*) &_io_ports[M6811_TIC2_H])[0];
00067 }
00068
00069 extern __inline__ void
00070 set_input_capture_2 (unsigned short value)
00071 {
00072 ((unsigned volatile short*) &_io_ports[M6811_TIC2_H])[0] = value;
00073 }
00074
00075 extern __inline__ unsigned short
00076 get_input_capture_3 (void)
00077 {
00078 return ((unsigned volatile short*) &_io_ports[M6811_TIC3_H])[0];
00079 }
00080
00081 extern __inline__ void
00082 set_input_capture_3 (unsigned short value)
00083 {
00084 ((unsigned volatile short*) &_io_ports[M6811_TIC3_H])[0] = value;
00085 }
00086
00087
00088 extern __inline__ unsigned short
00089 get_output_compare_1 (void)
00090 {
00091 return ((unsigned volatile short*) &_io_ports[M6811_TOC1_H])[0];
00092 }
00093
00094 extern __inline__ void
00095 set_output_compare_1 (unsigned short value)
00096 {
00097 ((unsigned volatile short*) &_io_ports[M6811_TOC1_H])[0] = value;
00098 }
00099
00100 extern __inline__ unsigned short
00101 get_output_compare_2 (void)
00102 {
00103 return ((unsigned volatile short*) &_io_ports[M6811_TOC2_H])[0];
00104 }
00105
00106 extern __inline__ void
00107 set_output_compare_2 (unsigned short value)
00108 {
00109 ((unsigned volatile short*) &_io_ports[M6811_TOC2_H])[0] = value;
00110 }
00111
00112 extern __inline__ unsigned short
00113 get_output_compare_3 (void)
00114 {
00115 return ((unsigned volatile short*) &_io_ports[M6811_TOC3_H])[0];
00116 }
00117
00118 extern __inline__ void
00119 set_output_compare_3 (unsigned short value)
00120 {
00121 ((unsigned volatile short*) &_io_ports[M6811_TOC3_H])[0] = value;
00122 }
00123
00124 extern __inline__ unsigned short
00125 get_output_compare_4 (void)
00126 {
00127 return ((unsigned volatile short*) &_io_ports[M6811_TOC4_H])[0];
00128 }
00129
00130 extern __inline__ void
00131 set_output_compare_4 (unsigned short value)
00132 {
00133 ((unsigned volatile short*) &_io_ports[M6811_TOC4_H])[0] = value;
00134 }
00135
00136 extern __inline__ unsigned short
00137 get_output_compare_5 (void)
00138 {
00139 return ((unsigned volatile short*) &_io_ports[M6811_TOC5_H])[0];
00140 }
00141
00142 extern __inline__ void
00143 set_output_compare_5 (unsigned short value)
00144 {
00145 ((unsigned volatile short*) &_io_ports[M6811_TOC5_H])[0] = value;
00146 }
00147
00148
00149 extern __inline__ void
00150 set_bus_expanded (void)
00151 {
00152 _io_ports[M6812_HPRIO] |= M6811_MDA;
00153 }
00154
00155
00156
00157 extern __inline__ void
00158 set_bus_single_chip (void)
00159 {
00160 _io_ports[M6811_HPRIO] &= ~M6811_MDA;
00161 }
00162 #endif
00163
00164
00165 extern __inline__ void
00166 cop_reset (void)
00167 {
00168 _io_ports[M6812_COPRST] = 0x55;
00169 _io_ports[M6812_COPRST] = 0xAA;
00170 }
00171
00172 extern __inline__ void
00173 cop_optional_reset (void)
00174 {
00175 #if defined(M6811_USE_COP) && M6811_USE_COP == 1
00176 cop_reset ();
00177 #endif
00178 }
00179
00180
00181 extern __inline__ void
00182 timer_acknowledge (void)
00183 {
00184 _io_ports[M6812_RTIFLG] = M6812_RTIF;
00185 }
00186
00187
00188 extern __inline__ void
00189 timer_initialize_rate (unsigned char divisor)
00190 {
00191 _io_ports[M6812_RTICTL] = divisor;
00192 }
00193
00194 #endif