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

📄 pin.cpp

📁 里面有通过JTAG口对FLASH的烧写代码
💻 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 + -