CH32V203? USB? 寄存器庫在哪里可以找到,EVT中USB部分也沒有寄存器庫。打開USB例程也沒有找到。等等,就是找不到寄存器
這個(gè)問題,誰能回答一下,在線等
您好,你截圖這部分對應(yīng)的是高速USB,CH32V203系列是沒有高速USB的。CH32V203系列支持全速USB,可做設(shè)備和主機(jī),EVT中對應(yīng)的USB說明可參考應(yīng)用手冊第21章和第23章
調(diào)試,中的寄存器名稱,在程序中找不到,怎么對應(yīng)關(guān)系呢
您好,例程中的庫是采用基地址與結(jié)構(gòu)體映射的方式操作寄存器的,USBFS所有相關(guān)寄存器都可在USBOTGH_FS_TypeDef機(jī)構(gòu)中找到對應(yīng)關(guān)系。
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即對應(yīng)USBFS的基地址又對應(yīng)R8_USB_CTRL(USB控制寄存器)。