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

📄 suspend.asm

📁 该程序为USB HUB程序
💻 ASM
字号:
IFDEF   AnyKB
;-------------------------------------------------------------------------
;   To make it work, GPIO enable must be followed.
;-------------------------------------------------------------------------
SuspendProcess:

    push   A
    
    clr_flag FLAG_GPIO              ;clear the GPIO flag
    
    mov     A, 0                    ; pull down the column lines
    iowr    REG_PORT_0
    iowr    REG_PORT_1

IFDEF   PS2KB    
    mov     A,[dual_ifc_keyboard]   ; check keyboard type
    cmp     A, PS2_KEYBOARD
    mov     A,[ksc_p3out] 
    jz      .PS2KB
ENDIF
    
.USBKB:    
    or      A, P3_LED_MASK          ; Turn off the LEDs

.PS2KB:
    iowr    REG_PORT_3               ;write it back

.KB_RemoteWakeup:
	mov     A, FFh
	iowr    Port2_Interrupt		    ; enable port 2 GPIO interrupt for keyboard

    pop     A
    RET
    
ENDIF

IFDEF   AnyKB
;-------------------------------------------------------------------------
;   To make it work, GPIO enable must be disabled.
;-------------------------------------------------------------------------
WakeupProcess:

    push   A
    
	mov     A, 00h
	iowr    Port2_Interrupt		    ; enable port 2 GPIO interrupt for keyboard

    pop     A
    RET
    
ENDIF
;-------------------------------------------------------------------------
;   GPIO ISR
;-------------------------------------------------------------------------
GPIOint:
    PUSH    A
    set_flag FLAG_GPIO              ; Set this flag to let micro know
    POP     A                       ; that GPIO interrupt was occurred.
    RETI

⌨️ 快捷键说明

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