6. Appendix
Status LED
The operation of the status LED can be controlled from user applications.
The following is a sample program created in an MS-DOS environment with MSC version 8.03.
The status LED blinks once per second for approximately 10 seconds.
#include <stdio.h>
#include <time.h>
#include <dos.h>
#include <io.h>
#define IDX
#define DAT
#define IOWAIT
/* READ WD83627 CR */
int
get_reg( int adr )
{
IOWAIT;
outp( IDX, adr );
IOWAIT;
return inp( DAT );
}
/* WRITE WD83627 CR */
void set_reg( int adr, int dat )
{
IOWAIT;
outp( IDX, adr );
IOWAIT;
outp( DAT, dat );
}
/* WD83627 SET LOGICAL DEV */
void set_ldev( int dev )
{
set_reg( 7, dev );
}
/* OPEN WD83627 CR */
void open_dev( void )
{
IOWAIT;
outp( IDX, 0x87 );
IOWAIT;
80
0x2e
IDX+1
outp( 0xed, 0x00 )
BX-955Sx Series User's manual