IO Device:81801 Linux

From LEXWiKi

(Difference between revisions)
Jump to: navigation, search
Current revision (12:32, 25 February 2022) (edit) (undo)
 
(8 intermediate revisions not shown.)
Line 1: Line 1:
 +
[[Category:AllowPages]]
 +
== The Sample code source you can download from ==
== The Sample code source you can download from ==
-
Source file: [ftp://ftp.lex.com.tw/Engineer/SoftSupport/AP_Module/81801_WDT/Windows_Base/81801UWDTw_src_v11.rar 81801UWDTw_src_v11.rar]<br>
+
 
-
Binary file: [ftp://ftp.lex.com.tw/Engineer/SoftSupport/AP_Module/81801_WDT/Windows_Base/81801UWDTw_bin_v11.rar 81801UWDTw_bin_v11.rar]
+
<Google Drive>
 +
 
 +
Source file: [https://drive.google.com/file/d/1GfdFnygoVoOAV_wlWl45rydEx-pBSf2A/view?usp=sharing 81801U_WDT_v1.0L_Src]
 +
 
 +
Binary file: [https://drive.google.com/file/d/1GBgPVN66Tei4RvQByAnp-OPn2eb3sgwD/view?usp=sharing 81801U_WDT_v1.0L_Bin]
 +
 
 +
<FTP>
 +
 
 +
Source file: [ftp://ftp.lex.com.tw/Engineer/SoftSupport/AP_Module/81801_WDT/linux_Base/81801UWDT_v1.0_src.tar.gz 81801U_WDT_v1.0L_Src]
 +
 
 +
Binary file: [ftp://ftp.lex.com.tw/Engineer/SoftSupport/AP_Module/81801_WDT/linux_Base/81801UWDT_v1.0_bin.tar.gz 81801U_WDT_v1.0L_Bin]
 +
 
== How to compile source code ==
== How to compile source code ==
 +
1. '''Compile source code with Code::Blocks'''<br>
1. '''Compile source code with Code::Blocks'''<br>
#download and install the Code::Block and libgtk2.0-dev with command "apt-get install codeblocks libgtk2.0-dev"<br>
#download and install the Code::Block and libgtk2.0-dev with command "apt-get install codeblocks libgtk2.0-dev"<br>
Line 16: Line 30:
# make
# make
# cd src/lanbypass // execute the binary file()
# cd src/lanbypass // execute the binary file()
-
== How to use the DEMO Application ==
 
 +
== How to use the DEMO Application ==
 +
[[Image:81801WDT_linux.jpg]]
*'''Step 1:Key-in the 1~255 value in Red number 1.'''<br />
*'''Step 1:Key-in the 1~255 value in Red number 1.'''<br />
*'''Step 2:Press the "WDT Enable" button in Red number 2,the system will reboot after step 1 you key-in Sec.'''<br />
*'''Step 2:Press the "WDT Enable" button in Red number 2,the system will reboot after step 1 you key-in Sec.'''<br />
*'''Step 3:Press the "WDT Disable" button in Red number 3,It will stop WDT function.'''<br />
*'''Step 3:Press the "WDT Disable" button in Red number 3,It will stop WDT function.'''<br />
So you can make the loop with Enable and Disable to protection your system when crash.<br />
So you can make the loop with Enable and Disable to protection your system when crash.<br />
 +
 +
 +
== Enable WDT function ==
 +
 +
void enable()
 +
{
 +
outb(EntryKey,IndexPort);
 +
outb(EntryKey,IndexPort);
 +
outb(LDNSET,IndexPort);
 +
outb(0x07,DataPort); //Select WDT device configuration registers.
 +
outb(WDTDE,IndexPort);
 +
outb(0x01,DataPort); //Set WDT "Device" Enable
 +
outb(WDTEnable,IndexPort); //WDT "timer" enable register
 +
outb(0x80,DataPort); //Set watchdog timer enable
 +
outb(WDTCount,IndexPort);
 +
outb(0x05,DataPort); //System will reboot after timer sec.
 +
outb(WDTUS,IndexPort);
 +
outb(0x31,DataPort); //Set WDTRST output mode: Pulse(width: 25ms)
 +
}
 +
== Disable WDT function ==
 +
void disable()
 +
{
 +
outb(WDTUS,IndexPort);
 +
outb(0x51,DataPort);
 +
}

Current revision


Contents

The Sample code source you can download from

<Google Drive>

Source file: 81801U_WDT_v1.0L_Src

Binary file: 81801U_WDT_v1.0L_Bin

<FTP>

Source file: 81801U_WDT_v1.0L_Src

Binary file: 81801U_WDT_v1.0L_Bin

How to compile source code

1. Compile source code with Code::Blocks

  1. download and install the Code::Block and libgtk2.0-dev with command "apt-get install codeblocks libgtk2.0-dev"
  2. Open an exist project(lanbypass.cbp) in Code::Blocks
  3. add an option `pkg-config gtk+-2.0 --cflags`-std=gnu99 in "Project->Build Option->compiler setting->Other option"
  4. add an option `pkg-config gtk+-2.0 --libs` in "Project->Build Option->Linker Setting->Other linker option"
  5. click the compile button

2.Compile source code with "make"

  1. download and install the libgtk2.0-dev with command "apt-get install libgtk2.0-dev"
  2. cd lanbypass
  3. ./configure
  4. make
  5. cd src/lanbypass // execute the binary file()

How to use the DEMO Application

Image:81801WDT_linux.jpg

  • Step 1:Key-in the 1~255 value in Red number 1.
  • Step 2:Press the "WDT Enable" button in Red number 2,the system will reboot after step 1 you key-in Sec.
  • Step 3:Press the "WDT Disable" button in Red number 3,It will stop WDT function.

So you can make the loop with Enable and Disable to protection your system when crash.


Enable WDT function

void enable()
{
    outb(EntryKey,IndexPort);
    outb(EntryKey,IndexPort);
    outb(LDNSET,IndexPort);
    outb(0x07,DataPort);     //Select WDT device configuration registers.
    outb(WDTDE,IndexPort);
    outb(0x01,DataPort);     //Set WDT "Device" Enable
    outb(WDTEnable,IndexPort);     //WDT "timer" enable register
    outb(0x80,DataPort);     //Set watchdog timer enable
    outb(WDTCount,IndexPort);
    outb(0x05,DataPort);     //System will reboot after timer sec.
    outb(WDTUS,IndexPort);
    outb(0x31,DataPort);     //Set WDTRST output mode: Pulse(width: 25ms)
}

Disable WDT function

void disable()
{
    outb(WDTUS,IndexPort);
    outb(0x51,DataPort);
}
Personal tools