📄 etpuc_qom.c
字号:
| Set Interrupt and DMA request bits |
| Clear Link Service Request Event register. |
| Clear LSR_flag. |
| Schedule no more matches and exit thread |
| 5. If loop mode and Current_Match_Ptr has overflowed |
| point it to start of table and decrement loop counter |
| 6. If in single shot mode and Current_Match_Ptr has |
| overflowed |
| Clear channel flag0 |
| Record last match event time (in Last_Match_Time) |
| Clear match on action unit B |
| Set Interrupt and DMA request bits |
| Clear Link Service Request Event register. |
| Clear LSR_flag. |
| Schedule no more matches and exit thread |
| 7. Clear exisitng match and schedule future match according |
| to next queue entry |
| 8. Clear channel flag0 |
+--------------------------------------------------------------------------*/
else if( m1==1 && m2==1 && (flag0==1) )
{
Service_single_match1:
/*read_match() not required as Thread entered because of double match; so erta & ertb already hold value of last matches.*/
Current_Match_Ptr++; /*increment pointer*/
if ( IsLatchedFuncMode1() ) /*continuous mode FM=10|11 */
{
if (Current_Match_Ptr > Table_End_Ptr)
{
Current_Match_Ptr = Table_Start_Ptr;
}
}
else /* FM = 0x*/
{
if (IsLatchedFuncMode0()) /*Loop mode FM=01*/
{
if (Loop ==1 )
{
Done1:
if (Current_Match_Ptr > Table_End_Ptr)
{
Clear_Matches1:
Clear(flag0);
Last_Match_Time = ertb;
ClearMatchBEvent();
Clear_Matches0:
if (Overrun ==1)
{
SetChannelInterruptRequest();
SetDataTransferInterruptRequest();
Clear(LSRLatch) ;
Option = (Option & 0xBF); /* Clear LSR flag */
}
Overrun++;
return; /*schedule no more matches*/
}
}
else
{
if (Current_Match_Ptr > Table_End_Ptr)
{
Current_Match_Ptr = Table_Start_Ptr;
Loop--;
}
}
}
else /* single shot FM=00*/
{
goto Done1;
}
}
Offset= *Current_Match_Ptr;
Offset = Offset >>1;
if (CC.C ==1)
{
OnMatchB(PinHigh);
}
else
{
OnMatchB(PinLow);
}
ertb = erta + Offset ; /*update ertb with next value*/
ClearMatchBEvent();
WriteErtBToMatchBAndEnable();
Clear(flag0);
}
/*--------------------------------------------------------------------------+
| THREAD NAME: MATCH_0 |
| DESCRIPTION: This thread occurrs when there is either a MatchA event or a |
| MatchB event and the channel flag is 0. A future match will |
| be scheduled for Action unit A. |
| 1. update erta and ertb with MatchA and MatchB values |
| 2. Proceed as per DOUBLE_MATCH_0 |
+--------------------------------------------------------------------------*/
else if( ( m1==1 && m2==0 && flag0==0 ) || \
( m1==0 && m2==1 && flag0==0 ) )
{
/*NOP; not currently required*/
read_match(); /* get erta and ertb from match registers. For this thread one of the matches is in the future.*/
goto Service_single_match0;
}
/*--------------------------------------------------------------------------+
| THREAD NAME: MATCH_1 |
| DESCRIPTION: This thread occurrs when there is either a MatchA event or a |
| MatchB event and the channel flag is 1. A future match will |
| be scheduled for Action unit B. |
| 1. update erta and ertb with MatchA and MatchB values |
| 2. Proceed as per DOUBLE_MATCH_1 |
+--------------------------------------------------------------------------*/
else if( ( m1==1 && m2==0 && flag0==1 ) || \
( m1==0 && m2==1 && flag0==1 ) )
{
/*NOP; not currently required*/
read_match(); /* get erta and ertb from match registers. For this thread one of the matches is in the future.*/
goto Service_single_match1;
}
/*--------------------------------------------------------------------------+
| THREAD NAME: Error |
| DESCRIPTION: Something has gone wrong. :-( |
| Call the Global error routine and end. |
+--------------------------------------------------------------------------*/
else
{
#ifdef GLOBAL_ERROR_FUNC
Global_Error_Func();
#else
ClearAllLatches();
#endif
}
}
/* Information exported to Host CPU program */
#pragma write h, (::ETPUfilename (cpu/etpu_qom_auto.h));
#pragma write h, (/****************************************************************);
#pragma write h, ( * WARNING this file is automatically generated DO NOT EDIT IT! *);
#pragma write h, ( * *);
#pragma write h, ( * FILE NAME: etpu_qom_auto.c COPYRIGHT (c) Freescale 2004 *);
#pragma write h, ( * All Rights Reserved *);
#pragma write h, ( * This file generated by: *);
#pragma write h, ( * $RCSfile: etpuc_qom.c,v $ $Revision: 1.3 $);
#pragma write h, ( * *);
#pragma write h, ( * This file provides an interface between eTPU code and CPU *);
#pragma write h, ( * code. All references to the QOM function should be made with *);
#pragma write h, ( * information in this file. This allows only symbolic *);
#pragma write h, ( * information to be referenced which allows the eTPU code to be*);
#pragma write h, ( * optimized without effecting the CPU code. *);
#pragma write h, ( ****************************************************************/);
#pragma write h, (#ifndef _ETPU_QOM_AUTO_H_ );
#pragma write h, (#define _ETPU_QOM_AUTO_H_ );
#pragma write h, ( );
#pragma write h, (/* Function Configuration Information */);
#pragma write h, (::ETPUliteral(#define FS_ETPU_QOM_FUNCTION_NUMBER) QOM_FUNCTION_NUMBER );
#pragma write h, (::ETPUliteral(#define FS_ETPU_QOM_TABLE_SELECT) ::ETPUentrytype(QOM) );
#pragma write h, (::ETPUliteral(#define FS_ETPU_QOM_NUM_PARMS) ::ETPUram(QOM) );
#pragma write h, ( );
#pragma write h, (/* Time Reference Mode Bits - first_match_mode options */);
#pragma write h, (::ETPUliteral(#define FS_ETPU_QOM_IMMEDIATE) IMMEDIATE );
#pragma write h, (::ETPUliteral(#define FS_ETPU_QOM_USE_LAST_EVENT) USE_LAST_EVENT );
#pragma write h, (::ETPUliteral(#define FS_ETPU_QOM_USE_REF_ADDRESS) USE_REF_ADDRESS );
#pragma write h, ( );
#pragma write h, (/* Host Service Request Definitions - init_pin options */);
#pragma write h, (::ETPUliteral(#define FS_ETPU_QOM_INIT_PIN_LOW_LINK) INIT_PIN_LOW_LINK );
#pragma write h, (::ETPUliteral(#define FS_ETPU_QOM_INIT_PIN_HIGH_LINK) INIT_PIN_HIGH_LINK );
#pragma write h, (::ETPUliteral(#define FS_ETPU_QOM_INIT_PIN_NO_CHANGE_LINK) INIT_PIN_NO_CHANGE_LINK );
#pragma write h, (::ETPUliteral(#define FS_ETPU_QOM_INIT_PIN_LOW) INIT_PIN_LOW );
#pragma write h, (::ETPUliteral(#define FS_ETPU_QOM_INIT_PIN_HIGH) INIT_PIN_HIGH );
#pragma write h, (::ETPUliteral(#define FS_ETPU_QOM_INIT_PIN_NO_CHANGE) INIT_PIN_NO_CHANGE );
#pragma write h, ( );
#pragma write h, (/* Function Mode Bit Definitions - mode options */);
#pragma write h, (::ETPUliteral(#define FS_ETPU_QOM_SINGLE_SHOT) SINGLE_SHOT );
#pragma write h, (::ETPUliteral(#define FS_ETPU_QOM_LOOP) LOOP );
#pragma write h, (::ETPUliteral(#define FS_ETPU_QOM_CONTINUOUS) CONTINUOUS );
#pragma write h, (::ETPUliteral(#define FS_ETPU_QOM_CONTINUOUS_A) CONTINUOUS_A );
#pragma write h, ( );
#pragma write h, (/* Parameter Definitions */);
#pragma write h, (::ETPUliteral(#define FS_ETPU_QOM_TABLE_START_PTR_OFFSET) ::ETPUlocation (QOM, Table_Start_Ptr) );
#pragma write h, (::ETPUliteral(#define FS_ETPU_QOM_TABLE_END_PTR_OFFSET) ::ETPUlocation (QOM, Table_End_Ptr) );
#pragma write h, (::ETPUliteral(#define FS_ETPU_QOM_LAST_MATCH_TIME_OFFSET) ::ETPUlocation (QOM, Last_Match_Time) );
#pragma write h, (::ETPUliteral(#define FS_ETPU_QOM_LOOP_COUNT_OFFSET) ::ETPUlocation (QOM, Loop));
#pragma write h, (::ETPUliteral(#define FS_ETPU_QOM_OPTION_OFFSET) ::ETPUlocation (QOM, Option));
#pragma write h, (::ETPUliteral(#define FS_ETPU_QOM_REF_ADDR_PTR_OFFSET) ::ETPUlocation (QOM, Ref_Addr_ptr));
#pragma write h, ( );
#pragma write h, (#endif /* _ETPU_QOM_AUTO_H_ */);
#pragma write h, ( );
/*********************************************************************
*
* Copyright:
* FREESCALE, 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, FREESCALE
* 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 FREESCALE 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.
*
* Freescale assumes no responsibility for the maintenance and support
* of this software
********************************************************************/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -