NAR-4040 User’s Manual
29
outw(val&0xffff,
port);
else
outb(val&0xff,
port);
return 0;
}
void led_init()
{
unsigned int rval=0,mval=0;
// program bit 31,30,29 of PCR GENCFG to 1,1,1
write_port(0xCF8,0x800038B0,4);
rval=read_port(0xCFC,4);
mval=rval | 0xe0000000;
write_port(0xCF8,0x800038B0,4);
write_port(0xCFC,mval,4);
// program bit 8 of PCR XBCS to 0
write_port(0xCF8,0x8000384C,4);
rval=read_port(0xCFC,4);
mval=rval & 0xfffffeff;
write_port(0xCF8,0x8000384C,4);
write_port(0xCFC,mval,4);
// raed Power Management base address
write_port(0xCF8,0x80003B40,4);
rval=read_port(0xCFC,4);
pmbase=rval&0xFFC0;
}
//
// pos= 1~8 ,flag=1/0
//
void led_onoff(int pos, int flag)
{
unsigned int led=0;
switch (pos) {
case 1: // (D9) Bit5: 0-> led ON, 1-> led OFF
led = read_port(0x37,1);
led=( flag==1 ?(led & 0xDF) : (led | 0x20));
write_port(0x37,led,1);
break;
case 2: // (D10)Bit4: 0-> led ON, 1-> led OFF
led=read_port(0x37,1);
led=( flag==1 ?(led & 0xEF) :(led | 0x10));
write_port(0x37,led,1);
break;
case 3: // (D11)Bit3 0-> led ON, 1-> led OFF
led=read_port(0x37,1);
led=( flag==1 ?(led & 0xF7) :(led | 0x08));
write_port(0x37,led,1);
Summary of Contents for NAR-4040
Page 3: ...NAR 4040 User s Manual 2 5 9 Sample Code 53 ...
Page 27: ...Fig 3 2 PPAP 3711VL System Block Diagram NAR 4040 User s Manual 26 ...
Page 46: ...NAR 4040 User s Manual 45 pop dx pop cx ret FIXDELAY ENDP END programstart ...
Page 53: ...NAR 4040 User s Manual 52 5 8 Character Generator ROM CGROM ...