Page 68 Epson Research and Development
Vancouver Design Center
S1D13705 Programming Notes and Examples
X27A-G-002-03 Issue Date: 02/01/22
10.2 Sample code without using the S1D13705 HAL API

This second sample demonstrates exactly the same sequence as the fi rst h owever t he HAL

is not used, all manipulation is done by directly accessing the registers.

/*
**===========================================================================
** SAMPLE2.C - Sample code demonstrating a direct access of the S1D13705.
**-------------------------------------------------------------------------
** Created 1998, Vancouver Design Centre
** Copyright (c) 1998, 1999 Epson Research and Development, Inc.
** All Rights Reserved.
**-------------------------------------------------------------------------
**
** The sample code using direct S1D13705 access
** will configure for the following:
**
** 320x240 Single Color 4-bit STN
** 8 bpp color depth - 70 Hz Frame Rate (6 MHz CLKi)
**
** Notes:
** 1) This code is written to be compiled for use under 32-bit
** Windows. In order to function the vxd file S1D13X0X.VXD must
** be in the \WINDOWS\SYSTEM directory.
** 2) Register setup is done with discreet writes rather than being table
** driven. This allows for clear commenting. It is more efficient to
** loop through the array writing each element to a control register.
** 3) The array of register values as produced by 13705CFG.EXE is included
** here. I write the registers directly rather than refer to the register
** array in the sample code.
**
**===========================================================================
*/
#include <conio.h>
#include <windows.h>
#include <winioctl.h>
#include "ioctl.h"
/*
** Look-Up Table - 16 of 256 elements.
** For this sample only the first sixteen LUT elements are set.
*/
unsigned char LUT[16*3] =
{ 0x00, 0x00, 0x00,/* BLACK */
0x00, 0x00, 0xA0,/* BLUE */
0x00, 0xA0, 0x00,/* GREEN */
0x00, 0xA0, 0xA0,/* CYAN */
0xA0, 0x00, 0x00,/* RED */
0xA0, 0x00, 0xA0,/* PURPLE */