2 backlight example, Mopslcdlx software guide – Kontron MOPSlcdLX User Manual
Page 15
KTD-S0006-B
Page 12
Watchdog and Backlight
MOPSlcdLX Software Guide
4.2
Backlight Example
#include <stdio.h>
#include <dos.h>
#include <conio.h>
#define JIDA16_INT
0x15
#define BACKL_OUT
0xEA29
#define BACKL_IN
0xEA28
#define JIDA_ID
0x4648
#define BOARD_NUM
1
void WriteBacklight (unsigned char value)
{
union REGS regs;
regs.x.ax = BACKL_OUT;
regs.x.dx = JIDA_ID;
regs.h.cl = BOARD_NUM;
regs.h.ch = value;
int86 (JIDA16_INT, ®s, ®s);
}
unsigned char ReadBacklight (void)
{
union REGS regs;
regs.x.ax = BACKL_IN;
regs.x.dx = JIDA_ID;
regs.h.cl = BOARD_NUM;
int86 (JIDA16_INT, ®s, ®s);
return
regs.h.ch;
}
void main (void)
{
unsigned
char
val;
char str [32];
WriteBacklight
(0x80);
val = ReadBacklight ();
sprintf (str, "\n%02X\n", val);
printf
(str);
}