system.h 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. /* ========================================================================
  2. * [PROJECT] SIR
  3. * [MODULE] global module
  4. * [TITLE] system header file
  5. * [FILE] system.h
  6. * [VSN] 1.0
  7. * [CREATED] 18 august 2003
  8. * [LASTCHNGD] 18 august 2003
  9. * [COPYRIGHT] Copyright (C) STREAMIT BV 2010
  10. * [PURPOSE] global defines and prototypes for Lucas project
  11. * ======================================================================== */
  12. /*--------------------------------------------------------------------------*/
  13. /* Include files */
  14. /*--------------------------------------------------------------------------*/
  15. #include "typedefs.h"
  16. /*-------------------------------------------------------------------------*/
  17. /* global defines */
  18. /*-------------------------------------------------------------------------*/
  19. #define ON (1)
  20. #define OFF (0)
  21. #define NO_CHANNEL 200 // make sure this is > SETTINGS_NROF_CHANNELS
  22. #define NO_PLAYLIST 200 // make sure this is > SETTINGS_NROF_PLAYLISTS
  23. /*!\brief System status bit definitions */
  24. #define STATUS_STARTING_UP 0x01 // true during startup and Setup Wizzard
  25. #define STATUS_IP_MODE 0x02 // do we use DHCP or Static IP?
  26. #define STATUS_POWER 0x04 // if set, we are on
  27. #define STATUS_SELFTEST 0x08 // switch to re-direct keys from Menu to Selftest module
  28. #define STATUS_CONFIGURED 0x10 // if set, we are configured
  29. #define STATUS_GPB_INVALID 0x20 // if set, we cannot rely on Productcode, Remote Updatemode, etc
  30. #define STATUS_FALLBACK_ACTIVE 0x40 // if set, we cannot play from the internet and if a card is present, we play from card
  31. #define STATUS_STARTING_UP_MASK 0x01
  32. #define STATUS_IP_MODE_MASK 0x02
  33. #define STATUS_POWER_MASK 0x04
  34. #define STATUS_SELFTEST_MASK 0x08
  35. #define STATUS_CONFIGURED_MASK 0x10
  36. #define STATUS_GPB_INVALID_MASK 0x20
  37. #define STATUS_FALLBACK_ACTIVE_MASK 0x40
  38. #define ONE_SECOND 225 // 225 times 4,44 msecs makes 1 second
  39. #define ONE_MINUTE 60
  40. #define ONE_HOUR 60
  41. /*!\brief define possible languages */
  42. #define LANGUAGE_NL 0
  43. #define LANGUAGE_EN 1
  44. #define LANGUAGE_DE 2
  45. /*!\brief define possible IP_Modes */
  46. #define IP_MODE_DHCP 0
  47. #define IP_MODE_STATIC 1
  48. /*!\brief define possible countrycodes (mainly used for the modem) */
  49. #define COUNTRY_US 0
  50. #define COUNTRY_UK 1
  51. #define COUNTRY_SA 2
  52. #define COUNTRY_NL_V92 3
  53. #define COUNTRY_NL_V34 4
  54. #define COUNTRY_NROF 5
  55. /*!\brief Maximum size to use for threadnames */
  56. #define THREADNAME_SIZE 9
  57. enum
  58. {
  59. IRQ_INT0,
  60. IRQ_INT1,
  61. IRQ_INT2,
  62. IRQ_INT3,
  63. IRQ_INT4,
  64. IRQ_INT5,
  65. IRQ_INT6,
  66. IRQ_INT7,
  67. IRQ_TIMER2_COMP,
  68. IRQ_TIMER2_OVF,
  69. IRQ_TIMER1_CAPT,
  70. IRQ_TIMER1_COMPA,
  71. IRQ_TIMER1_COMPB,
  72. IRQ_TIMER1_OVF,
  73. IRQ_TIMER0_COMP,
  74. IRQ_TIMER0_OVF,
  75. IRQ_SPI_STC,
  76. IRQ_UART_RX,
  77. IRQ_UART_UDRE,
  78. IRQ_UART_TX,
  79. IRQ_ADC,
  80. IRQ_EE_RDY,
  81. IRQ_ANA_COMP,
  82. IRQ_TIMER1_COMPC,
  83. IRQ_TIMER3_CAP,
  84. IRQ_TIMER3_COMPA,
  85. IRQ_TIMER3_COMPB,
  86. IRQ_TIMER3_COMPC,
  87. IRQ_TIMER3_OVF,
  88. IRQ_UART1_RX,
  89. IRQ_UART1_UDRE,
  90. IRQ_UART1_TX,
  91. IRQ_I2C,
  92. IRQ_SPM_RDY,
  93. IRQ_MAX
  94. };
  95. /*-------------------------------------------------------------------------*/
  96. /* typedefs & structs */
  97. /*-------------------------------------------------------------------------*/
  98. typedef struct
  99. {
  100. u_char KeyLockStatus; // overall lock, if ACTIVE, keyboard is locked
  101. u_char KeyLockEditStatus; // used when user wants to change the status of the Keylock
  102. u_char KeyLockTempStatus; // after entering a valid PIN, this goes to INACTIVE for 30 secs
  103. u_short KeyLockPIN; // range = [0]..[5555]
  104. } TKeyLock;
  105. typedef u_char TIPMode;
  106. typedef u_char TLanguage;
  107. /*-------------------------------------------------------------------------*/
  108. /* export global variables */
  109. /*-------------------------------------------------------------------------*/
  110. extern u_char SystemStatus;
  111. extern TLanguage SystemLanguage;
  112. extern TIPMode SystemIPMode;
  113. extern TKeyLock SystemKeyLock;
  114. /*-------------------------------------------------------------------------*/
  115. /* export global routines (interface) */
  116. /*-------------------------------------------------------------------------*/
  117. extern void SysInitVars(void);
  118. extern void SysPowerOn(void);
  119. extern void SysPowerOff(void);
  120. extern void SysInitIO(void);
  121. extern void SystemShowSysInfo(void);
  122. /* ÍÍÍÍ End Of File ÍÍÍÍÍÍÍÍ ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ */