Subversion Repositories pentevo

Rev

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