Lanner LEC-2280E User Manual Download Page 28

28

Programming Watchdog Timer

Embedded and Industrial Computing

Appendix A

Source Code

You can write your own program by modifying the source 

code F81865_Test.cpp.. The index address is 2EH.
/////////////////////////////////////////////////////////////////////

////
// F81865_Test.cpp : F81865_test.exe utility for F81865.lib 

APIs demonstration.
//
// History:
// 

7/15/2011 

Brand 

new 

F81865_test 

program.

#include <winsock2.h>
#include “Windows.h”
#include “stdio.h”
#include “F81865.h” 

#define PARAMETER_HELP 

 

“\n”\

                            “The F81865 GPIO utility of Lanner\n”\
                            “-------------------------------------\n”\
                            “Usage:\n”\
                            “  F81865_test  DIO_IN                 port_

number\n”\
                            “  F81865_test  DIO_OUT                port_number  

value\n”\
                            “  F81865_test  PIO                    port_number  

value\n”\
                            “  F81865_test  RunLED                 port_number  

value\n”\
                            “  F81865_test  AlarmLED               port_number  

value\n”\
                            “  F81865_test  GPS_LED                port_number  

value\n”\
                            “  F81865_test  WirelessLED            port_number  

value\n”\
 

 

 

 

 

 

 

“  F81865_test  WatchDog               seconds\n”\
 

 

 

 

 

 

 

“  F81865_test  CaseOpen\n”\
 

 

 

 

 

 

 

“  F81865_test  CaseOpen_Clear\n”\
                                                        “    F81865_test    Sleep                  

milliseconds\n”\
                            “\n”\
 

 

 

 

 

 

 

“Argement:\n”\
                            “  DIO_IN                 Read state from DIO 

In.\n”\
                            “  DIO_OUT                Set DIO Out state.\n”\
                            “  PIO                    Set PIO LED state.\n”\
                            “  RunLED                 Set RUN LED state.\n”\
 

 

 

 

 

 

 

“  AlarmLED               Set Alarm LED state.\n”\
 

 

 

 

 

 

 

“  GPS_LED                Set GPS LED state.\n”\
 

 

 

 

 

 

 

“  WirelessLED            Set Wireless LED state.\n”\
 

 

 

 

 

 

 

“  Watchdog 

 

 

 

    Set 

Watchdog timer.\n”\
 

 

 

 

 

 

 

“  CaseOpen               Check case opened state.\n”\
 

 

 

 

 

 

 

“  CaseOpen_Clear         Clear case open state.\n”\
                            “  port_number            The port number.\n”\
                            “  value                  1 for on and 0 for off.\n”\
                            “  seconds   

 

 

   The 

watchdog count down seconds. 0 for disable.\n”\
                            “  milliseconds           Milliseconds to 

delay\n”

#define  RETMSG(a,b)  {printf  (b)  ;  return  a;} 

 

#define 

CHECK_ARGC(a) 

{if 

(argc 

!= 

a) 

throw 

PARAMETER_HELP 

;} 

 

 

//  Translate 

Hex 

string 

to 

long 

value 

LONG 

Hex2Long 

(char 

*str) 

 

LONG 

nLong 

 

 

if 

(scanf 

(str,  “%x”, 

&nLong) 

!= 

1)  

 

 

throw  “Error  parsing  parameter\n”  ; 

 

 

return 

 

nLong 

Summary of Contents for LEC-2280E

Page 1: ...Embedded Industrial Computing Hardware Platforms for Embedded and Industrial Computing LEC 2280 Preliminary User s Manual Publication date 2013 02 27...

Page 2: ...umes no responsibility for its use nor for any infringements upon the rights of third parties that may result from such use Acknowledgement Intel Pentium and Celeron are registered trademarks of Intel...

Page 3: ...s and Jumpers 12 Internal Connectors and Jumpers backside 13 Connectors and Jumpers List 14 Jumper Settings 15 Chapter 4 Hardware Setup 21 Preparing the Hardware Installation 21 Installing the System...

Page 4: ...ication Dimensions WxHxD 277x 67 89 x194mm 10 91 x 2 64 3 50 x7 64 Processor i5 3610ME i3 3120ME Ivy Bridge i7 3612QE i7 3555LE Chipset Intel HM65 System Memory Technology DDR3 SO DIMM x2 Max Capacity...

Page 5: ...Cable P N 080W1N0002001 Wall Mounting Kit P N SE9ESA900R100 Drivers and User s Manual CD 087W0200V1001 Power Adapter P N 0P0W075190001 Optional Accessories The system has a variety of optional access...

Page 6: ...6 System Components Chapter 2 Embedded and Industrial Computing Chapter 2 System Components System Drawing Mechanical dimensions of the LEC 2280E Unit mm...

Page 7: ...7 System Components Chapter 2 Embedded and Industrial Computing System Drawing Continued Mechanical dimensions of the LEC 2280P2 Unit mm...

Page 8: ...to 2048x1536 DVI D Up to 1920x1200 Port C HDMI Up to 1920x1200 Port D 3G Card SIM Card Reader LPC PCIe Expansion For Riser Board pin header PEG LEK IOA2 audio serial board Serial Intel HD Audio In Ou...

Page 9: ...Ds Standby mode in Red Power on mode in Green F2 HDD Yellow and Power Led Green HDD Blinking data access activities Off no data access activities Power On The computer is on Off The computer is off F3...

Page 10: ...AN2 on page 21 R4 DVI D A DVI D port single link which is provided by Intel HD Graphic Engine This port can support up to 1920x1200 60 Hz resolution DVID1 Connectors on page 19 R5 HDMI A HDMI High Def...

