• Main Page
  • Modules
  • Index
  • File List
  • Globals

projects/nrfgo_sdk/bootloader_32k/firmware/usb.h

Go to the documentation of this file.
00001 /* Copyright (c) 2009 Nordic Semiconductor. All Rights Reserved.
00002  *
00003  * The information contained herein is confidential property of Nordic 
00004  * Semiconductor ASA.Terms and conditions of usage are described in detail 
00005  * in NORDIC SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. 
00006  *
00007  * Licensees are granted free, non-transferable use of the information. NO
00008  * WARRENTY of ANY KIND is provided. This heading must NOT be removed from
00009  * the file.
00010  *              
00011  * $LastChangedRevision: 133 $
00012  */
00013 
00019 #ifndef USB_H__
00020 #define USB_H__
00021 
00022 #include "usb_desc_bootloader.h"
00023 
00024 #define USB_EP0_HSNAK() do {ep0cs = 0x02; } while(0)
00025 #define USB_EP0_STALL() do {ep0cs = 0x11; } while(0) // Set both DSTALL and STALL when we want to stall a request during a SETUP transaction
00026 
00027 #define INT_SUDAV    0x00
00028 #define INT_SOF      0x04
00029 #define INT_SUTOK    0x08
00030 #define INT_SUSPEND  0x0C
00031 #define INT_USBRESET 0x10
00032 #define INT_EP0IN    0x18
00033 #define INT_EP0OUT   0x1C
00034 #define INT_EP1IN    0x20
00035 #define INT_EP1OUT   0x24
00036 
00037 #define USB_BM_STATE_CONFIGURED           0x01
00038 #define USB_BM_STATE_ALLOW_REMOTE_WAKEUP  0x02
00039 
00045 typedef enum 
00046 {
00047     ATTACHED,
00048     POWERED,
00049     DEFAULT,
00050     ADDRESSED,
00051     CONFIGURED,
00052     SUSPENDED
00053 } usb_state_t;
00054 
00055 void usb_init(void);
00056 void usb_irq(void);
00057 
00058 #endif  // USB_H__

Generated on Fri Apr 20 2012 14:11:45 for nRFGo SDK by  doxygen 1.7.2