Atmel AT91 Specifications

Browse online or download Specifications for Network switches Atmel AT91. Atmel AT91 Specifications User Manual

  • Download
  • Add to my manuals
  • Print
  • Page
    / 23
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 0
AT91 USB Framework
1. Introduction
This document describes a device-side USB framework developed for Atmel
®
AT91
ARM
®
Thumb
®
based microcontrollers. It enables rapid development of USB-compli-
ant class drivers such as the Mass Storage Device class (MSD) or the Communication
Device Class (CDC).
Most microcontrollers of the AT91 family embed a USB controller. However, since
there are several different controllers used in the devices, the framework provides a
hardware layer abstraction. This means that an application relying on this framework
can be easily ported to any AT91 device.
Finally, the presented framework has been carefully designed to be easily integrable
into an Operating System (OS), as well as to operate in a stand-alone way.
2. Framework Architecture
The following three-tiered structure is used:
•A hardware layer which performs low-level operations on the USB controller
•The USB API offers hardware-independent methods and structures
•The application layer, made up of a USB class driver and the user application
The framework includes the USB API and the hardware layer as well as a standard
requests handler. The application layer is built on top of that to provide the device
functionality.
To do so, there must be some form of communication between the USB API and the
application layer. This is carried out by using callbacks. Callbacks are functions
which are automatically called by the USB API to perform specific operations, such as
putting the device in low-power mode or handling class requests sent by the host. The
callback API is defined more thoroughly in Section 3.4 on page 8.
Figure 2-1. USB Framework Architecture
Note: Components in gray are part of the framework.
Specific
USB class driver
User application
USB API
Hardware layer
UDP Controller
CallbacksMethods
Events
Standard
6263A–ATARM–10-Oct-06
AT91 ARM
Thumb
Microcontrollers
Application Note
Page view 0
1 2 3 4 5 6 ... 22 23

Summary of Contents

Page 1 - Application Note

AT91 USB Framework1. IntroductionThis document describes a device-side USB framework developed for Atmel® AT91ARM® Thumb® based microcontrollers. It e

Page 2

106263A–ATARM–10-Oct-06Application NoteIf a PIO pin is connected to VBus, it is possible to monitor it by configuring the pin as an inputand enabling

Page 3

116263A–ATARM–10-Oct-06Application NoteBecause the start-of-frame interrupt puts some stress on the processor (since it is called a lot), itis only ac

Page 4

126263A–ATARM–10-Oct-06Application Note3.5.1.4 Clear Feature, Set Feature & Get StatusSeveral features of a device can either be activated or deac

Page 5

136263A–ATARM–10-Oct-06Application Notecore_usb.h: USB API definitionscore_udp.c: UDP controller driver methodsMakefile: makefile used to build the pr

Page 6

146263A–ATARM–10-Oct-06Application Note– Possible values: YES, NO.– Default: NO.•LEDS– Optional, enables the program to use the board LEDs to signal d

Page 7

156263A–ATARM–10-Oct-06Application NoteEndpoints can be configured to have a specific number of FIFO banks (depending on the USBcontroller peripheral)

Page 8

166263A–ATARM–10-Oct-06Application Note// USB instancestatic const S_usb sUsb = { &sDefaultDriver, pEndpoints, 1, &sCallbacks,

Page 9

176263A–ATARM–10-Oct-06Application Note5.2.2.2 Configuration & Interface DescriptorsWhen the configuration descriptor is requested by the host, vi

Page 10

186263A–ATARM–10-Oct-06Application NoteAgain, those are very generic values. For the interface descriptor, most of them are zeroed. Thisis because thi

Page 11

196263A–ATARM–10-Oct-06Application Note(char *) &sLanguageID,pManufacturer,pProduct,pSerial};The actual descriptors list can then be instantiated:

Page 12

26263A–ATARM–10-Oct-06Application Note3. Framework DescriptionThe framework is comprised of several components:• Standard USB structures• USB API–Stru

Page 13

206263A–ATARM–10-Oct-06Application Notedo that, an interrupt must be programmed when the status of VBus changes. The ISR shouldcall the USB_Attach fun

Page 14

216263A–ATARM–10-Oct-06Application Note5.4.2 Suspend & ResumeThe Suspend callback is used by the USB API to notify the device that it should enter

Page 15

226263A–ATARM–10-Oct-06Application Note6. Revision HistoryTable 6-1.Document Ref. CommentsChange Request Ref.6263 First issue

Page 16

Disclaimer: The information in this document is provided in connection with Atmel products. No license, express or implied, by estoppel or otherwise,

Page 17

36263A–ATARM–10-Oct-06Application NoteA pointer to an S_usb instance is needed to use all of the USB API methods. This pointer ispassed as an argument

Page 18

46263A–ATARM–10-Oct-06Application Note• Reset• Suspend• Resume• NewRequest•StartOfFrameBe sure to use the same order when declaring the S_usb_callback

Page 19

56263A–ATARM–10-Oct-06Application NoteThis function triggers the Resume and the Suspend callbacks upon attachment/detachment.Those callbacks are used

Page 20

66263A–ATARM–10-Oct-06Application Note3.3.1.7 Device State DiagramFigure 3-1 is the device state diagram (refer to chapter 9 of the USB specification

Page 21

76263A–ATARM–10-Oct-06Application Note• Resume, when the bus becomes active again• Reset, when an end-of-bus reset is detected• NewRequest, when a set

Page 22

86263A–ATARM–10-Oct-06Application NoteThis function handles double-buffering, if it is supported by the USB controller and if it hasbeen enabled for t

Page 23 - Regional Headquarters

96263A–ATARM–10-Oct-06Application NoteFigure 3-2. Callback Invocation Flowchart3.4.2 InitThe Init callback is invoked when the USB_Init method is call

Comments to this Manuals

No comments