Page 11: ...expansion card Refer to the table 3 1 Connector List for more details Note Daughter boards such as COM ports and low profile PCIe extension boards can only be inserted to the mainboards with the same...

Page 12: ...External Connectors The following picture highlights the location of system input output connectors Refer to the table 3 2 Connector List for more details DVID1 USB1 LAN1 LAN2 HDMI1 USB3 USB2 RST1 VGA...

Page 13: ...ectors and Jumpers The following picture highlights the location of internal connectors and jumpers Refer to the table 3 2 Connector List for more details LPC1 LEB 2280 MPCIE1 FAN2 USB4 SIM1 SO DIMM S...

Page 14: ...mputing Internal Connectors and Jumpers backside The following picture highlights the location of internal connectors and jumpers on the backside of the board Refer to the table 3 2 Connector List for...

Page 15: ...bels Function Pin Definition Reference Page CMOS1 Cleaning CMOS data including RTC P17 CMOS2 Cleaning CMOS data only P17 COMSLT1 Daughter board LEK IOA3 enable disable P21 COMSLT2 Daughter board LEK I...

Page 16: ...order Chipset INF Graphic Audio COM1 RS 232 Serial Port COM1 It is a RS 232 422 485 port through the D SUB9 connector RS 232 422 485SerialPort COM2 ItisaRS 232 422 485 port through the D SUB9 connect...

Page 17: ...8 N A 98 COM2_DSR 49 N A 99 COM2_SOUT 50 N A 100 COM2_SIN Note Daughter boards such as COM ports and low profile PCIe extension boards can only be inserted to the mainboards with the same version Fail...

Page 18: ...M2_SOUT 50 COM4_SIN 100 COM2_SIN The controller contains two modes of operation a legacy mode using I O space and an AHCI mode using memory space Software that uses legacy mode will not have AHCI capa...

Page 19: ...side PIN SIGNAL PIN SIGNAL PIN SIGNAL 1 VCC3P3_SB 53 PCIE_CKP1 105 PEG_RXP9 2 VCC5_SB 54 PCIE_TXP1 106 PEG_TXP9 3 VCC3P3_SB 55 PCIE_CKN1 107 GND 4 VCC5_SB 56 PCIE_TXN1 108 GND 5 N A 57 GND 109 PEG_RXN...

Page 20: ...N A 47 RSV 48 VCC1 5 49 RSV 50 GND 51 RSV 52 VCC3 3 PIN SIGNAL PIN SIGNAL PIN SIGNAL 39 GND 91 PEG_RXN11 143 GND 40 GND 92 PEG_TXN11 144 GND 41 PCIE_RXN2 93 PEG_RXP11 145 PEG_RXN2 42 PCIE_CKN2 94 PEG...

Page 21: ...ering Pin No Description Fast Ethernet Gigabit Ethernet 1 TX BI_DA 2 TX BI_DA 3 RX BI_DB 4 BI_DC 5 BI_DC 6 RX BI_DB 7 BI_DD 8 BI_DD Pin No Pin Name 1 Ignition 2 GND 3 DC_VIN Pin No Pin Name 1 2 SATAII...

Page 22: ...until power is removed Unpower the LEC 2280 and remove the power cord 1 Unscrew the 4 threaded screws from the top cover 2 Open the cover 3 Note If the CPU thermal pad mounting breaks apart use your h...

Page 23: ...rd 3 Connect the PCIe expansion card to the riser 4 Fix the card holder back to the system 5 On 2280E with one PCIe slot Wireless Module Installation Align the wireless module s cutout with the Mini P...

Page 24: ...erial ATA power and data disk cables to 4 the Serial ATA power and disk connectors on the main board respectively On 2280P2 with 2 PCI slot Note Using a PCIe or PCI riser card users have choice of eit...

Page 25: ...surface You may need a hammer to tap the wall anchor Use a screwdriver to screw the threaded screw into the 3 plastic anchor Attach the wall mounting bracket to the back of the 4 device securing it in...

Page 26: ...a human operator had cycled the power For sample watchdog code see Watch dog and DIO folder in the Driver and Manual CD Driver Installation Before you could access or control the operation of the wat...

Page 27: ...listed 4 under the Non Plug and Play Drivers If not click the San for hardware changes button from the tool bar Sample Program Via the Demo Program Enter the number of seconds to start count down befo...

Page 28: ...value n F81865_test WirelessLED port_number value n F81865_test WatchDog seconds n F81865_test CaseOpen n F81865_test CaseOpen_Clear n F81865_test Sleep milliseconds n n Argement n DIO_IN Read state f...

Page 29: ...on generate by common function definition GPIO_OUT mDIO_ OUT DIO_OUT Write_DIO G P I O _ O U T mPIO DIO_OUT PIO G P I O _ O U T mRunLED RunLED RunLED G P I O _ O U T mAlarmLED AlarmLED AlarmLED GPIO_O...

Page 30: ...METER_HELP if argc 3 CheckNumeric argv 2 int nValue atoi argv 2 WatchDog_Enable nValue int nLeft WatchDog_GetLeft printf Watchdog timer left d seconds n nLeft return nLeft Argument function mapping ty...

Page 31: ...argument if argc 2 RETMSG 1 PARAMETER_HELP Find the match argument and execute the mapping function for int i 0 i num i if stricmp argv 1 c2f i szCmd 0 return c2f i function argc argv No match argumen...

Page 32: ...ll be returned at customer s expense The following conditions are excluded from this 5 warranty Improper or inadequate maintenance by the customer Unauthorized modification misuse or reversed engineer...

Page 33: ...ing by Air Freight Sea Express ___ Others ________________ Item Model Name Serial Number Configuration Item Problem Code Failure Status Problem Code 01 D O A 02 Second Time R M A 03 CMOS Data Lost 04...

Reviews: