diff options
author | laforge <laforge@6dc7ffe9-61d6-0310-9af1-9938baff3ed1> | 2006-10-04 17:56:57 +0000 |
---|---|---|
committer | laforge <laforge@6dc7ffe9-61d6-0310-9af1-9938baff3ed1> | 2006-10-04 17:56:57 +0000 |
commit | d1dd3611ea59cf0c61d66d124a85709573cb7f61 (patch) | |
tree | aa790487cbc82fddea41420d017814a0314e3602 /firmware/src/os/pcd_enumerate.c | |
parent | a2f768dd5faf13e770a454cda623eda068115394 (diff) |
v0.4 of the readers uses a different pin for the USB pullup
git-svn-id: https://svn.openpcd.org:2342/trunk@261 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
Diffstat (limited to 'firmware/src/os/pcd_enumerate.c')
-rw-r--r-- | firmware/src/os/pcd_enumerate.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/firmware/src/os/pcd_enumerate.c b/firmware/src/os/pcd_enumerate.c index 24b2874..f201a32 100644 --- a/firmware/src/os/pcd_enumerate.c +++ b/firmware/src/os/pcd_enumerate.c @@ -487,6 +487,18 @@ out: AT91F_AIC_ClearIt(AT91C_BASE_AIC, AT91C_ID_UDP); } +void udp_pullup_on(void) +{ + AT91F_PIO_SetOutput(AT91C_BASE_PIOA, OPENPCD_PIO_UDP_PUP); + AT91F_PIO_ClearOutput(AT91C_BASE_PIOA, OPENPCD_PIO_UDP_PUPv4); +} + +void udp_pullup_off(void) +{ + AT91F_PIO_ClearOutput(AT91C_BASE_PIOA, OPENPCD_PIO_UDP_PUP); + AT91F_PIO_SetOutput(AT91C_BASE_PIOA, OPENPCD_PIO_UDP_PUPv4); +} + /* Open USB Device Port */ void udp_open(void) { @@ -508,16 +520,18 @@ void udp_open(void) /* Set the Pull up resistor */ AT91F_PIO_SetOutput(AT91C_BASE_PIOA, OPENPCD_PIO_UDP_PUP); + AT91F_PIO_ClearOutput(AT91C_BASE_PIOA, OPENPCD_PIO_UDP_PUPv4); + udp_pullup_on(); } void udp_reset(void) { volatile int i; - AT91F_PIO_ClearOutput(AT91C_BASE_PIOA, OPENPCD_PIO_UDP_PUP); + udp_pullup_off(); for (i = 0; i < 0xffff; i++) ; - AT91F_PIO_SetOutput(AT91C_BASE_PIOA, OPENPCD_PIO_UDP_PUP); + udp_pullup_on(); } #ifdef DEBUG_UDP_EP0 |