?? pin.cpp
字號:
// Pin.cpp: implementation of the CPin class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "FluteD.h"
#include "Pin.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CPin::~CPin()
{
}
CPin::CPin(CString strInitName)
{
strName = strInitName;
nType = PIN_NA;
pInCell = NULL;
pOutCell = NULL;
pCtrlCell = NULL;
nInCell = -1;
nOutCell = -1;
nCtrlCell = -1;
nAct = -1;
error = ERR_FALSE;
nAct = 0;
nAssigned = 0;
}
int CPin::Read()
{
if(!pInCell)
{
error = 1;
return 0;
}
return *pInCell;
}
void CPin::Write(int dt)
{
if(!pOutCell)
{
error = 1;
return;
}
*pOutCell = dt;
}
void CPin::Oe(int enable)
{
if(!pCtrlCell)
{
// error = 1; maybe some output pin has no ctrl_cell
return;
}
if(nAct <0)
{
error = 1;
return;
}
if(enable)
{
*pCtrlCell = nAct;
}
else
{
*pCtrlCell = !nAct;
}
}
char * CPin::TypeName()
{
switch (nType)
{
case 0: return "PIN_NA";
case 1: return "PIN_IN";
case 2: return "PIN_OUT";
case 3: return "PIN_BUFFER";
case 4: return "PIN_INOUT";
case 5: return "PIN_LINKAGE";
}
return "UNKOWN";
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -