[En-Nut-Discussion] SAM7x Basic USB example

Uwe Bonnes bon at elektron.ikp.physik.tu-darmstadt.de
Sat Sep 16 15:37:37 CEST 2006


Hello,

Martin THOMAS publised a basic usb example (no interrupt) for the SAM7S on
http://www.siwawi.arubi.uni-kl.de/avr_projects/arm_projects/index_at91.html#at91_usb1 
It's obviosly based on the source code for the sam-ba bootloader, published
by Atmel. I have it running as an ethernut example with very few changes,
and have a half-hearted include/arch/arm/at91_udp.h file. Only some few 
meta comments, but somehow in ethernut register way, like:

#define AT91C_BASE_UDP UDP_BASE
/*! \name (UDP) Frame Number Register */
/*@{*/
#define UDP_NUM_OFF 0
#define AT91C_UDP_NUM   (UDP_BASE + UDP_NUM_OFF)
#define AT91C_UDP_FRM_NUM     ((unsigned int) 0x7FF <<  0) /*!< \brief (UDP)\
Frame Number as Defined in the Packet Field Formats */
#define AT91C_UDP_FRM_ERR     ((unsigned int) 0x1 << 16)  /*!< \brief (UDP)\
Frame Error */
#define AT91C_UDP_FRM_OK      ((unsigned int) 0x1 << 17)  /*!< \brief (UDP)\
Frame OK */
/*@}*/
...

The AT91C_ prefix is still needed, to avoid a nameclash with the register
pointer usage in the given sources.

The app is running on my Olimex SAM7-EX256 board.
Is this of interest for the apps directory? What should be changed.
There are more sources out there that could easily be integrates with Sam7
headers using the register pointer definition way.

Cheers
-- 
Uwe Bonnes                bon at elektron.ikp.physik.tu-darmstadt.de

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------



More information about the En-Nut-Discussion mailing list