beautypg.com

Acnodes PCH 3582 User Manual

Page 53

background image

out dx, al

Example C code:

outportb(0x4E, 0xE6); //GPIO I/O selection reg.

outportb(0x4F, 0x0); //0

– normal, 1 – inverted

outportb(0x4E, 0xE4); //GPIO inversion reg.

outportb(0x4F, 0xFF); //0

– Output, 1 - Input

or

outportb(0x4E, 0xE4); //GPIO inversion reg.

outportb(0x4F, 0xF0); //0

– Output, 1 – Input

Read GPIO value

Example x86 assembly code:

mov dx, 4Eh

mov al, 0E5h ;GPIO data reg.

out dx, al

mov dx, 4Fh

in al, dx ;Bit[3::0] = GPI[3::0] value

Example C code:

outportb(0x4E, 0xE5); //GPIO data reg.

GP = inportb(0x4F); //Bit[3::0] = GPI[3::0]

Write GPIO value

Example x86 assembly code:

;Set GPO62

mov dx, 4Eh

mov al, 0E5h ;GPIO data reg.

out dx, al

mov dx, 4Fh

in al, dx

or al, 00000100b ;Bit2 = GPO62

out dx, al

;Clear GPO62

mov dx, 4Eh

mov al, 0E5h ;GPIO data reg.

out dx, al

mov dx, 4Fh

in al, dx

and al, not 00000100b

This manual is related to the following products: