⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 machine.h

📁 瑞萨M16C编写的模拟PS2主机与标准键盘通讯程序.完整的工程文件,测试可用.
💻 H
字号:
// General processor specific definitions#ifndef __MACHINE_H#define __MACHINE_H//#include "skp_bsp.h"// Data type definitionstypedef signed char s8;typedef unsigned char u8;typedef signed int s16;typedef unsigned int u16;typedef signed long s32;typedef unsigned long u32;typedef signed long long s64;typedef unsigned long long u64;// General purpose macros#ifndef max  #define max( x, y ) ( ( x ) > ( y ) ? ( x ) : ( y ) )#endif#ifndef min    #define min( x, y ) ( ( x ) < ( y ) ? ( x ) : ( y ) )#endif#define HI8( x ) ( ( ( x ) & 0xFF00 ) >> 8 )#define LO8( x ) ( ( x ) & 0x00FF )// Serial interface speed#define UART_SPEED 115200L// Definitions for the memory interface#define CS2_START 0x10000L#define CS1_START 0x28000L#define CS0_START 0x30000L// Memory map for CS2 (for a total of 92k)// First zone: 64k cache for block erase operations// Second zone: interactive editor data area (20k)// Third zone: fat file system data block cache(4k)// Third zone: flash file system data block cache (3k)// Fourth zone: remote file system data block cache (1k)#define MEM_ERASE_CACHE_START 010000h#define MEM_ERASE_CACHE_SIZE 0x10000L#define MEM_EDITOR_DATA 020000h#define MEM_EDITOR_SIZE 0x5000L#define MEM_FAT_CACHE 025000h#define MEM_FAT_SIZE 0x1000L#define MEM_FFS_CACHE 026000h#define MEM_FFS_SIZE 0x0C00L#define MEM_RFS_CACHE 026C00h#define MEM_RFS_SIZE 0x0400L// Code memory constants#define MEM_FIRST_CODE 0x000A0000UL	// start of code memory#define MEM_FIXED_CODE 0x000FC000UL // start of fixed code memory#define MEM_LAST_CODE 0x000FFFFFUL  // last address in code memory#define MEM_BLOCKA_START 0x0000F000UL // start of block A#define MEM_BLOCKA_END 0x00000FFFFUL // end of block A#define MEM_IMAGE_START 0x00028000UL // start of RAM cache for 'image' command// PS2 definitions are here because they are needed by the EEPROM driver#define PS2_DATA_LINE p8_1        // PS2 data line#define PS2_DATA_DIR pd8_1        // direction bit for PS2 data#define PS2_CLOCK_LINE p8_2       // PS2 clock line#define PS2_CLOCK_DIR pd8_2       // direction bit for PS2 clock// SPI clock speed#define SPI_CLK_RATE 2000000UL			// 2MHz // Video memory page definitions#define NORMAL_MEM_PAGE 2#define EDITOR_MEM_PAGE 0// Image 'magic' signatures#define IMAGE_MAGIC "REVIMAGE"#define SECTION_MAGIC "REVS"// Adddress of the directory for the flash file system#define MEM_FFS_DIRECTORY 0F000h#define TRACE( x ) printf( __FILE__ ## ": " ## #x ## "\n" )// This defines the image type#define IMAGE_BARE 0#define IMAGE_MMC 1#define IMAGE_MMC_LCD 2#define IMAGE_COMPLETE 3// **** Data merged from FAT library (typedefs.h) ******************************#define TRUE    1#define FALSE   0typedef unsigned char   boolean;#define to_boolean(b)   (((b) != 0) ? TRUE : FALSE)typedef unsigned char   uint8;typedef unsigned short int  uint16;typedef unsigned long int   uint32;typedef signed char int8;typedef signed short int    int16;typedef signed long int int32;// Machine-specific functions#define nop()		_asm ("NOP")#define reset() prc1 = 1; pm03 = 1#define CHIP_SELECT 		p7_3#define CHIP_SELECT_DDR		pd7_3// The pin that will be checked for remote server activation#define REMOTE_START_PIN p8_4#define REMOTE_START_DIR pd8_4// **** LCD DEFINITIONS ********************************************************#define LCD_CS_PIN p9_7							// CS pin#define LCD_CS_DIR pd9_7						// CS pin direction#define LCD_RD_PIN p7_4							// RD pin#define LCD_RD_DIR pd7_4						// RD pin direction#define LCD_WR_PIN p7_5							// WR pin#define LCD_WR_DIR pd7_5						// WR direction#define LCD_A0_PIN p9_6							// A0 pin#define LCD_A0_DIR pd9_6						// A0 direction#define LCD_RES_PIN p8_0						// RES pin#define LCD_RES_DIR pd8_0						// RES direction#define LCD_DATA_PORT p1						// data port for LCD#define LCD_DATA_DIR pd1						// data direction#define LCD_LINES 25								// lines on display#define LCD_COLS 40									// columns on display#define LCD_X_SIZE 320							// Ox size in pixels#define LCD_Y_SIZE 200							// Oy size in pixels#define LCD_XTAL 6000000UL					// LCD clock frequency#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -