idchain.h
来自「ARM核的边界扫描(JTAG)的实现,此代码在s3c2400上测试通过」· C头文件 代码 · 共 45 行
H
45 行
//////////////////////////////////////////////////////////////////////////////
// IDChain.h //
//////////////////////////////////////////////////////////////////////////////
/*
ID chain
*/
#ifndef _IDCHAIN_H
#define _IDCHAIN_H
//////////////////////////////////////////////////////////////////////////////
// Includes //
//////////////////////////////////////////////////////////////////////////////
#include "Chain.h"
//////////////////////////////////////////////////////////////////////////////
// IDChain //
//////////////////////////////////////////////////////////////////////////////
#pragma pack(1)
class IDChain : public Chain
{
public:
unsigned one:1; // 1
unsigned manufacturer:11; // 0x787
unsigned productCode:16; // 0x0920
unsigned specificationRev:1; // 1
static void Select() { JTAG::Command(JTAG::IDCODE); }
static int GetLength() { return 32; }
unsigned int Read()
{
Select();
JTAG::Read(this, GetLength());
/*printf("one: %X\n", one);
printf("manufacturer: %X\n", manufacturer);
printf("productCode: %X\n", productCode);
printf("specificationRev: %X\n", specificationRev);*/
return *(unsigned int *)this;
}
};
#pragma pack()
#endif // _IDCHAIN_H
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?