📄 iop.inc
字号:
;;------------------------------------------------------------------
;; File Name : IOP.INC
;;
;; Description : This module contain the IO port define of functions
;;
;; Version : IOP.01.040924
;;
;; Rev Date Author(s) Status & Comments
;;-------------------------------------------------------------------
;; 2004/9/24 LIJD Updating
;;
;;-------------------------------------------------------------------
.if SPHE8202
.ifnz IOP_CLK_108
IOP_CLOCK equ 108000000
.else
.ifnz IOP_CLK_135
IOP_CLOCK equ 135000000
.else
.ifnz IOP_CLK_141_75
IOP_CLOCK equ 141750000
.else
IOP_CLOCK equ 121500000
.endif
.endif
.endif
.endif
.if SPHE8200
.ifnz IOP_CLK_114_75
IOP_CLOCK equ 114750000
.else
IOP_CLOCK equ 121500000
.endif
.endif
.ifnz (IR_M3004 + IR_ORITRON)
IR_SCAN_TIME equ (IOP_CLOCK*80/1000000)
.else
.ifnz (IR_ORITRON_5116)
IR_SCAN_TIME equ (IOP_CLOCK*40/1000000)
.else
IR_SCAN_TIME equ (IOP_CLOCK*112/1000000)
.endif
.endif
UART_TIME equ (IOP_CLOCK*3472/100000000)
.ifnz PCA9564
PCA9564_SCAN_TIME equ (IOP_CLOCK*60/1000000)
.endif
;;64 bit port; Read: Input data;
;; Write: update output data
GPIO_PORT0 equ $00
GPIO_PORT1 equ $01
GPIO_PORT2 equ $02
GPIO_PORT3 equ $03
GPIO_PORT4 equ $04
GPIO_PORT5 equ $05
GPIO_PORT6 equ $06
GPIO_PORT7 equ $07
.if SPHE8202
;;Second 64 bit port; Read: Input data;
;; Write: update output data
GPIO_PORT8 equ $28
GPIO_PORT9 equ $29
GPIO_PORT10 equ $2A
GPIO_PORT11 equ $2B
GPIO_PORT12 equ $2C
GPIO_PORT13 equ $2D
GPIO_PORT14 equ $2E
GPIO_PORT15 equ $2F
.endif
;;64 bit port for each port I/O define
;;gpio_oe[] config. 0 = input / 1 = output
GPIO_IO0_CFG equ $08
GPIO_IO1_CFG equ $09
GPIO_IO2_CFG equ $0A
GPIO_IO3_CFG equ $0B
GPIO_IO4_CFG equ $0C
GPIO_IO5_CFG equ $0D
GPIO_IO6_CFG equ $0E
GPIO_IO7_CFG equ $0F
.if SPHE8202
;;Second 64 bit port for each port I/O define
;;gpio_oe[] config. 0 = input / 1 = output
GPIO_IO8_CFG equ $30
GPIO_IO9_CFG equ $31
GPIO_IO10_CFG equ $32
GPIO_IO11_CFG equ $33
GPIO_IO12_CFG equ $34
GPIO_IO13_CFG equ $35
GPIO_IO14_CFG equ $36
GPIO_IO15_CFG equ $37
.endif
;;RISC and IOP data exchanging area
IOP_DATA0_L equ $10
IOP_DATA0_H equ $11
IOP_DATA1_L equ $12
IOP_DATA1_H equ $13
IOP_DATA2_L equ $14
IOP_DATA2_H equ $15
IOP_DATA3_L equ $16
IOP_DATA3_H equ $17
IOP_DATA4_L equ $18
IOP_DATA4_H equ $19
IOP_DATA5_L equ $1A
IOP_DATA5_H equ $1B
IOP_DATA6_L equ $1C
IOP_DATA6_H equ $1D
IOP_DATA7_L equ $1E
IOP_DATA7_H equ $1F
;;timer and interrupt
IntMask equ $20
IntFlag equ $21
TimerA_Lo equ $22
TimerA_Hi equ $23
TimerB_Lo equ $24
TimerB_Hi equ $25
;;64 bit port for gpio_out[] retriving. (read only)
GPIO_PORT0_OUT equ $30
GPIO_PORT1_OUT equ $31
GPIO_PORT2_OUT equ $32
GPIO_PORT3_OUT equ $33
GPIO_PORT4_OUT equ $34
GPIO_PORT5_OUT equ $35
GPIO_PORT6_OUT equ $36
GPIO_PORT7_OUT equ $37
;; Reset RISC area
Reset_RISC_L equ $3E
Reset_RISC_H equ $3F
INT_TIMER_B equ %00000001
INT_TIMER_A equ %00000010
INT_TIMER_B_bit equ 0
INT_TIMER_A_bit equ 1
;;*********************************
;;IOP function select
;;*********************************
FUN_MASK equ %11110000
FUN_MAIN_MASK equ %11000000
FUN_SUB_MASK equ %00110000
FUN_FREE equ %00000000
FUN_VFD_REQ_R equ %00010000
FUN_VFD_REQ_W equ %00100000
FUN_CUSTID_SET equ %01000000
FUN_CUSTID_READ equ %01010000
FUN_UART_TXD equ %01100000
FUN_I2C_WRITE equ %01110000
FUN_I2C_READ equ %10000000
FUN_GPAD_READ equ %10010000
.ifnz PMP_MCU810_DRIVER
FUN_PMP_MCU810 equ %10100000
.endif
;;*********************************
;;VFD command type
;;*********************************
VFD_CMD_MASK equ %00000011
VFD_READ equ %00000000
VFD_WRITE equ %00000001
;;VFD data size
VFD_DAT_LN_MASK equ %00000111 ;;low byte
VFD_FIRST_DATA_ADDR equ %00001111
;;*********************************
;;UART interface
;;*********************************
UART_PORT equ GPIO_PORT3
UART_PORT_CFG equ GPIO_IO3_CFG
UART_TXD_OUT equ %00000100
UART_TXD_BIT equ %00000100 ;;gpio 26
UART_RXD_BIT equ %00001000 ;;gpio 27
UART_TXD_bit equ 2
UART_RXD_bit equ 3
;;*********************************
;;VFD port define
;;*********************************
.if SPHE8202
.ifnz SPHE8202L_128PIN
VFD_PORT equ GPIO_PORT1
VFD_DATA_PORT equ GPIO_PORT1
VFD_PORT_CFG equ GPIO_IO1_CFG
VFD_DATA_PORT_CFG equ GPIO_IO1_CFG
.else
.ifnz SPHE8202R_128PIN
VFD_PORT equ GPIO_PORT2
VFD_DATA_PORT equ GPIO_PORT2
VFD_PORT_CFG equ GPIO_IO2_CFG
VFD_DATA_PORT_CFG equ GPIO_IO2_CFG
.else
VFD_PORT equ GPIO_PORT2
VFD_DATA_PORT equ GPIO_PORT2
VFD_PORT_CFG equ GPIO_IO2_CFG
VFD_DATA_PORT_CFG equ GPIO_IO2_CFG
.endif
.endif
.endif
.if SPHE8200
VFD_PORT equ GPIO_PORT6
VFD_PORT_CFG equ GPIO_IO6_CFG
VFD_DATA_PORT equ GPIO_PORT7
VFD_DATA_IN_PORT equ GPIO_PORT0
VFD_DATA_PORT_CFG equ GPIO_IO7_CFG
VFD_DATA_IN_PORT_CFG equ GPIO_IO0_CFG
.endif
.if SPHE8202
.ifnz SPHE8202L_128PIN
VFD_DATA equ %00010000 ;;gpio 12
VFD_STB equ %00001000 ;;gpio 11
VFD_CLK equ %00000100 ;;gpio 10
.else
.ifnz SPHE8202R_128PIN
VFD_DATA equ %00000100 ;;gpio 18
VFD_STB equ %00000010 ;;gpio 17
VFD_CLK equ %00000001 ;;gpio 16
.else
VFD_DATA equ %10000000 ;;gpio 23
VFD_STB equ %01000000 ;;gpio 22
VFD_CLK equ %00100000 ;;gpio 21
.endif
.endif
.endif
.if SPHE8200
VFD_DATA equ %00000001 ;;gpio 56
VFD_STB equ %10000000 ;;gpio 55
VFD_CLK equ %01000000 ;;gpio 54
.endif
.ifnz SPHE8202
.ifnz SPHE8202L_128PIN
VFD_DATA_bit equ 4
VFD_STB_bit equ 3
VFD_CLK_bit equ 2
.else
.ifnz SPHE8202R_128PIN
VFD_DATA_bit equ 2
VFD_STB_bit equ 1
VFD_CLK_bit equ 0
.else
VFD_DATA_bit equ 7
VFD_STB_bit equ 6
VFD_CLK_bit equ 5
.endif
.endif
.endif
.if SPHE8200
VFD_DATA_bit equ 0
VFD_DATA_IN_bit equ 2
VFD_STB_bit equ 7
VFD_CLK_bit equ 6
.endif
;;*********************************
;;I2C interface
;;*********************************
.ifnz OLD_I2C_DEFINE
I2C_PORT equ GPIO_PORT4
I2C_PORT_CFG equ GPIO_IO4_CFG
I2C_SDA equ %00010000 ;;gpio 36
I2C_SCL equ %00001000 ;;gpio 35
I2C_SDA_bit equ 4 ;;gpio 36
I2C_SCL_bit equ 3 ;;gpio 35
.endif
.ifnz PMP_MCU810_DRIVER
I2C_SDA_PORT equ GPIO_PORT0
I2C_SDA_PORT_CFG equ GPIO_IO0_CFG
I2C_SCL_PORT equ GPIO_PORT0
I2C_SCL_PORT_CFG equ GPIO_IO0_CFG
I2C_SDA equ %00100000 ;;gpio 5 pin62
I2C_SCL equ %01000000 ;;gpio 6 pin63
I2C_SDA_bit equ 5 ;;gpio 5 pin62
I2C_SCL_bit equ 6 ;;gpio 6 pin63
.endif
.ifnz (SPHE8202_256PIN_NON_SHARE_32bit+SPHE8202_256PIN_SHARE_32bit)
I2C_PORT equ GPIO_PORT6
I2C_PORT_CFG equ GPIO_IO6_CFG
I2C_SDA equ %00000010 ;;gpio 49
I2C_SCL equ %00000001 ;;gpio 48
I2C_SDA_bit equ 1 ;;gpio 49
I2C_SCL_bit equ 0 ;;gpio 48
.endif
.if SPHE8202_256PIN_NON_SHARE_16bit
I2C_SDA_PORT equ GPIO_PORT12
I2C_SDA_PORT_CFG equ GPIO_IO12_CFG
I2C_SCL_PORT equ GPIO_PORT11
I2C_SCL_PORT_CFG equ GPIO_IO11_CFG
I2C_SDA equ %00000001 ;;gpio 96
I2C_SCL equ %10000000 ;;gpio 95
I2C_SDA_bit equ 0 ;;gpio 96
I2C_SCL_bit equ 7 ;;gpio 95
.endif
.if SPHE8202_216PIN_NON_SHARE
I2C_PORT equ GPIO_PORT2
I2C_PORT_CFG equ GPIO_IO2_CFG
I2C_SCL equ %00000010 ;;gpio 17
I2C_SDA equ %00000100 ;;gpio 18
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -