;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Copyright (c) 2000 - 2002 TIMEX Corporation.
; 
; This document is the property of, and contains information proprietary to
; TIMEX Corporation.  It is to be returned upon request.  Reproduction by any
; means, disclosure, or use of its contents for other than the expressed
; purpose for which it is loaned, without the written consent of TIMEX
; Corporation, is strictly prohibited.
;
; File Name :   tod.h
;
; Purpose   :   TOD Application Header
;
; File Change History:
;
;               05/16/2000 NLS - Created tod.h for m841
;
;   M851 Development:
;
;               11/12/2001 FSU - Modified for M851 development.
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


;==============================================================================
;
; STATE REDEFINITIONS
;
;==============================================================================

TODBANNERSTATE              equ     COREBANNERSTATE 
TODDEFAULTSTATE             equ     COREDEFAULTSTATE
TODSETBANNERSTATE           equ     CORESETBANNERSTATE
TODSETSTATE                 equ     CORESETSTATE      

;==============================================================================
;
; EVENT REDEFINITIONS
;
;==============================================================================

TOD_STATEENTRY              equ     COREEVENT_STATEENTRY
TOD_TIMEOUTDONELOWRES       equ     COREEVENT_TIMEOUTDONE_LOWRES
TOD_TIMEOUTDONEHIGHRES      equ     COREEVENT_TIMEOUTDONE_HIGHRES
TOD_TIMEOUTDONESTICKY       equ     COREEVENT_STICKY_TIMEOUTDONE
TOD_ELDEPRESS               equ     COREEVENT_CROWN_EL_DEPRESS
TOD_ELRELEASE               equ     COREEVENT_CROWN_EL_RELEASE
TOD_CROWNHOME               equ     COREEVENT_CROWN_HOME
TOD_CROWNSET                equ     COREEVENT_CROWN_SET1
TOD_CWPULSES                equ     COREEVENT_CW_PULSES
TOD_CCWPULSES               equ     COREEVENT_CCW_PULSES
TOD_CWEDGE                  equ     COREEVENT_CW_EDGE_TRAILING
TOD_CCWEDGE                 equ     COREEVENT_CCW_EDGE_TRAILING
TOD_MODEDEPRESS             equ     COREEVENT_SWITCH1DEPRESS
TOD_STOPRESETDEPRESS        equ     COREEVENT_SWITCH2DEPRESS
TOD_STARTSPLITDEPRESS       equ     COREEVENT_SWITCH3DEPRESS
TOD_MODERELEASE             equ     COREEVENT_SWITCH1RELEASE
TOD_STOPRESETRELEASE        equ     COREEVENT_SWITCH2RELEASE
TOD_STARTSPLITRELEASE       equ     COREEVENT_SWITCH3RELEASE
TOD_POPUPCANCEL             equ     COREEVENT_MELODYPOPUPCANCEL
TOD_DISPLAYUPDATETODRES     equ     COREEVENT_DISPLAY_UPDATE_TODRES
TOD_ICONREFRESH             equ     COREEVENT_ICON_REFRESH 
TOD_ANYSWITCHDEPRESS        equ     COREEVENT_ANYSWITCHDEPRESS
TOD_ANYSWITCHRELEASE        equ     COREEVENT_ANYSWITCHRELEASE


;==============================================================================
;
; SWITCH MASK REDEFINITIONS
;
;==============================================================================

TODSWITCHMASK_ENTER         equ     bCORESwitch1
TODSWITCHMASK_STOPRESET     equ     bCORESwitch2
TODSWITCHMASK_STARTSPLIT    equ     bCORESwitch3
TODSWITCHMASK_CW            equ     bCORECWSwitch
TODSWITCHMASK_CCW           equ     bCORECCWSwitch
TODSWITCHMASK_EL            equ     bCOREELSwitch

TODSWITCHMASK_CW_CCW_EL     equ     (TODSWITCHMASK_CW | TODSWITCHMASK_CCW | TODSWITCHMASK_EL)
        

;==============================================================================
;
; DISPLAY COLUMN POSITIONS
;
;==============================================================================

;------------------------------------------------------------------------------
; Large Font Main Dot Matrix Display Positions
;------------------------------------------------------------------------------
TODLDMPOSITIONHOUR          equ     LCDMAINDMLINE1COL1
TODLDMPOSITIONCOLON         equ     LCDMAINDMLINE1COL15
TODLDMPOSITIONMINUTE        equ     LCDMAINDMLINE1COL17
TODLDMPOSITIONSECOND        equ     LCDMAINDMLINE2COL32
TODLDMPOSITIONAMPM          equ     LCDMAINDMLINE1COL32

TODLDMPOSITIONDATELEFT      equ     LCDMAINDMLINE1COL1
TODLDMPOSITIONDATERIGHT     equ     LCDMAINDMLINE1COL17        
TODLDMPOSITIONDASHDOT       equ     LCDMAINDMLINE1COL15

;------------------------------------------------------------------------------
; Small Font Main Dot Matrix Display Positions
;------------------------------------------------------------------------------
; Line 1

TODDML1POSITIONHOUR         equ     LCDMAINDMLINE1COL1
TODDML1POSITIONCOLON        equ     LCDMAINDMLINE1COL13
TODDML1POSITIONMINUTE       equ     LCDMAINDMLINE1COL15
TODDML1POSITIONAMPM         equ     LCDMAINDMLINE1COL31

; Line 2
TODDML2POSITIONTZNUMBER     equ     LCDMAINDMLINE2COL10
TODDML2POSITIONCITYCODE1    equ     LCDMAINDMLINE2COL25
TODDML2POSITIONCITYCODE2    equ     LCDMAINDMLINE2COL31
TODDML2POSITIONCITYCODE3    equ     LCDMAINDMLINE2COL37

TODDML2POSITIONYEARHI       equ     LCDMAINDMLINE2COL10
TODDML2POSITIONYEARLO       equ     LCDMAINDMLINE2COL20

;------------------------------------------------------------------------------
; Small Font Upper Dot Matrix Display Positions
;------------------------------------------------------------------------------
TODDMPOSITIONDOW            equ     LCDUPPERDMCOL1
TODDMPOSITIONWEEKNUMBER     equ     LCDUPPERDMCOL2

;------------------------------------------------------------------------------
; Miscellaneous
;------------------------------------------------------------------------------

; Value to be added to the current display position to point to the next display position.
;  This will be used to display the city code.  Observe that the gap of the starting
;  display position of char 1 to char 2 and char 2 to char 3 is always 6 columns.
TODCITYCODEDISPLACEMENT     equ     ( TODDML2POSITIONCITYCODE2 - TODDML2POSITIONCITYCODE1 )



;==============================================================================
;
; HIGH RESOLUTION TIMEOUT DEFINITIONS (Based on 8Hz)
;
;==============================================================================
                                                              
TODHIRESTO_250MSECONDS      equ     TIMEOUTHIRES_P250SEC      
TODHIRESTO_1SECOND          equ     TIMEOUTHIRES_1SEC         
TODHIRESTO_1P5SECONDS       equ     TIMEOUTHIRES_1P5SEC       
TODHIRESTO_2SECONDS         equ     TIMEOUTHIRES_2SEC         
TODHIRESTO_4SECONDS         equ     TIMEOUTHIRES_4SEC         
                                                              
;==============================================================================
;
; MISCELLANEOUS DEFINITIONS
;
;==============================================================================

;------------------------------------------------------------------------------
; Resource Index
;------------------------------------------------------------------------------

TODRESOURCEINDEX0           equ     0
TODRESOURCEINDEX1           equ     1
TODRESOURCEINDEX2           equ     2

;------------------------------------------------------------------------------
; Timeout Arguments.
;------------------------------------------------------------------------------

TODTMOUTPEEKSECONDARYTZ     equ     0               ; A 4 sec timeout for peeking other TZ's is 
                                                    ;   being tracked.  

TODTMOUTHOLDTOSWITCH        equ     1               ; A 2 sec timeout before switching to other 
                                                    ;   TZ is being tracked.

