Kontron KTLX800-pITX User Manual Page 25

  • Download
  • Add to my manuals
  • Print
  • Page
    / 37
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 24
KTD-S0023-A Page 22 JIDA32 Interface
KTLX800/pITX Software Guide
8.8 JIDA32 Windows
®
Programming
For further information see the actual JIDA32 documentation (JIDA32.pdf).
8.8.1 Program Language C
The demo program reads and shows the board name and the first 16 bytes of SPD EEPROM (SMBus). The
program uses the static linked library JIDA.LIB.
Example:
#include <windows.h>
#include "jida.h"
#define I2C_BUS 1
#define DEV_ADDR 0xA0
INT WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, INT nCmdShow)
{
BOOL bRet;
HJIDA hJida = (DWORD) NULL;
CHAR szStr1 [128],
szStr2 [32],
szVal [JIDA_BOARD_MAX_SIZE_ID_STRING];
UCHAR uVal [32];
if (JidaDllInitialize ())
{
if (JidaDllIsAvailable ())
{
if (JidaBoardOpen (JIDA_BOARD_CLASS_CPU, 0, JIDA_BOARDINFO_FLAGS_DEFAULT, &hJida))
{
bRet = JidaBoardGetName (hJida, (LPTSTR) szVal, JIDA_BOARD_MAX_SIZE_ID_STRING);
wsprintf (szStr1, "JidaBoardGetName = %d / %s", bRet, szVal);
lstrcpy (szStr2, "DEMO");
MessageBox (NULL, szStr1, szStr2, MB_OK | MB_ICONEXCLAMATION);
JidaI2CRead (hJida, I2C_BUS, DEV_ADDR, (LPBYTE) &uVal[0], 16);
wsprintf (szStr1, "JidaI2CRead = %02X %02X %02X %02X %02X %02X %02X %02X",
uVal[0], uVal [1], uVal[2], uVal [3],
uVal[4], uVal [5], uVal[6], uVal [7]);
MessageBox (NULL, szStr1, szStr2, MB_OK | MB_ICONEXCLAMATION);
JidaBoardClose (hJida);
}
}
JidaDllUninitialize ();
}
return (INT) FALSE;
}
Page view 24
1 2 ... 20 21 22 23 24 25 26 27 28 29 30 ... 36 37

Comments to this Manuals

No comments