C.2 gpio sample code, Gpio sample code, Appendix c p rogrammable g pio & watchdog timer – Advantech PCM-9588 User Manual
Page 89

79
PCM-9588 User Manual
Appendix C
P
rogrammable
G
PIO
&
Watchdog
Timer
C.2
GPIO Sample Code
;===============================================================
NEWIODELAY Macro
out 0ebh,al
ENDM
;===============================================================
.model small
.486p
.stack 256
.data
;===============================================================
; Data Area
;===============================================================
SMBus_Port
EQU
500h
PCA9554_ID
EQU
40h
PCA9554_ID2 EQU
4Eh
Input_Reg
EQU
00h
Output_Reg
EQU
01h
Inversion_Reg EQU
02h
Configure_Reg EQU
03h
;RA02 Advantech_Str db 'Advantech Company Copyright (C) 2005 Design by
Duncan',0AH,0Dh,'$'
Advantech_Str db 'Advantech Company Copyright (C) 2005 Design by Duncan,
Modify by Steven',0AH,0Dh,'$' ;RA02
GX3_Fun_Str db 'Check Philip GPIO function.',0Ah,0Dh,'$'
Note1_Str db 'Test Method: GPIO 0 connect to GPIO 1.',0Ah,0Dh,'$'
Note2_Str db 'GPIO 2 connect to GPIO 3.',0Ah,0Dh,'$'
Note3_Str db 'GPIO 4 connect to GPIO 5.',0Ah,0Dh,'$'
Note4_Str db 'GPIO 6 connect to GPIO 7.',0Ah,0Dh,'$'
Success1_Str db 'First GPIO Chip Test success !! ',0Ah,0Dh,'$'
Success2_Str db 'Second GPIO Chip Test success !! ',0Ah,0Dh,'$'
;RA02 - START
Success_lenght EQU ($ - offset Success1_Str) / 2
db 'Third GPIO Chip Test success !! ',0Ah,0Dh,'$'
db 'Fouth GPIO Chip Test success !! ',0Ah,0Dh,'$'
db 'Fifth GPIO Chip Test success !! ',0Ah,0Dh,'$'
db 'Sixth GPIO Chip Test success !! ',0Ah,0Dh,'$'
db 'Seventh GPIO Chip Test success !!',0Ah,0Dh,'$'
db 'Eighth GPIO Chip Test success !! ',0Ah,0Dh,'$'
;RA02 - END
Fail_Str db 'First GPIO Chip Test Fail !! ',0Ah,0Dh,'$'
Fail2_Str db 'Second GPIO Chip Test Fail !! ',0Ah,0Dh,'$'
;RA02 - START
Fail_lenght EQU ($ - offset Fail_Str) / 2
db 'Third GPIO Chip Test Fail !! ',0Ah,0Dh,'$'