This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Re: USB on the AT91SAM7S
- From: Andrew Lunn <andrew at lunn dot ch>
- To: Frank Pagliughi <fpagliughi at mindspring dot com>
- Cc: ecos-discuss at ecos dot sourceware dot org
- Date: Mon, 3 Mar 2008 15:35:52 +0100
- Subject: Re: [ECOS] USB on the AT91SAM7S
- References: <47C82063.8060608@mindspring.com> <20080229153244.GA17619@lunn.ch> <47C83044.9000008@mindspring.com> <47CC0883.1030204@mindspring.com>
> Ah, so since they're binary compatible, the driver just overlays a
> 'usbs_tx_endpoint' over one of the defined 'usbs_rx_endpoint'
> structures? So, say, if you define EP2 as IN (tx) then you can just cast
> the struct like this:
>
> usbs_tx_endpoint* tx_ep = (usbs_tx_endpoint*) &usbs_at91_ep2;
>
> Is this correct?
It is a while since i used this code. What i have in my protocol
driver package is:
extern usbs_control_endpoint CYGDAT_IO_USB_RUP_EP0_STRUCT;
extern usbs_rx_endpoint CYGDAT_IO_USB_RUP_OUT_EP_STRUCT;
extern usbs_tx_endpoint CYGDAT_IO_USB_RUP_IN_EP_STRUCT;
Where CYGDAT_IO_USB_RUP_*_STRUCT are defined in my CDL for this
package. They default to usbs_at91_ep0, usbs_at91_ep1, usbs_at91_ep2
etc, but if i wanted to run this over a different USB device i can
just change the values of the CDL variables.
What you suggest should also work for the AT91.
Andrew
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss