?? usb.h
字號(hào):
/* Copyright (c) 2007 Nordic Semiconductor. All Rights Reserved.
*
* The information contained herein is property of Nordic Semiconductor ASA.
* Terms and conditions of usage are described in detail in NORDIC
* SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
*
* Licensees are granted free, non-transferable use of the information. NO
* WARRENTY of ANY KIND is provided. This heading must NOT be removed from
* the file.
*
* $LastChangedRevision: 2290 $
*/
/** @file
*
* This file contain definitions related to the USB-controller and internal structures
*
* @author Ken A. Redergaard
*/
#ifndef __NRF24LU1__
#define __NRF24LU1__
#include <stdint.h>
#include "hal_usb.h"
#include "usb_map.h"
#define USB_ENDPOINT_IN_COUNT 5
#define USB_ENDPOINT_OUT_COUNT 5
#define USB_EP0_HSNAK() do { i_usb.map->ep0cs = 0x02; } while(0)
#define USB_EP0_STALL() do { i_usb.map->ep0cs = 0x11; } while(0) // Set both DSTALL and STALL when we want to stall a request during a SETUP transaction
#define USB_EP0_DSTALL() do { i_usb.map->ep0cs |= 0x10; } while(0)
#define INT_SUDAV 0x00
#define INT_SOF 0x04
#define INT_SUTOK 0x08
#define INT_SUSPEND 0x0C
#define INT_USBRESET 0x10
#define INT_EP0IN 0x18
#define INT_EP0OUT 0x1C
#define INT_EP1IN 0x20
#define INT_EP1OUT 0x24
#define INT_EP2IN 0x28
#define INT_EP2OUT 0x2C
#define INT_EP3IN 0x30
#define INT_EP3OUT 0x34
#define INT_EP4IN 0x38
#define INT_EP4OUT 0x3C
#define INT_EP5IN 0x40
#define INT_EP5OUT 0x44
#define BM_REQUEST_TYPE 0
#define B_REQUEST 1
#define W_VALUE 2
#define W_INDEX 4
#define W_LENGTH 6
typedef struct {
uint8_t* data_ptr;
uint16_t data_size;
uint16_t pkt_size;
} packetizer_t;
typedef struct {
usb_map_t xdata* map;
packetizer_t packetizer;
hal_usb_cb_endpoint_t endpoint_in_isr[USB_ENDPOINT_IN_COUNT];
hal_usb_cb_endpoint_t endpoint_out_isr[USB_ENDPOINT_OUT_COUNT];
} usb_t;
#endif // __NRF24LU1__
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -