Page 64
Epson Research and Development
Vancouver Design Center
S1D13704
Programming Notes and Examples
X26A-G-002-03
Issue Date: 01/02/12
10.1.2 Sample code without using the S1D13704 HAL API
This second sample demonstrates exactly the same sequence as the first howerver the HAL
is not used, all manipulation is done by manually adjusting the registers.
/*
**===========================================================================
** SAMPLE2.C - Sample code demonstating a direct access of the S1D13704.
**-------------------------------------------------------------------------
** Created 1998, Vancouver Design Centre
** Copyright (c) 1998 Epson Research and Development, Inc.
** All Rights Reserved.
**-------------------------------------------------------------------------
**
** The sample code using direct S1D13704 access
** will configure for the following:
**
** 320x240 Single Color 8-bit STN (format 2)
** 4 bpp - 70 Hz Frame Rate (25 MHz CLKi)
** High Performance enabled
**
** Notes:
** 1) This code is pseudo-C code intended to show technique.
** It is assumed that pointers can access the relevant memory addresses.
** 2) Register setup is done with discreet writes rather than being table
** driven. This allows for clearer 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 1374CFG.EXE is included
** here. I used the values directly rather than refer to the register
** array in the sample code.
**
**===========================================================================
*/
#include <conio.h>
/*
** Look-up table for 4 bpp color.
*/
unsigned char Color_4BPP[16*3] =
{
0x00, 0x00, 0x00,/* BLACK */
0x00, 0x00, 0x0A,/* BLUE */
0x00, 0x0A, 0x00,/* GREEN */
0x00, 0x0A, 0x0A,/* CYAN */
0x0A, 0x00, 0x00,/* RED */
0x0A, 0x00, 0x0A,/* PURPLE */
0x0A, 0x0A, 0x00,/* YELLOW */
0x0A, 0x0A, 0x0A,/* WHITE */
0x00, 0x00, 0x00,/* BLACK */
*