📄 srvudeif.h
字号:
//===========================================================================
// CheerTek DVD22C-A Combo DVD-Player Servo Firmware
//
// Filename : srvudeif.h
// Description : Definitions UDE interface
//===========================================================================
//---------------------------------------------------------------------------
#ifndef __SRVUDEIF_H__
//---------------------------------------------------------------------------
#define __SRVUDEIF_H__
//==========================================================================
// Firmware version setting
//==========================================================================
#define FIRMWARE_VERSION 0x931009//931008->931009 For YHI, PDV288+Arima 601PHS+3721+5954, 2005.1.18 supported by CCH
//===========================================================================
// FBCR/FTGR tuning relative setting
//===========================================================================
#ifdef DYNAMIC_FBCR_FTGR
#define FBAL_PI_THRESHOLD BM_MULTI_PASS_PO_THRESHOLD
#define FBAL_TUNNING_CASE_FOR_D5 3
#define FBAL_TUNNING_CASE_FOR_D9 6
#define FBAL_TUNNING_SWITCH_POINT FBAL_TUNNING_CASE_FOR_D5 // the switching point for Layer0 & Layer1
#endif
#if defined(DYNAMIC_PI_CHECK) || defined(DYNAMIC_TUNING_1)
#define FBCR_TABLE_IDX 5
#define FTGR_TABLE_IDX 6
#define PI_CHECK_LIMIT 3
#endif
//===========================================================================
// Serial communication definitions
//===========================================================================
#define CMD_RXD_TIMER 0x82
#define CMD_RXD_TIMEOUT 0x70 // 2*CPU_TIME_GAP
#define ACK_TXD_TIMER 0x10 // 0x70
#define ACK_TXD_TIMEOUT 0x08 // 0x68
//===========================================================================
// UART related setting
//===========================================================================
#define T0MODE1 0x01 // T0_GATE = 0
#define T1MODE2 0x20 // T1_GATE = 0
#define UART_MODE3 0xC0
#define REN_ENABLE 0x10
#define UART_SMOD0 0x7F
#define UART_SMOD1 0x80 // Double Baud Rate
#define UART_MODE3_TH1 0xFB // 35.28Kbps, [2^(1)*33.8688M]/[32*12*(256-TH1), 0xFB
//===========================================================================
// Communication Command Definition
//===========================================================================
#define CMD_OPEN_TRAY 0x00
#define CMD_CLOSE_TRAY 0x01
#define CMD_RESTART_UNIT 0x02
#define CMD_STOP_UNIT 0x03
#define CMD_GET_DISCTYPE 0x04
#define CMD_GET_TOC 0x05
#define CMD_GET_LBA 0x06
#define CMD_GET_QSUBCHANNEL 0x08
#define CMD_READ_CD 0x09
#define CMD_READ_DVD 0x0A
#define CMD_SCAN 0x0B
#define CMD_PAUSE_RESUME 0x0C
#define CMD_ABORT 0x0D
#define CMD_GROOVE_JUMP 0x0E
#define CMD_WAKEUP_SEEK 0x0F // Jodo add 04292002, for wake-up servo by seek!!
#define CMD_GET_STATUS 0x10
#define CMD_CONFIGURE_LOADER 0x11
#define CMD_POWER_MANAGEMENT 0x12
#define CMD_READ_DISCKEY 0x13
#ifdef NEW_UDE_INTERFACE
#define CMD_CONTROL_GPIO 0x14 // Andy 020715: GPIO control
#define CMD_SERVO_DEBUG 0x17 // Andy 020715: servo debug/test mode
#ifdef PROG_ACLK_PLL
#define CMD_SETPLL_ACLK 0x18 // Add by HCC for program external ACLK
#endif // PROG_ACLK_PLL
#else
#define CMD_GET_COPYRIGHT 0x14 // UDE Spec is 0x15!
//#define CMD_INQUIRY 0x16
#define CMD_DEBUG_PI_PO 0x15 // Debug Mode!!!
#define CMD_GET_PI_PO 0x16 // Debug Mode!!!
#ifdef PROG_ACLK_PLL
#define CMD_SETPLL_ACLK 0x18 // Add by HCC for program external ACLK
#endif // PROG_ACLK_PLL
#endif
//********************************************************
// GET_STATUS command
//********************************************************
#define PLAYBACK_STOPPED 0x00
#define PLAYBACK_PAUSING 0x01
#define PLAYBACK_PLAYING 0x02
#ifdef CHANGE_SRV_FAIL_BIT
#define SERVO_FAIL 0x80
#define PLAYBACK_ERROR 0x40
#else
#define SERVO_FAIL 0x40
#define PLAYBACK_ERROR 0x80
#endif
#define TRAY_OPEN 0x00
#define TRAY_OPENING 0x04
#define TRAY_CLOSE 0x08
#define TRAY_CLOSING 0x0C
#define MEDIA_ANALYZING 0x00
#define MEDIA_PRESENT 0x10
#define MEDIA_NOT_PRESENT 0x20
#ifdef Top_Open_System
#define TOP_OPEN_AT_POWER_ON 0x02
#endif
//********************************************************
// Error Codes
//********************************************************
#define NO_ERROR 0x00
#ifdef NEW_UDE_ERROR_MESSAGE
// ACK error message: servo cannot accept command
#define SERVO_VALIDATE_FAIL 0x21
#define SERVO_STARTUP_FAIL 0x22
#define SERVO_RECOVER_BUSY 0x23
// ACK error message: servo rejects command
#define CMD_CODE_ERROR 0x31
#define CMD_PARAM_ERROR 0x32
// Result Code error message
#define SERVO_SEEK_TIMEOUT 0x41
#define SERVO_DUMPIN_TIMEOUT 0x42
#define SERVO_DUMPOUT_TIMEOUT 0x43
#define SERVO_SEEK_FAIL 0x44
#else
#define SERVO_NOT_READY 0x2F
#define CMD_ERROR 0x30
#define CMD_CODE_ERROR 0x31
#define CMD_PARAM_ERROR 0x32
#define CMD_AUDIO_ERROR 0x33
#define CMD_ABORTED 0x40
#define CMD_IGNORED 0x42
#endif
//===========================================================================
// Acknowledgment Codes
//===========================================================================
#ifdef EMULATOR_EPP
#ifndef SINGLE_CPU_420_28
#define ACK_RET_NONE 0x80;gbtRET1stByte=1
#define ACK_RET_1 0x81;gbtRET1stByte=1
#define ACK_RET_2 0x82;gbtRET1stByte=1
#define ACK_RET_3 0x83;gbtRET1stByte=1
#define ACK_RET_4 0x84;gbtRET1stByte=1
#define ACK_RET_5 0x85;gbtRET1stByte=1
#define ACK_RET_6 0x86;gbtRET1stByte=1
#define ACK_RET_10 0x8A;gbtRET1stByte=1
#else
#define ACK_RET_NONE 0x80
#define ACK_RET_1 0x81
#define ACK_RET_2 0x82
#define ACK_RET_3 0x83
#define ACK_RET_4 0x84
#define ACK_RET_5 0x85
#define ACK_RET_6 0x86
#define ACK_RET_7 0x87 // for FAE_VERSION
#define ACK_RET_10 0x8A
#endif
#else // else of #ifdef EMULATOR_EPP
#define ACK_RET_NONE 0x80
#define ACK_RET_1 0x81
#define ACK_RET_2 0x82
#define ACK_RET_3 0x83
#define ACK_RET_4 0x84
#define ACK_RET_5 0x85
#define ACK_RET_6 0x86
#define ACK_RET_7 0x87 // for FAE_VERSION
#define ACK_RET_10 0x8A
#endif // End of #ifdef EMULATOR_EPP
//===========================================================================
// Servo machine definitions
//===========================================================================
#define WAIT_NEWCMD 0xFF // set this value after result code returned
#ifdef NEW_UDE_INTERFACE
#ifdef PROG_ACLK_PLL
#define MAX_CMD_NUMBER 0x19
#else
#define MAX_CMD_NUMBER 0x18 // Andy 020715: number of commands
#endif
#else
#ifdef PROG_ACLK_PLL
#define MAX_CMD_NUMBER 0x19
#else
#define MAX_CMD_NUMBER 0x17 // Andy 020704: number of commands
#endif
#endif
#define MAX_PARAM_NUMBER 0x0A
#define NEW_CMD_PACKET_LENGTH 12 // Andy 030113: unify packet length
#define RET_PACKET_LENGTH 6 // Andy 030113: unify packet length
#define MAX_TOC_ENTRY 50
#define MAX_BLOCKS_FOR_COUNT_PI_PO 8 // Debug Mode
#define READY 0 // active low
#define BUSY 1
//===========================================================================
// Servo Command Definition
//===========================================================================
#define SRV_OPEN_TRAY 0x00
#define SRV_CLOSE_TRAY 0x01
#define SRV_STOP_UNIT 0x02
#define SRV_SEEK 0x03
#define SRV_JUMP_TRACK 0x04
#define SRV_POWER_MANAGEMENT 0x05
#define SRV_WAKEUP_SEEK 0x06 // Andy 020619: for restart function
//===========================================================================
// Servo Command Error Code
//===========================================================================
//#define NO_ERROR 0x00
#define SRV_BUSY 0xFF
#define SRV_ERROR 0x10
#define SRV_ABORTED 0x20
#define SRV_FAIL 0x30
//===========================================================================
// Buffer Management Command Definition
//===========================================================================
#define BMSTATE_OPEN_TRAY 0x00
#define BMSTATE_CLOSE_TRAY 0x01
#define BMSTATE_READ_LEADIN 0x02
//#define BMSTATE_CHECK_BUFFER 0x03
#define BMSTATE_DUMPIN_PREPARE 0x04
#define BMSTATE_DUMPIN_TRIGGER 0x05
#define BMSTATE_DUMPOUT_PREPARE 0x06
#define BMSTATE_CD_OUTPUT_MONITOR 0x07
#define BMSTATE_SEND_RESULT_CODE 0x08
#define BMSTATE_CLV_SCALE 0x09
#define BMSTATE_SEEK_CONTROL 0x0A
#define BMSTATE_JUMP_CONTROL 0x0B
#define BMSTATE_WAKEUP_SEEK 0x0C
#define BMSTATE_DEBUG_PI_PO 0x0D // Debug Mode
#define BMSTATE_POWER_MANAGEMENT 0x0E
#ifdef BM_MONITOR_PI_PO
#define BMSTATE_MONITOR_PI_PO 0x0F
#endif
#define BMSTATE_STANDBY 0x10
//===========================================================================
// Timer for each state
//===========================================================================
//#define BMTIMER_OPEN_TRAY (60 / CPU_TIME_GAP)
//#define BMTIMER_CLOSE_TRAY (60 / CPU_TIME_GAP)
#define BMTIMER_CLV_SCALE (1000 / CPU_TIME_GAP) // 3800 ms
//#define BMTIMER_CHECK_BUFFER (60 / CPU_TIME_GAP) // 60 ms, MAX 4 block Data required at 2x
#define BMTIMER_CHECK_BUFFER (500 / CPU_TIME_GAP) // Andy test 500 ms, MAX 4 block Data required at 2x
#define BMTIMER_DUMPING_TRIGGER (3500 / CPU_TIME_GAP) //3000 Eric100402 // 1000 ms, !!!Must be less!!!
#define BMTIMER_AUTO_DUMPING_TRIGGER (1000 / CPU_TIME_GAP) // 60 ms, !!!Must be less!!!
#define BMTIMER_READ_LEADIN_TOC (1000 / CPU_TIME_GAP) // 3800 ms
#ifdef AUTO_PAUSE
#define BMTIMER_WAIT_PAUSE_TIMER (3000 / CPU_TIME_GAP) // 3000 ms
#define BMTIMER_PAUSE_SEEK (1000 / CPU_TIME_GAP)
#endif
#define BMTIMER_CDDA_WIAT_FOR_START (200 / CPU_TIME_GAP) // 100 ms
#define BMTIMER_CDDA_WIAT_FOR_STOP (500 / CPU_TIME_GAP)
//---------------------------------------------------------------------------
#endif // __SRVUDEIF_H__
//-------------------------------- End --------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -