AHM-6156P User Manual
53
mov dx, 4Eh
mov al, 0E5h ;GPIO data reg.
out dx, al
mov dx, 4Fh
in al, dx
and al, not 00000100b
out dx, al
Example C code:
//Set GPO62
outportb(0x4E, 0xE5); //GPIO data reg.
Outportb(0x4F, (inportb(0x4F)|0x4)); //Set Bit[2]
//Clear GPO62
outportb(0x4E, 0xE5); //GPIO data reg.
Outportb(0x4F, (inportb(0x4F)&0xFB)); //Clear Bit[2]
The followings are C language source code:
#include "stdio.h"
#include "conio.h"
//Super I/O index access port
#define INDEXP 0x4E
#define DATAP 0x4F
//Enter super I/O programming mode
#define ENTERPRG { \
outportb(INDEXP, 0x87); \
outportb(INDEXP, 0x87);}
//Super I/O index write
#define WRITEREG(reg,val) { \
outportb(INDEXP, reg); \
outportb(DATAP, val);}
//Exit super I/O programming mode
#define EXITPRG { \
outportb(INDEXP, 0xAA);}
//Select logic device number
#define SELETDEV(ldn) { \