/*************************/
/* AD2COM Battery Status */
/*   RS232C version      */
/*************************/

<<<Explanation>>>
Read the voltage value by using onHand/Ruputer a cursor pointer.

Left key --- 	Light load voltage value display (pwread =***d)
Right key --- 	Heavy load voltage value display (pwread2=***d)
Up key --- 		LCD ON
Down key --- 	LCD OFF
MENU key --- 	exit

When LCD is ON, the voltage value is displayed on LCD by using right and left keys.
When LCD is OFF, no voltage value is displayed even if you use right or left key.

<<<Source File>>>

#include<*****> <> is used if it is C language standard library.
#include"*****" When a user creates a library, "" is used.

int main(void){} 
 This function is required in the standard main routine.

screen(1)
 This is the setting of onHand/Ruputer display mode.
 Usually 1=GVRAM(320x240)
 Actual LCD display area is 102x64
 Set the left upper corner to x=0, y=0

cls(4)
 Clear all range of GVRAM display.
 In general, 4=GVRAM mode.

gv_kput();
 Strings are displayed in any GVRAM.
 
** Format **
  gv_kput(x,y,str,size,space,logic)

  int   x     Display start point of GVRAM coordinate x(from the left margin)
  int   y     Display start point of GVRAM coordinate y(from the upper margin)
  char *str   Display strings
  int   size  Character size 12dot=0,10dot=1,8dot=2,....
  int   space Character interval space (usually 0)
  int   logic Usually 0. XOR and INVERTE can be used.

Bkey_D  --- The value of Menu key was defined in Rupsys.h
Bkey_up --- The value of up key was defined in Rupsys.h
Bkey_dw --- The value of down key was defined in Rupsys.h
Bkey_lf --- The value of left key was defined in Rupsys.h
Bkey_rg --- The value of right key was defined in Rupsys.h

bi_getbtn()
 The state of key is returned.
 This function is not returned until the key event occurs (press down or press up).

** Format **
  int bi_getbtn()

  Return value
  		 The key state when the key event occurs (press down or press up).
         Each key is allocated by 1 bit from all 8 bit.
         It is defined in Rupsys.h  Refer to this.

lcdon()
 Turn ON/OFF the LCD power.

** Format **
  lcdon(flag)

  int	flag  LCD power ON=1 OFF=0

getlcdon()
 This returns the ON/OFF status of the LCD power.

** Format **
  int getlcdon()

  Return value
 		 LCD power ON=1 OFF=0

bi_powerread()
 This returns the AD conversion value of the battery voltage at the light load. 

** Format **
  int bi_powerread()

  Return value
 		 The actual battery voltage AD conversion value 0-255 for the AD conversion value=255 of the basic voltage (when it is the light load).  Other return values are measurement errors.
         You should consider that the basic voltage is the relative scale because it is not consistent.

bi_powerread2()
 This returns the AD conversion value of the battery voltage when it is the heavy load.

** Format **
  int bi_powerread2()

  Return value
 		 Returns AD conversion value 0-255 of the battery voltage when it is the heavy load (when 6-10mA load current by EL light is imposed).  Refer to bi_powerread().

gv_place()
 This sets the coordinate within GVRAM 320x240 and the left-upper of LCD(102x64) display.

** Format **
  gv_place(x,y)

  int   x     Display start point of GVRAM coordinate x(from the left margin)
  int   y     Display start point of GVRAM coordinate y(from the upper margin)


===============================================================================
 Copyright (c) 1998-1999.  Seiko Instruments Inc.  All rights reserved. 
===============================================================================
