Home

User Manual SUSI Library

image

Contents

1. Index Code Function Index DLL 00100000 ESusilnit 00200000 ESusiUnlnit 00300000 ESusiGetVersion 00400000 ESusibDillnit 00500000 ESusiDlIlUnlnit 00600000 ESusiDllGetVersion 00700000 ESusiDIlGetLastError Core 10100000 ESusiCorelnit 10200000 ESusiCoreAvailable 10300000 ESusiCoreGetBlOSVersion 10400000 ESusiCoreGetPlatformName 10500000 ESusiCoreAccessBootCounter 10600000 ESusiCoreAccessRunTimer 10700000 ESusiCoreRebootSystem 10800000 ESusiReserved8000000 Watchdog 20100000 ESusiWDlnit 20200000 ESusiWDAvailable 20300000 ESusiWDDisable 20400000 ESusiWDGetRange 20500000 ESusiWDSetConfig 20600000 ESusiWDTrigger GPIO 30100000 ESusilOlnit 30200000 ESusilOAvailable 30300000 ESusilOCount 30400000 ESusilOlnitial 30500000 ESusilORead 30600000 ESusilOReadMulti 30700000 ESusilOWrite 30800000 ESusilOWriteMulti 30900000 ESusilOCountEx 31000000 ESusilOQueryMask 31100000 ESusilOSetDirection 31200000 ESusilOSetDirectionMulti SUSI Library User Manual 76 31300000 ESusilOReadEx 31400000 ESusilOReadMultiEx 31500000 ESusilOWriteEx 31600000 ESusilOWriteMultiEx SMBus 40100000 ESusiSMBuslnit 40200000 ESusiSMBusAvailable 40300000 ESusiSMBusReadByte 40400000 ESusiSMBusReadByteMulti 40500000 ESusiSMBusReadWord 40600000 ESusiSMBusWriteByte 40700000 ESusiSMBusWriteByteMulti 40800000 ESusiSMBusWriteWord 40900000 ESusi
2. Pin Signal Pin 1 5 V Pin 2 GND Pin 3 12 V Pin 19 INO Pin 20 IN1 Pin 21 IN2 Pin 22 IN3 Pin 23 OUTO Pin 24 OUT1 Pin 25 OUT2 Pin 26 OUT3 There are two high drive digital outputs OUTO OUTT 24 VDC 1 A max two TTL level digital outputs OUT2 OUTS and four digital inputs TTL level You can config ure the digital I O to control the opening of the cash drawer and to sense the closing of the cash drawer The above table explains how the digital I O is controlled via soft ware programming and how a 12 V solenoid or relay can be triggered For complete ness please refer to the user manual of POS 563 POS 564 POS 761 69 SUSI Library User Manual SUSI Library User Manual 70 Appendix B Programming Flags Overview B 1 Programming Flags Overview Hardware Monitor Flags Fan Flag Value Description FCPU tu CPU FAN FSYS 2u System FAN F2ND 4u 3rd FAN Temperature Flag Value Description TCPU tu CPU Temperature TSYS 2u System Temperature P Voltage Flag Value Description VCORE tu Vcore V25 2u 2 5V V33 4u 3 3 V V50 8u 5V V120 16u 12 V VSB 32u Voltage of standby VBAT 64u VBAT VN50 128u 5 V VN120 256u 12 V VTT 512u VTT Boot Logger Flags m Bootcounter Mode Flag Value Description ESCORE_BOOTCOUNTER_MODE_GET 1u Read Operation ESCORE_BOOTCOUNTER_MODE_SET 2u Write Operation Element
3. 3 1 Package Contents SUSI currently supports Windows XP Contents listed below Operating System Location Installation Windows XP e C ProgramFiles Advantech SUSIV30 Setup exe Directory Contents User Manual SUSI pdf E Gust lb Function export Library Files Susi di Dynamic link library m Susi h moue EES Debug h Errdrv h Errlib h E SusiDemo exe Demo program execution file SusiDemo m Susidll Dynamic link library SusiDemo SRC C Source code of SusiDemo program in C VS2005 SUSI Library User Manual 10 Chapter A Additional Programs 4 1 4 2 4 3 VGA Control Hotkey Utility The VGA control hotkey utility SusiHotkey exe automatically runs during system startup in both Windows XP and Windows CE It provides users with an easy access to VGA functions with the following hotkey assignments Key Action Ctrl Alt Increase brightness by 10 Ctrl Alt Decrease brightness by 10 Ctrl Alt 6 Set brightness to 60 Ctrl Alt 1 Turn VGA display on Ctrl Alt 0 Turn VGA display off Demo Program The SUSI demo program demonstrates how to incorporate SUSI library into user s own applications The program is written in C programming language and based upon NET Compact Framework 2 0 Visual Studio 2005 SusiDemo exe The execution file SusiDemo exe released with source code can be run on both
4. Return Value Value Meaning 1 The function fails 0 The function succeeds the platform does not support SusiSMbus APIs The function succeeds the platform supports SMBus 49 SUSI Library User Manual 6 37 6 38 Remarks After calling SusiDillnit successfully all Susi Available functions are use to check if the corresponding features are supported by the platform or not So it is suggested to call Susi Available before using any Susi functions SusiSMBusScanDevice Scan ifthe address is taken by one of the slave devices currently connected to the SMBus int SusiSMBusScanDevice BYTE SlaveAddress_7 Parameters SlaveAddress in Specifies the 7 bit device address ranging from 0x00 Ox7F Return Value Value Meaning 1 The function fails 0 The function succeeds the address is not occupied 1 The function succeeds there is a device to this address Remarks There could be as much as 128 devices connected to a single SMBus For more information about how to use this API please refer to Programming Overview part SMBus functions SusiSMBusReadQuick Turn a SMBus device function on off or enable disable a specific device mode BOOL SusiSMBusReadQuick BYTE SlaveAddress Parameters SlaveAddress in Specifies the 8 bit device address ranging from 0x00 OxFF Whether to give a 1 read or O write to the LSB of SlaveAddress could be ignored Return
5. User Manual SUSI Library Trusted ePlatform Services AD ANTECH Copyright The documentation and the software included with this product are copyrighted 2009 by Advantech Co Ltd All rights are reserved Advantech Co Ltd reserves the right to make improvements in the products described in this manual at any time without notice No part of this manual may be reproduced copied translated or transmitted in any form or by any means without the prior written permission of Advantech Co Ltd Information provided in this manual is intended to be accurate and reliable How ever Advantech Co Ltd assumes no responsibility for its use nor for any infringe ments of the rights of third parties which may result from its use Part No 2006SUSI00 Edition 1 Printed in Taiwan August 2009 SUSI Library User Manual ii Contents Chapter Chapter Chapter Chapter Chapter Chapter 3 3 1 4 4 1 4 2 4 3 Ipntroduchton enen KN KN KN KN KN KKK une 1 utgele Tei te 1 DEE 2 SUSI FUNCIONS ce ea ae 2 Benefits 2u dert eessen EE Sage 5 Environmente ee eN KN ENKEN KKK ve ll Sin Ville ETC 8 Package Contents uu2 a2u00 an00nnan 9 Package Contents abhanden 10 Additional Programs uun002000 1 1 VGA Control Hotkey Utility 200rsnnennnennnnnnnnnnnnnnnnennnnnnnnnnnnnn nenn 12 Pemo FOG EE 12 TIR ue 12 4 3 1 Leg Te EE 12 4 3 2 Ee Le Le EE 13 4 33 GPIO EE 14 4 3 4 P
6. 1 Input direction 2 Status HIGH 3 Direction changeable Or a bit value 0 stands for a pin with 1 Output direction 2 Status LOW 3 Direction unchangeable SUSI Library User Manual 46 Here are the definitions for masks m ESIO_SMASK_PIN_FULL If there are total 8 GPIO pins GPIO 0 7 in a platform the full pin mask is OxFF or in binary 11111111 i e the number of 1s corresponds to the num ber of pins m ESIO_SMASK_CONFIGURABLE This is the mask to indicate which pins have changeable directions If all the 8 pins are changeable the mask would be OxFF m ESIO_DMASK_DIRECTION The current direction of pins If the mask is OxAA or in binary 10101010 it means the even pins are output pins and the odd pins are input pins 6 32 Susi64BitslOSetDirection Set direction of one GPIO pin as input or output BOOL Susi64BitslOSetDirection ULONG PinNum BYTE IO UINT64 Pin DirMask Parameters PinNum in Specifies the GPIO pin to be changed ranging from O total number of GPIO pins minus 1 IO in Specifies the pin direction to be set PinDirMask out Pointer to a variable in which the function returns the latest direction mask after the pin direction is set Return Value TRUE 1 indicates success FALSE 0 indicates failure Remarks Use an IO value of 1 to set a pin as an input or 0 to set a pin as an output The function can only set the direction of one of the pins that are direction config u
7. 51 SUSI Library User Manual Overview part SMBus functions 6 41 SusiSMBusSendByte Send information in a byte to the target slave device in the SMBus BOOL SusiSMBusSendByte BYTE SlaveAddress BYTE Result Parameters SlaveAddress in Specifies the 8 bit device address ranging from 0x00 OxFF Whether to give a 1 read or 0 write to the LSB of SlaveAddress could be ignored Result in Specifies the byte information to be sent Return Value TRUE 1 indicates success FALSE 0 indicates failure Remarks A simple device may recognize its own slave address and accept up to 256 possi ble encoded commands in the form of a byte given in the parameter Result For more information about how to use this API please refer to Programming Overview part SMBus functions 6 42 SusiSMBusReadByte Read a byte of data from the target slave device in the SMBus BOOL SusiSMBusReadByte BYTE SlaveAddress BYTE RegisterOffset BYTE Result Parameters SlaveAddress in Specifies the 8 bit device address ranging from 0x00 OxFF Whether to give a 1 read or 0 write to the LSB of SlaveAddress could be ignored RegisterOffset in Specifies the offset of the device register to read data from Result out Pointer to a variable in which the function reads the byte data Return Value TRUE 1 indicates success FALSE 0 indicates failure SUSI Library User Manual 52 Remarks For more inf
8. board information such as the platform name and BIOS version New SusiCoreAc cessBootCounter and SusiCoreAccessBootCounter APIs are Boot Logger features that enable monitoring of system reboot times total OS run time and continual run time SusCoreThrottlingSpeed to SusiCoreGetCpuMaxSpeed APIs are CPU throt tling features m SusiCoreGetPlatformName SusiCoreGetBlOSVersion SusiCoreAccessBootCounter SusiCoreAccessRunTimer SusiCoreGetThrottlingSpeed SusiCoreSetThrottlingSpeed SusiCoreGetThrottlingDuty SusiCoreSetThrottlingDuty SusiCoreGetCpuMaxSpeed SusiCoreGetCpuVendor Watchdog WD functions The hardware watchdog timer is a common feature among all Advantech platforms In user applications call SusiWDSetConfig with specific timeout values to start the watchdog timer countdown meanwhile create a thread or timer to periodically refresh the timer with SusiWDTrigger before it expires If the application ever hangs it will fail to refresh the timer and the watchdog reset will cause a system reboot m SusiWDGetRange m SusiWDSetConfig m SusiWDTrigger m SusiWDDisable GPIO IO functions There are two sets of GPIO functions It is highly recommended to use the new one With pin read and write more flexibility has been added to allow easy pin direction change as needed as well as the capability of reading output pin status New programmable GPIO function set SusilOCountEx SusilOQueryMask SusilOSetDirection SusilOSetDirecti
9. A a a eia 60 GusilWMAvalable 60 GusiiWMGeitantpoeed nn 60 GusiiWMGei emperature nn 61 SusiHWMGetVoltage nn 62 SusiHWMSetFanSpeed ran 63 GPIO Information ee KEN vu vun 65 EIS ege d on Ee EEN 66 AppendixB Programming Flags Overview 71 B 1 Programming Flags Cvervlew nenn 72 AppendixC API Error Codes uuuuuenneneennnnnnnnnnnnnnn 75 C 1 API Error EE 76 v SUSI Library User Manual SUSI Library User Manual vi Chapter 1 Introduction 1 1 Introduction SUSI A Bridge to Simplify amp Enhance H W amp Application Implementation Effi ciency When developers want to write an application that involves hardware access they have to study the specifications to write the drivers This is a time consuming job and requires lots of expertise Advantech has done all the hard work for our customers with the release of a suite of APIs Application Programming Interfaces called the Secured amp Unified Smart Interface SUSI SUSI provides not only the underlying drivers required but also a rich set of user friendly intelligent and integrated interfaces which speeds development enhances security and offers add on value for Advantech platforms SUSI plays the role of cat alyst between developer and solution and makes Advantech embedded platforms easier and simpler to adopt and operate with customer applications 1 2 SUSI Functions Control GPIO GPIO a General Purpose Input Output is a flexi
10. BlOSVersion as NULL to get the array size required for the string Then allocate a TCHAR array with the size required and give the array with its size as parameters to get the BIOS version Note that the BIOS version cannot be correctly retrieved if it s a release version SusiCoreGetPlatformName Get the current platform name BOOL SusiCoreGetPlatformName TCHAR PlatformName DWORD size Parameters PlatformName out Pointer to an array in which the platform name string is returned size in out Pointer to a variable that specifies the size in TCHAR of the array pointed to by the PlatformName parameter SUSI Library User Manual 32 If PlatformName is given as NULL when the function returns the vari able will contain the array size required for the platform name Return Value TRUE 1 indicates success FALSE 0 indicates failure Remarks Call the function twice first by giving PlatformName as NULL to get the array size required for the string Then allocate a TCHAR array with the size required and give the array with its size as parameters to get the platform name Note that the platform name cannot be correctly retrieved ifthe BIOS is a release version 6 8 SusiCoreAccessBootCounter Access the boot counter A boot counter is used to count the number of boot times BOOL SusiCoreAccessBootCounter DWORD mode DWORD OPFlag BOOL enable DWORD value Parameters mode in The value can be either ESCORE_BOOTCOU
11. Driver Error Code The Function Index Code distinguishes which API the error resulted from and the library Driver Error Code indicates the actual error type i e if it is an error ina library or driver For a complete list of error codes please refer to the Appendix SusiCoreAvailable Check if Core driver is available int SusiCoreAvailable void Parameters None Return Value Value Meaning 1 The function fails 0 The function succeeds the platform does not support SusiCore APIs 31 SUSI Library User Manual 6 6 6 7 1 The function succeeds the platform supports Core Remarks After calling SusiDlllnit successfully all Susi Available functions are used to check if the corresponding features are supported by the platform or not So it is sug gested to call Susi Available before using any Susi functions SusiCoreGetBlOSVersion Get the current BIOS version BOOL SusiCoreGetBlOSVersion TCHAR BlOSVersion DWORD size Parameters BlOSVersion out Pointer to an array in which the BIOS version string is returned size in out Pointer to a variable that specifies the size in TCHAR of the array pointed to by the BlOSVersion parameter If BIOSVersion is given as NULL when the function returns the vari able will contain the array size required for the BIOS version Return Value TRUE 1 indicates success FALSE 0 indicates failure Remarks Call the function twice first by giving
12. Windows XP and Windows CE The following pages are a detailed introduction to the SusiDemo program 4 3 1 Boot Logger SusiDemo Boot Logger Watchdog GPIO Programmable GPIO SMBus Multibyte 1c vea _4 gt Boot Counter Enable ss boolean Get Set Run Timer Running ss 1 or 0 Autorun st lor 0 Continualon ss min TotalOn ss min Set SUSI Library User Manual 12 This part belongs to the feature Core in SUSI APIs m Select or clear the check box to select the information to get or set in its text box In Boot Counter m To reset the BootTimes parameter to 0 just type 0 in the BootTimes text box with its check box selected and then click the Set button In Run Timer m Set the Running text box to 1 to start the timer or O to stop the timer Set the Autorun text box to 1 to start the timer when the system restarts 4 3 2 Watchdog SusiDemo Timeout Information ss Unit ms Ld I Timeout Setting en PL Unten Countdown Value Cl mmm Start Refresh Stop When the SusiDemo program executes it shows watchdog information in the Time out Information fields Min Max and Step in milliseconds For example for a range of 1 255 seconds 1000 appears in the Min text box 255000 appears in the Max text box and 1000 appears in the Step text box Here is an example of how to use the watchdog timer m Type 3000 3 sec in the T
13. drivers for SUSI CORE WDT GPIO SMBus IIC VC and HWM E g Driver CORE is for SusiCore prefixed APIs and so on A driver will be loaded only if its corresponding function set is supported by a plat form Installation File In Windows XP you have to run Setup exe for installation To avoid double installa tion please make sure you have removed any existing SUSI drivers either by using Setup exe or by manually removing them in Device Manger DII functions SusiDIl APIs are driver independent i e they can be called without any drivers In Windows XP after drivers having been installed users have to call SusiDlIllnit for ini tialization before using any other APIs that are not SusiDIl prefixed Before the appli cation terminates call SusiDIlUnlnit to free allocated system resources When an API call fails use SusGetLastError to get an error report An error value will be either Function Index Code Library Error Code or Function Index Code Driver Error Code The Function Index Code indicates which API the error came from and the library Driver Error Code indicates the actual error type i e whether it was an error in a library or driver For a complete list of error codes please refer to the Appendix SusiDlllnit SusiDIlUnlnit SusiDllGetLastError SusiDllGetVersion SUSI Library User Manual 24 5 2 5 3 5 4 Core functions SusiCore APIs are available for all Advantech SUSI enabled platforms to provide
14. for users to have a longer delay time in SusiWDSetConfig 6 21 SusiWDDisable Disable the watchdog and stop its timer countdown BOOL SusiWDDisable void Parameters None Return Value TRUE 1 indicates success FALSE 0 indicates failure Remarks If watchdog protection is no longer required by an application it can call SusiWD SUSI Library User Manual 40 Disable to disable the watchdog A call to SusiWDDisable in the middle of a delay resulting from a previous call to SusiWDSetConfig causes the delay timer to be canceled immediately and stops watchdog timer countdown Only a few hardware implementations in which the watchdog timer cannot be stopped once it has been activated will return with FALSE 6 22 SusilOAvailable Check if GPIO driver is available int SusiCoreAvailable void Parameters None Return Value value Meaning 1 The function fails 0 The function succeeds the platform does not support SusilO APIs 1 The function succeeds the platform supports GPIO Remarks After calling SusiDlllnit successfully all Susi Available functions are used to check if the corresponding features are supported by the platform or not It is suggested to call Susi Available before using any Susi functions 6 23 SusilOCountEx Query the current number of input and output pins BOOL SusilOCountEx DWORD inCount DWORD outCount Parameters inCount out Pointer to a variable in which this func
15. the member dwTimeContinual ESCORE_RUNTIMER_VALUE_TOTALON 8 The operation is on the member dw me Total isRunning TURE indicates the timer is running now FALSE indicates not isAutorun TRUE states the timer will start automatically upon startup i e it will be running each time when the system reboots dwTimeContinual Specify the system continual on time in minutes i e the OS running time without a system reboot At reboot it will be reset to 0 dwTimeTotal Specify the system total on time in minutes i e the total time accumulated while the OS has been running 6 11 SusiCoreSetThrottlingSpeed Set the CPU throttling speed BOOL SusiCoreSetThrottlingSpeed int value Parameters value in CPU Throttling Speed value 35 SUSI Library User Manual 6 12 6 13 Return Value TRUE 1 indicates success FALSE 0 indicates failure Remarks N A SusiCoreGetThrottlingSpeed Get the CPU throttling Speed BOOL SusiCoreGetThrottlingSpeed int amp value Parameters value out Get the CPU Throttling Speed value Return Value TRUE 1 indicates success FALSE 0 indicates failure Remarks N A SusiCoreGetThrottlingDuty Get the CPU throttling Duty BOOL SusiCoreGetThrottlingDuty DWORD amp dutyFlag Parameters dutyFlag out Get the CPU Throttling Speed value Duty flag type define define TFULL 0x00 define T875 Ox1E define T750 0x1C define T625 0x1A define T500 0x18 define T375 0x16 define T250 0x
16. which this function returns the temperature in Cel sius Typesupport out If the value is specified as a pointer non NULL to a variable it will return the types of available sensors in flags bitwise ORed Return Value TRUE 1 indicates success FALSE 0 indicates failure 61 SUSI Library User Manual Remarks Call the function first with a non NULL typesupport to know the available tempera ture sensors and a following call to get the temperature required 6 59 SusiHWMGetVoltage Read the current value of one of the voltage sensors or get the types of available sensors BOOL SusiHWMGetVoltage DWORD voltType float retval DWORD typeSup port NULL Parameters voltType in Specifies a voltage sensor to get value from It can be one of the flags VCORE 1 lt lt 0 V25 1 lt lt 1 V33 1 lt lt 2 V50 1 lt lt 3 V120 1 lt lt 4 VSB 1 lt lt 5 VBAT 1 lt lt 6 VN50 1 lt lt 7 VN120 1 lt lt 8 VTT 1 lt lt 9 retval out Point to a variable in which this function returns the voltage in Volt Typesupport out If the value is specified as a pointer non NULL to a variable it will return the types of available sensors in flags bitwise ORed Return Value TRUE 1 indicates success FALSE 0 indicates failure Remarks Call the function first with a non NULL typesupport to know the available fan sen sors and a following call to get the voltage required SUSI Library User Manual 62
17. 11 i e the number of 1s corresponds to the num ber of pins m ESIO_SMASK_CONFIGURABLE This is the mask to indicate which pins have changeable directions If all the 8 pins are changeable the mask would be OxFF SUSI Library User Manual 42 E ESIO_DMASK_DIRECTION The current direction of pins If the mask is OxAA or in binary 10101010 it means the even pins are output pins and the odd pins are input pins 6 25 SusilOSetDirection Set direction of one GPIO pin as input or output BOOL SusilOSetDirection BYTE PinNum BYTE IO DWORD PinDirMask Parameters PinNum in Specifies the GPIO pin to be changed ranging from O total number of GPIO pins minus 1 IO in Specifies the pin direction to be set PinDirMask out Pointer to a variable in which the function returns the latest direction mask after the pin direction is set Return Value TRUE 1 indicates success FALSE 0 indicates failure Remarks Use an IO value of 1 to set a pin as an input or 0 to set a pin as an output The function can only set the direction of one of the pins that are direction config urable If the pin number specified is an invalid pin or a pin that can only be config ured as an input the function call will fail and return FALSE 6 26 SusilOSetDirectionMulti Set directions of multiple pins at once BOOL SusilOSetDirectionMultiiDWORD TargetPinMask DWORD PinDirMask Parameters TargetPinMask in Specifies the mask of GPIO ou
18. 11603 ERRDRV_IIC_BUSCOLLISION 00011604 ERRDRV_IIC_CLIENTDEV_NORESPONSE 00011605 ERRDRV_IIC_REQUESTMASTERMODE FAILED 00011606 ERRDRV_IIC_NOT_MASTERMODE 00011607 ERRDRV_IIC_BUS ERROR 00011608 ERRDRV_IIC_BUS STALLED 00011609 ERRDRV_IIC_NEGACK_DETECTED 00011610 ERRDRV_IIC_TRANSMITMODE_ACTIVE 00011611 ERRDRV_IIC_TRANSMITMODE_INACTIVE 00011612 ERRDRV_IIC_STATE_UNKNOWN VGA Control Driver 00011800 ERRDRV_VC_FINDVGA_FAILED 00011801 ERRDRV_VC_FINDBRIGHTDEV_FAILED 00011802 ERRDRV_VC_VGA_UNSUPPORTED 00011803 ERRDRV_VC_BRIGHTDEV_UNSUPPORTED Hardware Monitor Driver N A SUSI Library User Manual 80 81 SUSI Library User Manual Trusted ePlatform Services AD ANTECH www advantech com Please verify specifications before quoting This guide is intended for reference purposes only All product specifications are subject to change without notice No part of this publication may be reproduced in any form or by any means electronic photocopying recording or otherwise without prior written permis sion of the publisher All brand and product names are trademarks or registered trademarks of their respective companies Advantech Co Ltd 2009
19. 14 define T125 0x12 Return Value TRUE 1 indicates success FALSE 0 indicates failure Remarks N A SUSI Library User Manual 36 6 14 6 15 SusiCoreSetThrottlingDuty Set the CPU throttling Duty BOOL SusiCoreSetThrottlingDuty DWORD dutyFlag Parameters dutyFlag in Get the CPU Throttling Speed value Duty flag type define define TFULL 0x00 define T875 Ox1E define T750 0x1C define T625 0x1A define T500 0x18 define T375 0x16 define T250 0x14 define T125 0x12 Return Value TRUE 1 indicates success FALSE 0 indicates failure Remarks N A SusiCoreGetMaxCpuSpeed Get max CPU speed BOOL SusiCoreGetCpuMaxSpeed DWORD amp Value Parameters value out Getthe CPU Max CPU Speed value Return Value TRUE 1 indicates success FALSE 0 indicates failure Remarks N A 37 SUSI Library User Manual 6 16 SusiCoreGetCpuVendor Get the CPU Vendor type Parameters value out Get the CPU vendor type Vendor define INTEL 1 lt lt 0 define VIA 1 lt lt 1 define SIS 1 lt lt 2 define NVIDIA 1 lt lt 3 define AMD 1 lt lt 4 Return Value TRUE 1 indicates success FALSE 0 indicates failure Remarks N A 6 17 SusiWDAvailable Check if the watchdog driver is available BOOL SusiWDAvailable void Parameters None Return Value value Meaning 1 The function fails 0 The function succeeds the platform does not support SusiWD APIs The function succeeds the pl
20. 38 GusiWGettiange birie iaaiaee naiiai adaini 39 SUSIWDSetConid EE 39 E VOIR e A0 SUSIWDDISADIC irrena sandra anna ae 40 GusilOAvallable 41 SUSIIOGOUNTEX EE 41 S silOQu ry MaSK Akku 42 SusilOSetDirecti N sernir eo N E eet 43 SusilOSetDirectionMulti u 00nnenennnnnnnnnnnnnnnnnnneenenenennnnnnnnnenen 43 SUSIIORSAAEX EE 44 GusilObeacdMuhtx 44 SUSIIOWFIEER 00th nn EES GENEE 45 SusilOWriteMultiEx cc 45 GuslGABitelOOuervkMack nn 46 GusiGADBntelOGeiDurecton 47 Susi64BitslOSetDirectionMulti cccccceececccceceeeeececeeeeaeseeeeeeeeeeseeecs 48 GusiGdADBntelOeadMuhtx nennen 48 Susi64BitslOWriteMUultiEx 0 0 0 0 cece eceeeeeeceeccceeeceeseeeeusesusueaeaeseaeeeceeseseeees 49 SusiSMBusAvailable eee eeeceeeececececccceecececeeeecueeecusuuaeaeaeueseseseeeeeeeeeeess 49 SusiSMBusScanDevViCE nennen 50 GuslGM usbeadCOuick 50 GuslGM uswWriteOuick nennen 51 SusiSMBusReceiveByte mann 51 SusiSMBusSendByte ran 52 GuslGMusbeadbvie nenn 52 SusiSMBusWriteByte nn 53 SusiSMBusReadWord nenn 53 SusiSMBusWriteWord sesesesessnssesineresesesesnsnsnrnrnrrrirrrirrrirseuressessnnnenenennn 54 GusillCAvallable nennen 54 SUSIIIGREAG EE 55 SUSI G WEE 56 SusillCWriteReadCOombinEe s sssssesesesesesesesesnsnrnrrrrrrrirrrrrirrrsrensssesnnnnenennnnn 56 GusiVCAvailable 57 SusiVCGetBrightRange nn 58 EE Elte nennen anne nun 58 SusivE Elle ae een en 59 Gust Gcreen m usanne aandie annia raaaa 59 SUSIVESCESMOM orren an
21. 6 60 SusiHWMSetFanSpeed Control the speed of one of the fans or get the types of available fans BOOL SusiHWMSetFanSpeed WORD fanType BYTE setval WORD typeSup port NULL Parameters fantype in Specifies a fan to be controlled It can be one of the flags FCPU 1 CPU Fan FSYS 2 System Chassis fan setval in Specifies the value to set ranging from 0 to 255 Typesupport out If the value is specified as a pointer non NULL to a variable it will return the types of available fans in flags bitwise ORed Return Value TRUE 1 indicates success FALSE 0 indicates failure Remarks The fan speed is controlled by Pulse Width Modulation PWM Duty cycle setval 255 100 And the default duty cycle is set to 100 i e the maximal fan speed Call the function first with a non NULL typesupport to know the available fan sen sors and a following call to set the fan speed 63 SUSI Library User Manual SUSI Library User Manual 64 Appendix A GPIO Information A 1 GPIO Information Look up the table for the GPIO pins assignment and the default pins direction for a platform E g AIMB 330 CN19 means that the platform name is AIMB 330 and its GPIO pins are located in CN19 on the board AIMB 330 CN19 AIMB 340 CN19 AIMB 640 CN18 The number of GPIO pins4 Inputs 4 outputs Pin Signal Pin Signal Pin 1 INO Pin 2 5 V Pin 3 IN1 Pin 4 OUTO Max 1A P
22. 7 give the Multiple Pin text box the value 11000011 Bit O stand for GPIO 0 bit 1 stand for GPIO 1 and so on To set pin 0 as high pin 1 as low pin 6 as high and pin 7 as low give the Value text box the value 01XXXX01 where X stands for a don t care pin Please simply assign a 0 for don t care pins e g 10000001 To set the direction of GPIO pins 0 1 6 and 7 give the Multiple Pin text box the value 11000011 Again bit 0 stands for GPIO 0 bit 1 stands for GPIO 1 and so on To set pin 0 as an input pin 1 as an output pin 6 as an input and pin 7 as an output give the Value text box with 01XXXX01 where X is for don t care Please simply assign a 0 for don t care pins e g 10000001 Multiple Pin Operation IO Read m For example if you want to read the status of GPIO pins 0 1 6 and 7 give the Multiple Pin text box the value 11000011 Bit 0 stands for GPIO 0 bit 1 stands for GPIO 1 and so on Again if the pin is in status high the value in the relevant bit of the Value text box will be 1 If the pin status is low the Value text box will be 0 Note 1 lO Write can only be performed on pins in the output direction E 2 Set Direction can only be performed on bidirectional pins 3 IO Read can get the status of both input and output pins Please get the information first in the MASK field SUSI Library User Manual 16 4 3 5 SMBus SusiDemo E Protocols m Choose one of the protocol ope
23. Flag Value Description Current Status ESCORE_BOOTCOUNTER_STATUS tu Is Enabled or Disabled ESCORE_BOOTCOUNTER_VALUE 2u Number of Reboot Times SUSI Library User Manual 72 Runtimer Mode Flag Value Description ESCORE_RUNTIMER_MODE_GET du Read Operation ESCORE_RUNTIMER_MODE_SET 2u Write Operation Element Flag Value Description ESCORE_RUNTIMER STATUS RUNNING Tu Current arama Is Enabled or Disabled ESCORE_RUNTIMER_STATUS_AUTORUN 2u Is AutoRun upon Startup ESCORE_RUNTIMER_VALUE_CONTINUAL OS continual run time reset to 0 ON u after a reboot ESCORE_RUNTIMER_VALUE TOTALON 8u Sum of OS total run time GPIO Mask Flags Flag Value Description ESIO_SMASK_PIN FULL 0x01 Series of binary 1s for the number of total pins ESIO_SMASK_CONFIGURABLE 0x02 Direction Changeable Pins ESIO_DMASK_DIRECTION 0x20 Current Direction of Pins 73 SUSI Library User Manual SUSI Library User Manual 74 Appendix C API Error Codes C 1 API Error Codes An error value will be either Function Index Code Library Error Code or Function Index Code Driver Error Code If you call an API and returns with fail The Function Index Code in its error code combination does not necessarily equal to the index code of the API This is because the API may make a call to another API Function Index Code
24. NSUFFICIENT 00010003 ERRDRV_OUTBUF_INSUFFICIENT 00010004 ERRDRV_STOPTIMER_FAILED 00010005 ERRDRV_STARTTIMER_FAILED 00010006 ERRDRV_CREATEREG_ FAILED 00010007 ERRDRV_OPENREG_FAILED 00010008 ERRDRV_SETREGVALUE_FAILED 00010009 ERRDRV_GETREGVALUE_FAILED 00010010 ERRDRV_FLUSHREG_FAILED 00010011 ERRDRV_MEMMAP_ FAILED Core Driver N A Watchdog Driver N A GPIO Driver 00011200 ERRDRV_GPIO_PIN_DIR_CHANGED 00011201 ERRDRV_GPIO_PIN_INCONFIGURABLE 00011202 ERRDRV_GPIO_PIN OUTPUT UNREADABLE 00011203 ERRDRV_GPIO_PIN_INPUT_UNWRITTABLE 00011204 ERRDRV_GPIO_INITIAL_FAILED 00011205 ERRDRV_GPIO_GETINPUT_FAILED 00011206 ERRDRV_GPIO_SETOUTPUT_FAILED 00011207 ERRDRV_GPIO_GETSTATUS_IO_FAILED 00011208 ERRDRV_GPIO_SETSTATUS_OUT_FAILED 00011209 ERRDRV_GPIO_SETDIR_FAILED SMBus Driver 00011400 ERRDRV_SMB_RESETDEV_FAILED 00011401 ERRDRV_SMB_TIMEOUT 00011402 ERRDRV_SMB_BUSTRANSACTION_ FAILED 00011403 ERRDRV_SMB_BUSCOLLISION 00011404 ERRDRV_SMB_CLIENTDEV_NORESPONSE 00011405 ERRDRV_SMB_REQUESTMASTERMODE_FAILED 00011406 ERRDRV_SMB_NOT_MASTERMODE 00011407 ERRDRV_SMB_BUS_ERROR 00011408 ERRDRV_SMB_BUS_STALLED 00011409 ERRDRV_SMB_NEGACK_DETECTED 79 SUSI Library User Manual 00011410 ERRDRV_SMB_TRANSMITMODE_ACTIVE 00011411 ERRDRV_SMB_TRANSMITMODE_INACTIVE 00011412 ERRDRV_SMB_STATE_UNKNOWN IIC Driver 00011600 ERRDRV_IIC_RESETDEV_FAILED 00011601 ERRDRV_IIC_TIMEOUT 00011602 ERRDRV_IIC_BUSTRANSACTION_ FAILED 000
25. NTER_MODE_GET 0 To get information from counter ESCORE_BOOTCOUNTER_MODE_SET 1 To set information to counter OPFlag in The operation flag can be the combination of ESCORE_BOOTCOUNTER_STATUS 1 The operation is on the parameter enable ESCORE_BOOTCOUNTER_VALUE 2 The operation is on the parameter value enable in out If OPFlag contains ESCORE_BOOTCOUNTER_ STATUS 1 When mode equals ESCORE_BOOTCOUNTER_MODE_GET 0 after the function returns enable will contain the status of the counter TRUE enabled or FALSE disabled When mode equals ESCORE_BOOTCOUNTER_MODE_SET 1 enable is a pointer to a variable that contains the status to set Use TRUE to start the counter or FALSE to stop value in out If OPFlag contains ESCORE_BOOTCOUNTER_VALUE 2 When mode equals ESCORE_BOOTCOUNTER_MODE_GET 0 33 SUSI Library User Manual after the function returns value will contain the reboot count When mode equals ESCORE_BOOTCOUNTER_MODE_SET 1 value is a pointer to a variable that contains the reboot count to set Give a value 0 to clear the count or any other value to start from Return Value TRUE 1 indicates success FALSE 0 indicates failure Remarks In windows XP the boot counter information is stored in the following registry val ues HKEY_LOCAL_MACHINE SYSTEM SusiBootCounter Enable HKEY_LOCAL_MACHINE SYSTEM SusiBootCounter BootTimes 6 9 SusiCoreAccessRunTimer Access the run timer A run timer i
26. ORT 00000008 ERRLIB_RESERVED8 00000009 ERRLIB_API_CURRENT_UNSUPPORT 00000010 ERRLIB_LIB_INIT_FAIL 00000011 ERRLIB_DRIVER_CONTROL_FAIL 00000012 ERRLIB_INVALID_PARAMETER 00000013 ERRLIB_INVALID_ID 00000014 ERRLIB_CREATEMUTEX_FAIL 00000015 ERRLIB_OUTBUF_RETURN_SIZE_INCORRECT 00000016 ERRLIB_RESERVED16 00000017 ERRLIB_ARRAY_LENGTH_INSUFFICIENT 00000032 ERRLIB_RESERVED32 00000050 ERRLIB_BRIGHT_CONTROL_FAIL 00000051 ERRLIB_BRIGHT_OUT_OF_RANGE 00000064 ERRLIB_RESERVED64 00000128 ERRLIB_RESERVED128 00000256 ERRLIB_RESERVED256 Core Functions 00000500 ERRLIB_CORE_BIOS_STRING_NOT_FOUND 00000512 ERRLIB_RESERVED512 Watchdog Functions 00001024 ERRLIB_RESERVED1024 GPIO Functions N A SMBus Functions 00001400 ERRLIB_SMB_MAX_BLOCK_SIZE_MUST_WITHIN_32 IIC Functions 00001600 ERRLIB_IIC_GETCPUFREQ_FAIL VGA Control Functions N A Hardware Monitor Functions 00002000 ERRLIB_HWM_CHECKCPUTYPE_FAIL 00002001 ERRLIB_HWM_FUNCTION_UNSUPPORT SUSI Library User Manual 78 00002002 ERRLIB_HWM_FUNCTION_CURRENT_UNSUPPORT 00002003 ERRLIB_HWM_FANDIVISOR_INVALID 00002048 ERRLIB_RESERVED2048 Reserved Functions 00004096 ERRLIB_RESERVED4096 00008192 ERRLIB_RESERVED8192 Driver Error Code Error Code Error Type 00000000 ERRDRV_SUCCESS Common to all Drivers 00010000 ERRDRV_CTRLCODE 00010001 ERRDRV_LOGIC 00010002 ERRDRV_INBUF_I
27. Parameters TargetPinMask in Specifies the mask of GPIO output pins demanded to be written StatusMask in Statuses of pins to be set in Bitwise ORed For pins that are not spec ified in TargetPinMask the related bit value is invalid 45 SUSI Library User Manual Return Value TRUE 1 indicates success FALSE 0 indicates failure Remarks For example if you want to write the statuses of GPIO output pin 0 1 6 7 Give parameter TargetPinMask with a value 11000011 or 0xC3 Bit 0 stand for GPIO 0 bit 1 stand for GPIO 1 and so on If you want to set pin O as high pin 1 as low pin 6 as high and pin 7 as low Give parameter StatusMask with a value 01XXXX01 X is for don t care pin you could simply assign a 0 for it i e 0x41 6 31 Susi64BitslOQueryMask Query the GPIO mask information BOOL Susi64BitsIOQueryMask DWORD flag UINT64 Mask Parameters flag in The value given to indicate the type of mask to retrieve can be one of the following values Static masks ESIO_SMASK_PIN_FULL 1 ESIO_SMASK_CONFIGURABLE 2 Dynamic masks ESIO_DMASK_DIRECTION 0x20 Mask out Pointer to a variable in which this function returns the queried mask Return Value TRUE 1 indicates success FALSE 0 indicates failure Remarks A mask is expressed as a series of binary digits Each bit corresponds to a pin bit 0 for pin 0 bit 1 for pin 1 bit 2 for pin 2 depending on the mask type A bit value 1 stands for a pin with
28. SMBusReceiveByte 41000000 ESusiSMBusSendByte 41100000 ESusiSMBusWriteQuick 41200000 ESusiSMBusReadQuick 41300000 ESusiSMBusScanDevice 41400000 ESusiSMBusWriteBlock 41500000 ESusiSMBusReadBlock lic 50100000 ESusillClnit 50200000 ESusillCAvailable 50300000 ESusillCReadByte 50400000 ESusillCWriteByte 50500000 ESusillCWriteReadCombine 50600000 ESusillCRead 50700000 ESusillCWrite 50800000 ESusillCScanDevice 50900000 ESusillCWriteRegister 51000000 ESusillCReadRegister VGA Control 60100000 ESusiVClnit 60200000 ESusiVCAvailable 60300000 ESusiVCGetBright 60400000 ESusiVCGetBrightRange 60500000 ESusiVCScreenOff 60600000 ESusiVCScreenOn 60700000 ESusiVCSetBright Hardware Monitor 70100000 ESusiHWMlnit 70200000 ESusiHWMAvailable 70300000 ESusiHWMGetFanSpeed 70400000 ESusiHWMGetTemperature 70500000 ESusiHWMGetVoltage 70600000 ESusiHWMSetFanSpeed 77 SUSI Library User Manual Library Error Code Error Code Error Type Driver Open Errors 00000001 ERRLIB_CORE_OPEN_FAIL 00000002 ERRLIB_WDT_OPEN_FAIL 00000004 ERRLIB_GPIO_OPEN_FAIL 00000008 ERRLIB_SMB_OPEN_FAIL 00000016 ERRLIB_VC_OPEN_FAIL 00000032 ERRLIB_HWM_OPEN_FAIL DLL Functions 00000000 ERRLIB_SUCCESS 00000001 ERRLIB_RESERVED1 00000002 ERRLIB_RESERVED2 00000003 ERRLIB_LOGIC 00000004 ERRLIB_RESERVED4 00000005 ERRLIB_SUSIDLL_NOT_INIT 00000006 ERRLIB_PLATFORM_UNSUPPORT 00000007 ERRLIB_API_UNSUPP
29. SusiVC APIs SUSI_VC_VGA_CONTROL_AVAILABLE 2 SUSI_VC_BOTH_AVAILABLE 3 Remarks After calling SusiDlllnit successfully all Susi Available functions are use to check if the corresponding features are supported by the platform or not So it is suggested to call Susi Available before using any Susi functions 6 51 SusiVCGetBrightRange Get the step minimum and maximum values in brightness adjustment BOOL SusiVCGetBrightRange BYTE minimum BYTE maximum BYTE step ping Parameters minimum out Pointer to a variable to get the minimum brightness value maximum out Pointer to a variable to get the maximum brightness value stepping out Pointer to a variable to get the step of brightness up and down Return Value TRUE 1 indicates success FALSE 0 indicates failure Remarks Call SusiVCAvailable first to make sure if the brightness control is available The values may vary from platform to platform depend on the hardware imple mentations of brightness control For example if minimum is 0 maximum is 255 and stepping is 5 it means the brightness can be 0 5 10 255 6 52 SusiVCGetBright Get the current panel brightness BOOL SusiVCGetBright BYTE brightness Parameters brightness out Pointer to a variable in which this function returns the brightness SUSI Library User Manual 58 6 53 6 54 Return Value TRUE 1 indicates success FALSE 0 indicates failure Remarks Call Sus
30. Value TRUE 1 indicates success FALSE 0 indicates failure Remarks For more information about how to use this API please refer to Programming SUSI Library User Manual 50 Overview part SMBus functions 6 39 SusiSMBusWriteQuick Turn a SMBus device function off on or disable enable a specific device mode BOOL SusiSMBusWriteQuick BYTE SlaveAddress Parameters SlaveAddress in Specifies the 8 bit device address ranging from 0x00 OxFF Whether to give a 1 read or 0 write to the LSB of SlaveAddress could be ignored Return Value TRUE 1 indicates success FALSE 0 indicates failure Remarks For more information about how to use this API please refer to Programming Overview part SMBus functions 6 40 SusiSMBusReceiveByte Receive information in a byte from the target slave device in the SMBus BOOL SusiSMBusReceiveByte BYTE SlaveAddress BYTE Result Parameters SlaveAddress in Specifies the 8 bit device address ranging from 0x00 OxFF Whether to give a 1 read or 0 write to the LSB of SlaveAddress could be ignored Result out Pointer to a variable in which the function receives the byte informa tion Return Value TRUE 1 indicates success FALSE 0 indicates failure Remarks A simple device may have information that the host needs to be received in the parameter Result For more information about how to use this API please refer to Programming
31. WORD StatusMask Parameters TargetPinMask in Specifies the mask of GPIO pins demanded to be read StatusMask out Statuses of pins in Bitwise ORed For pins that are not specified in TargetPinMask the related bit value is invalid SUSI Library User Manual 44 6 29 6 30 Return Value TRUE 1 indicates success FALSE 0 indicates failure Remarks For example if you want to read the statuses of GPIO pin 0 1 6 7 Give parame ter TargetPinMask with a value 11000011 or 0xC3 Bit 0 stand for GPIO 0 bit 1 stand for GPIO 1 and so on Again if the pin is in status high the value got in rel evant bit of StatusMask will be 1 If the pin is in status low it will be zero SusilOWriteEx Set one GPIO output pin as status high or low BOOL SusilOWriteEx BYTE PinNum BOOL status Parameters PinNum in Specifies the GPIO pin demanded to be written ranging from 0 total number of GPIO pins minus 1 status in Specifies the GPIO status to be written Return Value TRUE 1 indicates success FALSE 0 indicates failure Remarks The function can only set the status of one of the output pins If the pin number specified is an input pin or an invalid pin the function call will fail and return with FALSE A status with 1 to set the pin as output high O to set the pin as output low SusilOWriteMultiEx Set statuses of multiple output pins at once BOOL SusilOWriteMultiEx DWORD TargetPinMask DWORD StatusMask
32. able functions are use to check if the corresponding features are supported by the platform or not So it is suggested to call Susi Available before using any Susi functions 6 57 SusiHWMGetFanSpeed Read the current value of one of the fan speed sensors or get the types of avail able sensors BOOL SusiHWMGetFanSpeed WORD fanType WORD retval WORD typeSup port NULL SUSI Library User Manual 60 Parameters fantype in Specifies a fan speed sensor to get value from It can be one of the flags FCPU 1 CPU Fan FSYS 2 System Chassis fan retval out Point to a variable in which this function returns the fan speed in RPM Typesupport out If the value is specified as a pointer non NULL to a variable it will return the types of available sensors in flags bitwise ORed Return Value TRUE 1 indicates success FALSE 0 indicates failure Remarks Call the function first with a non NULL typesupport to know the available fan sen sors and a following call to get the fan speed required 6 58 SusiHWMGetTemperature Read the current value of one of the temperature sensors or get the types of avail able sensors BOOL SusiHWMGetTemperature WORD tempType float retval WORD type Support NULL Parameters temp Type in Specifies a temperature sensor to get value from It can be one of the flags TCPU 1 CPU temperature TSYS 2 System ambient temperature retval out Point to a variable in
33. atform supports Watchdog 1 Remarks After calling SusiDllinit successfully all Susi Available functions are used to check if the corresponding features are supported by the platform or not We suggest Susi Available is called before using any Susi functions SUSI Library User Manual 38 6 18 SusiWDGetRange Get the step minimum and maximum values of the watchdog timer BOOL SusiWDGetRange DWORD minimum DWORD maximum DWORD stepping Parameters minimum out Pointer to a variable containing the minimum timeout value in millisec onds maximum out Pointer to a variable containing the maximum timeout value in milli seconds stepping out Pointer to a variable containing the resolution of the timer in millisec onds Return Value TRUE 1 indicates success FALSE 0 indicates failure Remarks The values may vary from platform to platform depending on the hardware imple mentation of the watchdog timer For example if the minimum timeout is 1000 the maximum timeout is 63000 and the step is 1000 it means the watchdog timeout will count 1 2 3 63 seconds 6 19 SusiWDSetConfig Start watchdog timer with specified timeout value BOOL SusiWDSetConfig DWORD delay DWORD timeout Parameters delay in Specifies a value in milliseconds which will be added to the first time out period This allows the application to have sufficient time to do initial ization before the first call to SusiWDTrigg
34. ble parallel interface that allows a variety of custom connections It supports various Digital I O devices input devices like buttons switches output devices such as cash drawers LED lights etc And allows users to monitor the level of signal input or set the output status to switch on off the device Our API also provide Programmable GPIO allows developers to dynamically set the GPIO input or output status SMBus SMBus is the System Management Bus defined by Intel Corporation in 1995 It is used in personal computers and servers for low speed system management communications Today SMBus is used in all types of embedded systems The SMBus API allows a developer to interface a Windows XP or CE PC toa downstream embedded system environment and transfer serial messages using the SMBus protocols allowing multiple simultaneous device control SUSI Library User Manual 2 I2C is a bi directional two wire bus that was developed by Philips for use in their televisions in the 1980s Today 12C is used in all types of embedded systems The I2C API allows a developer to interface a Windows XP or CE PC to a down stream embedded system environment and transfer serial messages using the I2C protocols allowing multiple simultaneous device control Monitor m Watchdog A watchdog timer WDT is a device or electronic card that performs a specific operation after a certain period of time if something goes wrong with an elec tronic sy
35. e related bit value is invalid Return Value TRUE 1 indicates success FALSE 0 indicates failure SUSI Library User Manual 48 Remarks For example if you want to read the statuses of GPIO pin 0 1 6 7 Give parame ter TargetPinMask with a value 11000011 or 0xC3 Bit O stand for GPIO 0 bit 1 stand for GPIO 1 and so on Again if the pin is in status high the value got in rel evant bit of StatusMask will be 1 If the pin is in status low it will be zero 6 35 Susi64BitslOWriteMultiEx Set statuses of multiple output pins at once BOOL Susi64BitsIOWriteMultiEx DWORD TargetPinMask DWORD StatusMask Parameters TargetPinMask in Specifies the mask of GPIO output pins demanded to be written StatusMask in Statuses of pins to be set in Bitwise ORed For pins that are not spec ified in TargetPinMask the related bit value is invalid Return Value TRUE 1 indicates success FALSE 0 indicates failure Remarks For example if you want to write the statuses of GPIO output pin 0 1 6 7 Give parameter TargetPinMask with a value 11000011 or 0xC3 Bit 0 stand for GPIO 0 bit 1 stand for GPIO 1 and so on If you want to set pin O as high pin 1 as low pin 6 as high and pin 7 as low Give parameter StatusMask with a value 01XXXX01 X is for don t care pin you could simply assign a 0 for it i e Ox41 6 36 SusiSMBusAvailable Check if SMBus driver is available int SusiSMBusAvailable void Parameters None
36. ed to probe whether an address is currently used by certain devices on a platform You can find out which addresses are occupied by scanning from 0x00 to 0x7f For example you could scan for occupied addresses and avoid them when connecting a new device or by probing before and after con necting the new device you could quickly know its address The SlaveAddress_7 parameter given in this API is a 7 bit address IIC functions The APIs here cover IIC standard mode operations with a 7 bit device address SusillCRead SusillCWrite SusillCWriteReadCombine IC versus SMBus compatibility On platforms that do not have IIC but do have SMBus a call to SusillCAvailable returns SUSI_IIC_TYPE_SMBUS 2 Users might be able to use SMBus as a substi tute however whether it s with fully or partially supported depends on the SMBus controller type In AMD platforms we have implemented the SMBus driver to be totally IIC standard mode compatible users could use the IIC APIs implemented by the SMBus controller SUSI Library User Manual 26 5 7 5 8 with IICType SUSI_IIC_TYPE_SMBUS to communicate with all kinds of IIC devices In Intel and VIA s platforms the currently compatible protocols are m SusillCRead with ReadLen 1 SusillCWrite with WriteLen 1 IIC devices with 7 bit slave addresses can also be scanned by SusiSMBusScanDe vice on all platforms that have SMBus support We are now working on more IIC compatible APIs for I
37. emarks An application must call SusiDlIllnit before calling any other non SusiDIl functions SusiDlIlUnlnit Uninitialize the Susi Library BOOL SusiDIlUnlnit void Parameters None Return Value TRUE 1 indicates success FALSE 0 indicates failure Remarks Before an application terminates it must call SusiDllUnlnit if it has successfully called SusiDlllnit Calls to SusiDIllnit and SusiDllUnInit can be nested but must be paired SusiDIlGetVersion Retrieve the version numbers of SUSI Library void SusiDlIGetVersion WORD major WORD minor Parameters major out Pointer to a variable containing the major version number SUSI Library User Manual 30 6 4 6 5 minor out Pointer to a variable containing the minor version number Return Value None Remarks This function returns the version numbers of SUSI It s suggested to call this func tion first and compare the numbers with the constants SUSI_LIB_VER_MJ and SUSI_LIB_VER_MR in header file SUSI H to insure the library compatibility SusiDIlGetLastError This function returns the last error code value int SusiDIIGetLastError void Parameters None Return Value The code of error reason for the last function call with failure Remarks You should call the SusiDllGetLastError immediately when a function s return value indicates failure The return error code will be either Function Index Code Library Error Code or Function Index Code
38. er and still be protected by the watchdog timeout in Specifies a value in milliseconds for the watchdog timeout Return Value TRUE 1 indicates success FALSE 0 indicates failure 39 SUSI Library User Manual Remarks Once the watchdog has been activated its timer begins to count down The appli cation has to periodically call SusiWDTrigger to refresh the timer before it expires i e reload the watchdog timer within the specified timeout or the system will reboot when it counts down to 0 Actually a subsequent call to SusiWDTrigger equals a call to SusiWDSetConfig with delay 0 and the original timeout value so if you want to change the timeout value call SusiWDSetConfig with new timeout value instead of SusiWDTrigger Use SusiWDGetRange to get the acceptable timeout values 6 20 SusiWDTrigger Reload the watchdog timer to the timeout value given in SusiWDSetConfig to pre vent the system from rebooting BOOL SusiWDTrigger void Parameters None Return Value TRUE 1 indicates success FALSE 0 indicates failure Remarks A watchdog protected application has to call SusiWDTrigger continuously to indi cate that it is still working properly and prevent a system restart The first call to SusiWDTrigger in the middle of a delay resulting from a previous call to SusiWD SetConfig causes the delay timer to be canceled immediately and starts the watch dog timer countdown from the timeout value It is always a good choice
39. from slave device will be placed in the low byte of Result and the second byte read will be placed in the high byte For more information about how to use this API please refer to Programming Overview part SMBus functions 6 45 SusiSMBusWriteWord Write a word 2 bytes of data to the target slave device in the SMBus BOOL SusiSMBusWriteWord BYTE SlaveAddress BYTE RegisterOffset WORD Result Parameters SlaveAddress in Specifies the 8 bit device address ranging from 0x00 OxFF Whether to give a 1 read or O write to the LSB of SlaveAddress could be ignored RegisterOffset in Specifies the offset of the device register to write data to Result in Specifies the word data to be written Return Value TRUE 1 indicates success FALSE 0 indicates failure Remarks The low byte of Result will be send to the slave device first and then the high byte For more information about how to use this API please refer to Programming Overview part SMBus functions 6 46 SusillCAvailable Check if PC driver is available and also get the IIC type supported int SusillCAvailable Parameters None SUSI Library User Manual 54 Return Value Value Meaning 1 The function fails 0 The function succeeds the platform does not support any SusillC APIs SUSI_IIC_TYPE_PRIMARY 1 M function succeeds the platform supports only primary The function succeeds the platform sup
40. iVCAvailable first to make sure if the brightness control is available SusiVCSetBright Set current panel brightness BOOL SusiVCSetBright BYTE brightness Parameters brightness in Specifies the brightness value to be set Return Value TRUE 1 indicates success FALSE 0 indicates failure Remarks Call SusiVCAvailable first to make sure if the brightness control is available In some implementations the higher the brightness value the higher the voltage fed to the panel So please make sure the voltage toleration of your panel prior to the API use SusiVCScreenOn Turn on VGA display signal BOOL SusiVCScreenOn void Parameters None Return Value TRUE 1 indicates success FALSE 0 indicates failure Remarks The function enables both the LCD and CRT display signals 59 SUSI Library User Manual 6 55 SusiVCScreenOff Turn off VGA display signal BOOL SusiVCScreenOff void Parameters None Return Value TRUE 1 indicates success FALSE 0 indicates failure Remarks The function disables both the LCD and CRT display signals 6 56 SusiHWMAvailable Check if the hardware monitor driver is available int SusiHWMAvailable Parameters None Return Value Value Meaning 1 The function fails 0 The function succeeds the platform does not support SusiHWM APIs 1 The function succeeds the platform supports HWM Remarks After calling SusiDillnit successfully all Susi Avail
41. imeout text box and optionally type 2000 2 sec in the Delay text box Click the Start button The Left text box will show the approximate countdown value the watchdog timer This is a software timer in the demo program not the actual watchdog hardware timer so it is not very accurate m Before the timer counts down to zero you may reset the timer by clicking the Refresh button stop it by clicking the Stop button 13 SUSI Library User Manual 4 3 3 GPIO SusiDemo Boot Logger Watchdog GPIO Programmable GPIO SMBus Multibyte uc Pin Information Num of out pins Bo fl Pin Control Single pin bp Pin number Multi pins I Hex unse DL em Read Write This page is only for backward compatibility with previous APIs that are bidirectional So in new GPIO supported platforms such as SUSI V12 this page will not be shown We highly recommend you use the new Programmable GPIO When the SusiDemo program executes it displays the fixed numbers of input pins and output pins in Pin Information field You can click the Single pin or Multi pins radio button to choose single or multiple pins For GPIO pinout information for each platform please refer to the Appendix Read Single Input Pin Click Single Pin radio button Type the input pin number to read the status from Pins are numbered from 0 to the total number of input pins minus 1 Click Read button and the status
42. in 5 IN2 Pin 6 GND Pin 7 IN3 Pin 8 OUT1 Max 1A Pin 9 GND Pin 10 12 V Pin 11 Key Pin 12 Key Pin 13 POUT3 Pin 14 GND Pin 15 OUT2 Pin 16 12 V It should add the pull up resistors to OUTO OUT1 on AIMB 330 AIMB 340 and AIMB 640 PCM 3350 CN36 CN37 PCM 3353 CN36 CN37 PCM 3372 CN2 CN23 PCM 4153 CN36 CN37 PCM XXXX IN OUT The number of GPIO pins4 Inputs 4 outputs IN OUT Pin Signal Pin Signal Pin 1 VCC Pin 1 OUTO Pin 2 INO Pin 2 OUT1 Pin 3 IN1 Pin 3 OUT2 Pin 4 IN2 Pin 4 OUT3 Pin 5 IN3 Pin 5 GND SUSI Library User Manual 66 PCM 4372 CN2 PCM 4386 CN7 PCM 4380 CN7 PCM 4390 CN6 PCM 9374 CN4 PCM 9375 CN9 PCM 9377 27 PCM 9380 CN7 PCM 9386 CN7 PCM 9577 CN25 PCM 9584 CN16 PCM 9586 CN9 PCM 9679 CN7 The number of GPIO pins4 Inputs 4 outputs Pin Signal Pin Signal Pin 1 VCC Pin 2 OUTO Pin 3 INO Pin 4 OUT1 Pin 5 IN Pin 6 OUT2 Pin 7 IN2 Pin 8 OUT3 Pin 9 IN3 Pin 10 GND It should add the pull up resistors to the input pins on PCM 9577 for logic level PCM 9381 CN7 PCM 9387 CN7 The number of GPIO pins4 Inputs Pin Signal Pin 1 VCC Pin 2 INO Pin 3 IN Pin 4 IN2 Pin 5 IN3 PCM 9578 CN5 The number of GPIO pins4 Inputs 4 outputs Pin Signal Pin Signal Pin 1 OUTO Pin 2 OUT1 Pin 3 OUT2 Pin 4 OUT3 Pin 5 OUT4 Pin 6 OUT5 Pin 7 OUT6 Pin 8 OUT7 Pin 9 GND Pin 10 GND PCM 9580 CN16 The nu
43. mber of GPIO pins4 Inputs 4 outputs Pin Signal Pin Signal Pin 1 INO Pin 2 OUTO Pin 3 IN1 Pin 4 OUT1 Pin 5 IN2 Pin 6 OUT2 Pin 7 IN3 Pin 8 OUT Pin 9 GND Pin 10 GND 67 SUSI Library User Manual PCM 9581 CN9 PCM 9582 CN19 PCM 9586 CN9 PCM 9587 CN19 PCI 6681 CN16 The number of GPIO pins4 Inputs 4 outputs Pin Signal Pin Signal Pin 1 INO Pin 2 OUTO Pin 3 GND Pin 4 GND Pin 5 IN1 Pin 6 OUT1 Pin 7 VCC Pin 8 NC Pin 9 IN2 Pin 10 OUT2 Pin 11 GND Pin 12 GND Pin 13 IN3 Pin 14 OUT3 It should add the pull up resistors to n2 In3 OUTO OUT1 on PCM 9581 and PCM 9586 PCI 6880 CN2 The number of GPIO pins4 Inputs 4 outputs Pin Signal Pin Signal Pin 1 INO Pin 2 OUTO Pin 3 IN Pin 4 OUT1 Pin 5 IN2 Pin 6 OUT2 Pin 7 IN3 Pin 8 OUT3 Pin 9 VCC Pin 10 GND SOM 5780 U17 SOM 5782 U14 The number of GPIO pins4 Inputs 4 outputs Pin Signal Pin Signal Pin 1 VCC 3 3 V Pin 16 GND Pin 4 IN2 Pin 20 OUT3 Pin 5 IN3 Pin 21 OUT2 Pin 11 INO Pin 22 OUT1 Pin 12 IN1 Pin 23 OUTO SOM 5780 SOM 5782 must combine with SOM DB5700 carrier board SOM DB5700 CN27 Pin 1 INO Pin 2 VCC Pin 3 IN1 Pin 4 OUTO Pin 5 IN2 Pin 6 OUT1 Pin 7 IN3 Pin 8 OUT2 Pin 9 GND Pin 10 12V Pin 11 NC Pin 12 NC Pin 13 OUT3 Pin 14 NC Pin 15 GND Pin 16 12V SUSI Library User Manual 68 PCM 3375 CN16 The number of GPIO pins4 Inputs 4 outputs
44. ntel and VIA controllers These APIs will be supported soon For more details on platform IIC SMBus support please refer to Appendix A VGA Control VC functions SusiVC functions support VGA signal ON OFF on all SUSI enabled platforms and also LCD brightness adjustment m SusiVCScreenOn SusiVCScreenOff SusiVCGetBrightRange SusiVCGetBright SusiVCSetBright One application of SusiVCScreenOn and SusiVCScreenOff is to have the display signal disabled when system idles after certain period of time to expand the panel life span Hardware Monitoring HWM functions SusiHWM functions support system health supervision by retrieving the values of voltage temperature and fan sensors In some platforms it is possible to control the CPU System fan speed Use these functions cautiously SusiHWMAvailable SusiHWMGetFanSpeed SusiHWMGetTemperature SusiHWMGetVoltage SusiHWMSetFanSpeed 27 SUSI Library User Manual SUSI Library User Manual 28 SUSI API Programmer s Documentation 6 1 6 2 6 3 All APIs return the BOOL data type except Susi Available and some special cases that are of type int If any function call fails i e a BOOL value of FALSE or an int value of 1 the error code can always be retrieved by an immediate call to SusiGet LastError SusiDillnit Initialize the Susi Library BOOL SusiDIllnit void Parameters None Return Value TRUE 1 indicates success FALSE 0 indicates failure R
45. o low the value given in text box of R W Result should be OxOA Click Write button to perform the operation 4 3 4 Programmable GPIO SusiDemo Boot Logger watchdog GPIO Programmable GPIO SMBus Multibyte uc vea 4 Pin Number Direction Change RW Access Output bp C Single Pin bp Multiple Pin Oo e Bin Get Pin Count Value ss Bin Set Direction MASK DI Full Pin 5 Lem E _ 10 Configurable 5 i 7 N ee C 10 Direction Now EH Bin Pin Number dGetthe numbers of input pins and output pins respectively Each number may vary with the direction of current pins but the sum remains the same MASK m Choose the mask of interest by selecting or clearing its check box then clicking Get Mask 15 SUSI Library User Manual Direction Change RW Access m Choose either Single Pin or Multiple Pin The possible values that the Single Pin text box can be set to ranges from 0 to the total number of GPIO pins minus 1 Single Pin Operation IO Write Set Direction m Give a value of 1 output status high input direction or 0 output status low output direction to set the pin then click the IO Write or Set Direction button Single Pin Operation IO Read Click IO Read to get the pin input status Multiple Pin Operation IO Write Set Direction If there are 8 GPIO pins To write the status of GPIO output pins 0 1 6 and
46. of the GPIO pin appears in R W Result Read Multiple Input Pins Click Multiple Pins radio button E Type a pin number from 0x01 to 0xOF to read the status of the input pins The pin numbers are bitwise ORed i e bit 0 stands for input pin 0 bit 1 stands for input pin 1 etc For example to read input pins 0 1 and 3 type Ox0B into the Multi Pins text box Click the Read button and the status of the GPIO pins appears in the R W Result text box Write Single Output Pin Click the Single Pin radio button SUSI Library User Manual 14 Type the output pin number to write the status to Pins are numbered from 0 to the total number of input pins minus 1 Type either 0 or 1 in R W Result to set the output status as low or high Click Write button to perform the operation Write Multiple Output Pins Click the Multi Pins radio button Type a pin number from 0x01 to OxOF to choose the output pins to write The pin numbers are bitwise ORed i e bit O stands for output pin 0 bit 1 stands for output pin 1 etc For example to write input pins 0 1 and 3 type OxOB into the Multi Pins text box Type a value from 0x01 to OxOF into the R W Result text box to set the sta tus of the output pins Again the pin statuses are bitwise ordered i e bit 0 stands for the desired status of output pin 0 bit 1 for output pin 1 etc For exam ple if you want to set pin 0 and 1 high 3 t
47. onMulti SusilOReadEx SusilOReadMultiEx SusilOWriteEx SusilOWriteMultiEx Previous function set SusilOCount SusilOlnitial 25 SUSI Library User Manual 5 9 5 6 SusilORead SusilOReadMulti SusilOWrite SusilOWriteMulti Refer to Appendix for pin allocation and their default direction SMBus functions We support the SMBus 2 0 compliant protocols in SusiSMBus APIs Quick Command SusiSMBusReadQuick SusiSMBusWrite Quick m Byte Receive Send SusiSMBusReceiveByte SusiSMBusSendByte E Byte Data Read Write SusiSMBusReadByte SusiSMBusWriteByte m Word Data Read Write SusisMBusReadWord SusiSMBusWriteWord We also support an additional API for probing m SusiSMBusScanDevice The slave address is expressed as a 7 bit hex number between 0x00 to 0x7F how ever the actual addresses used for R W are 8 bit write address 7 bit address lt lt 1 left shift one with LSB 0 for write 8 bit read address 7 bit address lt lt 1 left shift one with LSB 1 for read E g Given a 7 bit slave address 0x20 the write address is 0x40 and the read address is 0x41 Here in all APIs except for SusiSMBusScanDevice parameter SlaveAddress is the 8 bit address and users don t need to care about giving it as a read or write address since the actual R W is taken care by the API itself i e you could even use a write address say 0x41 for APIs with write operation and get the right result and vice versa SusiSMBusScanDevice is us
48. ormation about how to use this API please refer to Programming Overview part SMBus functions 6 43 SusiSMBusWriteByte Write a byte of data to the target slave device in the SMBus BOOL SusiSMBusWriteByte BYTE SlaveAddress BYTE RegisterOffset BYTE Result Parameters SlaveAddress in Specifies the 8 bit device address ranging from 0x00 OxFF Whether to give a 1 read or 0 write to the LSB of SlaveAddress could be ignored RegisterOffset in Specifies the offset of the device register to write data to Result in Specifies the byte data to be written Return Value TRUE 1 indicates success FALSE 0 indicates failure Remarks For more information about how to use this API please refer to Programming Overview part SMBus functions 6 44 SusiSMBusReadWord Read a word 2 bytes of data from the target slave device in the SMBus BOOL SusiSMBusReadWord BYTE SlaveAddress BYTE RegisterOffset WORD Result Parameters SlaveAddress in Specifies the 8 bit device address ranging from 0x00 OxFF Whether to give a 1 read or 0 write to the LSB of SlaveAddress could be ignored RegisterOffset in Specifies the offset of the device register to read data from Result out Pointer to a variable in which the function reads the word data 53 SUSI Library User Manual Return Value TRUE 1 indicates success FALSE 0 indicates failure Remarks The first byte read
49. ports only SMBus implemented IIC The function succeeds the platform supports both primary IIC and SMBus IIC SUSI_IIC_TYPE_SMBUS 2 SUSI_IIC_TYPE_BOTH 3 Remarks After calling SusiDlllnit successfully all Susi Available functions are use to check if the corresponding features are supported by the platform or not So it is suggested to call Susi Available before using any Susi functions 6 47 SusillCRead Read bytes of data from the target slave device in the DC bus SUSI_API BOOL SusillCRead DWORD IICType BYTE SlaveAddress BYTE ReadBuf DWORD ReadLen Parameters IC Type in Specifies the 1 C type the value can either be SUSI_IIC_TYPE_PRIMARY 1 SUSI_IIC_TYPE_SMBUS 2 SlaveAddress in Specifies the 8 bit device address ranging from 0x00 OxFF Whether to give a 1 read or O write to the LSB of SlaveAddress could be ignored ReadBuf out Pointer to a variable in which the function reads the bytes of data ReadLen in Specifies the number of bytes to be read Return Value TRUE 1 indicates success FALSE 0 indicates failure Remarks Call SusillCAvailable first to make sure the support I C type For more information 55 SUSI Library User Manual about how to use this API and the relationship between IC and SMBus please refer to Programming Overview parts SMBus functions to IIC versus SMBus compatibility 6 48 SusillCWrite Write bytes of data to the target
50. rable If the pin number specified is an invalid pin or a pin that can only be config ured as an input the function call will fail and return FALSE 47 SUSI Library User Manual 6 33 Susi64BitslOSetDirectionMulti Set directions of multiple pins at once BOOL Susi64BitslOSetDirectionMulti UINT64 TargetPinMask UINT64 Pin DirMask Parameters TargetPinMask in Specifies the mask of GPIO output pins to be written PinDirMask in out Specifies the directions of pins to be set in a bitwise ORed manner After the function call returns TRUE it contains the latest direction mask after set Return Value TRUE 1 indicates success FALSE 0 indicates failure Remarks For example if you set to the directions of GPIO pin 0 1 6 7 Give parameter Tar getPinMask with a value 11000011 or 0xC3 Bit 0 stand for GPIO 0 bit 1 stand for GPIO 1 and so on If you want to set pin 0 as input pin 1 as output pin 6 as input and pin 7 as output Give value in parameter PinDirMask as 01XXXX01 X is for don t care you could simply assign a 0 for it i e 0x41 6 34 Susi64BitslOReadMultiEx Read current statuses of multiple pins at once regardless of the pin directions BOOL Susi64BitslOReadMultiEx DWORD TargetPinMask DWORD Status Mask Parameters TargetPinMask in Specifies the mask of GPIO pins demanded to be read StatusMask out Statuses of pins in Bitwise ORed For pins that are not specified in TargetPinMask th
51. rations by selecting a radio button m Give the proper value to the Slave address and Register offset text boxes Some protocol operations don t have register offsets m Click the Read button for read receive operations and the Write button for write send operations m The values read or to be written are in the Result Hex text box Scan Address Occupancy Button Click this button to get the addresses currently used by slave devices connected to the SMBus m The occupied addresses will be shown in the Result Hex text box The addresses are already in an 8 bit format 17 SUSI Library User Manual y Ja deyo SWEABOAIA EUONIPPY 4 3 6 Multibyte IIC m Select the Primary or SMBus IIC radio button If one of them is not sup ported its radio button will be unavailable Primary m Connect the IIC devices to the IIC connector Type in the data bytes to be written in the Input Data text box The bytes read will be shown in the Result text box SMBus lIC m Connect the IIC devices to the SMBus connector E n AMD platforms all the IIC functions are fully supported In Intel or VIA platforms only Read and Write with Read num 1 or Write num 1 are supported WR Combine is not supported SUSI Library User Manual 18 4 3 7 VGA Control y Ja deyo SWEIBOII JEUONIPPY You may control VGA functions from the VGA Control tab or directly by hotkey If the brightness control is not
52. rite to the LSB of SlaveAddress could be ignored WriteBuf in Pointer to a byte array which contains the bytes of data to be written WriteLen in Specifies the number of bytes to be written ReadBuf out Pointer to a variable in which the function reads the bytes of data ReadLen in Specifies the number of bytes to be read Return Value TRUE 1 indicates success FALSE 0 indicates failure Remarks The function is mainly for EEPROM I C devices the bytes written first are used to locate to a certain address in ROM and the following bytes read will retrieve the data bytes starting from this address Call SusillCAvailable first to make sure the support PC type For more information about how to use this API and the relationship between IIC and SMBus please refer to Programming Overview parts SMBus functions to IIC versus SMBus compatibility 6 50 SusiVCAvailable Check if VC driver is available and also get the feature support information BOOL SusiVCAvailable void Parameters None Return Value value Meaning 1 The function fails 0 The function succeeds the platform does not support any SusiVC APIs SUSI_VC_BRIGHT_CONTROL_AVAILABLE 1 57 The function succeeds the platform sup ports only brightness APIs SUSI Library User Manual The function succeeds the platform sup ports only screen on off APIs The function succeeds the platform sup ports all
53. rogrammable GP 15 e E TEE 17 4 3 6 Multibyte IO osas asenin een 18 SCT Be ut 19 4 3 8 Hardware Monitor nn 20 4 3 9 Hardware Control nennen 21 ALS 102 ee EE 22 Programming Overview ssassn 23 Introduction T rn 24 CORE TUNCTIONS E 25 Watchdog WD functions 00 0 0 eee cece tenet ee nan E 25 GPIO lO Ter EE 25 SMBUS FUNCTIONS u ee ek 26 n TEE 26 VGA Control VC functions 40urss40nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn 27 Hardware Monitoring HWM functions nen nnnnennennnnnnen 27 SUSI API Programmer s Documentation sccssessecseenseeeneenerre 29 TT RIIT EE 30 GusifDlllnlnp ioaren niinn aaeeea Kinan anaana 30 SusiDllGetVersion 00 cece cece ccccceccececceceeeseeeueesseeeseeeeecceceeeceseeeeeeueueesauananaeaea 30 SusiDIIGetLastError cece cccccccecceaeseceeeeeeeeeeeeeseseccecceeeeeeceeeeeeeeeeaeananaeaea 31 elle Ee EEN 31 SusiCoreGetBIOSVersion nennen 32 ili SUSI Library User Manual 6 60 Appendix A A 1 SUSI Library User Manual SusiCoreGetPlatformName oeeeeeiseeererrnsersrirrisesnrnrrssrnrrnnesnnrrnenens 32 GuslorehccessboottCoumter 33 GusiCorehccessbiunf mer 34 GGCORE BUNTIMER ccccccccccccccssceeeeeeseeseeccesseesesaeuaueaueueeeaeenseees 35 SusiCoreSetThrottlingSpeed nen 35 GusiCoreGetThrottlmgGpeed nenn 36 SusiCoreGetThrottlingDuty nenn 36 SusiCoreSetThrottlingDuty nn nnn 37 GuslCoreGetavtC poufzpeed nen 37 SusiCoreGetCpuVendor nn 38 SUSIWDAVAIIADIG u einen
54. s to control the hardware without knowing the hardware specs of the chipsets and driver architecture Reduced Project Effort When customers have their own devices connected to the onboard bus they can either study the data sheet and write the driver amp API from scratch or they can use SUSI to start the integration with a 50 head start Developers can ref erence the sample program on the CD to see and learn more about the software development environment Enhances Hardware Platform Reliability SUSI provides a trusted custom ready solution which combines chipset and library function support controlling application development through SUSI enhances reliability and brings peace of mind Flexible Upgrade Possibilities SUSI supports an easy upgrade solution for customers Customers just need to install the new version SUSI that supports the new functions 5 SUSI Library User Manual SUSI Library User Manual Chapter 2 Environments 2 1 Environments Operating Systems that SUSI supports include m Windows XP Embedded m Windows XP Pro or Home Edition For the complete list of SUSI enabled platforms please refer to Appendix A Note that the list may be changed without notice For the latest support list please check http www advantech com tw ess SUSI asp Should you have any questions about your Advantech boards please contact us by telephone or E mail SUSI Library User Manual 8 Chapter 3 Package Contents
55. s used to count the system running time BOOL SusiCoreAccessRunTimer DWORD mode PSSCORE_RUNTIMER pRunTimer Parameters mode in The value can be either ESCORE_BOOTCOUNTER_MODE_GET 0 Get the counter ESCORE_BOOTCOUNTER_MODE_SET 1 Set the counter pRunTimer in out Pointer to a SSCORE_RUNTIMER structure to set or get the timer Please see next page for details of this structure Return Value TRUE 1 indicates success FALSE 0 indicates failure Remarks In windows XP the information is stored in the following registry values HKEY_LOCAL_MACHINE SYSTEM SusiRunTimer Running HKEY_LOCAL_MACHINE SYSTEM SusiRunTimer Autorun HKEY_LOCAL_MACHINE SYSTEM SusiRunTimer ContinualOnTime HKEY_LOCAL_MACHINE SYSTEM SusiRunTimer TotalOnTime The information will be lost only if the registry values have been wiped out For a detailed definition of the SSCORE_RUNTIMER structure please refer to next page SUSI Library User Manual 34 6 10 SSCORE_RUNTIMER This structure represents the run timer information typedef struct DWORD dwOPFlag BOOL isRunning BOOL isAutorun DWORD dwTimeContinual DWORD dwTimerTotal SSCORE_RUNTIMER PSSCORE_RUNTIMER Members dwOPFlag The operation flag can be a combination of ESCORE_RUNTIMER_STATUS_ RUNNING 1 The operation is on the member isRunning ESCORE_RUNTIMER_STATUS_ AUTORUN 2 The operation is on the member isAutorun ESCORE_RUNTIMER_VALUE_CONTINUALON 4 The operation is on
56. slave device in the IC bus BOOL SusillCWrite DWORD IICType BYTE SlaveAddress BYTE WriteBuf DWORD WriteLen Parameters IC Type in Specifies the 1 C type the value can either be SUSI_IIC_TYPE_PRIMARY 1 SUSI_IIC_TYPE_SMBUS 2 SlaveAddress in Specifies the 8 bit device address ranging from 0x00 OxFF Whether to give a 1 read or 0 write to the LSB of SlaveAddress could be ignored WriteBuf in Pointer to a byte array which contains the bytes of data to be written WriteLen in Specifies the number of bytes to be written Return Value TRUE 1 indicates success FALSE 0 indicates failure Remarks Call SusillC Available first to make sure the support PC type For more information about how to use this API and the relationship between IIC and SMBus please refer to Programming Overview parts SMBus functions to IIC versus SMBus compatibility 6 49 SusillCWriteReadCombine A sequential operation to write bytes of data followed by bytes read from the target slave device in the I C bus BOOL SusillCWriteReadCombine DWORD IICType BYTE SlaveAddress BYTE WriteBuf DWORD WriteLen BYTE ReadBuf DWORD Readlen Parameters IICType SUSI Library User Manual 56 in Specifies the IC type the value can either be SUSI_IIC_TYPE_PRIMARY 1 SUSI_IIC_TYPE_SMBUS 2 SlaveAddress in Specifies the 8 bit device address ranging from 0x00 OxFF Whether to give a 1 read or 0 w
57. stem and the system does not recover on its own A watchdog timer can be programmed to perform a warm boot restarting the system after a certain number of seconds during which a program or computer fails to respond following the most recent mouse click or keyboard action P Hardware Monitor The Hardware Monitor HWM API is a system health supervision API that inspects certain condition indexes such as fan speed temperature and voltage m Hardware Control The Hardware Control API allows developers to set the PWM Pulse Width Mod ulation value to adjust Fan Speed or other devices can also be used to adjust the LCD brightness 3 SUSI Library User Manual Display m Brightness Control The Brightness Control API allows a developer to interface Windows XP and Windows CE PC to easily control brightness sm Backlight The Backlight API allows a developer to control the backlight screen on off in Windows XP and Windows CE Power Saving m CPU Speed Make use of Intel SpeedStep technology to save the power consumption The system will automatically adjust the CPU Speed depend on the system loading System Throttling Refers to a series of methods for reducing power consumption in computers by lowering the clock frequency These API allow user to lower the clock from 87 5 to 12 5 SUSI Library User Manual 4 1 3 Benefits Faster Time to Market SUSI s unified API helps developers write application
58. supported the control parts are unavailable grayed out 19 SUSI Library User Manual 4 3 8 Hardware Monitor Click Monitor to get and display the hardware monitor values If a data value is not supported on the platform its text box will be unavailable grayed out SUSI Library User Manual 20 4 3 9 Hardware Control y Jeldeyg SWweIBOJd JEUONIPPY This function now includes Pulse Width Modulation PWM control over parameters such as fan speed panel brightness etc The bigger the value given the higher the duty cycle power of the pulse e g the fan will have a higher speed 21 SUSI Library User Manual 4 3 10 About AD ANTECH This page contains the platform name the BIOS version etc i e the information retrieved by the SUSI APIs SUSI Library User Manual 22 Chapter 5 Programming Overview 5 1 Introduction Header Files m SUSI H includes API declaration constants and flags that are required for pro gramming E DEBUGH ERRDRV H ERRLIB H are for debug code definitions DEBUG H Function index codes ERRLIB H Library error codes ERRDRV H Driver error codes Library Files m Susi lib is for library import and Susi dll is a dynamic link library that exports all the API functions Demo Program m The SusiDemo program released with source code demonstrates how to fully use SUSI APIs The program is written in the latest programming language C Drivers There are seven
59. tion returns the count of input pins outCount out Pointer to a variable in which this function returns the count of output pins Return Value TRUE 1 indicates success FALSE 0 indicates failure 41 SUSI Library User Manual Remarks The number of GPIO pins equals the number of input pins plus the number of out put pins The number of input and output pins may vary in accordance with the cur rent pin direction 6 24 SusilOQueryMask Query the GPIO mask information BOOL SusilOQueryMask DWORD flag DWORD Mask Parameters flag in The value given to indicate the type of mask to retrieve can be one of the following values Static masks ESIO_SMASK_PIN_FULL 1 ESIO_SMASK_CONFIGURABLE 2 Dynamic masks ESIO_DMASK_DIRECTION 0x20 Mask out Pointer to a variable in which this function returns the queried mask Return Value TRUE 1 indicates success FALSE 0 indicates failure Remarks A mask is expressed as a series of binary digits Each bit corresponds to a pin bit 0 for pin 0 bit 1 for pin 1 bit 2 for pin 2 depending on the mask type A bit value 1 stands for a pin with 1 Input direction 2 Status HIGH 3 Direction changeable Or a bit value 0 stands for a pin with 1 Output direction 2 Status LOW 3 Direction unchangeable Here are the definitions for masks m ESIO_SMASK_PIN_FULL If there are total 8 GPIO pins GPIO 0 7 in a platform the full pin mask is OxFF or in binary 111111
60. tput pins to be written PinDirMask in out Specifies the directions of pins to be set in a bitwise ORed manner After the function call returns TRUE it contains the latest direction mask after set 43 SUSI Library User Manual 6 27 6 28 Return Value TRUE 1 indicates success FALSE 0 indicates failure Remarks For example if you set to the directions of GPIO pin 0 1 6 7 Give parameter Tar getPinMask with a value 11000011 or 0xC3 Bit 0 stand for GPIO 0 bit 1 stand for GPIO 1 and so on If you want to set pin 0 as input pin 1 as output pin 6 as input and pin 7 as output Give value in parameter PinDirMask as 01XXXX01 X is for don t care you could simply assign a 0 for it i e 0x41 SusilOReadEx Read current status of one GPIO input or output pin BOOL SusilOReadEx BYTE PinNum BOOL status Parameters PinNum in Specifies the GPIO pin demanded to be read ranging from O total number of GPIO pins minus 1 status out Pointer to a variable in which the pin status returns Return Value TRUE 1 indicates success FALSE 0 indicates failure Remarks If the pin is in status high the value got in status will be 1 If the pin is in status low it will be zero The function is capable of reading the status of either an input pin or an output pin SusilOReadMultiEx Read current statuses of multiple pins at once regardless of the pin directions BOOL SusilOReadMultiEx DWORD TargetPinMask D

Download Pdf Manuals

image

Related Search

Related Contents

ダウンロード - Spansion  Anbindung von Handhelds an SAP am Beispiel einer  PELLET STOVES USER MANUAL - La Nordica  Loaner Car Net – User Manual  Samsung SCH-I605ZWAVZW User's Manual  VOX N40 USER`S MANUAL  Samsung 173P PLUS Εγχειρίδιο χρήσης  Musicfly Bedienungsanleitung  Samsung SGH-C130 service manual  vademecum de l`intelligence économique - ILE-DE  

Copyright © All rights reserved.
Failed to retrieve file