diff options
author | Bernd Porr <mail@berndporr.me.uk> | 2015-07-22 09:27:34 +0100 |
---|---|---|
committer | Kyle McMartin <kyle@kernel.org> | 2015-07-22 13:40:47 -0400 |
commit | 09852eab3e84ccea03541980b7610367accff643 (patch) | |
tree | e552fdaff3ba983e00b5627af2d888331a24ca43 | |
parent | 22e3407bda1bcc4ce0317b14cd75add80b3f41a4 (diff) |
usbdux: usbduxsigma: added digital IO read
for future driver versions I've added a digtial I/O read via
endpoint in1. This is not yet used but might be used in the
future for low latency IO reads if all ports are input ports
and thus the write could be omitted.
Signed-off-by: Bernd Porr <mail@berndporr.me.uk>
Signed-off-by: Kyle McMartin <kyle@kernel.org>
-rw-r--r-- | usbdux/usbduxsigma_firmware.asm | 52 |
1 files changed, 47 insertions, 5 deletions
diff --git a/usbdux/usbduxsigma_firmware.asm b/usbdux/usbduxsigma_firmware.asm index 90998a0b..0bdadc2f 100644 --- a/usbdux/usbduxsigma_firmware.asm +++ b/usbdux/usbduxsigma_firmware.asm @@ -20,8 +20,8 @@ ; Firmware: usbduxsigma_firmware.asm for usbduxsigma.c ; Description: University of Stirling USB DAQ & INCITE Technology Limited ; Devices: [ITL] USB-DUX-SIGMA (usbduxsigma.ko) -; Author: Bernd Porr <Bernd.Porr@f2s.com> -; Updated: 19 Jul 2015 +; Author: Bernd Porr <mail@berndporr.me.uk> +; Updated: 20 Jul 2015 ; Status: testing ; ;;; @@ -129,7 +129,6 @@ ep0ack_isr: spare_isr: ep0in_isr: ep0out_isr: -ep1in_isr: ibn_isr: ep0ping_isr: ep1ping_isr: @@ -169,6 +168,49 @@ ep4_isr: reti + +ep1in_isr: + push dps + push dpl + push dph + push dpl1 + push dph1 + push acc + push psw + + mov dptr,#0E7C0h ; EP1in + mov a,IOB ; get DIO D + movx @dptr,a ; store it + inc dptr ; next byte + mov a,IOC ; get DIO C + movx @dptr,a ; store it + inc dptr ; next byte + mov a,IOD ; get DIO B + movx @dptr,a ; store it + inc dptr ; next byte + mov a,#0 ; just zero + movx @dptr,a ; pad it up + + ;; clear INT2 + mov a,EXIF ; FIRST clear the USB (INT2) interrupt request + clr acc.4 + mov EXIF,a ; Note: EXIF reg is not 8051 bit-addressable + + mov DPTR,#EPIRQ ; + mov a,#00000100b ; clear the ep1in + movx @DPTR,a + + pop psw + pop acc + pop dph1 + pop dpl1 + pop dph + pop dpl + pop dps + reti + + + ;;; this is triggered when DRY goes low isr0: push dps @@ -476,11 +518,11 @@ initeps: ;; enable interrupts mov dptr,#EPIE ; interrupt enable - mov a,#10001000b ; enable irq for ep1out,8 + mov a,#10001100b ; enable irq for ep1out,8,ep1in movx @dptr,a ; do it mov dptr,#EPIRQ ; clear IRQs - mov a,#10001000b + mov a,#10001100b movx @dptr,a mov DPTR,#USBIE ; USB int enables register |