亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? bldczc.c

?? MC56F802BLDC 可以使用的算法 就是電機啟動有點慢
?? C
?? 第 1 頁 / 共 5 頁
字號:
/****************************************************************************************************
*
*  Motorola Inc.
*  (c) Copyright 2000 Motorola Inc.
*  ALL RIGHTS RESERVED.
*
*****************************************************************************************************
*
*
*  FILE NAME: BldcZC.c
*  
*  DESCRIPTION: Motorola Bldc Zero Crossing Algorithm source file
*
*  MODULES INCLUDED: stdlib.h
*                    dspfunc.h
*                    bldc.h
*
*****************************************************************************************************/

/****************************************************************************************************
 *!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 *   READ ME CAREFULLY:                                                
 *!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 * The general of BldcZC algorithms interconnectivity is, they are     
 * devided into groups according to their functionalities:             
 * - COMPUTATION:                                                      
 *            - bldczcComput(),bldczcComputInit()                      
 * - ZERO CROSSING                                                     
 *           - bldczcCmtServ(),bldczcZCrosIntAlg(),bldczcZCrosInit()                                           
 * - COMMUTATION:                                                      
 *           - bldczcCmtServ(),bldczcCmtServInit()                     
 * - DATA EXCHANGE:                                                    
 *           - bldczcHndlr(),bldczcTimeoutIntAlg(),bldczcHndlrInit()   
 *             bldczcHndlrStop()                                       
 * !Each of the above group has its dedicated BldcZC_sState_xxx API    
 *    typedef data structure                                           
 * !Each of BldcZC_sState_xxx structure has BldcZC_u_xxx               
 *    Commands and Requests status flags register where the flags has  
 *    following meaning:                                               
 *    yy_zz_CmdFlag - is an output Command Flag from algorithm meaning:
 *                   action yy happened in algorithm zz!!!             
 *    yy_zz_RqFlag - is an input Request Flag to the algorithm meaning:
 *                  action yy happened(somewhere),                     
 *                  service in algorithm zz requested!!!                 
 *  !The data interchange between these groups is via:                 
 *  - bldczcHndlr() algorithm !!! and                                  
 *  - bldczcTimeoutIntAlg () algorithm !!!                             
 *       which input is bldczc_sStates data structure containing all   
 *       BldcZC_sState_xxx substructures                               
 *                                                                     
 *  The algorithms can also be splitted according to their             
 *  suggested calls:                                                   
 *  - from Main SW (or Arbiter called)                                 
 *  - from Interrupt subroutines called: xxxIntAlg                     
 *!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 ****************************************************************************************************/

/* Include Header Files */

/* include intristic functions */
#include "types.h"
#include "arch.h"
#include "mc.h"
#include "pwm.h"

/* include file contains global tables constants and definitions bldcdrv.h */
/* include BLDC Zero Crossing functions declarations BldcZC.h */
#include "bldc.h"

