IO Device:IntelDIO

From LEXWiKi

(Difference between revisions)
Jump to: navigation, search
Line 12: Line 12:
3. Press the "Disable" button when WDT enable to disable WDT
3. Press the "Disable" button when WDT enable to disable WDT
-
[[Image:.jpg]]
+
[[Image:DIO.jpg]]
== Introduction ==
== Introduction ==
-
=== Initial Internal F75111 port address (0x9c)===
+
=== Define Pin Address ===
-
define GPIO1X, GPIO2X, GPIO3X to input or output
+
#define INTEL_WDTE 0x600
-
and Enable WDT function pin
+
#define INTEL_WDTD 0x604
 +
#define INTEL_DI 0x608
 +
#define INTEL_DO 0x60C
-
=== Set F75111 DI/DO ( sample code as below Get Input value/Set output value )===
+
=== Initialize WinIO & Uninitializ WinIO ===
-
DO: InterDigitalOutput(BYTE byteValue))
+
InitializeWinIo()
-
DI: InterDigitalInput()
+
ShutdownWinIo()
 +
 
 +
=== Set DI/DO ===
 +
DO: DIO_Write(BYTE dwDataVal)
 +
{
 +
SetPortVal(INTEL_DO, dwDataVal, 1);
 +
}
 +
DI: DIO_Read()
 +
{
 +
DWORD dwPortVal;
 +
GetPortVal(INTEL_DI, &dwPortVal,1 );
 +
return (BYTE)(dwPortVal);
 +
}
=== Enable/Disable WDT ===
=== Enable/Disable WDT ===
-
Enable : F75111_SetWDTEnable (BYTE byteTimer)
+
Enable : SetPortVal(INTEL_WDTE, m_CountDown, 1); // m_CountDown is timer of WDT
-
Disable: F75111_SetWDTDisable ()
+
Disable: GetPortVal(INTEL_WDTD,&dwPortVal,1);

Revision as of 17:35, 5 August 2008


Contents

The Sample code source you can download from

852_DIO_WDT.rar

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 when WDT enable to disable WDT

Image:DIO.jpg

Introduction

Define Pin Address

   #define INTEL_WDTE	0x600
   #define INTEL_WDTD	0x604
   #define INTEL_DI	0x608
   #define INTEL_DO	0x60C

Initialize WinIO & Uninitializ WinIO

   InitializeWinIo()
   ShutdownWinIo()

Set DI/DO

   DO: DIO_Write(BYTE dwDataVal)
       {
           SetPortVal(INTEL_DO, dwDataVal, 1);
       }
   DI: DIO_Read()
       {
           DWORD dwPortVal;
           GetPortVal(INTEL_DI, &dwPortVal,1 );
           return (BYTE)(dwPortVal);
       }

Enable/Disable WDT

   Enable : SetPortVal(INTEL_WDTE, m_CountDown, 1);    // m_CountDown is timer of WDT 
   Disable: GetPortVal(INTEL_WDTD,&dwPortVal,1);
Personal tools