Subversion Repositories pentevo

Rev

Rev 374 | Rev 437 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. #ifndef __MAIN_H__
  2. #define __MAIN_H__
  3.  
  4. /**
  5.  * @mainpage  General program for ATMEGA128 ZX Evolution.
  6.  *
  7.  * @section history Revision history
  8.  *
  9.  * @subsection current Current version.
  10.  *
  11.  * - Control PLL (ICS501M) via PE2,PE3. Set it to 2X.
  12.  *
  13.  * @subsection ver_2011_04_26 Version 26.04.2011
  14.  *
  15.  * - Add RS232 supporting.
  16.  * - Increase delay for reset FPGA (nCONFIG pin) before download it.
  17.  *
  18.  * @subsection ver_2011_04_02 Version 02.04.2011
  19.  *
  20.  * - Add access to 0..EF cells of PC8583.
  21.  * - Fix RTC PC8583 dayweek 0..6 convert to DS12788 dayweek 1..7 and vice versa.
  22.  *
  23.  * @subsection ver_2010_12_07 Version 07.12.2010
  24.  *
  25.  * - Keyboard mapping without using RAM.
  26.  * - Add setting resolution for PS/2 mouse [1..4]
  27.  *   (left and right mouse buttons and pad'*' - default [1], pad'+' - increment, pad'-' - decrement).
  28.  * - Add PS/2 mouse resolution saving to RTC register.
  29.  *
  30.  * @subsection ver_2010_11_29 Version 29.11.2010
  31.  *
  32.  * - "NumLock" switch mode to beeper/pwm or tapeout ("NumLock" led light on tapeout mode).
  33.  * - Create full translation map (0x00-0x7f for extended scan codes).
  34.  *
  35.  * @subsection ver_2010_10_17 Version 17.10.2010
  36.  *
  37.  * - "F9","F10","F11" on PS/2 keyboard not used for reset function.
  38.  * - "F12" on PS/2 keyboard soft/hard reset. Short press (<5sec) - soft reset, long press (5sec) - hard reset.
  39.  * - "Ctrl-Alt-Del" on PS/2 keyboard reset ZX (hard reset). If all keys is mapped to ZX keyboard - function not work.
  40.  * - Create translation map (PS/2 to ZX keyboard) in eeprom (default in progmem).
  41.  * - Fix PS/2 mouse and keyboard send mode (without 'delay' function).
  42.  * - Support load from tape input.
  43.  *
  44.  * @subsection ver_2010_03_30 Version 30.03.2010
  45.  *
  46.  * - Fix fpga load and ZX part init (optimize).
  47.  *
  48.  * @subsection ver_2010_03_28 Version 28.03.2010
  49.  *
  50.  * - Fix PS/2 mouse error handler (analize error and reinit mouse if need it).
  51.  * - Add support for get version info (via Gluk cmos extra registers 0xF0..0xFF).
  52.  * - Optimize sources, some correction (log, fpga load).
  53.  * - Fix PS/2 timeout error handler.
  54.  *
  55.  * @subsection ver_2010_03_24 Version 24.03.2010
  56.  *
  57.  * - Fix Power Led behavior (it off while atx power off).
  58.  * - "Print Screen" PS2 keyboard key set NMI on ZX.
  59.  * - Soft reset (Z80 only) to service (0) page if pressed "softreset" key <5 seconds.
  60.  *
  61.  * @subsection ver_2010_03_10 Version 10.03.2010
  62.  *
  63.  * - Add PS2 keyboard led controlling: "Scroll Lock" led equal VGA mode.
  64.  * - Fix mapping gluk (DS12887) nvram to PCF8583.
  65.  * - Fix Update Flag in register C (emulation Gluk clock).
  66.  * - Add modes register and save/restore it to RTC NVRAM.
  67.  * - Add support for zx (mechanical) keyboard.
  68.  * - Add support for Kempston joystick.
  69.  *
  70.  * @subsection ver_2010_02_04 Version 04.02.2010 - base version (1.00 in SVN).
  71.  *
  72.  */
  73.  
  74. /**
  75.  * @file
  76.  * @brief Main module.
  77.  * @author http://www.nedopc.com
  78.  */
  79.  
  80. /** Common flag register. */
  81. extern volatile UBYTE flags_register;
  82. /** Direction for ps2 mouse data (0 - Receive/1 - Send). */
  83. #define FLAG_PS2MOUSE_DIRECTION 0x01
  84. /** Type of ps2 mouse (0 - classical [3bytes in packet]/1 - msoft [4bytes in packet]). */
  85. #define FLAG_PS2MOUSE_TYPE      0x02
  86. /** Ps2 mouse data for zx (0 - not ready/1 - ready). */
  87. #define FLAG_PS2MOUSE_ZX_READY  0x04
  88. /** Spi interrupt detected (0 - not received/1 - received). */
  89. #define FLAG_SPI_INT            0x08
  90. /** Direction for ps2 keyboard data (0 - Receive/1 - Send). */
  91. #define FLAG_PS2KEYBOARD_DIRECTION  0x10
  92. /** Version type (0 - BaseConf /1 - BootLoader). */
  93. #define FLAG_VERSION_TYPE       0x20
  94. /** Last tape in bit value. */
  95. #define FLAG_LAST_TAPE_VALUE    0x40
  96. /** Hard reset flag (1 - enable hard reset). */
  97. #define FLAG_HARD_RESET         0x80
  98.  
  99. /** Common flag register. */
  100. extern volatile UBYTE flags_ex_register;
  101. /** Ps2 mouse command (0 - not/1 - process). */
  102. #define FLAG_EX_PS2MOUSE_CMD    0x01
  103. /** Ps2 keyboard map (0 - default/1 - user). */
  104. #define FLAG_EX_PS2KEYBOARD_MAP 0x02
  105.  
  106. /** Common modes register. */
  107. extern volatile UBYTE modes_register;
  108. /** VGA mode (0 - not set/1 - set). */
  109. #define MODE_VGA 0x01
  110. /** Tapeout mode (0 - beeper or pwm mode/1 - tapeout). */
  111. #define MODE_TAPEOUT 0x02
  112.  
  113. /** Data buffer. */
  114. extern UBYTE dbuf[];
  115.  
  116. /** FPGA data index. */
  117. extern volatile ULONG curFpga;
  118.  
  119. /**
  120.  * Writes specified length of buffer to SPI.
  121.  * @param size [in] - size of buffer.
  122.  */
  123. void put_buffer(UWORD size);
  124.  
  125. #endif //__MAIN_H__
  126.