📄 mw_c28xx_csl_c.html
字号:
<SPAN class="LineNumber"> 103 </SPAN> PieVectTable.TINT0 = &<A HREF=MW_c28xx_csl_c.html#fcn_schedulerTimer_ISR TARGET="rtwreport_document_frame"><FONT COLOR="#1122aa">schedulerTimer_ISR</FONT></A>;<SPAN class="Comment">// Hook interrupt to the ISR</SPAN>
<SPAN class="LineNumber"> 104 </SPAN> EDIS;
<SPAN class="LineNumber"> 105 </SPAN> PieCtrlRegs.PIEIER1.bit.INTx7 = 1; <SPAN class="Comment">// Enable TINT0 in the PIE: Group 1 interrupt 7</SPAN>
<SPAN class="LineNumber"> 106 </SPAN> IER |= M_INT1; <SPAN class="Comment">// Enable Global INT1 (CPU INT1)</SPAN>
<SPAN class="LineNumber"> 107 </SPAN>
<SPAN class="LineNumber"> 108 </SPAN> <SPAN class="Comment">// Enable global Interrupts and higher priority real-time debug events:</SPAN>
<SPAN class="LineNumber"> 109 </SPAN> EINT; <SPAN class="Comment">// Enable Global interrupt INTM</SPAN>
<SPAN class="LineNumber"> 110 </SPAN> ERTM; <SPAN class="Comment">// Enable Global realtime interrupt DBGM</SPAN>
<SPAN class="LineNumber"> 111 </SPAN><B>}</B>
<SPAN class="LineNumber"> 112 </SPAN>
<SPAN class="LineNumber"> 113 </SPAN><SPAN class="Datatype">void</SPAN> <A NAME=fcn_disable_interrupts>disable_interrupts</A>()
<SPAN class="LineNumber"> 114 </SPAN><B>{</B>
<SPAN class="LineNumber"> 115 </SPAN> IER &= M_INT1; <SPAN class="Comment">// Disable Global INT1 (CPU Interrupt Group 1)</SPAN>
<SPAN class="LineNumber"> 116 </SPAN> DINT; <SPAN class="Comment">// Disable Global interrupt INTM</SPAN>
<SPAN class="LineNumber"> 117 </SPAN><B>}</B>
<SPAN class="LineNumber"> 118 </SPAN>
<SPAN class="LineNumber"> 119 </SPAN><SPAN class="Datatype">void</SPAN> <A NAME=fcn_init_board>init_board</A> ()
<SPAN class="LineNumber"> 120 </SPAN><B>{</B>
<SPAN class="LineNumber"> 121 </SPAN> InitSysCtrl();
<SPAN class="LineNumber"> 122 </SPAN>
<SPAN class="LineNumber"> 123 </SPAN> <SPAN class="Comment">/* Perform additional configuration of the XTINF for speed up */</SPAN>
<SPAN class="LineNumber"> 124 </SPAN> XintfRegs.XINTCNF2.bit.XTIMCLK = 0; <SPAN class="Comment">// XTIMCLK=SYSCLKOUT/1</SPAN>
<SPAN class="LineNumber"> 125 </SPAN> XintfRegs.XINTCNF2.bit.CLKOFF = 0; <SPAN class="Comment">// XCLKOUT is enabled</SPAN>
<SPAN class="LineNumber"> 126 </SPAN> XintfRegs.XINTCNF2.bit.CLKMODE = 0; <SPAN class="Comment">// XCLKOUT = XTIMCLK</SPAN>
<SPAN class="LineNumber"> 127 </SPAN>
<SPAN class="LineNumber"> 128 </SPAN> <SPAN class="Comment">// Make sure write buffer is empty before configuring buffering depth</SPAN>
<SPAN class="LineNumber"> 129 </SPAN> <SPAN class="Keyword">while</SPAN> (XintfRegs.XINTCNF2.bit.WLEVEL != 0) ;<SPAN class="Comment">// poll the WLEVEL bit</SPAN>
<SPAN class="LineNumber"> 130 </SPAN> XintfRegs.XINTCNF2.bit.WRBUFF = 0; <SPAN class="Comment">// No write buffering</SPAN>
<SPAN class="LineNumber"> 131 </SPAN>
<SPAN class="LineNumber"> 132 </SPAN> <SPAN class="Comment">// Example: Assume Zone 7 is slow, so add additional BCYC cycles whenever</SPAN>
<SPAN class="LineNumber"> 133 </SPAN> <SPAN class="Comment">// switching from Zone 7 to another Zone. This will help avoid bus contention.</SPAN>
<SPAN class="LineNumber"> 134 </SPAN> XintfRegs.XBANK.bit.BCYC = 7; <SPAN class="Comment">// Add 7 cycles</SPAN>
<SPAN class="LineNumber"> 135 </SPAN> XintfRegs.XBANK.bit.BANK = 7; <SPAN class="Comment">// select zone 7</SPAN>
<SPAN class="LineNumber"> 136 </SPAN>
<SPAN class="LineNumber"> 137 </SPAN> <SPAN class="Comment">/* Zone 0 Configuration */</SPAN>
<SPAN class="LineNumber"> 138 </SPAN> XintfRegs.XTIMING0.bit.X2TIMING = 0; <SPAN class="Comment">// Timing scale factor = 1</SPAN>
<SPAN class="LineNumber"> 139 </SPAN> XintfRegs.XTIMING0.bit.XSIZE = 3; <SPAN class="Comment">// Always write as 11b</SPAN>
<SPAN class="LineNumber"> 140 </SPAN> XintfRegs.XTIMING0.bit.READYMODE = 1;<SPAN class="Comment">// XREADY is asynchronous</SPAN>
<SPAN class="LineNumber"> 141 </SPAN> XintfRegs.XTIMING0.bit.USEREADY = 0; <SPAN class="Comment">// Disable XREADY</SPAN>
<SPAN class="LineNumber"> 142 </SPAN> XintfRegs.XTIMING0.bit.XRDLEAD = 1; <SPAN class="Comment">// Read lead time</SPAN>
<SPAN class="LineNumber"> 143 </SPAN> XintfRegs.XTIMING0.bit.XRDACTIVE = 2;<SPAN class="Comment">// Read active time</SPAN>
<SPAN class="LineNumber"> 144 </SPAN> XintfRegs.XTIMING0.bit.XRDTRAIL = 0; <SPAN class="Comment">// Read trail time</SPAN>
<SPAN class="LineNumber"> 145 </SPAN> XintfRegs.XTIMING0.bit.XWRLEAD = 1; <SPAN class="Comment">// Write lead time</SPAN>
<SPAN class="LineNumber"> 146 </SPAN> XintfRegs.XTIMING0.bit.XWRACTIVE = 2;<SPAN class="Comment">// Write active time</SPAN>
<SPAN class="LineNumber"> 147 </SPAN> XintfRegs.XTIMING0.bit.XWRTRAIL = 0; <SPAN class="Comment">// Write trail time</SPAN>
<SPAN class="LineNumber"> 148 </SPAN>
<SPAN class="LineNumber"> 149 </SPAN> <SPAN class="Comment">/* Zone 1 Configuration */</SPAN>
<SPAN class="LineNumber"> 150 </SPAN> XintfRegs.XTIMING1.bit.X2TIMING = 0; <SPAN class="Comment">// Timing scale factor = 1</SPAN>
<SPAN class="LineNumber"> 151 </SPAN> XintfRegs.XTIMING1.bit.XSIZE = 3; <SPAN class="Comment">// Always write as 11b</SPAN>
<SPAN class="LineNumber"> 152 </SPAN> XintfRegs.XTIMING1.bit.READYMODE = 1;<SPAN class="Comment">// XREADY is asynchronous</SPAN>
<SPAN class="LineNumber"> 153 </SPAN> XintfRegs.XTIMING1.bit.USEREADY = 0; <SPAN class="Comment">// Disable XREADY</SPAN>
<SPAN class="LineNumber"> 154 </SPAN> XintfRegs.XTIMING1.bit.XRDLEAD = 1; <SPAN class="Comment">// Read lead time</SPAN>
<SPAN class="LineNumber"> 155 </SPAN> XintfRegs.XTIMING1.bit.XRDACTIVE = 2;<SPAN class="Comment">// Read active time</SPAN>
<SPAN class="LineNumber"> 156 </SPAN> XintfRegs.XTIMING1.bit.XRDTRAIL = 0; <SPAN class="Comment">// Read trail time</SPAN>
<SPAN class="LineNumber"> 157 </SPAN> XintfRegs.XTIMING1.bit.XWRLEAD = 1; <SPAN class="Comment">// Write lead time</SPAN>
<SPAN class="LineNumber"> 158 </SPAN> XintfRegs.XTIMING1.bit.XWRACTIVE = 2;<SPAN class="Comment">// Write active time</SPAN>
<SPAN class="LineNumber"> 159 </SPAN> XintfRegs.XTIMING1.bit.XWRTRAIL = 0; <SPAN class="Comment">// Write trail time</SPAN>
<SPAN class="LineNumber"> 160 </SPAN>
<SPAN class="LineNumber"> 161 </SPAN> <SPAN class="Comment">/* Zone 2 Configuration */</SPAN>
<SPAN class="LineNumber"> 162 </SPAN> XintfRegs.XTIMING2.bit.X2TIMING = 0; <SPAN class="Comment">// Timing scale factor = 1</SPAN>
<SPAN class="LineNumber"> 163 </SPAN> XintfRegs.XTIMING2.bit.XSIZE = 3; <SPAN class="Comment">// Always write as 11b</SPAN>
<SPAN class="LineNumber"> 164 </SPAN> XintfRegs.XTIMING2.bit.READYMODE = 1;<SPAN class="Comment">// XREADY is asynchronous</SPAN>
<SPAN class="LineNumber"> 165 </SPAN> XintfRegs.XTIMING2.bit.USEREADY = 0; <SPAN class="Comment">// Disable XREADY</SPAN>
<SPAN class="LineNumber"> 166 </SPAN> XintfRegs.XTIMING2.bit.XRDLEAD = 1; <SPAN class="Comment">// Read lead time</SPAN>
<SPAN class="LineNumber"> 167 </SPAN> XintfRegs.XTIMING2.bit.XRDACTIVE = 2;<SPAN class="Comment">// Read active time</SPAN>
<SPAN class="LineNumber"> 168 </SPAN> XintfRegs.XTIMING2.bit.XRDTRAIL = 0; <SPAN class="Comment">// Read trail time</SPAN>
<SPAN class="LineNumber"> 169 </SPAN> XintfRegs.XTIMING2.bit.XWRLEAD = 1; <SPAN class="Comment">// Write lead time</SPAN>
<SPAN class="LineNumber"> 170 </SPAN> XintfRegs.XTIMING2.bit.XWRACTIVE = 2;<SPAN class="Comment">// Write active time</SPAN>
<SPAN class="LineNumber"> 171 </SPAN> XintfRegs.XTIMING2.bit.XWRTRAIL = 0; <SPAN class="Comment">// Write trail time</SPAN>
<SPAN class="LineNumber"> 172 </SPAN>
<SPAN class="LineNumber"> 173 </SPAN> <SPAN class="Comment">/* Zone 6 Configuration */</SPAN>
<SPAN class="LineNumber"> 174 </SPAN> XintfRegs.XTIMING6.bit.X2TIMING = 0; <SPAN class="Comment">// Timing scale factor = 1</SPAN>
<SPAN class="LineNumber"> 175 </SPAN> XintfRegs.XTIMING6.bit.XSIZE = 3; <SPAN class="Comment">// Always write as 11b</SPAN>
<SPAN class="LineNumber"> 176 </SPAN> XintfRegs.XTIMING6.bit.READYMODE = 1;<SPAN class="Comment">// XREADY is asynchronous</SPAN>
<SPAN class="LineNumber"> 177 </SPAN> XintfRegs.XTIMING6.bit.USEREADY = 0; <SPAN class="Comment">// Disable XREADY</SPAN>
<SPAN class="LineNumber"> 178 </SPAN> XintfRegs.XTIMING6.bit.XRDLEAD = 1; <SPAN class="Comment">// Read lead time</SPAN>
<SPAN class="LineNumber"> 179 </SPAN> XintfRegs.XTIMING6.bit.XRDACTIVE = 2;<SPAN class="Comment">// Read active time</SPAN>
<SPAN class="LineNumber"> 180 </SPAN> XintfRegs.XTIMING6.bit.XRDTRAIL = 0; <SPAN class="Comment">// Read trail time</SPAN>
<SPAN class="LineNumber"> 181 </SPAN> XintfRegs.XTIMING6.bit.XWRLEAD = 1; <SPAN class="Comment">// Write lead time</SPAN>
<SPAN class="LineNumber"> 182 </SPAN> XintfRegs.XTIMING6.bit.XWRACTIVE = 2;<SPAN class="Comment">// Write active time</SPAN>
<SPAN class="LineNumber"> 183 </SPAN> XintfRegs.XTIMING6.bit.XWRTRAIL = 0; <SPAN class="Comment">// Write trail time</SPAN>
<SPAN class="LineNumber"> 184 </SPAN>
<SPAN class="LineNumber"> 185 </SPAN> <SPAN class="Comment">/* Zone 7 Configuration */</SPAN>
<SPAN class="LineNumber"> 186 </SPAN> XintfRegs.XTIMING7.bit.X2TIMING = 0; <SPAN class="Comment">// Timing scale factor = 1</SPAN>
<SPAN class="LineNumber"> 187 </SPAN> XintfRegs.XTIMING7.bit.XSIZE = 3; <SPAN class="Comment">// Always write as 11b</SPAN>
<SPAN class="LineNumber"> 188 </SPAN> XintfRegs.XTIMING7.bit.READYMODE = 1;<SPAN class="Comment">// XREADY is asynchronous</SPAN>
<SPAN class="LineNumber"> 189 </SPAN> XintfRegs.XTIMING7.bit.USEREADY = 0; <SPAN class="Comment">// Disable XREADY</SPAN>
<SPAN class="LineNumber"> 190 </SPAN> XintfRegs.XTIMING7.bit.XRDLEAD = 1; <SPAN class="Comment">// Read lead time</SPAN>
<SPAN class="LineNumber"> 191 </SPAN> XintfRegs.XTIMING7.bit.XRDACTIVE = 2;<SPAN class="Comment">// Read active time</SPAN>
<SPAN class="LineNumber"> 192 </SPAN> XintfRegs.XTIMING7.bit.XRDTRAIL = 0; <SPAN class="Comment">// Read trail time</SPAN>
<SPAN class="LineNumber"> 193 </SPAN> XintfRegs.XTIMING7.bit.XWRLEAD = 1; <SPAN class="Comment">// Write lead time</SPAN>
<SPAN class="LineNumber"> 194 </SPAN> XintfRegs.XTIMING7.bit.XWRACTIVE = 2;<SPAN class="Comment">// Write active time</SPAN>
<SPAN class="LineNumber"> 195 </SPAN> XintfRegs.XTIMING7.bit.XWRTRAIL = 0; <SPAN class="Comment">// Write trail time</SPAN>
<SPAN class="LineNumber"> 196 </SPAN>
<SPAN class="LineNumber"> 197 </SPAN> <SPAN class="Comment">/* Flush pipeline to ensure that the write is complete. Wait to be sure. */</SPAN>
<SPAN class="LineNumber"> 198 </SPAN> asm(<FONT COLOR=#1122ff>" RPT #6 || NOP"</FONT>);
<SPAN class="LineNumber"> 199 </SPAN>
<SPAN class="LineNumber"> 200 </SPAN> <SPAN class="Comment">/* Disable and clear all CPU interrupts */</SPAN>
<SPAN class="LineNumber"> 201 </SPAN> DINT;
<SPAN class="LineNumber"> 202 </SPAN> IER = 0x0000;
<SPAN class="LineNumber"> 203 </SPAN> IFR = 0x0000;
<SPAN class="LineNumber"> 204 </SPAN> InitPieCtrl();
<SPAN class="LineNumber"> 205 </SPAN> InitPieVectTable();
<SPAN class="LineNumber"> 206 </SPAN>
<SPAN class="LineNumber"> 207 </SPAN> <SPAN class="Comment">/* initial eCAN function.... */</SPAN>
<SPAN class="LineNumber"> 208 </SPAN>
<SPAN class="LineNumber"> 209 </SPAN> <SPAN class="Comment">/* initial SPI function.... */</SPAN>
<SPAN class="LineNumber"> 210 </SPAN>
<SPAN class="LineNumber"> 211 </SPAN> <SPAN class="Comment">/* initial SCI function.... */</SPAN>
<SPAN class="LineNumber"> 212 </SPAN> InitCpuTimers();
<SPAN class="LineNumber"> 213 </SPAN><B>}</B>
</PRE>
</TD></TR></TABLE>
<P>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -