beautypg.com

4 read/write gpio sequence, 5 software programming example – Acnodes PCH 3582 User Manual

Page 51

background image

outportb(0x4E, 0x07); //LDN selection register

3.10.4 Read/write GPIO sequence

1. Enter the extended function mode

2. Select logic device number

3. Read/write GPIO register value

4. Exit the extended function mode

3.10.5 Software programming example

Enter the extended function mode

Writing 87h to index address port twice will enter the extended function mode.

Example x86 assembly code:

mov dx, 4Eh

mov al, 87h

out dx, al

out dx, al

Example C code:

outportb(0x4E, 0x87);

outportb(0x4E, 0x87);

Exit the extended function mode

Writing AAh to index address port will exit the extended function mode.

Example x86 assembly code:

mov dx, 4Eh

mov al, 0AAh

out dx, al

Example C code:

outportb(0x4E, 0xAA);

Select logic device number

Example x86 assembly code:

mov dx, 4Eh

mov al, 007h ;LDN selection register

out dx, al

mov dx, 4Fh

mov al, 008h ;Select LDN=8, GPIO Port6

;or Select LDN9, GPIO Port2

out dx, al

Example C code:

This manual is related to the following products: