Main Page | File List | Globals

rtc_display_def.h

Go to the documentation of this file.
00001 // ******************************************************************
00002 // *****DEFINES PARA RTC EN PLACA DISPLAY DEL BDA********************
00003 // ******************************************************************
00004 // _00. Inicial.
00005 //      Al dejar de interrogar se para el reloj y sigue perdiendo la hora
00006 // _01. Funciona correctamente al ralentizar el reloj y cambiar la
00007 //      gestion de las interrupciones
00008 // _03. Se reinicia en los cambios de alimentación, así que se elimina
00009 //      la inicialización de la hora en ese transitorio
00010 // _04. Cambio en la definicion de dia y mes, junto con la funcion 
00011 //      CalculaDiaSemana, para soluccionar el fallo de cambio de día.
00012 
00013 #ifndef _MIS_TIPOS
00014 #define _MIS_TIPOS
00015 typedef  unsigned char          BOOL;
00016 typedef  unsigned char  BYTE;
00017 //typedef  signed char          CHAR;
00018 typedef  unsigned int           WORD;
00019 typedef  signed   int           INT;
00020 typedef  unsigned long          DWORD;
00021 typedef  signed   long          LONG;
00022 #endif  //_MIS_TIPOS
00023 
00024 #ifndef __LIMIT_H
00025 #define __LIMIT_H
00026 #define CHAR_BIT        8
00027 #define CHAR_MAX        UCHAR_MAX
00028 #define CHAR_MIN        UCHAR_MIN
00029 #define INT_MAX 32767
00030 #define INT_MIN -32768
00031 #define SCHAR_MAX       127
00032 #define SCHAR_MIN       -128
00033 #define SHRT_MAX        INT_MAX
00034 #define SHRT_MIN        INT_MIN
00035 #define UCHAR_MAX       255
00036 #define UCHAR_MIN       0
00037 #define UINT_MAX        65535u
00038 #define UINT_MIN        0
00039 #define USHRT_MAX       UINT_MAX
00040 #define USHRT_MIN       0
00041 #define LONG_MAX        2147483647L
00042 #define LONG_MIN        (-2147483647L-1)
00043 #define ULONG_MAX       4294967295UL
00044 #define ULONG_MIN       0
00045 #endif
00046 
00047 //*******************************************************************
00048 //******* DEFINES PARTICULARES DE LA APLICACION   *******************
00049 //*******************************************************************
00050 #define         SI      1
00051 #define         YES     1
00052 #define         NO      0
00053 
00054 #define BIT_MSB 0x80
00055 #define BIT_LSB 0x01
00056 
00057 // *****Definiciones del hardware*****
00058 #define BIT_RTC_LD              0x01            //En P2
00059 #define BIT_RTC_SCLK    0x02
00060 #define BIT_RTC_DATA_OUT        0x04
00061 
00062 // *****GRABACION EN EEPROM***********
00063 #define         ADDRESS_SEG_B   0x1000  //Este es el bloque de 128 bytes
00064                                                         //que se utiliza
00065 
00066 // ***********************************
00067 // *****REFERENCIAS BASE TIEMPOS******
00068 // *****resolucion 1.965mseg**********
00069 #define _1_SEG                  (int)512
00070 #define _2_SEG                  (int)1024
00071 
00072 // **** Control frec. DCO*************
00073 #define DCO_SET (long)3000              
00074 #define RSEL_NOM        7       //Ahora sin regulacion 6
00075 #define F_REF           32768
00076 #define TCLK_DIV        1
00077 //#define F_SET         (int)(((long)(DCO_SET * (long)1000))/((long)F_REF*TCLK_DIV))
00078 
00079 #define MOD             32
00080 #define FSTEP           7
00081 #define PROP            MOD*FSTEP*65536/(2*F_SET*TCLK_DIV)
00082 
00083 #define DCO_MIN 0x05
00084 #define DCO_MAX 0xE2
00085 
00086 // ***********************************
00087 
00088 // *****Flags de interrupciones IO****
00089 #define F_OUT_ACTIVA    0x01    //Variable f_stat
00090 #define F_IRQ_CHGED             0x02
00091 
00092 #define F_MODO_LOWPOW   0x04
00093 #define F_FIX_SEG               0x08
00094 
00095 // *****Comandos del protocolo reloj**
00096 #define COMMD_HORA              0xC3
00097 
00098 // *****Defines del calendario********
00099 
00100 #define DOMINGO (int)0  //Variable dia_semana
00101 #define LUNES           (int)1
00102 #define MARTES          (int)2
00103 #define MIERCOLES       (int)3
00104 #define JUEVES          (int)4
00105 #define VIERNES (int)5
00106 #define SABADO          (int)6
00107 
00108 #define ENERO           (int)1  //Variable mes
00109 #define FEBRERO (int)2
00110 #define MARZO           (int)3
00111 #define ABRIL           (int)4
00112 #define MAYO            (int)5
00113 #define JUNIO           (int)6
00114 #define JULIO           (int)7
00115 #define AGOSTO          (int)8
00116 #define SEPTIEMBRE      (int)9
00117 #define OCTUBRE (int)10
00118 #define NOVIEMBRE       (int)11
00119 #define DICIEMBRE       (int)12
00120 
00121 
00122 
00123 

Generated on Thu Nov 10 22:38:51 2005 for Reloj TEXAS by  doxygen 1.4.4        for