📄 usbrx.h
字号:
/*
* Some code is from the internet, and the copyright is no confirmed. If use these code in
* the product, please think it over.
*
* 文件名称:USBrx.h
* 文件标识:
* 摘 要:usb程序的头文件
*
*/
/*
* Version Histor
* 2006/03/22 王伟
* V0.41: 在命令U盘命令Test Unit Ready(00)和PREVENT-ALLOW MEDIUM REMOVAL(1E)中添加了Cache写回的动作
*/
#ifndef __USB_RX_H
#define __USB_RX_H
#include "nightingale.h"
#include "types.h"
//#include "io.h"
//#include "usb.h"
// USBD registers Memory Map
//Refer to P799
#define USBD_BASE 0x00212000
#define _reg_USBD_STAT (*((volatile UINT32 *)(USBD_BASE+0x008)))
#define _reg_USBD_CTRL (*((volatile UINT32 *)(USBD_BASE+0x00C)))
//USB Descriptor RAM Address
#define _reg_USBD_CFGBSY (*((volatile UINT32 *)(USBD_BASE+0x010)))
#define _reg_USBD_EPBUF (*((volatile UINT32 *)(USBD_BASE+0x014)))
#define _reg_USBD_INTR_STAT (*((volatile UINT32 *)(USBD_BASE+0x018)))
#define _reg_USBD_INTR_MASK (*((volatile UINT32 *)(USBD_BASE+0x01C)))
#define _reg_USBD_ENABLE (*((volatile UINT32 *)(USBD_BASE+0x024)))
#define _reg_USBD_EP0_STAT (*((volatile UINT32 *)(USBD_BASE+0x030)))
#define _reg_USBD_EP0_INTR_STAT (*((volatile UINT32 *)(USBD_BASE+0x034)))
#define _reg_USBD_EP0_INTR_MASK (*((volatile UINT32 *)(USBD_BASE+0x038)))
#define _reg_USBD_EP0_FDAT (*((volatile UINT32 *)(USBD_BASE+0x03C)))
#define _reg_USBD_EP0_FCTRL (*((volatile UINT32 *)(USBD_BASE+0x044)))
//lack of USB Endpoint n Last Read or Writer Frame Pointer
#define _reg_USBD_EP0_FALRM (*((volatile UINT32 *)(USBD_BASE+0x050)))
#define _reg_USBD_EP1_STAT (*((volatile UINT32 *)(USBD_BASE+0x060)))
#define _reg_USBD_EP1_INTR_STAT (*((volatile UINT32 *)(USBD_BASE+0x064)))
#define _reg_USBD_EP1_INTR_MASK (*((volatile UINT32 *)(USBD_BASE+0x068)))
#define _reg_USBD_EP1_FDAT (*((volatile UINT32 *)(USBD_BASE+0x06C)))
#define _reg_USBD_EP1_FCTRL (*((volatile UINT32 *)(USBD_BASE+0x074)))
#define _reg_USBD_EP1_FALRM (*((volatile UINT32 *)(USBD_BASE+0x080)))
#define _reg_USBD_EP2_STAT (*((volatile UINT32 *)(USBD_BASE+0x090)))
#define _reg_USBD_EP2_INTR_STAT (*((volatile UINT32 *)(USBD_BASE+0x094)))
#define _reg_USBD_EP2_INTR_MASK (*((volatile UINT32 *)(USBD_BASE+0x098)))
#define _reg_USBD_EP2_FDAT (*((volatile UINT32 *)(USBD_BASE+0x09C)))
#define _reg_USBD_EP2_FSTAT (*((volatile UINT32 *)(USBD_BASE+0x0A0)))
#define _reg_USBD_EP2_FCTRL (*((volatile UINT32 *)(USBD_BASE+0x0A4)))
#define _reg_USBD_EP2_FALRM (*((volatile UINT32 *)(USBD_BASE+0x0B0)))
#define _reg_USBD_EP3_STAT (*((volatile UINT32 *)(USBD_BASE+0x0C0)))
#define _reg_USBD_EP3_INTR_STAT (*((volatile UINT32 *)(USBD_BASE+0x0C4)))
#define _reg_USBD_EP3_INTR_MASK (*((volatile UINT32 *)(USBD_BASE+0x0C8)))
#define _reg_USBD_EP3_FDAT (*((volatile UINT32 *)(USBD_BASE+0x0CC)))
#define _reg_USBD_EP3_FCTRL (*((volatile UINT32 *)(USBD_BASE+0x0D4)))
#define _reg_USBD_EP3_FALRM (*((volatile UINT32 *)(USBD_BASE+0x0E0)))
#define _reg_USBD_EP4_STAT (*((volatile UINT32 *)(USBD_BASE+0x0F0)))
#define _reg_USBD_EP4_INTR_STAT (*((volatile UINT32 *)(USBD_BASE+0x0F4)))
#define _reg_USBD_EP4_INTR_MASK (*((volatile UINT32 *)(USBD_BASE+0x0F8)))
#define _reg_USBD_EP4_FDAT (*((volatile UINT32 *)(USBD_BASE+0x0FC)))
#define _reg_USBD_EP4_FCTRL (*((volatile UINT32 *)(USBD_BASE+0x104)))
#define _reg_USBD_EP4_FALRM (*((volatile UINT32 *)(USBD_BASE+0x110)))
#define _reg_USBD_EP5_STAT (*((volatile UINT32 *)(USBD_BASE+0x120)))
#define _reg_USBD_EP5_INTR_STAT (*((volatile UINT32 *)(USBD_BASE+0x124)))
#define _reg_USBD_EP5_INTR_MASK (*((volatile UINT32 *)(USBD_BASE+0x128)))
#define _reg_USBD_EP5_FDAT (*((volatile UINT32 *)(USBD_BASE+0x12C)))
#define _reg_USBD_EP5_FCTRL (*((volatile UINT32 *)(USBD_BASE+0x134)))
#define _reg_USBD_EP5_FALRM (*((volatile UINT32 *)(USBD_BASE+0x140)))
#define MDEVREQ_MASK 0x00000008
#define EOT_MASK 0x00000004
#define DEVREQ_MASK 0x00000002
#define EOF_MASK 0x00000001
#define WFR_MASK 0x20000000
#define CMD_OVER_MASK 0x00000040
#define SOF_MASK 0x00000040
#define RST_STOP_MASK 0x00000020
#define RST_START_MASK 0x00000010
#define CFG_CHG_MASK 0x00000001
#define ZLPS_MASK 0x00000004
#define FORCE_STALL_MASK 0x00000001
//////////////////////////////////////////////////////////
// //
// INTERFACE ROUTINE //
// //
//////////////////////////////////////////////////////////
/*********************************************************
NAME : usbrx
FUNC : USB模块的处理函数(Task main Routine)
IN : 无
OUT : 无
**********************************************************/
void usbrx(void);
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -