Arrow / Mbed OS DAPLink Reset
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers usbd_event.h Source File

usbd_event.h

Go to the documentation of this file.
00001 /**
00002  * @file    usbd_event.h
00003  * @brief   USB Device Event header
00004  *
00005  * DAPLink Interface Firmware
00006  * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
00007  * SPDX-License-Identifier: Apache-2.0
00008  *
00009  * Licensed under the Apache License, Version 2.0 (the "License"); you may
00010  * not use this file except in compliance with the License.
00011  * You may obtain a copy of the License at
00012  *
00013  * http://www.apache.org/licenses/LICENSE-2.0
00014  *
00015  * Unless required by applicable law or agreed to in writing, software
00016  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
00017  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00018  * See the License for the specific language governing permissions and
00019  * limitations under the License.
00020  */
00021 
00022 #ifndef __USBD_EVENT_H__
00023 #define __USBD_EVENT_H__
00024 
00025 
00026 /* USB Device - Device Events                                                 */
00027 #define USBD_EVT_POWER_ON    (1 <<  0)  /* USB Power On                       */
00028 #define USBD_EVT_POWER_OFF   (1 <<  1)  /* USB Power Off                      */
00029 #define USBD_EVT_RESET       (1 <<  2)  /* USB Bus Reset                      */
00030 #define USBD_EVT_WAKEUP      (1 <<  3)  /* USB Remote Wakeup                  */
00031 #define USBD_EVT_SUSPEND     (1 <<  4)  /* USB Suspend                        */
00032 #define USBD_EVT_RESUME      (1 <<  5)  /* USB Resume                         */
00033 #define USBD_EVT_SOF         (1 <<  6)  /* USB Start of Frame                 */
00034 #define USBD_EVT_ERROR       (1 <<  7)  /* USB Error                          */
00035 
00036 /* USB Device - Endpoint Events                                               */
00037 #define USBD_EVT_SETUP       (1 <<  1)  /* Setup Packet                       */
00038 #define USBD_EVT_OUT         (1 <<  2)  /* OUT Packet                         */
00039 #define USBD_EVT_IN          (1 <<  3)  /*  IN Packet                         */
00040 #define USBD_EVT_OUT_NAK     (1 <<  4)  /* OUT Packet - Not Acknowledged      */
00041 #define USBD_EVT_IN_NAK      (1 <<  5)  /*  IN Packet - Not Acknowledged      */
00042 #define USBD_EVT_OUT_STALL   (1 <<  6)  /* OUT Packet - Stalled               */
00043 #define USBD_EVT_IN_STALL    (1 <<  7)  /*  IN Packet - Stalled               */
00044 #define USBD_EVT_OUT_DMA_EOT (1 <<  8)  /* DMA OUT EP - End of Transfer       */
00045 #define USBD_EVT_IN_DMA_EOT  (1 <<  9)  /* DMA  IN EP - End of Transfer       */
00046 #define USBD_EVT_OUT_DMA_NDR (1 << 10)  /* DMA OUT EP - New Descriptor Request*/
00047 #define USBD_EVT_IN_DMA_NDR  (1 << 11)  /* DMA  IN EP - New Descriptor Request*/
00048 #define USBD_EVT_OUT_DMA_ERR (1 << 12)  /* DMA OUT EP - Error                 */
00049 #define USBD_EVT_IN_DMA_ERR  (1 << 13)  /* DMA  IN EP - Error                 */
00050 
00051 /* USB Device - Core Events                                                   */
00052 #define USBD_EVT_SET_CFG     (1 <<  0)  /* Set Configuration                  */
00053 #define USBD_EVT_SET_IF      (1 <<  1)  /* Set Interface                      */
00054 #define USBD_EVT_SET_FEATURE (1 <<  2)  /* Set Feature                        */
00055 #define USBD_EVT_CLR_FEATURE (1 <<  3)  /* Clear Feature                      */
00056 
00057 /* USB Device - Device Events Callback Pointers                               */
00058 extern void (* const USBD_P_Power_Event)(BOOL power);
00059 extern void (* const USBD_P_Reset_Event)(void);
00060 extern void (* const USBD_P_Suspend_Event)(void);
00061 extern void (* const USBD_P_Resume_Event)(void);
00062 extern void (* const USBD_P_WakeUp_Event)(void);
00063 extern void (* const USBD_P_SOF_Event)(void);
00064 extern void (* const USBD_P_Error_Event)(U32 error);
00065 
00066 /* USB Device - Endpoint Events Callback Pointers                             */
00067 extern void (* const USBD_P_EP[16])(U32 event);
00068 
00069 /* USB Device - Core Events Callback Pointers                                 */
00070 extern void (* const USBD_P_Configure_Event)(void);
00071 extern void (* const USBD_P_Interface_Event)(void);
00072 extern void (* const USBD_P_Feature_Event)(void);
00073 
00074 /* USB Device - RTX version RTX tasks initialization                          */
00075 extern void USBD_RTX_TaskInit(void);
00076 
00077 #endif  /* __USBD_EVENT_H__ */