#ifdef __cplusplus
extern "C" {
#endif

/* variables definitions */
typedef union
{
	struct
	{
		UWord16 LSBpart;
		Word16 MSBpart;
	}RegParts;
	Word32 Reg32bit;
} uReg32;


/* BldcZCAlgo.c Internal Avialibility Functions Declarations */
static inline Result PresetCalculation (bldczc_sStateComput *pState_Comput, bldczc_sTimes *pTimes);
static inline Result SetCalculation (bldczc_sStateComput *pState_Comput, bldczc_sTimes *pTimes);

static inline Result PrepareToffTiming (bldczc_uCmdGeneral *pCmd_General,
                                        UWord16 *T_Next,
                                        UWord16 T_Cmt0,
                                        UWord16 Per_Toff);
inline static Result PrepareProcTiming (bldczc_uCmdGeneral *pCmd_General,
                                        UWord16 *T_Next,
                                        UWord16 T_Cmt0,
                                        UWord16 Const_PerProcCmt);
inline static Result CmtTimeout ( bldczc_sStates *pStates, bldczc_sTimes *pTimes , UWord16 T_Actual );
inline static Result CmtProcTimeout ( bldczc_sStates *pStates, bldczc_sTimes *pTimes );
inline static Result ZCToffTimeout ( bldczc_sStates *pStates );			  

/****************************************************************************************************
*
*  MODULE: bldczcHndlr ( bldczc_sStates *pStates, bldczc_sTimes *pTimes, UWord16 T_Actual )
*
*  DESCRIPTION: function bldczcHndlr is a command interface between bldczc software modules and their 
*               State_Comput, State_Cmt, State_ZCros, State_General data structures.
*               Refer to SDK documentation for detailes.
*
*  RETURNS: The function returns the PASS (0)      
*
*  SUBMODULES USED: CmtTimeout( pStates, pTimes, T_Actual )
*                       PrepareProcTiming ( bldczc_uCmdGeneral *pCmd_General,
*                                           UWord16 *T_Next,
*                                           UWord16 T_Cmt0,
*                                           UWord16 Const_PerProcCmt )
*                   PrepareToffTiming ( bldczc_uCmdGeneral *pCmd_General,
*                                       UWord16 *T_Next,
*                                       UWord16 T_Cmt0,
*                                       UWord16 Per_Toff)
*                   ZCToffTimeout ( bldczc_sStates *pStates )
*
*  ARGUMENTS: The function has three arguments:  in/out - pointer to bldczc_sStates structure that
*                                                         contains the status variables for all
*                                                         BLDC motor BEMF Zero Crossing algorithms
*                                                in/out - pointer to bldczc_sTimes structure that
*                                                         contains the time variables for all
*                                                         BLDC motor BEMF Zero Crossing algorithms
*                                                in     - T_Actual  - 16bit range  Actual Time
*
*  RANGE ISSUES: All the time variables and components T_x in bldczc_sTimes structure are 
*                computed as 16 bit rollower registers. It means that if their results overflows
*                16 bits, they are not saturated, just the overflow bit is ignored and low 16 bits
*                word is taken as a result. Then the T_x variables can be used as outputs and inputs
*                from a 16 bit past compare timer used as a system clock base!
*
*  SPECIAL ISSUES: The function calculates correct results if the saturaion mode is set or not .
*
****************************************************************************************************/
/* -------------------[ bldczcHndlr - Begin ]------------------------------*/
Result bldczcHndlr ( bldczc_sStates *pStates, bldczc_sTimes *pTimes, UWord16 T_Actual )
{
/* temporary registers - unions for 16bit MSB,LSB or 32 bit acces */
 uReg32   Temp1F32;
 uReg32   Temp2F32;
 UWord16  Temp1UW16;
 UWord16  TempOMR;

 if (pStates->State_Cmt.Cmd_Cmt.B.CmtDone_CmdFlag)
    {
/* -------------------[ CmtDoneHndlr - Begin ]-----------------------*/                                          
     pStates->State_ZCros.Cmd_ZCros.B.ZCOKGet_CmdFlag = 0;    /* clear possible hazard states */
     pStates->State_ZCros.Cmd_ZCros.B.ZCMiss_CmdFlag = 0;     /* clear possible hazard states */


     pStates->State_Comput.Cmd_Comput.B.CmtComp_CmdFlag = 0;  /* clear possible hazard states */     
     pStates->State_ZCros.Cmd_ZCros.B.CmtDone_ZCrosServ_CmdFlag = 0; /* clear possible hazard states */
     pStates->State_Comput.Cmd_Comput.B.CmtPreComp_CmdFlag = 0; /* clear possible hazard states */
     pStates->State_Cmt.Cmd_Cmt.B.CmtServ_CmdFlag = 0;          /* clear possible hazard states */ 
      
     pStates->State_ZCros.Cmd_ZCros.B.CmtDone_ZCrosServ_RqFlag = 1;
     pStates->State_Comput.Cmd_Comput.B.CmtDone_Comput_RqFlag = 1;  
     pStates->State_Cmt.Cmd_Cmt.B.CmtDone_CmtServ_RqFlag = 1;
     pStates->State_Cmt.Cmd_Cmt.B.CmtDone_CmdFlag = 0;            /* clear command Flag */     
/* -------------------[ CmtDoneHndlr - End ]-------------------------*/
    };
 if (pStates->State_ZCros.Cmd_ZCros.B.CmtDone_ZCrosServ_CmdFlag)
    {
/* -------------------[ CmtDoneZCrosHndlr - Begin ]------------------*/
     pStates->State_ZCros.Cmd_ZCros.B.CmtDone_ZCrosServ_CmdFlag = 0;
     if ( pStates->State_ZCros.Cmd_ZCros.B.EndStart_ZCrosServ_CmdFlag \
          && pStates->State_General.Cmd_General.B.StartMode_HndlrFlag )
         {
          pStates->State_General.Cmd_General.B.EndStartMode_HndlrCmdFlag = 1;               
         };
     if ( pStates->State_ZCros.Cmd_ZCros.B.MaxZCrosErr_ZCrosServ_CmdFlag )
         {
          pStates->State_General.Cmd_General.B.MaxZCrosErr_HndlrCmdFlag = 1;               
         };
/* -------------------[ CmtDoneZCrosHndlr - End ]--------------------*/
    }    
 if (pStates->State_General.Cmd_General.B.CmtProcEnd_CmdFlag)
    {
/* -------------------[ CmtProcEndHndlr - Begin ]--------------------*/
     pStates->State_ZCros.Cmd_ZCros.B.CmtProcEnd_ZCrosServ_RqFlag = 1;
     pStates->State_General.Cmd_General.B.CmtProcEnd_CmdFlag = 0;
/* -------------------[ CmtProcEndHndlr - End ]----------------------*/
    }
 if (pStates->State_Comput.Cmd_Comput.B.ToffComp_CmdFlag)
    {
/* -------------------[ ToffCompHndlr - Begin ]----------------------*/
     pStates->State_General.Cmd_General.B.ToffComp_Timeout_InfoFlag = 1;

     pStates->State_Comput.Cmd_Comput.B.ToffComp_CmdFlag = 0;
/* -------------------[ ToffCompHndlr - End ]------------------------*/    
    }
 if ( pStates->State_General.Cmd_General.B.ZCToff_TimedFlag )
    {    
      if ( pStates->State_General.Cmd_General.B.ZCToffTest_Hndlr_RqFlag )
         { 
/* -------------------[ ZCToffTestHndlr - Begin ]--------------------*/
/* solving of hazard states when Toff Passed before Timer was set */
          pStates->State_General.Cmd_General.B.ZCToffTest_Hndlr_RqFlag = 0;
          /* if ( pTimes->Per_Toff < T_Actual - pTimes->T_Cmt0 ) */
          Temp1F32.RegParts.MSBpart = 0;
          Temp1F32.RegParts.LSBpart = T_Actual;    
          Temp2F32.RegParts.MSBpart = 0;
          Temp2F32.RegParts.LSBpart = pTimes->T_Cmt0;
          Temp2F32.Reg32bit = L_sub( Temp1F32.Reg32bit, Temp2F32.Reg32bit );
          Temp1UW16 = Temp2F32.RegParts.LSBpart;
          /* Removed asm(move OMR,TempOMR); */ /* store OMR status */
          /* Removed archSetNoSat(); */       /* switch saturation off */ 
          /* Removed Temp1UW16 = T_Actual - pTimes->T_Cmt0;  */
          /* Removed asm(move TempOMR,OMR);  */  /* restore OMR status */
          if ( pTimes->Per_Toff < Temp1UW16)
             {                                                          
              ZCToffTimeout ( pStates );
             }
/* -------------------[ ZCToffTestHndlr - End ]----------------------*/
         }
      if ( pStates->State_General.Cmd_General.B.ToffComp_Timeout_InfoFlag )
         {
/* -------------------[ ToffTimedHndlr - Begin ]---------------------*/
/* solving of hazard states when Toff Timer is set with last value 
   before ZCToff computed */
          pStates->State_General.Cmd_General.B.ToffComp_Timeout_InfoFlag = 0;
          PrepareToffTiming (&pStates->State_General.Cmd_General,\
           &pTimes->T_Next, pTimes->T_Cmt0, pTimes->Per_Toff);
/* -------------------[ ToffTimedHndlr - End ]-----------------------*/ 
         }
     }
 if (pStates->State_Cmt.Cmd_Cmt.B.CmtServ_CmdFlag)
    {
/* -------------------[ CmtServHndlr - Begin ]-----------------------*/
     pStates->State_ZCros.Cmd_ZCros.B.CmtServ_ZCrosServ_RqFlag = 1; 
     pStates->State_General.Cmd_General.B.StepPrepared_Timeout_InfoFlag = 1;    
     pStates->State_Cmt.Cmd_Cmt.B.CmtServ_CmdFlag = 0;
/* -------------------[ CmtServHndlr - End ]-------------------------*/    
    }    
 if (pStates->State_ZCros.Cmd_ZCros.B.CmtServ_ZCrosServ_CmdFlag)
    {
/* -------------------[ CmtServZCServHndlr - Begin ]-----------------*/
     pStates->State_General.Cmd_General.B.ZCPrepared_Timeout_InfoFlag = 1;
     pStates->State_ZCros.Cmd_ZCros.B.CmtServ_ZCrosServ_CmdFlag = 0;     
/* -------------------[ CmtServZCServHndlr - End ]-------------------*/    
    }
 if ( pStates->State_General.Cmd_General.B.ZCToffEnd_CmdFlag && \
     pStates->State_Comput.Cmd_Comput.B.CmtPreComp_CmdFlag )

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美精品一二三四| 日本亚洲欧美天堂免费| 精品卡一卡二卡三卡四在线| 欧美剧情片在线观看| 欧美一区二区在线视频| 91国偷自产一区二区三区成为亚洲经典 | 亚洲一区自拍偷拍| 亚洲成人免费av| 亚洲va国产va欧美va观看| 日韩一区精品视频| 免费精品视频最新在线| 免费精品视频在线| 国产麻豆视频一区二区| 成人激情免费电影网址| 91蝌蚪porny| 欧美精品丝袜久久久中文字幕| 91精品国产乱| 日本一二三不卡| 欧美日韩一区在线观看| 欧美一区二区三区在线观看视频| 日韩一区二区影院| 中文av一区二区| 亚洲v日本v欧美v久久精品| 精品一区二区三区的国产在线播放| 成人高清免费在线播放| 欧美日本一区二区| 精品欧美一区二区三区精品久久| 国产精品久久久久久久浪潮网站| 午夜婷婷国产麻豆精品| 99麻豆久久久国产精品免费优播| 日韩欧美一级特黄在线播放| 亚洲精品国产无套在线观| 国产精品中文字幕日韩精品| 欧美日韩国产另类一区| 综合电影一区二区三区| 国产老肥熟一区二区三区| 日韩一区二区在线免费观看| 亚洲另类中文字| 成人黄色777网| 精品成a人在线观看| 五月天一区二区三区| 色哟哟日韩精品| 国产精品免费网站在线观看| 精品系列免费在线观看| 欧美精品第一页| 亚洲午夜一区二区三区| 色婷婷国产精品综合在线观看| 国产精品人成在线观看免费| 国产一区欧美日韩| 精品国产髙清在线看国产毛片| 亚洲成av人片在www色猫咪| 在线观看亚洲a| 亚洲免费色视频| 99久久久国产精品| 国产精品日产欧美久久久久| 国产成人啪午夜精品网站男同| 欧美电影免费观看高清完整版在| 亚洲成人av中文| 欧美日韩国产片| 亚洲不卡av一区二区三区| 欧美日韩一区二区三区高清| 一区二区三区自拍| 欧美最猛性xxxxx直播| 亚洲欧美日韩国产成人精品影院| www.爱久久.com| 国产精品久久久久aaaa| av网站免费线看精品| 亚洲图片激情小说| 91麻豆成人久久精品二区三区| 日韩毛片精品高清免费| 色综合天天综合网国产成人综合天| 专区另类欧美日韩| 91欧美激情一区二区三区成人| 亚洲精品国产视频| 欧美日韩亚洲综合在线 欧美亚洲特黄一级| 亚洲一区二区三区四区在线观看 | 亚洲女厕所小便bbb| 99久久综合色| 亚洲精品福利视频网站| 91九色02白丝porn| 亚洲成人精品在线观看| 日韩一区二区三区高清免费看看| 美女视频一区二区| 久久久久国产精品麻豆| 成人伦理片在线| 亚洲精品成人在线| 这里只有精品99re| 国产一区二区三区av电影| 中文字幕一区免费在线观看| av电影在线观看一区| 一区av在线播放| 欧美一区二区性放荡片| 国内偷窥港台综合视频在线播放| 久久久久青草大香线综合精品| 成人中文字幕在线| 亚洲综合丁香婷婷六月香| 制服丝袜中文字幕一区| 国产在线乱码一区二区三区| 亚洲欧洲韩国日本视频| 欧美日韩不卡一区二区| 国产伦精品一区二区三区免费| 国产精品国产精品国产专区不蜜| 色就色 综合激情| 免费观看在线色综合| 中文字幕av一区二区三区高| 欧美性色黄大片手机版| 久久99国产精品免费网站| 国产清纯白嫩初高生在线观看91| 91丨porny丨中文| 日韩av不卡在线观看| 久久久久久99久久久精品网站| 9人人澡人人爽人人精品| 亚欧色一区w666天堂| 国产女主播在线一区二区| 在线视频一区二区三| 蜜桃视频在线观看一区| 中文字幕一区在线观看| 91精品国产品国语在线不卡| 成人午夜视频在线| 日韩精品乱码免费| 国产精品大尺度| 日韩欧美在线网站| 97精品久久久午夜一区二区三区 | 日韩欧美国产一区二区在线播放| 国产传媒一区在线| 亚洲成人久久影院| 国产精品你懂的| 日韩一级完整毛片| 97久久超碰国产精品电影| 欧美国产激情二区三区| 欧美美女喷水视频| 丁香亚洲综合激情啪啪综合| 婷婷激情综合网| 亚洲欧洲www| 欧美精品一区男女天堂| 欧美色图一区二区三区| 国产不卡视频在线播放| 天天亚洲美女在线视频| 国产精品动漫网站| 26uuu亚洲| 91麻豆精品国产91久久久久| 91蜜桃视频在线| 国产成人精品一区二区三区网站观看 | 国产一区二区三区综合| 婷婷六月综合亚洲| 一区二区三区中文在线| 国产亚洲欧美日韩俺去了| 欧美精品成人一区二区三区四区| 99re6这里只有精品视频在线观看| 狠狠色丁香久久婷婷综| 男女激情视频一区| 午夜视频一区在线观看| 亚洲一区二区偷拍精品| 亚洲色图在线播放| 久久久久久黄色| 精品久久久久99| 欧美一区二区黄色| 在线影院国内精品| 色94色欧美sute亚洲线路一久 | 亚洲欧美日韩中文播放| 国产欧美日本一区二区三区| 精品国产乱码久久久久久影片| 91精品国产乱码久久蜜臀| 欧美精品九九99久久| 欧美日韩成人在线一区| 欧美日韩国产电影| 欧美日韩中文字幕精品| 日本高清不卡一区| 91污片在线观看| 99久久精品久久久久久清纯| www.亚洲人| 91视频xxxx| 91在线视频免费观看| 久久精品国产澳门| 九一九一国产精品| 精品一区二区三区在线播放视频| 麻豆专区一区二区三区四区五区| 日韩综合一区二区| 青娱乐精品在线视频| 美女视频免费一区| 国内精品久久久久影院薰衣草| 激情小说亚洲一区| 国产毛片一区二区| 粉嫩av亚洲一区二区图片| 国产传媒欧美日韩成人| 成人激情午夜影院| 91亚洲午夜精品久久久久久| 在线观看国产日韩| 欧美日韩1234| 欧美r级在线观看| 日本一区二区在线不卡| 国产精品网站一区| 亚洲黄网站在线观看| 亚洲国产乱码最新视频| 热久久国产精品| 韩国女主播一区| 成人午夜视频免费看| 91丝袜呻吟高潮美腿白嫩在线观看| 成人美女在线视频| 日本韩国精品在线|