CH32V203 USB 寄存器库在哪里可以找到,EVT中USB部分也没有寄存器库。打开USB例程也没有找到。等等,就是找不到寄存器
这个问题,谁能回答一下,在线等
您好,你截图这部分对应的是高速USB,CH32V203系列是没有高速USB的。CH32V203系列支持全速USB,可做设备和主机,EVT中对应的USB说明可参考应用手册第21章和第23章
调试,中的寄存器名称,在程序中找不到,怎么对应关系呢
您好,例程中的库是采用基地址与结构体映射的方式操作寄存器的,USBFS所有相关寄存器都可在USBOTGH_FS_TypeDef机构中找到对应关系。
typedef struct __attribute__((packed))
{
__IO uint8_t BASE_CTRL;
__IO uint8_t HOST_CTRL;
__IO uint8_t INT_EN;
__IO uint8_t DEV_ADDR;
__IO uint8_t Reserve0;
__IO uint8_t MIS_ST;
__IO uint8_t INT_FG;
__IO uint8_t INT_ST;
__IO uint16_t RX_LEN;
__IO uint16_t Reserve1;
__IO uint8_t Reserve2;
__IO uint8_t HOST_EP_MOD;
__IO uint16_t Reserve3;
__IO uint32_t Reserve4;
__IO uint32_t Reserve5;
__IO uint32_t HOST_RX_DMA;
__IO uint32_t HOST_TX_DMA;
__IO uint32_t Reserve6;
__IO uint32_t Reserve7;
__IO uint32_t Reserve8;
__IO uint32_t Reserve9;
__IO uint32_t Reserve10;
__IO uint16_t Reserve11;
__IO uint16_t HOST_SETUP;
__IO uint8_t HOST_EP_PID;
__IO uint8_t Reserve12;
__IO uint8_t Reserve13;
__IO uint8_t HOST_RX_CTRL;
__IO uint16_t HOST_TX_LEN;
__IO uint8_t HOST_TX_CTRL;
__IO uint8_t Reserve14;
__IO uint32_t Reserve15;
__IO uint32_t Reserve16;
__IO uint32_t Reserve17;
__IO uint32_t Reserve18;
__IO uint32_t Reserve19;
__IO uint32_t OTG_CR;
__IO uint32_t OTG_SR;
}USBOTGH_FS_TypeDef;
BASE_CTRL即对应USBFS的基地址又对应R8_USB_CTRL(USB控制寄存器)。