;**************************************************************************** ; ; file: dvk_hardware.asm ; Description: This file contains DVK specific hardware functionality ; such as reading the bind button AND controlling LEDs ; External Functions: ; check_for_bind ; connected_leds ; ping_leds ; bind_leds ; idle_leds ; ; Target: Cypress CY7C63723/CY7C63743 Encore Chips ; $Header: g:/archives/Projects/LS DVK P2/Dongle/Two Way/dvk_hardware.asm ; Version: 1.3.0000 ; ;**************************************************************************** ; Copyright (2003), Cypress Semiconductor Corporation ; This software is owned by Cypress Semiconductor Corporation (Cypress) and is ; protected by United States copyright laws and international treaty provisions. ; Cypress hereby grants to Licensee a personal, non-exclusive, non-transferable ; license to copy, use, modify, create derivative works of, and compile the ; Cypress Source Code and derivative works for the sole purpose of creating ; custom software in support of Licensee product ("Licensee Product") to be used ; only in conjunction with a Cypress integrated circuit. Any reproduction, ; modification, translation, compilation, or representation of this software ; except as specified above is prohibited without the express written permission ; of Cypress. ; Disclaimer: Cypress makes no warranty of any kind, express or implied, with ; regard to this material, including, but not limited to, the implied warranties ; of merchantability and fitness for a particular purpose. Cypress reserves the ; right to make changes without further notice to the materials described herein. ; Cypress does not assume any liability arising out of the application or use of ; any product or circuit described herein. Cypress’ products described herein are ; not authorized for use as components in life-support devices. ; This software is protected by and subject to worldwide patent coverage, ; including U.S. and foreign patents. Use may be limited by and subject to the ; Cypress Software License Agreement. ; ;**************************************************************************** ;------------------------------------------------------- ; check_for_bind ;------------------------------------------------------- check_for_bind: IORD port2 AND A, BIND_BUTTON JZ check_button_up ; button is up CMP A, [button_pushed] JNZ check_button_up ; button is down, but was up last time MOV A, 00h ; button is down, but was down last time so say it is up RET check_button_up: MOV [button_pushed], A check_for_bind_complete: RET ;------------------------------------------------------- ; LEDS ; ; Controls the two LEDs on PDC-9075 AND PDC-9168 ; ; PDC-9168 is part of the LS HID RDK ;------------------------------------------------------- ; D2 (PDC-9168) OR D5 (PDC-9075) ON connected_leds: MOV X, 1 MOV A, [led_timer] CMP A, f0h JNC leds_data_off clr_port_0 nDATA_LED JMP leds_data_on IFDEF BIND_SEMI ; D2 (PDC-9168) OR D5 (PDC-9075) flash rapidly bind_leds: MOV A, [led_timer2] AND A, 01h MOV X, A MOV A, [led_timer] CMP A, f0h JNC leds_data_off clr_port_0 nDATA_LED JMP leds_data_on ENDIF ; BIND_SEMI IFDEF BIND_AUTO ; D2 (PDC-9168) OR D5 (PDC-9075) flash rapidly bind_leds: MOV A, [led_timer2] AND A, 01h MOV X, A JMP leds_data_off ; D2 (PDC-9168) OR D5 (PDC-9075) flash slowly idle_leds: MOV A, [led_timer2] AND A, 10h MOV X, A JMP leds_data_; Both LEDs off ; D2 (PDC-9168) OR D5 (PDC-9075) OFF ping_leds: set_port_0 nDATA_LED set_port_1 nBIND_LED MOV X, 0RET clr_port_0 nDATA_LED JMP leds_data_on ENDIF ; BIND_AUTO leds_data_off: set_port_0 nDATA_LED leds_data_on: INC [led_timer2] MOV A, X AND A, ffh JZ led_bind_off clr_port_1 nBIND_LED RET led_bind_off: set_port_1 nBIND_LED RET