TODTMOUTWAITSECONDARYTZ     equ     2               ; A 1 sec timeout delay for displaying the 
                                                    ;   peeked at TZ is being tracked.  Before 
                                                    ;   this 1 sec timeout will be completed and 
                                                    ;   a STOP/RESET is pressed again, it will peek 
                                                    ;   to the other TZ.

TODTMOUTWAITPEEKAPP         equ     3               ; A 1 sec timeout delay for displaying the next 
                                                    ;   appointment entry that is scheduled to occur 
                                                    ;   or there is an upcoming occasion is being tracked.

TODTMOUTBANNERDISPLAY       equ     4               ; A 1.5 sec timeout for displaying the set banner 
                                                    ;   is being tracked.

TODTMOUTDELAYBEFORESCANNING equ     5               ; A 1 sec delay before the fast edit field selection.

TODTMOUTSCANNINGENABLED     equ     6               ; A 250 msec delay to change the field to edit.

TODTMOUTPEEKAPPT			equ		7				; Start/Split button is depressed (peeking at appt/occ)

TODTMOUTNULL				equ		0FFh

;------------------------------------------------------------------------------
; Setting Items
;------------------------------------------------------------------------------

TODSETMINHOUR               equ     0
TODSETHOURFORMAT            equ     1
TODSETDATE                  equ     2
TODSETDATEFORMAT            equ     3
TODSETYEAR                  equ     4
TODSETDOWDISPLAY            equ     5
TODSETPOSITIONTZNAME1       equ     6
TODSETPOSITIONTZNAME2       equ     7
TODSETPOSITIONTZNAME3       equ     8

TODMAXSETITEMS              equ     9

TODFIRSTSETITEM             equ     TODSETMINHOUR
TODLASTSETITEM              equ     TODSETPOSITIONTZNAME3

;------------------------------------------------------------------------------
; Date Format
;------------------------------------------------------------------------------

TODDDMMYY                   equ     0
TODYYMMDD                   equ     1
TODMMDDYY                   equ     2

TODMAXDATEFORMAT            equ     3
TODFIRSTDATEFORMAT          equ     TODDDMMYY                    
TODLASTDATEFORMAT           equ     TODMMDDYY                    

TODMASKDATEFORMAT           equ     (bTODDateFormat0 | bTODDateFormat1)

;------------------------------------------------------------------------------
; Display Type
;------------------------------------------------------------------------------

TODLARGEFONT                equ     0
TODSMALLFONT                equ     1

;------------------------------------------------------------------------------
; Initialization equates
;------------------------------------------------------------------------------

; Initialization of display formats during POR.
TODINITIALCONDITION         equ     (bTODEuroFormat | bTODDateFormat1) 

TODINITIALID                equ     0FFh            ; Initial TZ ID for worldtime wristapp.

TODINITIALSECONDS           equ     00h
TODINITIALMINUTE            equ     00h
TODINITIALHOUR              equ     00h             ; In 24 hour format. (12 AM)
TODINITIALDATE              equ     01h
TODINITIALMONTH             equ     JANUARY
TODINITIALYEARLO            equ     02h
TODINITIALYEARHI            equ     20h

TODDEFAULTYEARHIDATA        equ     20h

;------------------------------------------------------------------------------
; Miscellaneous
;------------------------------------------------------------------------------

TODNUMAPPTYPETOPEEK         equ     2               ; Number of app type that supports peeking.
                                                    ;   Only APPT and OCCASION.

TODHOURMAX                  equ     24h             ; Maximum range for TOD hour data (BCD format).

TODSIZEOFTZDBSTRUCTURE      equ     5               ; Size of TOD database structure.

TODNUMBEROFTIMEZONES        equ     3               ; Number of time zones supported.

TODSIZEOFTZCITYCODE         equ     3               ; Number of characters reserved for city 
                                                    ;   code for each time zone.

TODYEARCHANGEDATAVALUE      equ     1               ; Value to be added/subtracted to year data.

TODUPDATEALL                equ     (bKTODMinuteUpd | bKTODHourUpd | bKTODDateUpd)

TODUPDATEHMSONLY            equ     (bKTODMinuteUpd | bKTODHourUpd)

