my $i2cGetDeviceAddressFunc = Win32::API->new('CrdI2C32', 'int i2cGetDeviceAddress()') or warn "\n ERROR: Can not import API:i2cGetDeviceAddress , $^E ,";
my $ret = 0;
$ret = $i2cGetDeviceAddressFunc->Call();
print "\n RET: $ret";
####
1. Run
RET: 53113496
2. Run
RET: 52195992
3. Run
RET: 52851352
4. Run
RET: 52458136
5. Run
RET: 51540632
####
PASCAL Sample:
xx.pas
Function i2cGetDeviceAddress : Byte; stdcall; external 'CrdI2C32.DLL';
C Sample:
xx.h
typedef unsigned char __stdcall i2cGetDeviceAddress_type();
extern i2cGetDeviceAddress_type *i2cGetDeviceAddress;
xx.c
i2cGetDeviceAddress_type *i2cGetDeviceAddress = NULL;
....
i2cGetDeviceAddress = (i2cGetDeviceAddress_type*)GetProcAddress(hDll,"i2cGetDeviceAddress");
if (i2cGetDeviceAddress == NULL) {
FreeLibrary(hDll);
return 22; // function not found in library
}
VB Sample:
xx.bas
Declare Function i2cGetDeviceAddress Lib "CrdI2C32.DLL" () As Byte