User`s manual

PK2100
5-8 s Software Reference
The following routines read and write the clock:
int tmc_wr( struct tm *x ); // write the clock
int tmc_rd( struct tm *x ); // read the clock
The following routines convert the time to and from a long integer. The
long-integer format represents the number of seconds that have passed
since midnight (00:00:00), January 1, 1980.
// return long seconds from structure
long mktime( struct tm *t );
// return structure from long seconds
int mktm( struct tm *t, long time );
The long-integer format is easier for making comparisons. It represents
time until 12:00 midnight, December 31, 1999.
The real-time clock can also be programmed to interrupt the processor
periodically through the INT2 interrupt line. The Toshiba TC8250 data
book contains further details.
Liquid Crystal Display and Keypad
The library CPLC.LIB includes functions for writing to the LCD and
reading the keypad. There is a 16-element keypad buffer.
void lc_char( char ch )
Sends a character to the LCD. The function waits for the LCD to
become free before sending the character.
int lc_cmd( int cmd )
Sends a 1-byte command to the LCD. The function waits for the LCD
to become free before sending the command. If the LCD does not
become free within a certain time (5,000 attempts to write), the
function returns 1. Otherwise, it returns 0, indicating success.
void lc_ctrl( byte cmd )
Sends a 1-byte command to the control register of the LCD. The
function waits for the LCD to become free (not busy) before writing.
void lc_init()
Initializes the LCD. The display is turned on, cleared, and the cursor
(now in the top left character position) blinks.
void lc_init_keypad()
Initializes the keypad, timer1 and the real-time kernel (if it is in use).