Gpio Sample Code - Advantech PCM-3362 User Manual

Pc/104-plus sbc with intel atom n450, vga, lcd, lan, usb2.0, sata, and on-board flash
Hide thumbs Also See for PCM-3362:
Table of Contents

Advertisement

END
D.2

GPIO sample code

;===============================================================
;
Get Number of GPIO group
;
one group mean 8 gpio pins (one GPIO Chip)
; Input:
;
ax=5E87h
;
bh=00h
; output:
;
ax=5E78
;
cl= n group of gpio
mov ax,5E87h
mov bh,00h
INT15
;
You will get cl=01 in 8 bit GPIO product, cl = 02 in 16 bit GPIO product
;===============================================================
;===============================================================
;
Get GPIO Config
; Input:
;
ax=5E87h
;
bh=01h
;
cl= n ; n means which group of GPIO you want to get
; output:
;
ax=5E78
;
bl= the n group of gpio config
;
bit 0 = gpio 0 , 0 => output pin; 1 => input pin
;
bit 1 = gpio 1 , 0 => output pin; 1 => input pin
;
.....
;
bit 7 = gpio 7 , 0 => output pin; 1 => input pin
mov ax,5E87h
mov bh,01h
mov cl,01h
INT15
;
You will get GPIO default setting from bl
;===============================================================
;===============================================================
;
Set GPIO Config
; Input:
;
ax=5E87h
;
bh=02h
;function success, other value means function fail
;function success, other value means function fail
77
PCM-3362 User Manual

Advertisement

Table of Contents
loading

Table of Contents