⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hallsensor2.c

📁 BLDC电机控制源代码
💻 C
字号:
/** ###################################################################
**     THIS BEAN MODULE IS GENERATED BY THE TOOL. DO NOT MODIFY IT.
**     Filename  : HallSensor2.C
**     Project   : BLDC_sensor
**     Processor : 56F8013VFAE
**     Beantype  : Init_TMR
**     Version   : Bean 01.100, Driver 01.15, CPU db: 2.87.068
**     Compiler  : Metrowerks DSP C Compiler
**     Date/Time : 2006-07-24, 16:17
**     Abstract  :
**         This "Init_TMR" Peripheral Inspector implements the
**         Quad Timer module (TMR), basic initialization
**         and settings.
**     Settings  :
**         Timer counter device        : TMR1
**
**         Operation mode              : Edge count mode
**         Count once                  : count repeatedly
**         Count length                : count till compare, then reinitialize
**         Count direction             : up
**         Master mode                 : Disabled
**         External OFLAG force        : Disabled
**         Forced OFLAG value          : Disabled
**         Force OFLAG ouput           : Disabled
**         Output enable               : no
**         Output polarity             : true
**         Input  polarity             : true
**         Co-channel init.            : Disabled
**
**         Primary source              : counter 1 input pin
**         Secondary source            : counter 0 input pin
**
**         Input capture mode          : Disabled
**
**         Output mode                 : asserted while counter is active
**
**         Compare load control 1      : Disabled
**         Compare load control 2      : Disabled
**
**         Debug mode action           : Normal operation
**
**         Interrupts
**             Timer compare           : Enabled
**             Timer overflow          : Disabled
**             Input edge              : Disabled
**             Timer compare 1         : Disabled
**             Timer compare 2         : Disabled
**             ISR name                : ISR_HallSensor2
**             Interrupt name          : INT_TMR1
**             Priority                : 1
**     Contents  :
**         Init - void HallSensor2_Init(void);
**
**     (c) Copyright UNIS, spol. s r.o. 1997-2004
**     UNIS, spol. s r.o.
**     Jundrovska 33
**     624 00 Brno
**     Czech Republic
**     http      : www.processorexpert.com
**     mail      : info@processorexpert.com
** ###################################################################*/

/* MODULE HallSensor2. */

#include "HallSensor2.h"

/*
** ###################################################################
**
**  The following method must be implemented by the user in one
**  of the following modules:
**
**    #pragma interrupt
**    void ISR_HallSensor2(void)
**
**  Modules:
**       BLDC_sensor
**
** ###################################################################
*/

/*
** ===================================================================
**     Method      :  HallSensor2_Init (bean Init_TMR)
**
**     Description :
**         This method initializes registers of the TMR module
**         according to this Peripheral Initialization Bean settings.
**         Call this method in the user code to initialize the
**         module. By default, the method is called by PE
**         automatically; see "Call Init method" property of the
**         bean for more details.
**     Parameters  : None
**     Returns     : Nothing
** ===================================================================
*/
void HallSensor2_Init(void)
{
  setReg16(TMR1_CMP1, 0);              /* Set the Compare register 1 */ 
  setReg16(TMR1_CMP2, 0);              /* Set the Compare register 2 */ 
  setReg16(TMR1_LOAD, 0);              /* Set the Load register */ 
  setReg16(TMR1_CNTR, 0);              /* Set the Counter register */ 
  /* TMR1_SCR: TCF=0,TCFIE=1,TOF=0,TOFIE=0,IEF=0,IEFIE=0,IPS=0,INPUT=0,Capture_Mode=0,MSTR=0,EEOF=0,VAL=0,FORCE=0,OPS=0,OEN=0 */
  setReg16(TMR1_SCR, 16384);           /* Set the Status and control register */ 
  /* TMR1_CMPLD1: COMPARATOR_LOAD_1=0 */
  setReg16(TMR1_CMPLD1, 0);            /* Set the Comparator load register 1 */ 
  /* TMR1_CMPLD2: COMPARATOR_LOAD_2=0 */
  setReg16(TMR1_CMPLD2, 0);            /* Set the Comparator load register 2 */ 
  /* TMR1_COMSCR: DBG_EN=0,??=0,??=0,??=0,??=0,??=0,??=0,TCF2EN=0,TCF1EN=0,TCF2=0,TCF1=0,CL2=0,CL1=0 */
  setReg16(TMR1_COMSCR, 0);            /* Set the Comparator status/control register */ 
  /* TMR1_CTRL: CM=2,PCS=1,SCS=0,ONCE=0,LENGTH=1,DIR=0,Co_INIT=0,OM=0 */
  setReg16(TMR1_CTRL, 16928);          /* Set the Control register */ 
}

/* END HallSensor2. */

/*
** ###################################################################
**
**     This file was created by UNIS Processor Expert 2.96 [03.65]
**     for the Freescale 56800 series of microcontrollers.
**
** ###################################################################
*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -