📄 usbd_otghs.lst
字号:
###############################################################################
# #
# 18/Jul/2008 11:37:59 #
# IAR ARM ANSI C/C++ Compiler V5.11.0.20622/W32 EVALUATION #
# Copyright 1999-2007 IAR Systems. All rights reserved. #
# #
# Cpu mode = arm #
# Endian = little #
# Source file = D:\rock\atarm\at91sam7se\software\usb-device-core-projec #
# t-1.3-iar5-at91sam7se-ek\at91lib\usb\device\core\USBD_OT #
# GHS.c #
# Command line = D:\rock\atarm\at91sam7se\software\usb-device-core-projec #
# t-1.3-iar5-at91sam7se-ek\at91lib\usb\device\core\USBD_OT #
# GHS.c -D at91sam7se512 -lC D:\rock\atarm\at91sam7se\soft #
# ware\usb-device-core-project-1.3-iar5-at91sam7se-ek\at91 #
# sam7se-ek\usb-device-core-project\ewp\at91sam7se512_sdra #
# m\List\ --remarks -o D:\rock\atarm\at91sam7se\software\u #
# sb-device-core-project-1.3-iar5-at91sam7se-ek\at91sam7se #
# -ek\usb-device-core-project\ewp\at91sam7se512_sdram\Obj\ #
# --no_cse --no_unroll --no_inline --no_code_motion #
# --no_tbaa --no_clustering --no_scheduling --debug #
# --endian little --cpu ARM7TDMI -e --fpu None #
# --dlib_config "D:\Program Files\IAR Systems\Embedded #
# Workbench 5.0 Evaluation\ARM\INC\DLib_Config_Full.h" -I #
# D:\rock\atarm\at91sam7se\software\usb-device-core-projec #
# t-1.3-iar5-at91sam7se-ek\at91sam7se-ek\usb-device-core-p #
# roject\ewp\..\..\..\at91lib\ -I #
# D:\rock\atarm\at91sam7se\software\usb-device-core-projec #
# t-1.3-iar5-at91sam7se-ek\at91sam7se-ek\usb-device-core-p #
# roject\ewp\..\..\..\at91lib\boards\at91sam7se-ek\ -I #
# D:\rock\atarm\at91sam7se\software\usb-device-core-projec #
# t-1.3-iar5-at91sam7se-ek\at91sam7se-ek\usb-device-core-p #
# roject\ewp\..\..\..\at91lib\peripherals\ -I #
# D:\rock\atarm\at91sam7se\software\usb-device-core-projec #
# t-1.3-iar5-at91sam7se-ek\at91sam7se-ek\usb-device-core-p #
# roject\ewp\..\..\..\at91lib\components\ -I #
# D:\rock\atarm\at91sam7se\software\usb-device-core-projec #
# t-1.3-iar5-at91sam7se-ek\at91sam7se-ek\usb-device-core-p #
# roject\ewp\..\..\..\at91lib\usb\ -I "D:\Program #
# Files\IAR Systems\Embedded Workbench 5.0 #
# Evaluation\ARM\INC\" --interwork --cpu_mode arm -On #
# List file = D:\rock\atarm\at91sam7se\software\usb-device-core-projec #
# t-1.3-iar5-at91sam7se-ek\at91sam7se-ek\usb-device-core-p #
# roject\ewp\at91sam7se512_sdram\List\USBD_OTGHS.lst #
# Object file = D:\rock\atarm\at91sam7se\software\usb-device-core-projec #
# t-1.3-iar5-at91sam7se-ek\at91sam7se-ek\usb-device-core-p #
# roject\ewp\at91sam7se512_sdram\Obj\USBD_OTGHS.o #
# #
# #
###############################################################################
D:\rock\atarm\at91sam7se\software\usb-device-core-project-1.3-iar5-at91sam7se-ek\at91lib\usb\device\core\USBD_OTGHS.c
1 /* ----------------------------------------------------------------------------
2 * ATMEL Microcontroller Software Support - ROUSSET -
3 * ----------------------------------------------------------------------------
4 * Copyright (c) 2006, Atmel Corporation
5
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions are met:
10 *
11 * - Redistributions of source code must retain the above copyright notice,
12 * this list of conditions and the disclaiimer below.
13 *
14 * - Redistributions in binary form must reproduce the above copyright notice,
15 * this list of conditions and the disclaimer below in the documentation and/or
16 * other materials provided with the distribution.
17 *
18 * Atmel's name may not be used to endorse or promote products derived from
19 * this software without specific prior written permission.
20 *
21 * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
22 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
23 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
24 * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
25 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
27 * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
28 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
29 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 * ----------------------------------------------------------------------------
32 */
33
34 /*!
35 Functions for OTGHS peripheral usage.
36 */
37
38 //------------------------------------------------------------------------------
39 // Headers
40 //------------------------------------------------------------------------------
41
42 #include <board.h>
43
44 #ifdef CHIP_OTGHS
45
46 #include "common.h"
47 #include "trace.h"
48 #include "usb.h"
49
50 //------------------------------------------------------------------------------
51 // Definitions
52 //------------------------------------------------------------------------------
53
54 #define NUM_IT_MAX (AT91C_BASE_OTGHS->OTGHS_IPFEATURES & AT91C_OTGHS_EPT_NBR_MAX)
55 #define NUM_IT_MAX_DMA ((AT91C_BASE_OTGHS->OTGHS_IPFEATURES & AT91C_OTGHS_DMA_CHANNEL_NBR)>>4)
56
57 #define SHIFT_DMA 24
58 #define SHIFT_INTERUPT 12
59
60 #define DMA
61
62 //------------------------------------------------------------------------------
63 // Structures
64 //------------------------------------------------------------------------------
65
66 // \brief Endpoint states
67 typedef enum {
68
69 endpointStateDisabled,
70 endpointStateIdle,
71 endpointStateWrite,
72 endpointStateRead,
73 endpointStateHalted
74
75 } EndpointState_t;
76
77 //------------------------------------------------------------------------------
78 // Macros
79 //------------------------------------------------------------------------------
80
81 //------------------------------------------------------------------------------
82 // Internal Functions
83 //------------------------------------------------------------------------------
84 //------------------------------------------------------------------------------
85 // \brief Returns a pointer to the OTGHS controller interface used by an USB
86 // driver
87 //
88 // The pointer is cast to the correct type (AT91PS_OTGHS).
89 // \param pUsb Pointer to a S_usb instance
90 // \return Pointer to the USB controller interface
91 // \see S_usb
92 //------------------------------------------------------------------------------
93 static AT91PS_OTGHS OTGHS_GetDriverInterface(const S_usb *pUsb)
94 {
95 return (AT91PS_OTGHS) pUsb->pDriver->pInterface;
96 }
97
98 //------------------------------------------------------------------------------
99 // \fn OTGHS_GetInterfaceEPT
100 // \brief Returns OTGHS endpoint FIFO interface from S_usb structure
101 //------------------------------------------------------------------------------
102 static AT91PS_OTGHS_EPTFIFO OTGHS_GetInterfaceEPT(const S_usb *pUsb)
103 {
104 return (AT91PS_OTGHS_EPTFIFO) pUsb->pDriver->pEndpointFIFO;
105 }
106
107
108 //------------------------------------------------------------------------------
109 // \brief Enables the peripheral clock of the USB controller associated with
110 // the specified USB driver
111 // \param pUsb Pointer to a S_usb instance
112 // \see S_usb
113 //------------------------------------------------------------------------------
114 static void OTGHS_EnableMCK(const S_usb *pUsb)
115 {
116
117 }
118
119 //------------------------------------------------------------------------------
120 // \brief Disables the peripheral clock of the USB controller associated with
121 // the specified USB driver
122 // \param pUsb Pointer to a S_usb instance
123 // \see S_usb
124 //------------------------------------------------------------------------------
125 static void OTGHS_DisableMCK(const S_usb *pUsb)
126 {
127
128 }
129
130 //------------------------------------------------------------------------------
131 // \brief Enables the 48MHz clock of the USB controller associated with
132 // the specified USB driver
133 // \param pUsb Pointer to a S_usb instance
134 // \see S_usb
135 //------------------------------------------------------------------------------
136 static void OTGHS_EnableOTGHSCK(const S_usb *pUsb)
137 {
138
139 }
140
141 //------------------------------------------------------------------------------
142 // \brief Disables the 48MHz clock of the USB controller associated with
143 // the specified USB driver
144 // \param pUsb Pointer to a S_usb instance
145 // \see S_usb
146 //------------------------------------------------------------------------------
147 static void OTGHS_DisableOTGHSCK(const S_usb *pUsb)
148 {
149
150 }
151
152 //------------------------------------------------------------------------------
153 // \brief Enables the transceiver of the USB controller associated with
154 // the specified USB driver
155 // \param pUsb Pointer to a S_usb instance
156 // \see S_usb
157 //------------------------------------------------------------------------------
158 static void OTGHS_EnableTransceiver(const S_usb *pUsb)
159 {
160 SET(OTGHS_GetDriverInterface(pUsb)->OTGHS_CTRL, AT91C_OTGHS_OTGPADE);
161 }
162
163 //------------------------------------------------------------------------------
164 // \brief Disables the transceiver of the USB controller associated with
165 // the specified USB driver
166 // \param pUsb Pointer to a S_usb instance
167 // \see S_usb
168 //------------------------------------------------------------------------------
169 static void OTGHS_DisableTransceiver(const S_usb *pUsb)
170 {
171 CLEAR(OTGHS_GetDriverInterface(pUsb)->OTGHS_CTRL, AT91C_OTGHS_OTGPADE);
172 }
173
174 //------------------------------------------------------------------------------
175 // \brief Invokes the callback associated with a finished transfer on an
176 // endpoint
177 // \param pEndpoint Pointer to a S_usb_endpoint instance
178 // \param bStatus Status code returned by the transfer operation
179 // \see Status codes
180 // \see S_usb_endpoint
181 //------------------------------------------------------------------------------
182 static void OTGHS_EndOfTransfer(S_usb_endpoint *pEndpoint,
183 char bStatus)
184 {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -