上传者: f74108
|
上传时间: 2022-01-06 11:06:20
|
文件大小: 25KB
|
文件类型: -
使用WinIo获取CPU温度#include
#include "WinIo.h"
#pragma comment(lib,"WinIo.lib")
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
PSTR szCmdLine, int iCmdShow)
{
DWORD temp_dwPortVal=0;
InitializeWinIo();
SetPortVal(0x6C,0x80,1);//将命令写入命令端口0x6C
SetPortVal(0x68,0x0E7,1);//将要访问的寄存器号写入数据端口0x68
GetPortVal(0x68,&temp_dwPortVal, 1);//将数据从数据端口读出
ShutdownWinIo();
}