📄 usb_prop.s79
字号:
MOVS R0,#+0
STRB R0,[R4, #+0]
// 228 }
// 229 }
??Virtual_Com_Port_Status_In_0:
POP {R4,PC} ;; return
CFI EndBlock cfiBlock4
// 230
// 231 /*******************************************************************************
// 232 * Function Name : Virtual_Com_Port_Status_Out
// 233 * Description : Virtual COM Port Status OUT Routine.
// 234 * Input : None.
// 235 * Output : None.
// 236 * Return : None.
// 237 *******************************************************************************/
RSEG CODE:CODE:NOROOT(2)
CFI Block cfiBlock5 Using cfiCommon0
CFI Function Virtual_Com_Port_Status_Out
THUMB
// 238 void Virtual_Com_Port_Status_Out(void)
// 239 {}
Virtual_Com_Port_Status_Out:
BX LR ;; return
CFI EndBlock cfiBlock5
// 240
// 241 /*******************************************************************************
// 242 * Function Name : Virtual_Com_Port_Data_Setup
// 243 * Description : handle the data class specific requests
// 244 * Input : Request Nb.
// 245 * Output : None.
// 246 * Return : USB_UNSUPPORT or USB_SUCCESS.
// 247 *******************************************************************************/
RSEG CODE:CODE:NOROOT(2)
CFI Block cfiBlock6 Using cfiCommon0
CFI Function Virtual_Com_Port_Data_Setup
THUMB
// 248 RESULT Virtual_Com_Port_Data_Setup(u8 RequestNo)
// 249 {
// 250 u8 *(*CopyRoutine)(u16);
// 251
// 252 CopyRoutine = NULL;
// 253
// 254 if (RequestNo == GET_LINE_CODING)
Virtual_Com_Port_Data_Setup:
LDR.N R3,??DataTable13 ;; pInformation
PUSH {R4,LR}
CFI ?RET Frame(CFA, -4)
CFI R4 Frame(CFA, -8)
CFI CFA R13+8
MOVS R1,#+0
LDR R3,[R3, #+0]
MOVS R2,#+0
CMP R0,#+33
LDRB R4,[R3, #+0]
BNE.N ??Virtual_Com_Port_Data_Setup_0
// 255 {
// 256 if (Type_Recipient == (CLASS_REQUEST | INTERFACE_RECIPIENT))
LSLS R0,R4,#+25
LSRS R0,R0,#+25
CMP R0,#+33
BNE.N ??Virtual_Com_Port_Data_Setup_1
// 257 {
// 258 CopyRoutine = Virtual_Com_Port_GetLineCoding;
LDR.N R2,??Virtual_Com_Port_Data_Setup_2 ;; Virtual_Com_Port_GetLineCoding
B.N ??Virtual_Com_Port_Data_Setup_3
// 259 }
// 260 }
// 261 else if (RequestNo == SET_LINE_CODING)
??Virtual_Com_Port_Data_Setup_0:
CMP R0,#+32
BNE.N ??Virtual_Com_Port_Data_Setup_1
// 262 {
// 263 if (Type_Recipient == (CLASS_REQUEST | INTERFACE_RECIPIENT))
LSLS R0,R4,#+25
LSRS R0,R0,#+25
CMP R0,#+33
IT EQ
// 264 {
// 265 CopyRoutine = Virtual_Com_Port_SetLineCoding;
LDREQ.N R2,??Virtual_Com_Port_Data_Setup_2+0x4 ;; Virtual_Com_Port_SetLineCoding
// 266 }
// 267 Request = SET_LINE_CODING;
LDR.N R0,??DataTable8 ;; Request
MOVS R4,#+32
STRB R4,[R0, #+0]
// 268 }
// 269
// 270 if (CopyRoutine == NULL)
??Virtual_Com_Port_Data_Setup_3:
MOVS R0,R2
BNE.N ??Virtual_Com_Port_Data_Setup_4
// 271 {
// 272 return USB_UNSUPPORT;
??Virtual_Com_Port_Data_Setup_1:
MOVS R0,#+2
POP {R4,PC}
// 273 }
// 274
// 275 pInformation->Ctrl_Info.CopyData = CopyRoutine;
??Virtual_Com_Port_Data_Setup_4:
STR R2,[R3, #+24]
// 276 pInformation->Ctrl_Info.Usb_wOffset = 0;
STRH R1,[R3, #+18]
// 277 (*CopyRoutine)(0);
MOVS R0,#+0
BLX R2
// 278 return USB_SUCCESS;
MOVS R0,#+0
POP {R4,PC} ;; return
DATA
??Virtual_Com_Port_Data_Setup_2:
DC32 Virtual_Com_Port_GetLineCoding
DC32 Virtual_Com_Port_SetLineCoding
CFI EndBlock cfiBlock6
// 279 }
RSEG CODE:CODE:NOROOT(2)
DATA
??DataTable8:
DC32 Request
// 280
// 281 /*******************************************************************************
// 282 * Function Name : Virtual_Com_Port_NoData_Setup.
// 283 * Description : handle the no data class specific requests.
// 284 * Input : Request Nb.
// 285 * Output : None.
// 286 * Return : USB_UNSUPPORT or USB_SUCCESS.
// 287 *******************************************************************************/
RSEG CODE:CODE:NOROOT(2)
CFI Block cfiBlock7 Using cfiCommon0
CFI Function Virtual_Com_Port_NoData_Setup
THUMB
// 288 RESULT Virtual_Com_Port_NoData_Setup(u8 RequestNo)
// 289 {
// 290
// 291 if (Type_Recipient == (CLASS_REQUEST | INTERFACE_RECIPIENT))
Virtual_Com_Port_NoData_Setup:
LDR.N R1,??DataTable13 ;; pInformation
LDR R1,[R1, #+0]
LDRB R1,[R1, #+0]
LSLS R1,R1,#+25
LSRS R1,R1,#+25
CMP R1,#+33
BNE.N ??Virtual_Com_Port_NoData_Setup_0
// 292 {
// 293 if (RequestNo == SET_COMM_FEATURE)
CMP R0,#+2
BNE.N ??Virtual_Com_Port_NoData_Setup_1
// 294 {
// 295 return USB_SUCCESS;
??Virtual_Com_Port_NoData_Setup_2:
MOVS R0,#+0
BX LR
// 296 }
// 297 else if (RequestNo == SET_CONTROL_LINE_STATE)
??Virtual_Com_Port_NoData_Setup_1:
CMP R0,#+34
BEQ.N ??Virtual_Com_Port_NoData_Setup_2
// 298 {
// 299 return USB_SUCCESS;
// 300 }
// 301 }
// 302
// 303 return USB_UNSUPPORT;
??Virtual_Com_Port_NoData_Setup_0:
MOVS R0,#+2
BX LR ;; return
CFI EndBlock cfiBlock7
// 304 }
// 305
// 306 /*******************************************************************************
// 307 * Function Name : Virtual_Com_Port_GetDeviceDescriptor.
// 308 * Description : Gets the device descriptor.
// 309 * Input : Length.
// 310 * Output : None.
// 311 * Return : The address of the device descriptor.
// 312 *******************************************************************************/
RSEG CODE:CODE:NOROOT(2)
CFI Block cfiBlock8 Using cfiCommon0
CFI Function Virtual_Com_Port_GetDeviceDescriptor
THUMB
// 313 u8 *Virtual_Com_Port_GetDeviceDescriptor(u16 Length)
// 314 {
// 315 return Standard_GetDescriptorData(Length, &Device_Descriptor);
Virtual_Com_Port_GetDeviceDescriptor:
LDR.N R1,??Virtual_Com_Port_GetDeviceDescriptor_0 ;; Device_Descriptor
_BF.W Standard_GetDescriptorData,??Standard_GetDescriptorData??rT
Nop
DATA
??Virtual_Com_Port_GetDeviceDescriptor_0:
DC32 Device_Descriptor
CFI EndBlock cfiBlock8
// 316 }
// 317
// 318 /*******************************************************************************
// 319 * Function Name : Virtual_Com_Port_GetConfigDescriptor.
// 320 * Description : get the configuration descriptor.
// 321 * Input : Length.
// 322 * Output : None.
// 323 * Return : The address of the configuration descriptor.
// 324 *******************************************************************************/
RSEG CODE:CODE:NOROOT(2)
CFI Block cfiBlock9 Using cfiCommon0
CFI Function Virtual_Com_Port_GetConfigDescriptor
THUMB
// 325 u8 *Virtual_Com_Port_GetConfigDescriptor(u16 Length)
// 326 {
// 327 return Standard_GetDescriptorData(Length, &Config_Descriptor);
Virtual_Com_Port_GetConfigDescriptor:
LDR.N R1,??Virtual_Com_Port_GetConfigDescriptor_0 ;; Config_Descriptor
_BF.W Standard_GetDescriptorData,??Standard_GetDescriptorData??rT
Nop
DATA
??Virtual_Com_Port_GetConfigDescriptor_0:
DC32 Config_Descriptor
CFI EndBlock cfiBlock9
// 328 }
// 329
// 330 /*******************************************************************************
// 331 * Function Name : Virtual_Com_Port_GetStringDescriptor
// 332 * Description : Gets the string descriptors according to the needed index
// 333 * Input : Length.
// 334 * Output : None.
// 335 * Return : The address of the string descriptors.
// 336 *******************************************************************************/
RSEG CODE:CODE:NOROOT(2)
CFI Block cfiBlock10 Using cfiCommon0
CFI Function Virtual_Com_Port_GetStringDescriptor
THUMB
// 337 u8 *Virtual_Com_Port_GetStringDescriptor(u16 Length)
// 338 {
// 339 u8 wValue0 = pInformation->USBwValue0;
Virtual_Com_Port_GetStringDescriptor:
LDR.N R1,??DataTable13 ;; pInformation
PUSH {LR}
CFI ?RET Frame(CFA, -4)
CFI CFA R13+4
LDR R1,[R1, #+0]
LDRB R1,[R1, #+3]
// 340 if (wValue0 > 4)
CMP R1,#+5
ITT CS
// 341 {
// 342 return NULL;
MOVCS R0,#+0
POPCS {PC}
// 343 }
// 344 else
// 345 {
// 346 return Standard_GetDescriptorData(Length, &String_Descriptor[wValue0]);
LDR.N R2,??Virtual_Com_Port_GetStringDescriptor_0 ;; String_Descriptor
ADDS R1,R2,R1, LSL #+3
POP {LR} ;; Pop
CFI ?RET R14
CFI CFA R13+0
_BF.W Standard_GetDescriptorData,??Standard_GetDescriptorData??rT
Nop
DATA
??Virtual_Com_Port_GetStringDescriptor_0:
DC32 String_Descriptor
CFI EndBlock cfiBlock10
// 347 }
// 348 }
// 349
// 350 /*******************************************************************************
// 351 * Function Name : Virtual_Com_Port_Get_Interface_Setting.
// 352 * Description : test the interface and the alternate setting according to the
// 353 * supported one.
// 354 * Input1 : u8: Interface : interface number.
// 355 * Input2 : u8: AlternateSetting : Alternate Setting number.
// 356 * Output : None.
// 357 * Return : The address of the string descriptors.
// 358 *******************************************************************************/
RSEG CODE:CODE:NOROOT(2)
CFI Block cfiBlock11 Using cfiCommon0
CFI Function Virtual_Com_Port_Get_Interface_Setting
THUMB
// 359 RESULT Virtual_Com_Port_Get_Interface_Setting(u8 Interface, u8 AlternateSetting)
// 360 {
// 361 if (AlternateSetting > 0)
Virtual_Com_Port_Get_Interface_Setting:
CBZ R1,??Virtual_Com_Port_Get_Interface_Setting_0
// 362 {
// 363 return USB_UNSUPPORT;
MOVS R0,#+2
BX LR
// 364 }
// 365 else if (Interface > 1)
??Virtual_Com_Port_Get_Interface_Setting_0:
CMP R0,#+2
ITT CS
// 366 {
// 367 return USB_UNSUPPORT;
MOVCS R0,#+2
BXCS LR
// 368 }
// 369 return USB_SUCCESS;
MOVS R0,#+0
BX LR ;; return
CFI EndBlock cfiBlock11
// 370 }
// 371
// 372 /*******************************************************************************
// 373 * Function Name : Virtual_Com_Port_GetLineCoding.
// 374 * Description : send the linecoding structure to the PC host.
// 375 * Input : Length.
// 376 * Output : None.
// 377 * Return : Inecoding structure base address.
// 378 *******************************************************************************/
RSEG CODE:CODE:NOROOT(2)
CFI Block cfiBlock12 Using cfiCommon0
CFI Function Virtual_Com_Port_GetLineCoding
THUMB
// 379 u8 *Virtual_Com_Port_GetLineCoding(u16 Length)
// 380 {
// 381 if (Length == 0)
Virtual_Com_Port_GetLineCoding:
CBNZ R0,??Virtual_Com_Port_GetLineCoding_0
// 382 {
// 383 pInformation->Ctrl_Info.Usb_wLength = sizeof(linecoding);
B.N ?Subroutine0
// 384 return NULL;
// 385 }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -