The Sample code source you can download from Source file: F75111v2.1L.tar.gz Binary file: F75111v2.1LBin.tar.gz How to compile source code 1. Compile source code with Code::Blocks download and install the Code::Block with command "apt-get install codeblocks" Open an exist project(F75111.cbp) in Code::Blocks, click the compile button ( add an option 'pkg-config --libs gtk+-2.0 gthread-2.0' in "Project->Build Option->Linker Setting->Other linker option") 2. Compile source code with "make" 1.. cd F75111 1.. make 1.. src/f75111 // execute the binary file How to use this Demo Application 1. Press the "Start" button to test DIO function 2. Press the "Enable" button to test WDT function 3. Press the "Disable" button to disable WDT 4. Check the "Enable Loop" box and press "Enable" to do WDT loop test 5. Press "Install" to set the system to autorun this application when booting, press "Uninstall" to remove this application when booting. 6. If WDT enable, system icon will be blinking. p.s. f75111 send "F75111_SetWDTEnable(BYTE byteTimer)" including a parameter "timer", if there's no disable signal (F75111_SetWDTDisable()) to stop it before timer countdown to 0, System will reboot. if there's disable signal received, resent Enable WDT signal, for a loop to prevent from reboot Introduction IO function In file SMBus.c void SMBusIoWrite(BYTE byteOffset,BYTE byteData) { outb( byteData , m_SMBusMapIoAddr + byteOffset); } BYTE SMBusIoRead(BYTE byteOffset) { DWORD dwAddrVal; dwAddrVal = inb(m_SMBusMapIoAddr + byteOffset); return (BYTE)(dwAddrVal & 0x0FF); } Initial internal F75111 void F75111::InitInternalF75111() { this->Write_Byte(F75111_INTERNAL_ADDR,GPIO1X_CONTROL_MODE ,0x00); //set GPIO1X to Input function this->Write_Byte(F75111_INTERNAL_ADDR,GPIO3X_CONTROL_MODE ,0x00); //set GPIO3X to Input function this->Write_Byte(F75111_INTERNAL_ADDR,GPIO2X_CONTROL_MODE ,0xFF); //set GPIO2X to Output function this->Write_Byte(F75111_INTERNAL_ADDR,F75111_CONFIGURATION, 0x03); //Enable WDT OUT function } Set output value void F75111::InterDigitalOutput(BYTE byteValue) { BYTE byteData = 0; byteData = (byteData & 0x01 )? byteValue + 0x01 : byteValue; byteData = (byteData & 0x02 )? byteValue + 0x02 : byteValue; byteData = (byteData & 0x04 )? byteValue + 0x04 : byteValue; byteData = (byteData & 0x80 )? byteValue + 0x08 : byteValue; byteData = (byteData & 0x40 )? byteValue + 0x10 : byteValue; byteData = (byteData & 0x20 )? byteValue + 0x20 : byteValue; byteData = (byteData & 0x10 )? byteValue + 0x40 : byteValue; byteData = (byteData & 0x08 )? byteValue + 0x80 : byteValue; // get value bit by bit this->Write_Byte(F75111_INTERNAL_ADDR,GPIO2X_OUTPUT_DATA,byteData); // write byteData value via GPIO2X output pin } Get Input value BYTE F75111::InterDigitalInput() { BYTE byteGPIO1X = 0; BYTE byteGPIO3X = 0; BYTE byteData = 0; this->Read_Byte(F75111_INTERNAL_ADDR,GPIO1X_INPUT_DATA,&byteGPIO1X) ; // Get value from GPIO1X this->Read_Byte(F75111_INTERNAL_ADDR,GPIO3X_INPUT_DATA,&byteGPIO3X) ; // Get value from GPIO3X byteGPIO1X = byteGPIO1X & 0xF0; // Mask unuseful value byteGPIO3X = byteGPIO3X & 0x0F; // Mask unuseful value byteData = ( byteGPIO1X & 0x10 )? byteData + 0x01 : byteData; byteData = ( byteGPIO1X & 0x80 )? byteData + 0x02 : byteData; byteData = ( byteGPIO1X & 0x40 )? byteData + 0x04 : byteData; byteData = ( byteGPIO3X & 0x01 )? byteData + 0x08 : byteData; byteData = ( byteGPIO3X & 0x02 )? byteData + 0x10 : byteData; byteData = ( byteGPIO3X & 0x04 )? byteData + 0x20 : byteData; byteData = ( byteGPIO3X & 0x08 )? byteData + 0x40 : byteData; byteData = ( byteGPIO1X & 0x20 )? byteData + 0x80 : byteData; // Get correct DI value from GPIO1X & GPIO3X return byteData; } Enable WatchDog void F75111_SetWDTEnable (BYTE byteTimer) { WriteByte(F75111_INTERNAL_ADDR,WDT_TIMER_RANGE ,byteTimer); // set WatchDog range and timer WriteByte(F75111_INTERNAL_ADDR,WDT_CONFIGURATION,WDT_TIMEOUT_FLAG | WDT_ENABLE | WDT_PULSE | WDT_PSWIDTH_100MS); // Enable WatchDog, Setting WatchDog configure } Disable WatchDog void F75111_SetWDTDisable () { WriteByte(F75111_INTERNAL_ADDR,WDT_CONFIGURATION,0x00); // Disable WatchDog }