📄 iop.inc
字号:
I2C_SCL_bit equ 1 ;;gpio 17
I2C_SDA_bit equ 2 ;;gpio 18
.endif
.ifnz SPHE8202L_128PIN
I2C_PORT equ GPIO_PORT0
I2C_PORT_CFG equ GPIO_IO0_CFG
I2C_SDA equ %01000000 ;;gpio 6
I2C_SCL equ %10000000 ;;gpio 7
I2C_SDA_bit equ 6 ;;gpio 6
I2C_SCL_bit equ 7 ;;gpio 7
.endif
.if SPHE8200
I2C_PORT equ GPIO_PORT0
I2C_PORT_CFG equ GPIO_IO0_CFG
I2C_SDA equ %00000010 ;;gpio 1
I2C_SCL equ %00000001 ;;gpio 0
I2C_SDA_bit equ 1 ;;gpio 1
I2C_SCL_bit equ 0 ;;gpio 0
.endif
I2C_DATA_RDY equ %00001000
I2C_DATA_ERR equ %00010000
I2C_READ_CONT equ %00100000
I2C_WRITE_PAGE equ %01000000
I2C_DATA_RDY_bit equ 3
I2C_DATA_ERR_bit equ 4
I2C_READ_CONT_bit equ 5
I2C_WRITE_PAGE_bit equ 6
;;*******************************************************************
;;Game Pad interface
;;*******************************************************************
.if SPHE8202_256PIN_NON_SHARE_16bit
;;rbhung change for 8202 non-share mode(gpio) 04/06/09
GPAD_PORT_CLK equ GPIO_PORT12 ;;for CLK
GPAD_PORT_LATCH equ GPIO_PORT12 ;;for LATCH
GPAD_PORT_D0_D1 equ GPIO_PORT12 ;;for D0,D1
GPAD_PORT_CFG_CLK equ GPIO_IO12_CFG
GPAD_PORT_CFG_LATCH equ GPIO_IO12_CFG
GPAD_PORT_CFG_D0_D1 equ GPIO_IO12_CFG
GPAD_CLK equ 3 ;;gpio 99 PIN 232
GPAD_LATCH equ 4 ;;gpio 100 PIN 233
GPAD_D1 equ 1 ;;gpio 97 PIN 230
GPAD_D0 equ 2 ;;gpio 98 PIN 231
.endif
.if SPHE8202_256PIN_NON_SHARE_32bit
GPAD_PORT_CLK equ GPIO_PORT12 ;;for CLK
GPAD_PORT_LATCH equ GPIO_PORT12 ;;for LATCH
GPAD_PORT_D0_D1 equ GPIO_PORT12 ;;for D0,D1
GPAD_PORT_CFG_CLK equ GPIO_IO12_CFG
GPAD_PORT_CFG_LATCH equ GPIO_IO12_CFG
GPAD_PORT_CFG_D0_D1 equ GPIO_IO12_CFG
GPAD_CLK equ 3 ;;gpio 99 PIN 232
GPAD_LATCH equ 0 ;;gpio 96 PIN 229
GPAD_D1 equ 1 ;;gpio 97 PIN 230
GPAD_D0 equ 2 ;;gpio 98 PIN 231
.endif
.if SPHE8202_256PIN_SHARE_32bit
;;rbhung change for 8202 share mode(gpio) 04/06/09
GPAD_PORT_CLK equ GPIO_PORT11 ;;for CLK
GPAD_PORT_LATCH equ GPIO_PORT11 ;;for LATCH
GPAD_PORT_D0_D1 equ GPIO_PORT10 ;; for D0,D1
GPAD_PORT_CFG_CLK equ GPIO_IO11_CFG
GPAD_PORT_CFG_LATCH equ GPIO_IO11_CFG
GPAD_PORT_CFG_D0_D1 equ GPIO_IO10_CFG
GPAD_CLK equ 0 ;;gpio 88 PIN 183
GPAD_LATCH equ 1 ;;gpio 89 PIN 184
GPAD_D1 equ 6 ;;gpio 86 PIN 180
GPAD_D0 equ 7 ;;gpio 87 PIN 181
.endif
.if SPHE8202_216PIN_NON_SHARE
GPAD_PORT_CLK equ GPIO_PORT1 ;;for CLK
GPAD_PORT_LATCH equ GPIO_PORT1 ;;for LATCH
GPAD_PORT_D0_D1 equ GPIO_PORT1 ;;for D0,D1
GPAD_PORT_CFG_CLK equ GPIO_IO1_CFG
GPAD_PORT_CFG_LATCH equ GPIO_IO1_CFG
GPAD_PORT_CFG_D0_D1 equ GPIO_IO1_CFG
GPAD_CLK equ 3 ;;gpio 11 PIN 59
GPAD_LATCH equ 4 ;;gpio 12 PIN 61
GPAD_D1 equ 6 ;;gpio 14 PIN 63
GPAD_D0 equ 5 ;;gpio 13 PIN 62
.endif
.ifnz SPHE8202L_128PIN
;;wurh note:only for 8202L 16M SDRAM GAME PAD,64M SDRAM need change some port
GPAD_PORT_CLK equ GPIO_PORT3 ;;for CLK
GPAD_PORT_LATCH equ GPIO_PORT2 ;;for LATCH
GPAD_PORT_D0 equ GPIO_PORT0 ;; for D0
GPAD_PORT_D1 equ GPIO_PORT3 ;; for D1
GPAD_PORT_CFG_CLK equ GPIO_IO3_CFG
GPAD_PORT_CFG_LATCH equ GPIO_IO2_CFG
GPAD_PORT_CFG_D0 equ GPIO_IO0_CFG
GPAD_PORT_CFG_D1 equ GPIO_IO3_CFG
GPAD_CLK equ 1 ;;gpio 25 PIN 58
GPAD_LATCH equ 7 ;;gpio 23 PIN 45
GPAD_D0 equ 4 ;;gpio 21 PIN 22
GPAD_D1 equ 2 ;;gpio 4 PIN 1
.endif
.ifnz SPHE8202R_128PIN
;;wurh note:only for 8202R 64M SDRAM GAME PAD(GAME_GPIO_INTERFACE_TYPE1)
;;16M SDRAM need change D1 port(GAME_GPIO_INTERFACE_TYPE2)
GPAD_PORT_CLK equ GPIO_PORT2 ;;for CLK
GPAD_PORT_LATCH equ GPIO_PORT2 ;;for LATCH
GPAD_PORT_D0 equ GPIO_PORT3 ;; for D0
GPAD_PORT_D1 equ GPIO_PORT3 ;; for D1
GPAD_PORT_CFG_CLK equ GPIO_IO2_CFG
GPAD_PORT_CFG_LATCH equ GPIO_IO2_CFG
GPAD_PORT_CFG_D0 equ GPIO_IO3_CFG
GPAD_PORT_CFG_D1 equ GPIO_IO3_CFG
GPAD_CLK equ 5 ;;gpio 21 PIN 9
GPAD_LATCH equ 4 ;;gpio 20 PIN 8
GPAD_D0 equ 5 ;;gpio 29 PIN 52
GPAD_D1 equ 2 ;;gpio 10 PIN 123
.endif
.if SPHE8200
;;ljd change for 28.29.31.70(gpio) 03/09/17
GPAD_PORT_CLK equ GPIO_PORT0 ;;for CLK
GPAD_PORT_LATCH equ GPIO_PORT4 ;;for LATCH
GPAD_PORT_D0_D1 equ GPIO_PORT0 ;; for D0,D1
GPAD_PORT_CFG_CLK equ GPIO_IO0_CFG
GPAD_PORT_CFG_LATCH equ GPIO_IO4_CFG
GPAD_PORT_CFG_D0_D1 equ GPIO_IO0_CFG
GPAD_CFG_CLK equ %00010000
GPAD_CFG_LATCH equ %00001000
GPAD_CFG_D0_D1 equ %11110011
GPAD_CLK equ 4 ;;gpio 4 PIN 31
GPAD_LATCH equ 3 ;;gpio 3 PIN 70
GPAD_D1 equ 3 ;;gpio 3 PIN 29
GPAD_D0 equ 2 ;;gpio 2 PIN 28
.endif
;;*********************************
;;IR_IN
;;*********************************
.if SPHE8202
.ifnz SPHE8202L_128PIN
IR_PORT equ GPIO_PORT1
IR_PORT_CFG equ GPIO_IO1_CFG
IR_IN equ %00000010 ;;gpio 9
IR_IN_bit equ 1
.else
.ifnz SPHE8202R_128PIN
IR_PORT equ GPIO_PORT2
IR_PORT_CFG equ GPIO_IO2_CFG
IR_IN equ %00001000 ;;gpio 19
IR_IN_bit equ 3
.else
IR_PORT equ GPIO_PORT2
IR_PORT_CFG equ GPIO_IO2_CFG
IR_IN equ %00010000 ;;gpio 20
IR_IN_bit equ 4
.endif
.endif
.endif
.if SPHE8200
IR_PORT equ GPIO_PORT6
IR_PORT_CFG equ GPIO_IO6_CFG
IR_IN equ %00100000 ;;gpio 56
IR_IN_bit equ 5
.endif
IR_READY equ %10000000
IR_REPEAT equ %01000000
IR_REPLACE equ %00100000
;;IR process state
IR_CHK_HEAD equ 0
IR_CHK_OFF equ 1
IR_CHK_ADDR_DAT equ 2
;;NEC IR bit keep length
IR_MAX_TWO_DATA_LEN equ (9+2) ;;=108ms/12ms
IR_MAX_PULSE_LEN equ (10000*12)/1120 ;;12 ms
IR_HEAD_PULSE_LEN equ (9000*8)/1120 ;;72 ms
IR_OFF_PULSE_LEN equ (4500*8)/1120 ;;40 ms
IR_REP_PULSE_LEN equ (2500*8)/1120 ;;20 ms
IR_LOW_PULSE equ 3 ;;560us
IR_HI_PULSE equ 10 ;;1680us
;;PHILIPS
IR1_MAX_TWO_DATA_LEN equ (50+3) ;;=108ms/2.128ms
IR1_MAX_PULSE_LEN equ (16+3) ;;+ 3*112us
IR1_PULSE_LEN_MAX equ (8+3) ;;+ 3*112us
IR1_PULSE_LEN equ (8+3) ;;+ 3*112us
IR1_PULSE_LEN_MIN equ (8-3) ;;+ 3*112us
;;THOMSON
.ifnz IR_THOMSON
IR_MARK_STATE equ 1
IR_SPACE_STATE equ 2
IR_SYNC_STATE equ 3
IR_BIT01_STATE equ 4
BEGIN_FROM_HEAD equ 5
.endif
;;M50560
.ifnz IR_M50560
BEGIN_FROM_HEAD equ 1
IR_MARK_STATE equ 2
IR_SPACE_STATE equ 3
IR_SYNC_STATE equ 4
IR_BIT01_STATE equ 5
IR_4MSLOW_STATE equ 6
.endif
;;IR_AS1213
.ifnz IR_AS1213
BEGIN_FROM_HEAD equ 1
IR_MARK_STATE equ 2
IR_SPACE_STATE equ 3
IR_SYNC_STATE equ 4
IR_BIT01_STATE equ 5
IR_REPEAT_STATE equ 6
.endif
;;IR_M3004
.ifnz IR_M3004
IR_IDLE_STATE equ 0
IR_HIGH_STATE equ 1
IR_LOW_STATE equ 2
BIT_1_TOP equ (80*1000)/400
BIT_1_BOTTOM equ (70*1000)/400
BIT_0_TOP equ (55*1000)/400
BIT_0_BOTTOM equ (45*1000)/400
.endif
;;IR_KONKA
.ifnz IR_KONKA
STATE_IDLE equ 0
STATE_3MS_LOW equ 1
STATE_3MS_HIGH equ 2
STATE_0_5MS_LOW equ 3
STATE_BIT01 equ 4
MASK_LEN equ 23
SPACE_LEN equ 23
SYNC_LEN equ 4
BIT0_LEN equ 11
BIT1_LEN equ 20
REPEAT_LEN equ 255
.endif
;;IR_TDP101
.ifnz IR_TDP101
STATE_IDLE equ 0 ;; idle state
STATE_PRE_CODE_1 equ 1 ;; 4.22ms low
STATE_PRE_CODE_2 equ 2 ;; 2.11ms high
STATE_PRE_CODE_3 equ 3 ;; 2.11ms low
STATE_PRE_CODE_4 equ 4 ;; 4.22ms high
STATE_BIT_LOW equ 5 ;; 0.5275ms low
STATE_BIT_HIGH equ 6 ;; 0.527ms/1.5825 high
;;------------------------------------------------------------------------------------
LEN_PRE_CODE_1 equ 30 ;; 4.22ms /0.112ms
LEN_PRE_CODE_2 equ 14 ;; 2.11ms /0.112ms
LEN_PRE_CODE_3 equ 14 ;; 2.11ms /0.112ms
LEN_PRE_CODE_4 equ 30 ;; 4.22ms /0.112ms
LEN_REPEAT equ 14 ;; 2.11ms /0.112ms
LEN_BIT_LOW equ 2 ;; 0.5275ms/0.112ms
LEN_BIT_IS_1 equ 10 ;; 1.5825 /0.112ms
LEN_BIT_IS_0 equ 2 ;; 0.527ms/0.112ms
LEN_SEPARATE equ 140 ;; 16.88ms/0.112ms
.endif
;;==============================================================================
.ifnz PCA9564
;;==============================================================================
PCA9564_WR_bit equ 3 ;;GPIO 35 (8202 256PIN)
PCA9564_RD_bit equ 4 ;;GPIO 36 (8202 256PIN)
PCA9564_CE_bit equ 5 ;;GPIO 37 (8202 256PIN)
PCA9564_A0_bit equ 0 ;;GPIO 32 (8202 256PIN)
PCA9564_A1_bit equ 1 ;;GPIO 33 (8202 256PIN)
PCA9564_INT_bit equ 0 ;;GPIO 48 (8202 256PIN)
PCA9564_RESET_bit equ 1 ;;GPIO 49 (8202 256PIN)
;;==============================================================================
PCA9564_WR_CFG equ GPIO_IO4_CFG
PCA9564_RD_CFG equ GPIO_IO4_CFG
PCA9564_CE_CFG equ GPIO_IO4_CFG
PCA9564_A0_CFG equ GPIO_IO4_CFG
PCA9564_A1_CFG equ GPIO_IO4_CFG
PCA9564_INT_CFG equ GPIO_IO6_CFG
PCA9564_RESET_CFG equ GPIO_IO6_CFG
PCA9564_DATA_CFG equ GPIO_IO5_CFG
;;==============================================================================
PCA9564_WR_PORT equ GPIO_PORT4
PCA9564_RD_PORT equ GPIO_PORT4
PCA9564_CE_PORT equ GPIO_PORT4
PCA9564_A0_PORT equ GPIO_PORT4
PCA9564_A1_PORT equ GPIO_PORT4
PCA9564_INT_PORT equ GPIO_PORT6
PCA9564_RESET_PORT equ GPIO_PORT6
PCA9564_DATA_PORT equ GPIO_PORT5
;;==============================================================================
PCA9564_beginning_state equ 0
PCA9564_continue_Receive_data_state equ 1
PCA9564_Receive_Judge_SI_state equ 2
PCA9564_continue_Transmit_data_state equ 3
PCA9564_Transmit_Judge_SI_state equ 4
MAX_RX_BUF_LEN equ 64
MAX_TX_BUF_LEN equ 64
.endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -