📄 tpu_init.c
字号:
#include "mpc555.h"
#include "m_tpu3.h"
void init_TPU(void);
void init_TPU()
{
/* enable tpu clocks( stop = 0 )
tcr1 divide by 1( tcr1p = 0b00 )
tcr2 divide by 1( tcr2p = 0b00 )
no emulation( emu = 0 )
tcr2 pin used as gate of DIV8 clock for TCR2( t2cg = 1 )
stop flag
supervisor and user space( supv = 0 )
tpu prescaler div 4( psck = 0 )
tpu3 mode( tpu3 = 1 )
gated imb clock( t2csl = 0 )
*/
TPU_A.TPUMCR.R = 0x0220 ;
TPU_A.TICR.B.CIRL = 1 ; // Interrupt request level 1.
TPU_A.TICR.B.ILBS = 0 ; // Interrupt levels 0 to 7 selected.
// USIU.SIMASK.B.LVM1 = 1 ; // Enable level 1; others disabled
}
/*********************************************************************
*
* Copyright:
* MOTOROLA, INC. All Rights Reserved.
* You are hereby granted a copyright license to use, modify, and
* distribute the SOFTWARE so long as this entire notice is
* retained without alteration in any modified and/or redistributed
* versions, and that such modified versions are clearly identified
* as such. No licenses are granted by implication, estoppel or
* otherwise under any patents or trademarks of Motorola, Inc. This
* software is provided on an "AS IS" basis and without warranty.
*
* To the maximum extent permitted by applicable law, MOTOROLA
* DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED, INCLUDING
* IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR
* PURPOSE AND ANY WARRANTY AGAINST INFRINGEMENT WITH REGARD TO THE
* SOFTWARE (INCLUDING ANY MODIFIED VERSIONS THEREOF) AND ANY
* ACCOMPANYING WRITTEN MATERIALS.
*
* To the maximum extent permitted by applicable law, IN NO EVENT
* SHALL MOTOROLA BE LIABLE FOR ANY DAMAGES WHATSOEVER (INCLUDING
* WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS
* INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY
* LOSS) ARISING OF THE USE OR INABILITY TO USE THE SOFTWARE.
*
* Motorola assumes no responsibility for the maintenance and support
* of this software
********************************************************************/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -