ARC-FW.elf: file format elf32-littlearm Sections: Idx Name Size VMA LMA File off Algn 0 .text 00002634 00000000 00000000 00010000 2**2 CONTENTS, ALLOC, LOAD, READONLY, CODE 1 .relocate 00000068 20000000 00002634 00020000 2**2 CONTENTS, ALLOC, LOAD, DATA 2 .bss 000005e4 20000068 0000269c 00020068 2**2 ALLOC 3 .stack 00002004 2000064c 00002c80 00020068 2**0 ALLOC 4 .ARM.attributes 00000028 00000000 00000000 00020068 2**0 CONTENTS, READONLY 5 .comment 0000001e 00000000 00000000 00020090 2**0 CONTENTS, READONLY 6 .debug_info 00029042 00000000 00000000 000200ae 2**0 CONTENTS, READONLY, DEBUGGING, OCTETS 7 .debug_abbrev 000038f3 00000000 00000000 000490f0 2**0 CONTENTS, READONLY, DEBUGGING, OCTETS 8 .debug_loc 0000f0db 00000000 00000000 0004c9e3 2**0 CONTENTS, READONLY, DEBUGGING, OCTETS 9 .debug_aranges 00000ca8 00000000 00000000 0005babe 2**0 CONTENTS, READONLY, DEBUGGING, OCTETS 10 .debug_ranges 00002e58 00000000 00000000 0005c766 2**0 CONTENTS, READONLY, DEBUGGING, OCTETS 11 .debug_macro 00008987 00000000 00000000 0005f5be 2**0 CONTENTS, READONLY, DEBUGGING, OCTETS 12 .debug_line 0001505b 00000000 00000000 00067f45 2**0 CONTENTS, READONLY, DEBUGGING, OCTETS 13 .debug_str 00086064 00000000 00000000 0007cfa0 2**0 CONTENTS, READONLY, DEBUGGING, OCTETS 14 .debug_frame 00002250 00000000 00000000 00103004 2**2 CONTENTS, READONLY, DEBUGGING, OCTETS Disassembly of section .text: 00000000 : 0: 50 26 00 20 55 01 00 00 51 01 00 00 51 01 00 00 P&. U...Q...Q... ... 2c: 51 01 00 00 00 00 00 00 00 00 00 00 51 01 00 00 Q...........Q... 3c: 51 01 00 00 51 01 00 00 51 01 00 00 51 01 00 00 Q...Q...Q...Q... 4c: 51 01 00 00 51 01 00 00 51 01 00 00 51 01 00 00 Q...Q...Q...Q... 5c: f9 10 00 00 51 01 00 00 51 01 00 00 51 01 00 00 ....Q...Q...Q... 6c: 51 01 00 00 51 01 00 00 00 00 00 00 00 00 00 00 Q...Q........... 7c: 51 01 00 00 51 01 00 00 51 01 00 00 51 01 00 00 Q...Q...Q...Q... 8c: 51 01 00 00 51 01 00 00 00 00 00 00 00 00 00 00 Q...Q........... 9c: 51 01 00 00 51 01 00 00 51 01 00 00 51 01 00 00 Q...Q...Q...Q... ac: 51 01 00 00 00 00 00 00 Q....... 000000b4 <__do_global_dtors_aux>: b4: b510 push {r4, lr} b6: 4c06 ldr r4, [pc, #24] ; (d0 <__do_global_dtors_aux+0x1c>) b8: 7823 ldrb r3, [r4, #0] ba: 2b00 cmp r3, #0 bc: d107 bne.n ce <__do_global_dtors_aux+0x1a> be: 4b05 ldr r3, [pc, #20] ; (d4 <__do_global_dtors_aux+0x20>) c0: 2b00 cmp r3, #0 c2: d002 beq.n ca <__do_global_dtors_aux+0x16> c4: 4804 ldr r0, [pc, #16] ; (d8 <__do_global_dtors_aux+0x24>) c6: e000 b.n ca <__do_global_dtors_aux+0x16> c8: bf00 nop ca: 2301 movs r3, #1 cc: 7023 strb r3, [r4, #0] ce: bd10 pop {r4, pc} d0: 20000068 .word 0x20000068 d4: 00000000 .word 0x00000000 d8: 00002634 .word 0x00002634 000000dc : dc: 4b04 ldr r3, [pc, #16] ; (f0 ) de: b510 push {r4, lr} e0: 2b00 cmp r3, #0 e2: d003 beq.n ec e4: 4903 ldr r1, [pc, #12] ; (f4 ) e6: 4804 ldr r0, [pc, #16] ; (f8 ) e8: e000 b.n ec ea: bf00 nop ec: bd10 pop {r4, pc} ee: 46c0 nop ; (mov r8, r8) f0: 00000000 .word 0x00000000 f4: 2000006c .word 0x2000006c f8: 00002634 .word 0x00002634 000000fc <_delay_init>: fc: 4b02 ldr r3, [pc, #8] ; (108 <_delay_init+0xc>) fe: 4a03 ldr r2, [pc, #12] ; (10c <_delay_init+0x10>) 100: 605a str r2, [r3, #4] 102: 2205 movs r2, #5 104: 601a str r2, [r3, #0] 106: 4770 bx lr 108: e000e010 .word 0xe000e010 10c: 00ffffff .word 0x00ffffff 00000110 <_delay_cycles>: } /** * \brief Delay loop to delay n number of cycles */ void _delay_cycles(void *const hw, uint32_t cycles) { 110: b570 push {r4, r5, r6, lr} uint32_t buf = cycles; while (n--) { SysTick->LOAD = 0xFFFFFF; SysTick->VAL = 0xFFFFFF; while (!(SysTick->CTRL & SysTick_CTRL_COUNTFLAG_Msk)) 112: 2580 movs r5, #128 ; 0x80 uint8_t n = cycles >> 24; 114: 0e0b lsrs r3, r1, #24 116: 4a0c ldr r2, [pc, #48] ; (148 <_delay_cycles+0x38>) SysTick->LOAD = 0xFFFFFF; 118: 4c0c ldr r4, [pc, #48] ; (14c <_delay_cycles+0x3c>) uint8_t n = cycles >> 24; 11a: b2d8 uxtb r0, r3 while (!(SysTick->CTRL & SysTick_CTRL_COUNTFLAG_Msk)) 11c: 026d lsls r5, r5, #9 while (n--) { 11e: 3801 subs r0, #1 120: b2c0 uxtb r0, r0 122: 28ff cmp r0, #255 ; 0xff 124: d10a bne.n 13c <_delay_cycles+0x2c> 126: 0618 lsls r0, r3, #24 128: 1a1b subs r3, r3, r0 12a: 185b adds r3, r3, r1 ; buf -= 0xFFFFFF; } SysTick->LOAD = buf; 12c: 6053 str r3, [r2, #4] SysTick->VAL = buf; 12e: 6093 str r3, [r2, #8] while (!(SysTick->CTRL & SysTick_CTRL_COUNTFLAG_Msk)) 130: 2380 movs r3, #128 ; 0x80 132: 025b lsls r3, r3, #9 134: 6811 ldr r1, [r2, #0] 136: 4219 tst r1, r3 138: d0fc beq.n 134 <_delay_cycles+0x24> ; } 13a: bd70 pop {r4, r5, r6, pc} SysTick->LOAD = 0xFFFFFF; 13c: 6054 str r4, [r2, #4] SysTick->VAL = 0xFFFFFF; 13e: 6094 str r4, [r2, #8] while (!(SysTick->CTRL & SysTick_CTRL_COUNTFLAG_Msk)) 140: 6816 ldr r6, [r2, #0] 142: 422e tst r6, r5 144: d0fc beq.n 140 <_delay_cycles+0x30> 146: e7ea b.n 11e <_delay_cycles+0xe> 148: e000e010 .word 0xe000e010 14c: 00ffffff .word 0x00ffffff 00000150 : /** * \brief Default interrupt handler for unused IRQs. */ void Dummy_Handler(void) { while (1) { 150: e7fe b.n 150 ... 00000154 : if (pSrc != pDest) { 154: 4925 ldr r1, [pc, #148] ; (1ec ) 156: 4826 ldr r0, [pc, #152] ; (1f0 ) { 158: b570 push {r4, r5, r6, lr} if (pSrc != pDest) { 15a: 4281 cmp r1, r0 15c: d00a beq.n 174 *pDest++ = *pSrc++; 15e: 4b25 ldr r3, [pc, #148] ; (1f4 ) 160: 1ec4 subs r4, r0, #3 162: 2200 movs r2, #0 164: 42a3 cmp r3, r4 166: d303 bcc.n 170 168: 3303 adds r3, #3 16a: 1a1a subs r2, r3, r0 16c: 0892 lsrs r2, r2, #2 16e: 0092 lsls r2, r2, #2 170: 4b21 ldr r3, [pc, #132] ; (1f8 ) 172: 4798 blx r3 *pDest++ = 0; 174: 4821 ldr r0, [pc, #132] ; (1fc ) 176: 4b22 ldr r3, [pc, #136] ; (200 ) 178: 1ec1 subs r1, r0, #3 17a: 2200 movs r2, #0 17c: 4299 cmp r1, r3 17e: d803 bhi.n 188 180: 3303 adds r3, #3 182: 1a1a subs r2, r3, r0 184: 0892 lsrs r2, r2, #2 186: 0092 lsls r2, r2, #2 188: 2100 movs r1, #0 18a: 4b1e ldr r3, [pc, #120] ; (204 ) 18c: 4798 blx r3 SCB->VTOR = ((uint32_t)pSrc & SCB_VTOR_TBLOFF_Msk); 18e: 22ff movs r2, #255 ; 0xff 190: 4b1d ldr r3, [pc, #116] ; (208 ) USB->DEVICE.QOSCTRL.bit.CQOS = 2; 192: 2103 movs r1, #3 SCB->VTOR = ((uint32_t)pSrc & SCB_VTOR_TBLOFF_Msk); 194: 4393 bics r3, r2 196: 4a1d ldr r2, [pc, #116] ; (20c ) USB->DEVICE.QOSCTRL.bit.DQOS = 2; 198: 250c movs r5, #12 SCB->VTOR = ((uint32_t)pSrc & SCB_VTOR_TBLOFF_Msk); 19a: 6093 str r3, [r2, #8] SBMATRIX->SFR[SBMATRIX_SLAVE_HMCRAMC0].reg = 2; 19c: 2202 movs r2, #2 USB->DEVICE.QOSCTRL.bit.DQOS = 2; 19e: 2408 movs r4, #8 DMAC->QOSCTRL.bit.DQOS = 2; 1a0: 2630 movs r6, #48 ; 0x30 SBMATRIX->SFR[SBMATRIX_SLAVE_HMCRAMC0].reg = 2; 1a2: 4b1b ldr r3, [pc, #108] ; (210 ) USB->DEVICE.QOSCTRL.bit.CQOS = 2; 1a4: 481b ldr r0, [pc, #108] ; (214 ) SBMATRIX->SFR[SBMATRIX_SLAVE_HMCRAMC0].reg = 2; 1a6: 625a str r2, [r3, #36] ; 0x24 USB->DEVICE.QOSCTRL.bit.CQOS = 2; 1a8: 78c3 ldrb r3, [r0, #3] 1aa: 438b bics r3, r1 1ac: 4313 orrs r3, r2 1ae: 70c3 strb r3, [r0, #3] USB->DEVICE.QOSCTRL.bit.DQOS = 2; 1b0: 78c3 ldrb r3, [r0, #3] 1b2: 43ab bics r3, r5 1b4: 4323 orrs r3, r4 1b6: 70c3 strb r3, [r0, #3] DMAC->QOSCTRL.bit.DQOS = 2; 1b8: 4b17 ldr r3, [pc, #92] ; (218 ) 1ba: 7b98 ldrb r0, [r3, #14] 1bc: 43b0 bics r0, r6 1be: 0006 movs r6, r0 1c0: 2020 movs r0, #32 1c2: 4330 orrs r0, r6 1c4: 7398 strb r0, [r3, #14] DMAC->QOSCTRL.bit.FQOS = 2; 1c6: 7b98 ldrb r0, [r3, #14] 1c8: 43a8 bics r0, r5 1ca: 4304 orrs r4, r0 1cc: 739c strb r4, [r3, #14] DMAC->QOSCTRL.bit.WRBQOS = 2; 1ce: 7b98 ldrb r0, [r3, #14] 1d0: 4388 bics r0, r1 1d2: 4302 orrs r2, r0 1d4: 739a strb r2, [r3, #14] NVMCTRL->CTRLB.bit.MANW = 1; 1d6: 2380 movs r3, #128 ; 0x80 1d8: 4a10 ldr r2, [pc, #64] ; (21c ) 1da: 6851 ldr r1, [r2, #4] 1dc: 430b orrs r3, r1 1de: 6053 str r3, [r2, #4] __libc_init_array(); 1e0: 4b0f ldr r3, [pc, #60] ; (220 ) 1e2: 4798 blx r3 main(); 1e4: 4b0f ldr r3, [pc, #60] ; (224 ) 1e6: 4798 blx r3 while (1) 1e8: e7fe b.n 1e8 1ea: 46c0 nop ; (mov r8, r8) 1ec: 00002634 .word 0x00002634 1f0: 20000000 .word 0x20000000 1f4: 20000068 .word 0x20000068 1f8: 00002545 .word 0x00002545 1fc: 20000068 .word 0x20000068 200: 2000064c .word 0x2000064c 204: 00002557 .word 0x00002557 208: 00000000 .word 0x00000000 20c: e000ed00 .word 0xe000ed00 210: 410070fc .word 0x410070fc 214: 41005000 .word 0x41005000 218: 41004800 .word 0x41004800 21c: 41004000 .word 0x41004000 220: 000024fd .word 0x000024fd 224: 00001bd1 .word 0x00001bd1 00000228 : * \param[in] ep Endpoint address. * \param[in] req Pointer to the request. * \return Operation status. */ static int32_t cdcdf_acm_req(uint8_t ep, struct usb_req *req, enum usb_ctrl_stage stage) { 228: b5f0 push {r4, r5, r6, r7, lr} 22a: 0017 movs r7, r2 if (0x01 != ((req->bmRequestType >> 5) & 0x03)) { // class request 22c: 780a ldrb r2, [r1, #0] { 22e: b085 sub sp, #20 if (0x01 != ((req->bmRequestType >> 5) & 0x03)) { // class request 230: 0653 lsls r3, r2, #25 { 232: 000c movs r4, r1 234: 9001 str r0, [sp, #4] if (0x01 != ((req->bmRequestType >> 5) & 0x03)) { // class request 236: 0f9b lsrs r3, r3, #30 238: 2b01 cmp r3, #1 23a: d152 bne.n 2e2 return ERR_NOT_FOUND; } if ((req->wIndex == _cdcdf_acm_funcd.func_iface[0]) || (req->wIndex == _cdcdf_acm_funcd.func_iface[1])) { 23c: 7963 ldrb r3, [r4, #5] 23e: 7909 ldrb r1, [r1, #4] 240: 4d2a ldr r5, [pc, #168] ; (2ec ) 242: 021b lsls r3, r3, #8 244: 430b orrs r3, r1 246: 7829 ldrb r1, [r5, #0] 248: 4299 cmp r1, r3 24a: d002 beq.n 252 24c: 7869 ldrb r1, [r5, #1] 24e: 4299 cmp r1, r3 250: d147 bne.n 2e2 uint16_t len = req->wLength; 252: 79e6 ldrb r6, [r4, #7] 254: 79a3 ldrb r3, [r4, #6] 256: 0236 lsls r6, r6, #8 if (req->bmRequestType & USB_EP_DIR_IN) { 258: b252 sxtb r2, r2 uint16_t len = req->wLength; 25a: 431e orrs r6, r3 if (req->bmRequestType & USB_EP_DIR_IN) { 25c: 2a00 cmp r2, #0 25e: da0f bge.n 280 return ERR_NONE; 260: 2000 movs r0, #0 if (USB_DATA_STAGE == stage) { 262: 2f01 cmp r7, #1 264: d00a beq.n 27c switch (req->bRequest) { 266: 7863 ldrb r3, [r4, #1] 268: 2b21 cmp r3, #33 ; 0x21 26a: d111 bne.n 290 if (sizeof(struct usb_cdc_line_coding) != len) { 26c: 2e07 cmp r6, #7 26e: d13b bne.n 2e8 return usbdc_xfer(ep, (uint8_t *)&usbd_cdc_line_coding, len, false); 270: 0003 movs r3, r0 272: 1da9 adds r1, r5, #6 return usbdc_xfer(ep, ctrl_buf, len, false); 274: 0032 movs r2, r6 276: 9801 ldr r0, [sp, #4] 278: 4c1d ldr r4, [pc, #116] ; (2f0 ) 27a: 47a0 blx r4 return cdcdf_acm_set_req(ep, req, stage); } } else { return ERR_NOT_FOUND; } } 27c: b005 add sp, #20 27e: bdf0 pop {r4, r5, r6, r7, pc} uint8_t * ctrl_buf = usbdc_get_ctrl_buffer(); 280: 4b1c ldr r3, [pc, #112] ; (2f4 ) 282: 4798 blx r3 switch (req->bRequest) { 284: 7863 ldrb r3, [r4, #1] uint8_t * ctrl_buf = usbdc_get_ctrl_buffer(); 286: 0001 movs r1, r0 switch (req->bRequest) { 288: 2b20 cmp r3, #32 28a: d003 beq.n 294 28c: 2b22 cmp r3, #34 ; 0x22 28e: d019 beq.n 2c4 return ERR_INVALID_ARG; 290: 200d movs r0, #13 292: e027 b.n 2e4 if (sizeof(struct usb_cdc_line_coding) != len) { 294: 2e07 cmp r6, #7 296: d127 bne.n 2e8 if (USB_SETUP_STAGE == stage) { 298: 2f00 cmp r7, #0 29a: d101 bne.n 2a0 return usbdc_xfer(ep, ctrl_buf, len, false); 29c: 003b movs r3, r7 29e: e7e9 b.n 274 memcpy(&line_coding_tmp, ctrl_buf, sizeof(struct usb_cdc_line_coding)); 2a0: 0032 movs r2, r6 2a2: 4c15 ldr r4, [pc, #84] ; (2f8 ) 2a4: a802 add r0, sp, #8 2a6: 47a0 blx r4 if ((NULL == cdcdf_acm_set_line_coding) || (true == cdcdf_acm_set_line_coding(&line_coding_tmp))) { 2a8: 692b ldr r3, [r5, #16] 2aa: 2b00 cmp r3, #0 2ac: d105 bne.n 2ba usbd_cdc_line_coding = line_coding_tmp; 2ae: 2207 movs r2, #7 2b0: 1da8 adds r0, r5, #6 2b2: a902 add r1, sp, #8 2b4: 47a0 blx r4 return ERR_NONE; 2b6: 2000 movs r0, #0 2b8: e7e0 b.n 27c if ((NULL == cdcdf_acm_set_line_coding) || (true == cdcdf_acm_set_line_coding(&line_coding_tmp))) { 2ba: a802 add r0, sp, #8 2bc: 4798 blx r3 2be: 2800 cmp r0, #0 2c0: d1f5 bne.n 2ae 2c2: e7f8 b.n 2b6 usbdc_xfer(0, NULL, 0, 0); 2c4: 2300 movs r3, #0 2c6: 4e0a ldr r6, [pc, #40] ; (2f0 ) 2c8: 001a movs r2, r3 2ca: 0019 movs r1, r3 2cc: 0018 movs r0, r3 2ce: 47b0 blx r6 if (NULL != cdcdf_acm_notify_state) { 2d0: 696b ldr r3, [r5, #20] 2d2: 2b00 cmp r3, #0 2d4: d0ef beq.n 2b6 cdcdf_acm_notify_state(req->wValue); 2d6: 78e0 ldrb r0, [r4, #3] 2d8: 78a2 ldrb r2, [r4, #2] 2da: 0200 lsls r0, r0, #8 2dc: 4310 orrs r0, r2 2de: 4798 blx r3 2e0: e7e9 b.n 2b6 return ERR_NOT_FOUND; 2e2: 200a movs r0, #10 return ERR_INVALID_DATA; 2e4: 4240 negs r0, r0 2e6: e7c9 b.n 27c 2e8: 2001 movs r0, #1 2ea: e7fb b.n 2e4 2ec: 20000084 .word 0x20000084 2f0: 0000205d .word 0x0000205d 2f4: 00002485 .word 0x00002485 2f8: 00002545 .word 0x00002545 000002fc : { 2fc: b5f7 push {r0, r1, r2, r4, r5, r6, r7, lr} 2fe: 0015 movs r5, r2 switch (ctrl) { 300: 2901 cmp r1, #1 302: d04f beq.n 3a4 304: 2902 cmp r1, #2 306: d100 bne.n 30a 308: e076 b.n 3f8 30a: 2900 cmp r1, #0 30c: d000 beq.n 310 30e: e075 b.n 3fc return cdcdf_acm_enable(drv, (struct usbd_descriptors *)param); 310: 6883 ldr r3, [r0, #8] ifc = desc->sod; 312: 6810 ldr r0, [r2, #0] 314: 001e movs r6, r3 316: 9300 str r3, [sp, #0] for (i = 0; i < 2; i++) { 318: 3302 adds r3, #2 31a: 9301 str r3, [sp, #4] if (NULL == ifc) { 31c: 2800 cmp r0, #0 31e: d102 bne.n 326 return ERR_NOT_FOUND; 320: 200a movs r0, #10 return ERR_NOT_INITIALIZED; 322: 4240 negs r0, r0 324: e020 b.n 368 if ((CDC_CLASS_COMM == ifc_desc.bInterfaceClass) || (CDC_CLASS_DATA == ifc_desc.bInterfaceClass)) { 326: 2108 movs r1, #8 328: 7943 ldrb r3, [r0, #5] ifc_desc.bInterfaceNumber = ifc[2]; 32a: 7882 ldrb r2, [r0, #2] if ((CDC_CLASS_COMM == ifc_desc.bInterfaceClass) || (CDC_CLASS_DATA == ifc_desc.bInterfaceClass)) { 32c: 438b bics r3, r1 32e: 2b02 cmp r3, #2 330: d1f6 bne.n 320 if (func_data->func_iface[i] == ifc_desc.bInterfaceNumber) { // Initialized 332: 7833 ldrb r3, [r6, #0] 334: 429a cmp r2, r3 336: d063 beq.n 400 } else if (func_data->func_iface[i] != 0xFF) { // Occupied 338: 2bff cmp r3, #255 ; 0xff 33a: d163 bne.n 404 func_data->func_iface[i] = ifc_desc.bInterfaceNumber; 33c: 7032 strb r2, [r6, #0] ep = usb_find_desc(ifc, desc->eod, USB_DT_ENDPOINT); 33e: 6869 ldr r1, [r5, #4] 340: 2205 movs r2, #5 342: 4b32 ldr r3, [pc, #200] ; (40c ) 344: 4798 blx r3 ep = usb_find_ep_desc(usb_desc_next(desc->sod), desc->eod); 346: 1e04 subs r4, r0, #0 while (NULL != ep) { 348: d10f bne.n 36a ifc = usb_find_desc(usb_desc_next(desc->sod), desc->eod, USB_DT_INTERFACE); 34a: 6828 ldr r0, [r5, #0] 34c: 2204 movs r2, #4 * \param[in] desc Byte pointer to the descriptor start address * \return Byte pointer to the next descriptor */ static inline uint8_t *usb_desc_next(uint8_t *desc) { return (desc + usb_desc_len(desc)); 34e: 7803 ldrb r3, [r0, #0] 350: 6869 ldr r1, [r5, #4] 352: 18c0 adds r0, r0, r3 354: 4b2d ldr r3, [pc, #180] ; (40c ) 356: 4798 blx r3 for (i = 0; i < 2; i++) { 358: 9b01 ldr r3, [sp, #4] 35a: 3601 adds r6, #1 35c: 42b3 cmp r3, r6 35e: d1dd bne.n 31c _cdcdf_acm_funcd.enabled = true; 360: 2201 movs r2, #1 return ERR_NONE; 362: 0020 movs r0, r4 _cdcdf_acm_funcd.enabled = true; 364: 4b2a ldr r3, [pc, #168] ; (410 ) 366: 715a strb r2, [r3, #5] } 368: bdfe pop {r1, r2, r3, r4, r5, r6, r7, pc} return (ptr[0] + (ptr[1] << 8)); 36a: 7963 ldrb r3, [r4, #5] 36c: 7922 ldrb r2, [r4, #4] 36e: 021b lsls r3, r3, #8 ep_desc.bEndpointAddress = ep[2]; 370: 78a7 ldrb r7, [r4, #2] 372: 18d2 adds r2, r2, r3 if (usb_d_ep_init(ep_desc.bEndpointAddress, ep_desc.bmAttributes, ep_desc.wMaxPacketSize)) { 374: 0038 movs r0, r7 376: 78e1 ldrb r1, [r4, #3] 378: 4b26 ldr r3, [pc, #152] ; (414 ) 37a: b292 uxth r2, r2 37c: 4798 blx r3 37e: 2800 cmp r0, #0 380: d142 bne.n 408 if (ep_desc.bEndpointAddress & USB_EP_DIR_IN) { 382: b27b sxtb r3, r7 384: 4a24 ldr r2, [pc, #144] ; (418 ) 386: 2b00 cmp r3, #0 388: da09 bge.n 39e func_data->func_ep_in[i] = ep_desc.bEndpointAddress; 38a: 70b7 strb r7, [r6, #2] usb_d_ep_enable(func_data->func_ep_out); 38c: 0038 movs r0, r7 38e: 4790 blx r2 desc->sod = ep; 390: 602c str r4, [r5, #0] return (desc + usb_desc_len(desc)); 392: 7820 ldrb r0, [r4, #0] ep = usb_find_ep_desc(usb_desc_next(desc->sod), desc->eod); 394: 6869 ldr r1, [r5, #4] 396: 4b21 ldr r3, [pc, #132] ; (41c ) 398: 1820 adds r0, r4, r0 39a: 4798 blx r3 39c: e7d3 b.n 346 func_data->func_ep_out = ep_desc.bEndpointAddress; 39e: 9b00 ldr r3, [sp, #0] 3a0: 711f strb r7, [r3, #4] 3a2: e7f3 b.n 38c return cdcdf_acm_disable(drv, (struct usbd_descriptors *)param); 3a4: 6884 ldr r4, [r0, #8] if (desc) { 3a6: 2a00 cmp r2, #0 3a8: d005 beq.n 3b6 ifc_desc.bInterfaceClass = desc->sod[5]; 3aa: 6813 ldr r3, [r2, #0] if ((ifc_desc.bInterfaceClass != CDC_CLASS_COMM) && (ifc_desc.bInterfaceClass != CDC_CLASS_DATA)) { 3ac: 2208 movs r2, #8 3ae: 795b ldrb r3, [r3, #5] 3b0: 4393 bics r3, r2 3b2: 2b02 cmp r3, #2 3b4: d1b4 bne.n 320 if (func_data->func_iface[i] == 0xFF) { 3b6: 7823 ldrb r3, [r4, #0] 3b8: 2bff cmp r3, #255 ; 0xff 3ba: d007 beq.n 3cc func_data->func_iface[i] = 0xFF; 3bc: 25ff movs r5, #255 ; 0xff if (func_data->func_ep_in[i] != 0xFF) { 3be: 78a0 ldrb r0, [r4, #2] func_data->func_iface[i] = 0xFF; 3c0: 7025 strb r5, [r4, #0] if (func_data->func_ep_in[i] != 0xFF) { 3c2: 42a8 cmp r0, r5 3c4: d002 beq.n 3cc usb_d_ep_deinit(func_data->func_ep_in[i]); 3c6: 4b16 ldr r3, [pc, #88] ; (420 ) 3c8: 4798 blx r3 func_data->func_ep_in[i] = 0xFF; 3ca: 70a5 strb r5, [r4, #2] if (func_data->func_iface[i] == 0xFF) { 3cc: 7863 ldrb r3, [r4, #1] 3ce: 2bff cmp r3, #255 ; 0xff 3d0: d007 beq.n 3e2 func_data->func_iface[i] = 0xFF; 3d2: 25ff movs r5, #255 ; 0xff if (func_data->func_ep_in[i] != 0xFF) { 3d4: 78e0 ldrb r0, [r4, #3] func_data->func_iface[i] = 0xFF; 3d6: 7065 strb r5, [r4, #1] if (func_data->func_ep_in[i] != 0xFF) { 3d8: 42a8 cmp r0, r5 3da: d002 beq.n 3e2 usb_d_ep_deinit(func_data->func_ep_in[i]); 3dc: 4b10 ldr r3, [pc, #64] ; (420 ) 3de: 4798 blx r3 func_data->func_ep_in[i] = 0xFF; 3e0: 70e5 strb r5, [r4, #3] if (func_data->func_ep_out != 0xFF) { 3e2: 7920 ldrb r0, [r4, #4] 3e4: 28ff cmp r0, #255 ; 0xff 3e6: d003 beq.n 3f0 usb_d_ep_deinit(func_data->func_ep_out); 3e8: 4b0d ldr r3, [pc, #52] ; (420 ) 3ea: 4798 blx r3 func_data->func_ep_out = 0xFF; 3ec: 23ff movs r3, #255 ; 0xff 3ee: 7123 strb r3, [r4, #4] _cdcdf_acm_funcd.enabled = false; 3f0: 2000 movs r0, #0 3f2: 4b07 ldr r3, [pc, #28] ; (410 ) 3f4: 7158 strb r0, [r3, #5] return ERR_NONE; 3f6: e7b7 b.n 368 return ERR_UNSUPPORTED_OP; 3f8: 201b movs r0, #27 3fa: e792 b.n 322 switch (ctrl) { 3fc: 200d movs r0, #13 3fe: e790 b.n 322 return ERR_ALREADY_INITIALIZED; 400: 2012 movs r0, #18 402: e78e b.n 322 return ERR_NO_RESOURCE; 404: 201c movs r0, #28 406: e78c b.n 322 return ERR_NOT_INITIALIZED; 408: 2014 movs r0, #20 40a: e78a b.n 322 40c: 00001651 .word 0x00001651 410: 20000084 .word 0x20000084 414: 00001961 .word 0x00001961 418: 000019f1 .word 0x000019f1 41c: 0000166b .word 0x0000166b 420: 000019c5 .word 0x000019c5 00000424 : /** * \brief Initialize the USB CDC ACM Function Driver */ int32_t cdcdf_acm_init(void) { 424: b510 push {r4, lr} if (usbdc_get_state() > USBD_S_POWER) { 426: 4b0a ldr r3, [pc, #40] ; (450 ) 428: 4798 blx r3 42a: 2801 cmp r0, #1 42c: d80c bhi.n 448 return ERR_DENIED; } _cdcdf_acm.ctrl = cdcdf_acm_ctrl; 42e: 4809 ldr r0, [pc, #36] ; (454 ) 430: 4b09 ldr r3, [pc, #36] ; (458 ) _cdcdf_acm.func_data = &_cdcdf_acm_funcd; 432: 6200 str r0, [r0, #32] _cdcdf_acm.ctrl = cdcdf_acm_ctrl; 434: 61c3 str r3, [r0, #28] usbdc_register_function(&_cdcdf_acm); 436: 4b09 ldr r3, [pc, #36] ; (45c ) 438: 3018 adds r0, #24 43a: 4798 blx r3 usbdc_register_handler(USBDC_HDL_REQ, &cdcdf_acm_req_h); 43c: 2001 movs r0, #1 43e: 4908 ldr r1, [pc, #32] ; (460 ) 440: 4b08 ldr r3, [pc, #32] ; (464 ) 442: 4798 blx r3 return ERR_NONE; 444: 2000 movs r0, #0 } 446: bd10 pop {r4, pc} return ERR_DENIED; 448: 2011 movs r0, #17 44a: 4240 negs r0, r0 44c: e7fb b.n 446 44e: 46c0 nop ; (mov r8, r8) 450: 00002491 .word 0x00002491 454: 20000084 .word 0x20000084 458: 000002fd .word 0x000002fd 45c: 0000242d .word 0x0000242d 460: 20000000 .word 0x20000000 464: 000023a1 .word 0x000023a1 00000468 : /** * \brief USB CDC ACM Function Write Data */ int32_t cdcdf_acm_write(uint8_t *buf, uint32_t size) { 468: b510 push {r4, lr} /** * \brief Check whether CDC ACM Function is enabled */ bool cdcdf_acm_is_enabled(void) { return _cdcdf_acm_funcd.enabled; 46a: 4b07 ldr r3, [pc, #28] ; (488 ) { 46c: 000a movs r2, r1 if (!cdcdf_acm_is_enabled()) { 46e: 7959 ldrb r1, [r3, #5] { 470: 0004 movs r4, r0 if (!cdcdf_acm_is_enabled()) { 472: 2900 cmp r1, #0 474: d005 beq.n 482 return usbdc_xfer(_cdcdf_acm_funcd.func_ep_in[CDCDF_ACM_DATA_EP_INDEX], buf, size, true); 476: 0021 movs r1, r4 478: 78d8 ldrb r0, [r3, #3] 47a: 4c04 ldr r4, [pc, #16] ; (48c ) 47c: 2301 movs r3, #1 47e: 47a0 blx r4 } 480: bd10 pop {r4, pc} return ERR_DENIED; 482: 2011 movs r0, #17 484: 4240 negs r0, r0 486: e7fb b.n 480 488: 20000084 .word 0x20000084 48c: 0000205d .word 0x0000205d 00000490 : { 490: 000a movs r2, r1 492: b510 push {r4, lr} 494: 2803 cmp r0, #3 496: d810 bhi.n 4ba 498: 4b09 ldr r3, [pc, #36] ; (4c0 ) 49a: f002 f81b bl 24d4 <__gnu_thumb1_case_uqi> 49e: 0802 .short 0x0802 4a0: 0c0a .short 0x0c0a usb_d_ep_register_callback(_cdcdf_acm_funcd.func_ep_out, USB_D_EP_CB_XFER, func); 4a2: 7918 ldrb r0, [r3, #4] usb_d_ep_register_callback(_cdcdf_acm_funcd.func_ep_in[CDCDF_ACM_DATA_EP_INDEX], USB_D_EP_CB_XFER, func); 4a4: 2102 movs r1, #2 4a6: 4b07 ldr r3, [pc, #28] ; (4c4 ) 4a8: 4798 blx r3 return ERR_NONE; 4aa: 2000 movs r0, #0 } 4ac: bd10 pop {r4, pc} usb_d_ep_register_callback(_cdcdf_acm_funcd.func_ep_in[CDCDF_ACM_DATA_EP_INDEX], USB_D_EP_CB_XFER, func); 4ae: 78d8 ldrb r0, [r3, #3] 4b0: e7f8 b.n 4a4 cdcdf_acm_set_line_coding = (cdcdf_acm_set_line_coding_t)func; 4b2: 6119 str r1, [r3, #16] break; 4b4: e7f9 b.n 4aa cdcdf_acm_notify_state = (cdcdf_acm_notify_state_t)func; 4b6: 6159 str r1, [r3, #20] 4b8: e7f7 b.n 4aa return ERR_NONE; 4ba: 200d movs r0, #13 4bc: 4240 negs r0, r0 4be: e7f5 b.n 4ac 4c0: 20000084 .word 0x20000084 4c4: 00001b85 .word 0x00001b85 000004c8 : return _cdcdf_acm_funcd.enabled; 4c8: 4b01 ldr r3, [pc, #4] ; (4d0 ) 4ca: 7958 ldrb r0, [r3, #5] } 4cc: 4770 bx lr 4ce: 46c0 nop ; (mov r8, r8) 4d0: 20000084 .word 0x20000084 000004d4 <_dummy_func_no_return>: static bool _dummy_func_no_return(uint32_t unused0, uint32_t unused1) { (void)unused0; (void)unused1; return false; } 4d4: 2000 movs r0, #0 4d6: 4770 bx lr 000004d8 <_usb_d_dev_wait_dfll_rdy>: */ static inline void _usb_d_dev_wait_dfll_rdy(void) { #define DFLL_READY_FLAG (SYSCTRL_PCLKSR_DFLLRDY | SYSCTRL_PCLKSR_DFLLLCKF | SYSCTRL_PCLKSR_DFLLLCKC) /* In USB recovery mode the status is not checked */ if (!(SYSCTRL->DFLLCTRL.reg & SYSCTRL_DFLLCTRL_USBCRM)) { 4d8: 4b07 ldr r3, [pc, #28] ; (4f8 <_usb_d_dev_wait_dfll_rdy+0x20>) 4da: 8c9a ldrh r2, [r3, #36] ; 0x24 4dc: 0692 lsls r2, r2, #26 4de: d504 bpl.n 4ea <_usb_d_dev_wait_dfll_rdy+0x12> static inline hri_sysctrl_pclksr_reg_t hri_sysctrl_get_PCLKSR_reg(const void *const hw, hri_sysctrl_pclksr_reg_t mask) { uint32_t tmp; tmp = ((Sysctrl *)hw)->PCLKSR.reg; tmp &= mask; 4e0: 2210 movs r2, #16 tmp = ((Sysctrl *)hw)->PCLKSR.reg; 4e2: 68d9 ldr r1, [r3, #12] while (hri_sysctrl_get_PCLKSR_reg(SYSCTRL, DFLL_READY_FLAG) != DFLL_READY_FLAG) ; } else { while (hri_sysctrl_get_PCLKSR_reg(SYSCTRL, SYSCTRL_PCLKSR_DFLLRDY) != SYSCTRL_PCLKSR_DFLLRDY) 4e4: 4211 tst r1, r2 4e6: d0fc beq.n 4e2 <_usb_d_dev_wait_dfll_rdy+0xa> 4e8: e004 b.n 4f4 <_usb_d_dev_wait_dfll_rdy+0x1c> tmp &= mask; 4ea: 21d0 movs r1, #208 ; 0xd0 tmp = ((Sysctrl *)hw)->PCLKSR.reg; 4ec: 68da ldr r2, [r3, #12] tmp &= mask; 4ee: 400a ands r2, r1 while (hri_sysctrl_get_PCLKSR_reg(SYSCTRL, DFLL_READY_FLAG) != DFLL_READY_FLAG) 4f0: 2ad0 cmp r2, #208 ; 0xd0 4f2: d1fb bne.n 4ec <_usb_d_dev_wait_dfll_rdy+0x14> ; } } 4f4: 4770 bx lr 4f6: 46c0 nop ; (mov r8, r8) 4f8: 40000800 .word 0x40000800 000004fc <_usb_d_dev_ept>: * \param[in] epn Endpoint number. * \param[in] dir Endpoint direction. */ static inline struct _usb_d_dev_ep *_usb_d_dev_ept(uint8_t epn, bool dir) { uint8_t ep_index = (epn == 0) ? 0 : (dir ? (epn + CONF_USB_D_MAX_EP_N) : epn); 4fc: 2800 cmp r0, #0 4fe: d003 beq.n 508 <_usb_d_dev_ept+0xc> 500: 2900 cmp r1, #0 502: d001 beq.n 508 <_usb_d_dev_ept+0xc> 504: 3002 adds r0, #2 506: b2c0 uxtb r0, r0 return &dev_inst.ep[ep_index]; 508: 2314 movs r3, #20 50a: 3001 adds r0, #1 50c: 4358 muls r0, r3 50e: 4b01 ldr r3, [pc, #4] ; (514 <_usb_d_dev_ept+0x18>) 510: 18c0 adds r0, r0, r3 } 512: 4770 bx lr 514: 20000108 .word 0x20000108 00000518 <_usb_d_dev_handle_setup>: * \brief Handles setup received interrupt * \param[in] ept Pointer to endpoint information. */ static void _usb_d_dev_handle_setup(struct _usb_d_dev_ep *ept) { uint8_t epn = USB_EP_GET_N(ept->ep); 518: 230f movs r3, #15 { 51a: b570 push {r4, r5, r6, lr} 51c: 0001 movs r1, r0 uint8_t epn = USB_EP_GET_N(ept->ep); 51e: 7c80 ldrb r0, [r0, #18] bool is_ctrl = _usb_d_dev_ep_is_ctrl(ept); if (!is_ctrl) { 520: 2507 movs r5, #7 uint8_t epn = USB_EP_GET_N(ept->ep); 522: 4003 ands r3, r0 bool is_ctrl = _usb_d_dev_ep_is_ctrl(ept); 524: 001a movs r2, r3 526: 7ccc ldrb r4, [r1, #19] if (!is_ctrl) { 528: 3208 adds r2, #8 52a: 4025 ands r5, r4 52c: 015b lsls r3, r3, #5 52e: 2d01 cmp r5, #1 530: d008 beq.n 544 <_usb_d_dev_handle_setup+0x2c> } static inline void hri_usbendpoint_clear_EPINTFLAG_reg(const void *const hw, uint8_t submodule_index, hri_usbendpoint_epintflag_reg_t mask) { ((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPINTFLAG.reg = mask; 532: 4914 ldr r1, [pc, #80] ; (584 <_usb_d_dev_handle_setup+0x6c>) 534: 0152 lsls r2, r2, #5 536: 1852 adds r2, r2, r1 538: 2110 movs r1, #16 53a: 71d1 strb r1, [r2, #7] } } static inline void hri_usbendpoint_clear_EPINTEN_RXSTP_bit(const void *const hw, uint8_t submodule_index) { ((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPINTENCLR.reg = USB_DEVICE_EPINTENSET_RXSTP; 53c: 4a12 ldr r2, [pc, #72] ; (588 <_usb_d_dev_handle_setup+0x70>) 53e: 189b adds r3, r3, r2 540: 7259 strb r1, [r3, #9] _usbd_ep_clear_bank_status(epn, 1); _usbd_ep_int_ack(epn, USB_D_BANK0_INT_FLAGS | USB_D_BANK1_INT_FLAGS); _usbd_ep_int_dis(epn, USB_D_BANK0_INT_FLAGS | USB_D_BANK1_INT_FLAGS); /* Invoke callback. */ dev_inst.ep_callbacks.setup(ept->ep); } 542: bd70 pop {r4, r5, r6, pc} if (_usb_d_dev_ep_is_busy(ept)) { 544: 2540 movs r5, #64 ; 0x40 546: 422c tst r4, r5 548: d006 beq.n 558 <_usb_d_dev_handle_setup+0x40> ((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPSTATUSCLR.reg = mask; 54a: 2680 movs r6, #128 ; 0x80 ept->flags.bits.is_busy = 0; 54c: 43ac bics r4, r5 54e: 74cc strb r4, [r1, #19] 550: 4c0d ldr r4, [pc, #52] ; (588 <_usb_d_dev_handle_setup+0x70>) 552: 191c adds r4, r3, r4 554: 7166 strb r6, [r4, #5] ((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPSTATUSSET.reg = mask; 556: 71a5 strb r5, [r4, #6] ept->flags.bits.is_stalled = 0; 558: 2508 movs r5, #8 55a: 7ccc ldrb r4, [r1, #19] ((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPINTFLAG.reg = mask; 55c: 0152 lsls r2, r2, #5 55e: 43ac bics r4, r5 560: 74cc strb r4, [r1, #19] bank->STATUS_BK.reg = 0; 562: 2400 movs r4, #0 564: 4909 ldr r1, [pc, #36] ; (58c <_usb_d_dev_handle_setup+0x74>) 566: 18c9 adds r1, r1, r3 568: 728c strb r4, [r1, #10] 56a: 768c strb r4, [r1, #26] 56c: 4905 ldr r1, [pc, #20] ; (584 <_usb_d_dev_handle_setup+0x6c>) 56e: 1852 adds r2, r2, r1 570: 216f movs r1, #111 ; 0x6f 572: 71d1 strb r1, [r2, #7] } static inline void hri_usbendpoint_clear_EPINTEN_reg(const void *const hw, uint8_t submodule_index, hri_usbendpoint_epintenset_reg_t mask) { ((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPINTENCLR.reg = mask; 574: 4a04 ldr r2, [pc, #16] ; (588 <_usb_d_dev_handle_setup+0x70>) 576: 189b adds r3, r3, r2 578: 7259 strb r1, [r3, #9] dev_inst.ep_callbacks.setup(ept->ep); 57a: 4b05 ldr r3, [pc, #20] ; (590 <_usb_d_dev_handle_setup+0x78>) 57c: 689b ldr r3, [r3, #8] 57e: 4798 blx r3 580: e7df b.n 542 <_usb_d_dev_handle_setup+0x2a> 582: 46c0 nop ; (mov r8, r8) 584: 41005000 .word 0x41005000 588: 410050ff .word 0x410050ff 58c: 200000a8 .word 0x200000a8 590: 20000108 .word 0x20000108 00000594 <_usb_d_dev_handle_stall>: _usbd_ep_int_dis(epn, USB_DEVICE_EPINTFLAG_STALL0 << bank_n); 594: 2320 movs r3, #32 596: 408b lsls r3, r1 hri_usbendpoint_clear_EPINTEN_reg(USB, epn, flags); 598: b2da uxtb r2, r3 59a: 230f movs r3, #15 * \brief Handles stall sent interrupt * \param[in] ept Pointer to endpoint information. * \param[in] bank_n Bank number. */ static void _usb_d_dev_handle_stall(struct _usb_d_dev_ep *ept, const uint8_t bank_n) { 59c: b510 push {r4, lr} 59e: 0004 movs r4, r0 uint8_t epn = USB_EP_GET_N(ept->ep); 5a0: 7c80 ldrb r0, [r0, #18] 5a2: 4905 ldr r1, [pc, #20] ; (5b8 <_usb_d_dev_handle_stall+0x24>) 5a4: 4003 ands r3, r0 5a6: 015b lsls r3, r3, #5 5a8: 185b adds r3, r3, r1 5aa: 725a strb r2, [r3, #9] /* Clear interrupt enable. Leave status there for status check. */ _usbd_ep_int_stall_en(epn, bank_n, false); dev_inst.ep_callbacks.done(ept->ep, USB_TRANS_STALL, ept->trans_count); 5ac: 4b03 ldr r3, [pc, #12] ; (5bc <_usb_d_dev_handle_stall+0x28>) 5ae: 2101 movs r1, #1 5b0: 691b ldr r3, [r3, #16] 5b2: 68a2 ldr r2, [r4, #8] 5b4: 4798 blx r3 } 5b6: bd10 pop {r4, pc} 5b8: 410050ff .word 0x410050ff 5bc: 20000108 .word 0x20000108 000005c0 <_usb_d_dev_trans_done>: * \brief Finish the transaction and invoke callback * \param[in, out] ept Pointer to endpoint information. * \param[in] code Information code passed. */ static void _usb_d_dev_trans_done(struct _usb_d_dev_ep *ept, const int32_t code) { 5c0: b510 push {r4, lr} 5c2: 0003 movs r3, r0 if (!(_usb_d_dev_ep_is_used(ept) && _usb_d_dev_ep_is_busy(ept))) { 5c4: 7c80 ldrb r0, [r0, #18] 5c6: 28ff cmp r0, #255 ; 0xff 5c8: d009 beq.n 5de <_usb_d_dev_trans_done+0x1e> 5ca: 2440 movs r4, #64 ; 0x40 5cc: 7cda ldrb r2, [r3, #19] 5ce: 4222 tst r2, r4 5d0: d005 beq.n 5de <_usb_d_dev_trans_done+0x1e> return; } ept->flags.bits.is_busy = 0; 5d2: 43a2 bics r2, r4 5d4: 74da strb r2, [r3, #19] dev_inst.ep_callbacks.done(ept->ep, code, ept->trans_count); 5d6: 4a02 ldr r2, [pc, #8] ; (5e0 <_usb_d_dev_trans_done+0x20>) 5d8: 6914 ldr r4, [r2, #16] 5da: 689a ldr r2, [r3, #8] 5dc: 47a0 blx r4 } 5de: bd10 pop {r4, pc} 5e0: 20000108 .word 0x20000108 000005e4 <_usb_d_dev_trans_stop>: * \param[in, out] ept Pointer to endpoint information. * \param[in] dir Endpoint direction. * \param[in] code Information code passed. */ static void _usb_d_dev_trans_stop(struct _usb_d_dev_ep *ept, bool dir, const int32_t code) { 5e4: b5f7 push {r0, r1, r2, r4, r5, r6, r7, lr} 5e6: 4694 mov ip, r2 uint8_t epn = USB_EP_GET_N(ept->ep); 5e8: 7c83 ldrb r3, [r0, #18] ; const uint8_t intflags[2] = {USB_D_BANK0_INT_FLAGS, USB_D_BANK1_INT_FLAGS}; 5ea: 4a13 ldr r2, [pc, #76] ; (638 <_usb_d_dev_trans_stop+0x54>) 5ec: ae01 add r6, sp, #4 { 5ee: 000d movs r5, r1 const uint8_t intflags[2] = {USB_D_BANK0_INT_FLAGS, USB_D_BANK1_INT_FLAGS}; 5f0: 8032 strh r2, [r6, #0] if (!(_usb_d_dev_ep_is_used(ept) && _usb_d_dev_ep_is_busy(ept))) { 5f2: 2bff cmp r3, #255 ; 0xff 5f4: d01a beq.n 62c <_usb_d_dev_trans_stop+0x48> 5f6: 2740 movs r7, #64 ; 0x40 5f8: 7cc2 ldrb r2, [r0, #19] 5fa: 423a tst r2, r7 5fc: d016 beq.n 62c <_usb_d_dev_trans_stop+0x48> ((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPSTATUSCLR.reg = mask; 5fe: 220f movs r2, #15 600: 4013 ands r3, r2 602: 001c movs r4, r3 604: 3408 adds r4, #8 606: 0162 lsls r2, r4, #5 return; } /* Stop transfer */ if (dir) { 608: 2900 cmp r1, #0 60a: d010 beq.n 62e <_usb_d_dev_trans_stop+0x4a> 60c: 4f0b ldr r7, [pc, #44] ; (63c <_usb_d_dev_trans_stop+0x58>) 60e: 19d2 adds r2, r2, r7 610: 2780 movs r7, #128 ; 0x80 612: 7117 strb r7, [r2, #4] ((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPINTFLAG.reg = mask; 614: 4909 ldr r1, [pc, #36] ; (63c <_usb_d_dev_trans_stop+0x58>) 616: 0164 lsls r4, r4, #5 618: 1864 adds r4, r4, r1 ((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPINTENCLR.reg = mask; 61a: 4909 ldr r1, [pc, #36] ; (640 <_usb_d_dev_trans_stop+0x5c>) _usbd_ep_set_in_rdy(epn, 1, false); } else { /* NAK OUT */ _usbd_ep_set_out_rdy(epn, 0, false); } _usbd_ep_int_ack(epn, intflags[dir]); 61c: 5d72 ldrb r2, [r6, r5] 61e: 015b lsls r3, r3, #5 620: 185b adds r3, r3, r1 ((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPINTFLAG.reg = mask; 622: 71e2 strb r2, [r4, #7] _usbd_ep_int_dis(epn, intflags[dir]); _usb_d_dev_trans_done(ept, code); 624: 4661 mov r1, ip ((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPINTENCLR.reg = mask; 626: 725a strb r2, [r3, #9] 628: 4b06 ldr r3, [pc, #24] ; (644 <_usb_d_dev_trans_stop+0x60>) 62a: 4798 blx r3 } 62c: bdf7 pop {r0, r1, r2, r4, r5, r6, r7, pc} ((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPSTATUSSET.reg = mask; 62e: 4903 ldr r1, [pc, #12] ; (63c <_usb_d_dev_trans_stop+0x58>) 630: 1852 adds r2, r2, r1 632: 7157 strb r7, [r2, #5] } 634: e7ee b.n 614 <_usb_d_dev_trans_stop+0x30> 636: 46c0 nop ; (mov r8, r8) 638: 00004a25 .word 0x00004a25 63c: 41005000 .word 0x41005000 640: 410050ff .word 0x410050ff 644: 000005c1 .word 0x000005c1 00000648 <_usb_d_dev_handle_trfail>: { 648: b5f0 push {r4, r5, r6, r7, lr} 64a: 000d movs r5, r1 uint8_t epn = USB_EP_GET_N(ept->ep); 64c: 210f movs r1, #15 64e: 7c83 ldrb r3, [r0, #18] { 650: b085 sub sp, #20 uint8_t epn = USB_EP_GET_N(ept->ep); 652: 400b ands r3, r1 654: 469c mov ip, r3 const uint8_t fail[2] = {USB_DEVICE_EPINTFLAG_TRFAIL0, USB_DEVICE_EPINTFLAG_TRFAIL1}; 656: 4b30 ldr r3, [pc, #192] ; (718 <_usb_d_dev_handle_trfail+0xd0>) 658: ae03 add r6, sp, #12 65a: 8033 strh r3, [r6, #0] UsbDeviceDescBank *bank = prvt_inst.desc_table[epn].DeviceDescBank; 65c: 4663 mov r3, ip 65e: 015b lsls r3, r3, #5 660: 9300 str r3, [sp, #0] uint8_t eptype 662: 4663 mov r3, ip 664: 3308 adds r3, #8 666: 492d ldr r1, [pc, #180] ; (71c <_usb_d_dev_handle_trfail+0xd4>) static inline hri_usbendpoint_epcfg_reg_t hri_usbendpoint_read_EPCFG_EPTYPE1_bf(const void *const hw, uint8_t submodule_index) { uint8_t tmp; tmp = ((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPCFG.reg; 668: 015c lsls r4, r3, #5 66a: 2d00 cmp r5, #0 66c: d020 beq.n 6b0 <_usb_d_dev_handle_trfail+0x68> 66e: 5d09 ldrb r1, [r1, r4] tmp = (tmp & USB_DEVICE_EPCFG_EPTYPE1_Msk) >> USB_DEVICE_EPCFG_EPTYPE1_Pos; 670: 0649 lsls r1, r1, #25 672: 0f49 lsrs r1, r1, #29 st.reg = bank[bank_n].STATUS_BK.reg; 674: 9a00 ldr r2, [sp, #0] 676: 012c lsls r4, r5, #4 678: 18a4 adds r4, r4, r2 67a: 4a29 ldr r2, [pc, #164] ; (720 <_usb_d_dev_handle_trfail+0xd8>) hri_usbendpoint_clear_EPINTFLAG_reg(hw, epn, fail[bank_n]); 67c: 5d76 ldrb r6, [r6, r5] st.reg = bank[bank_n].STATUS_BK.reg; 67e: 1914 adds r4, r2, r4 680: 7aa7 ldrb r7, [r4, #10] 682: b2ff uxtb r7, r7 if ((eptype == USB_D_EPTYPE_ISOCH) && st.bit.CRCERR) { 684: 2902 cmp r1, #2 686: d117 bne.n 6b8 <_usb_d_dev_handle_trfail+0x70> 688: 3901 subs r1, #1 68a: 420f tst r7, r1 68c: d014 beq.n 6b8 <_usb_d_dev_handle_trfail+0x70> bank[bank_n].STATUS_BK.bit.CRCERR = 0; 68e: 7aa7 ldrb r7, [r4, #10] ((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPINTFLAG.reg = mask; 690: 4a22 ldr r2, [pc, #136] ; (71c <_usb_d_dev_handle_trfail+0xd4>) 692: 015b lsls r3, r3, #5 694: 189b adds r3, r3, r2 696: 438f bics r7, r1 ((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPINTENCLR.reg = mask; 698: 9a00 ldr r2, [sp, #0] 69a: 72a7 strb r7, [r4, #10] ((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPINTFLAG.reg = mask; 69c: 71de strb r6, [r3, #7] ((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPINTENCLR.reg = mask; 69e: 4b21 ldr r3, [pc, #132] ; (724 <_usb_d_dev_handle_trfail+0xdc>) _usb_d_dev_trans_stop(ept, bank_n, USB_TRANS_ERROR); 6a0: 4029 ands r1, r5 6a2: 18d2 adds r2, r2, r3 6a4: 7256 strb r6, [r2, #9] 6a6: 2204 movs r2, #4 _usb_d_dev_trans_stop(ept, _usb_d_dev_ep_is_in(ept), USB_TRANS_DONE); 6a8: 4b1f ldr r3, [pc, #124] ; (728 <_usb_d_dev_handle_trfail+0xe0>) 6aa: 4798 blx r3 } 6ac: b005 add sp, #20 6ae: bdf0 pop {r4, r5, r6, r7, pc} tmp = ((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPCFG.reg; 6b0: 5d0c ldrb r4, [r1, r4] tmp = (tmp & USB_DEVICE_EPCFG_EPTYPE0_Msk) >> USB_DEVICE_EPCFG_EPTYPE0_Pos; 6b2: 2107 movs r1, #7 6b4: 4021 ands r1, r4 return tmp; 6b6: e7dd b.n 674 <_usb_d_dev_handle_trfail+0x2c> } else if (st.bit.ERRORFLOW) { 6b8: 2102 movs r1, #2 6ba: 003a movs r2, r7 6bc: 400a ands r2, r1 6be: 9201 str r2, [sp, #4] 6c0: 420f tst r7, r1 6c2: d017 beq.n 6f4 <_usb_d_dev_handle_trfail+0xac> bank[bank_n].STATUS_BK.bit.ERRORFLOW = 0; 6c4: 7aa2 ldrb r2, [r4, #10] bool is_ctrl = _usb_d_dev_ep_is_ctrl(ept); 6c6: 7cc7 ldrb r7, [r0, #19] bank[bank_n].STATUS_BK.bit.ERRORFLOW = 0; 6c8: 438a bics r2, r1 6ca: 72a2 strb r2, [r4, #10] ((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPINTFLAG.reg = mask; 6cc: 4a13 ldr r2, [pc, #76] ; (71c <_usb_d_dev_handle_trfail+0xd4>) 6ce: 015b lsls r3, r3, #5 6d0: 189b adds r3, r3, r2 6d2: 71de strb r6, [r3, #7] ((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPINTENCLR.reg = mask; 6d4: 9a00 ldr r2, [sp, #0] 6d6: 4b13 ldr r3, [pc, #76] ; (724 <_usb_d_dev_handle_trfail+0xdc>) 6d8: 18d2 adds r2, r2, r3 if (is_ctrl && _usb_d_dev_ep_is_busy(ept)) { 6da: 2307 movs r3, #7 6dc: 7256 strb r6, [r2, #9] 6de: 403b ands r3, r7 6e0: 2b01 cmp r3, #1 6e2: d1e3 bne.n 6ac <_usb_d_dev_handle_trfail+0x64> 6e4: 067b lsls r3, r7, #25 6e6: d5e1 bpl.n 6ac <_usb_d_dev_handle_trfail+0x64> if (bank_n != _usb_d_dev_ep_is_in(ept)) { 6e8: 7cc1 ldrb r1, [r0, #19] 6ea: 09c9 lsrs r1, r1, #7 6ec: 42a9 cmp r1, r5 6ee: d0dd beq.n 6ac <_usb_d_dev_handle_trfail+0x64> _usb_d_dev_trans_stop(ept, _usb_d_dev_ep_is_in(ept), USB_TRANS_DONE); 6f0: 2200 movs r2, #0 6f2: e7d9 b.n 6a8 <_usb_d_dev_handle_trfail+0x60> bank->STATUS_BK.reg = 0; 6f4: 4662 mov r2, ip 6f6: 0051 lsls r1, r2, #1 6f8: 194d adds r5, r1, r5 6fa: 4a09 ldr r2, [pc, #36] ; (720 <_usb_d_dev_handle_trfail+0xd8>) 6fc: 012d lsls r5, r5, #4 6fe: 1955 adds r5, r2, r5 700: 9a01 ldr r2, [sp, #4] ((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPINTFLAG.reg = mask; 702: 015b lsls r3, r3, #5 704: 72aa strb r2, [r5, #10] 706: 4a05 ldr r2, [pc, #20] ; (71c <_usb_d_dev_handle_trfail+0xd4>) 708: 189b adds r3, r3, r2 70a: 71de strb r6, [r3, #7] ((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPINTENCLR.reg = mask; 70c: 9a00 ldr r2, [sp, #0] 70e: 4b05 ldr r3, [pc, #20] ; (724 <_usb_d_dev_handle_trfail+0xdc>) 710: 18d2 adds r2, r2, r3 712: 7256 strb r6, [r2, #9] } 714: e7ca b.n 6ac <_usb_d_dev_handle_trfail+0x64> 716: 46c0 nop ; (mov r8, r8) 718: 00000804 .word 0x00000804 71c: 41005000 .word 0x41005000 720: 200000a8 .word 0x200000a8 724: 410050ff .word 0x410050ff 728: 000005e5 .word 0x000005e5 0000072c <_usb_d_dev_reset_epts>: for (i = 0; i < USB_D_N_EP; i++) { 72c: 238c movs r3, #140 ; 0x8c { 72e: b570 push {r4, r5, r6, lr} dev_inst.ep[i].ep = 0xFF; 730: 26ff movs r6, #255 ; 0xff 732: 4d09 ldr r5, [pc, #36] ; (758 <_usb_d_dev_reset_epts+0x2c>) 734: 009b lsls r3, r3, #2 736: 4c09 ldr r4, [pc, #36] ; (75c <_usb_d_dev_reset_epts+0x30>) 738: 18ed adds r5, r5, r3 _usb_d_dev_trans_done(&dev_inst.ep[i], USB_TRANS_RESET); 73a: 2103 movs r1, #3 73c: 0020 movs r0, r4 73e: 4b08 ldr r3, [pc, #32] ; (760 <_usb_d_dev_reset_epts+0x34>) 740: 4798 blx r3 dev_inst.ep[i].flags.u8 = 0; 742: 2100 movs r1, #0 dev_inst.ep[i].ep = 0xFF; 744: 74a6 strb r6, [r4, #18] dev_inst.ep[i].flags.u8 = 0; 746: 74e1 strb r1, [r4, #19] for (i = 0; i < USB_D_N_EP; i++) { 748: 3414 adds r4, #20 74a: 42ac cmp r4, r5 74c: d1f5 bne.n 73a <_usb_d_dev_reset_epts+0xe> memset(prvt_inst.desc_table, 0, sizeof(UsbDeviceDescriptor) * (CONF_USB_D_MAX_EP_N + 1)); 74e: 2260 movs r2, #96 ; 0x60 750: 4b04 ldr r3, [pc, #16] ; (764 <_usb_d_dev_reset_epts+0x38>) 752: 4805 ldr r0, [pc, #20] ; (768 <_usb_d_dev_reset_epts+0x3c>) 754: 4798 blx r3 } 756: bd70 pop {r4, r5, r6, pc} 758: 20000108 .word 0x20000108 75c: 2000011c .word 0x2000011c 760: 000005c1 .word 0x000005c1 764: 00002557 .word 0x00002557 768: 200000a8 .word 0x200000a8 0000076c <_usb_d_dev_in_next>: { 76c: b5f0 push {r4, r5, r6, r7, lr} uint8_t epn = USB_EP_GET_N(ept->ep); 76e: 270f movs r7, #15 { 770: b085 sub sp, #20 772: 9101 str r1, [sp, #4] uint8_t epn = USB_EP_GET_N(ept->ep); 774: 7c83 ldrb r3, [r0, #18] { 776: 0004 movs r4, r0 uint8_t epn = USB_EP_GET_N(ept->ep); 778: 9302 str r3, [sp, #8] 77a: 401f ands r7, r3 uint16_t trans_count = isr ? bank[1].PCKSIZE.bit.BYTE_COUNT : 0; 77c: 2300 movs r3, #0 77e: 4299 cmp r1, r3 780: d005 beq.n 78e <_usb_d_dev_in_next+0x22> UsbDeviceDescBank *bank = &prvt_inst.desc_table[epn].DeviceDescBank[0]; 782: 4b4b ldr r3, [pc, #300] ; (8b0 <_usb_d_dev_in_next+0x144>) 784: 017a lsls r2, r7, #5 786: 189b adds r3, r3, r2 uint16_t trans_count = isr ? bank[1].PCKSIZE.bit.BYTE_COUNT : 0; 788: 695b ldr r3, [r3, #20] 78a: 049b lsls r3, r3, #18 78c: 0c9b lsrs r3, r3, #18 uint16_t last_pkt = trans_count & ((ept->size == 1023) ? ept->size : (ept->size - 1)); 78e: 8a25 ldrh r5, [r4, #16] 790: 4a48 ldr r2, [pc, #288] ; (8b4 <_usb_d_dev_in_next+0x148>) 792: 46ac mov ip, r5 794: 4295 cmp r5, r2 796: d002 beq.n 79e <_usb_d_dev_in_next+0x32> 798: 1e6a subs r2, r5, #1 79a: b212 sxth r2, r2 79c: 4694 mov ip, r2 bool is_ctrl = _usb_d_dev_ep_is_ctrl(ept); 79e: 2207 movs r2, #7 7a0: 7ce0 ldrb r0, [r4, #19] 7a2: 4002 ands r2, r0 7a4: 9203 str r2, [sp, #12] if (isr) { 7a6: 9a01 ldr r2, [sp, #4] 7a8: 2a00 cmp r2, #0 7aa: d004 beq.n 7b6 <_usb_d_dev_in_next+0x4a> ((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPINTFLAG.reg = mask; 7ac: 4942 ldr r1, [pc, #264] ; (8b8 <_usb_d_dev_in_next+0x14c>) 7ae: 017a lsls r2, r7, #5 7b0: 1852 adds r2, r2, r1 7b2: 2102 movs r1, #2 7b4: 71d1 strb r1, [r2, #7] ept->trans_count += trans_count; 7b6: 68a2 ldr r2, [r4, #8] 7b8: 1899 adds r1, r3, r2 if (ept->trans_count < ept->trans_size) { 7ba: 6862 ldr r2, [r4, #4] ept->trans_count += trans_count; 7bc: 60a1 str r1, [r4, #8] if (ept->trans_count < ept->trans_size) { 7be: 4291 cmp r1, r2 7c0: d240 bcs.n 844 <_usb_d_dev_in_next+0xd8> memcpy(ept->cache, &ept->trans_buf[ept->trans_count], trans_next); 7c2: 6823 ldr r3, [r4, #0] trans_next = ept->trans_size - ept->trans_count; 7c4: 1a52 subs r2, r2, r1 memcpy(ept->cache, &ept->trans_buf[ept->trans_count], trans_next); 7c6: 1859 adds r1, r3, r1 7c8: 017b lsls r3, r7, #5 7ca: 4e39 ldr r6, [pc, #228] ; (8b0 <_usb_d_dev_in_next+0x144>) trans_next = ept->trans_size - ept->trans_count; 7cc: b292 uxth r2, r2 if (ept->flags.bits.use_cache) { 7ce: 9302 str r3, [sp, #8] 7d0: 0683 lsls r3, r0, #26 7d2: d52c bpl.n 82e <_usb_d_dev_in_next+0xc2> if (trans_next > ept->size) { 7d4: 1c2b adds r3, r5, #0 7d6: 4295 cmp r5, r2 7d8: d900 bls.n 7dc <_usb_d_dev_in_next+0x70> 7da: 1c13 adds r3, r2, #0 7dc: b29d uxth r5, r3 memcpy(ept->cache, &ept->trans_buf[ept->trans_count], trans_next); 7de: 002a movs r2, r5 7e0: 4b36 ldr r3, [pc, #216] ; (8bc <_usb_d_dev_in_next+0x150>) 7e2: 68e0 ldr r0, [r4, #12] 7e4: 4798 blx r3 bank->ADDR.reg = addr; 7e6: 4b32 ldr r3, [pc, #200] ; (8b0 <_usb_d_dev_in_next+0x144>) _usbd_ep_set_buf(epn, 1, (uint32_t)ept->cache); 7e8: 68e2 ldr r2, [r4, #12] bank->ADDR.reg = addr; 7ea: 0179 lsls r1, r7, #5 7ec: 185b adds r3, r3, r1 7ee: 611a str r2, [r3, #16] bank->PCKSIZE.bit.BYTE_COUNT = size; 7f0: 017b lsls r3, r7, #5 7f2: 18f6 adds r6, r6, r3 7f4: 6973 ldr r3, [r6, #20] 7f6: 04ad lsls r5, r5, #18 7f8: 0b9b lsrs r3, r3, #14 7fa: 0caa lsrs r2, r5, #18 7fc: 039d lsls r5, r3, #14 7fe: 4315 orrs r5, r2 800: 6175 str r5, [r6, #20] bank->PCKSIZE.bit.MULTI_PACKET_SIZE = count; 802: 6973 ldr r3, [r6, #20] 804: 4a2e ldr r2, [pc, #184] ; (8c0 <_usb_d_dev_in_next+0x154>) 806: 4013 ands r3, r2 808: 6173 str r3, [r6, #20] if (!isr) { 80a: 9b01 ldr r3, [sp, #4] 80c: 2b00 cmp r3, #0 80e: d108 bne.n 822 <_usb_d_dev_in_next+0xb6> if (is_ctrl) { 810: 9b03 ldr r3, [sp, #12] inten = USB_D_BANK1_INT_FLAGS | USB_DEVICE_EPINTFLAG_TRFAIL0; 812: 224e movs r2, #78 ; 0x4e if (is_ctrl) { 814: 2b01 cmp r3, #1 816: d000 beq.n 81a <_usb_d_dev_in_next+0xae> inten = USB_D_BANK1_INT_FLAGS; 818: 3a04 subs r2, #4 ((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPINTENSET.reg = mask; 81a: 492a ldr r1, [pc, #168] ; (8c4 <_usb_d_dev_in_next+0x158>) 81c: 017b lsls r3, r7, #5 81e: 185b adds r3, r3, r1 820: 729a strb r2, [r3, #10] ((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPSTATUSSET.reg = mask; 822: 4a25 ldr r2, [pc, #148] ; (8b8 <_usb_d_dev_in_next+0x14c>) 824: 017b lsls r3, r7, #5 826: 189b adds r3, r3, r2 828: 2280 movs r2, #128 ; 0x80 82a: 715a strb r2, [r3, #5] } 82c: e039 b.n 8a2 <_usb_d_dev_in_next+0x136> if (trans_next > USB_D_DEV_TRANS_MAX) { 82e: 2380 movs r3, #128 ; 0x80 830: 1c15 adds r5, r2, #0 832: 019b lsls r3, r3, #6 834: 429a cmp r2, r3 836: d900 bls.n 83a <_usb_d_dev_in_next+0xce> 838: 1c1d adds r5, r3, #0 bank->ADDR.reg = addr; 83a: 017b lsls r3, r7, #5 83c: 18f3 adds r3, r6, r3 83e: b2ad uxth r5, r5 840: 6119 str r1, [r3, #16] } 842: e7d5 b.n 7f0 <_usb_d_dev_in_next+0x84> } else if (ept->flags.bits.need_zlp) { 844: 2610 movs r6, #16 846: 017a lsls r2, r7, #5 848: 4230 tst r0, r6 84a: d00e beq.n 86a <_usb_d_dev_in_next+0xfe> ept->flags.bits.need_zlp = 0; 84c: 7ce3 ldrb r3, [r4, #19] bank->PCKSIZE.bit.MULTI_PACKET_SIZE = count; 84e: 491c ldr r1, [pc, #112] ; (8c0 <_usb_d_dev_in_next+0x154>) ept->flags.bits.need_zlp = 0; 850: 43b3 bics r3, r6 852: 74e3 strb r3, [r4, #19] bank->PCKSIZE.bit.BYTE_COUNT = size; 854: 4b16 ldr r3, [pc, #88] ; (8b0 <_usb_d_dev_in_next+0x144>) 856: 189a adds r2, r3, r2 858: 1992 adds r2, r2, r6 85a: 6853 ldr r3, [r2, #4] 85c: 0b9b lsrs r3, r3, #14 85e: 039b lsls r3, r3, #14 860: 6053 str r3, [r2, #4] bank->PCKSIZE.bit.MULTI_PACKET_SIZE = count; 862: 6853 ldr r3, [r2, #4] 864: 400b ands r3, r1 866: 6053 str r3, [r2, #4] goto _in_tx_exec; 868: e7cf b.n 80a <_usb_d_dev_in_next+0x9e> if (is_ctrl) { 86a: 9803 ldr r0, [sp, #12] 86c: 2801 cmp r0, #1 86e: d11a bne.n 8a6 <_usb_d_dev_in_next+0x13a> ((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPINTENCLR.reg = mask; 870: 4814 ldr r0, [pc, #80] ; (8c4 <_usb_d_dev_in_next+0x158>) 872: 1812 adds r2, r2, r0 874: 204b movs r0, #75 ; 0x4b 876: 7250 strb r0, [r2, #9] if (last_pkt == ept->size) { 878: 4662 mov r2, ip 87a: 4013 ands r3, r2 87c: 429d cmp r5, r3 87e: d10c bne.n 89a <_usb_d_dev_in_next+0x12e> ept->flags.bits.is_busy = 0; 880: 2540 movs r5, #64 ; 0x40 882: 7ce3 ldrb r3, [r4, #19] if (dev_inst.ep_callbacks.more(ept->ep, ept->trans_count)) { 884: 9802 ldr r0, [sp, #8] ept->flags.bits.is_busy = 0; 886: 43ab bics r3, r5 888: 74e3 strb r3, [r4, #19] if (dev_inst.ep_callbacks.more(ept->ep, ept->trans_count)) { 88a: 4b0f ldr r3, [pc, #60] ; (8c8 <_usb_d_dev_in_next+0x15c>) 88c: 68db ldr r3, [r3, #12] 88e: 4798 blx r3 890: 2800 cmp r0, #0 892: d106 bne.n 8a2 <_usb_d_dev_in_next+0x136> ept->flags.bits.is_busy = 1; 894: 7ce3 ldrb r3, [r4, #19] 896: 432b orrs r3, r5 898: 74e3 strb r3, [r4, #19] _usb_d_dev_trans_done(ept, USB_TRANS_DONE); 89a: 2100 movs r1, #0 89c: 0020 movs r0, r4 89e: 4b0b ldr r3, [pc, #44] ; (8cc <_usb_d_dev_in_next+0x160>) 8a0: 4798 blx r3 } 8a2: b005 add sp, #20 8a4: bdf0 pop {r4, r5, r6, r7, pc} 8a6: 4807 ldr r0, [pc, #28] ; (8c4 <_usb_d_dev_in_next+0x158>) 8a8: 1812 adds r2, r2, r0 8aa: 204a movs r0, #74 ; 0x4a 8ac: e7e3 b.n 876 <_usb_d_dev_in_next+0x10a> 8ae: 46c0 nop ; (mov r8, r8) 8b0: 200000a8 .word 0x200000a8 8b4: 000003ff .word 0x000003ff 8b8: 41005100 .word 0x41005100 8bc: 00002545 .word 0x00002545 8c0: f0003fff .word 0xf0003fff 8c4: 410050ff .word 0x410050ff 8c8: 20000108 .word 0x20000108 8cc: 000005c1 .word 0x000005c1 000008d0 <_usb_d_dev_out_next>: uint8_t epn = USB_EP_GET_N(ept->ep); 8d0: 230f movs r3, #15 { 8d2: b5f0 push {r4, r5, r6, r7, lr} uint8_t epn = USB_EP_GET_N(ept->ep); 8d4: 7c85 ldrb r5, [r0, #18] { 8d6: b085 sub sp, #20 8d8: 0004 movs r4, r0 8da: 000e movs r6, r1 uint8_t epn = USB_EP_GET_N(ept->ep); 8dc: 401d ands r5, r3 uint16_t trans_size = isr ? bank->PCKSIZE.bit.MULTI_PACKET_SIZE : 0; 8de: 9103 str r1, [sp, #12] uint16_t last_trans = isr ? bank->PCKSIZE.bit.BYTE_COUNT : 0; 8e0: 9101 str r1, [sp, #4] uint16_t trans_size = isr ? bank->PCKSIZE.bit.MULTI_PACKET_SIZE : 0; 8e2: 2900 cmp r1, #0 8e4: d00a beq.n 8fc <_usb_d_dev_out_next+0x2c> 8e6: 4b61 ldr r3, [pc, #388] ; (a6c <_usb_d_dev_out_next+0x19c>) 8e8: 016a lsls r2, r5, #5 8ea: 189b adds r3, r3, r2 8ec: 6859 ldr r1, [r3, #4] 8ee: 0109 lsls r1, r1, #4 8f0: 0c8a lsrs r2, r1, #18 8f2: 9203 str r2, [sp, #12] uint16_t last_trans = isr ? bank->PCKSIZE.bit.BYTE_COUNT : 0; 8f4: 6859 ldr r1, [r3, #4] 8f6: 0489 lsls r1, r1, #18 8f8: 0c8b lsrs r3, r1, #18 8fa: 9301 str r3, [sp, #4] uint16_t size_mask = (ept->size == 1023) ? 1023 : (ept->size - 1); 8fc: 8a23 ldrh r3, [r4, #16] 8fe: 9300 str r3, [sp, #0] 900: 9a00 ldr r2, [sp, #0] 902: 4b5b ldr r3, [pc, #364] ; (a70 <_usb_d_dev_out_next+0x1a0>) 904: 429a cmp r2, r3 906: d003 beq.n 910 <_usb_d_dev_out_next+0x40> 908: 0013 movs r3, r2 90a: 3b01 subs r3, #1 90c: b29b uxth r3, r3 90e: 9300 str r3, [sp, #0] uint16_t last_pkt = last_trans & size_mask; 910: 9b01 ldr r3, [sp, #4] 912: 9f00 ldr r7, [sp, #0] bool is_ctrl = _usb_d_dev_ep_is_ctrl(ept); 914: 7ce2 ldrb r2, [r4, #19] uint16_t last_pkt = last_trans & size_mask; 916: 401f ands r7, r3 bool is_ctrl = _usb_d_dev_ep_is_ctrl(ept); 918: 2307 movs r3, #7 91a: 4013 ands r3, r2 91c: 9302 str r3, [sp, #8] if (isr) { 91e: 2e00 cmp r6, #0 920: d004 beq.n 92c <_usb_d_dev_out_next+0x5c> ((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPINTFLAG.reg = mask; 922: 4954 ldr r1, [pc, #336] ; (a74 <_usb_d_dev_out_next+0x1a4>) 924: 016b lsls r3, r5, #5 926: 185b adds r3, r3, r1 928: 2101 movs r1, #1 92a: 71d9 strb r1, [r3, #7] if (ept->flags.bits.use_cache && ept->trans_size) { 92c: 0693 lsls r3, r2, #26 92e: d50f bpl.n 950 <_usb_d_dev_out_next+0x80> 930: 6863 ldr r3, [r4, #4] 932: 2b00 cmp r3, #0 934: d00c beq.n 950 <_usb_d_dev_out_next+0x80> uint16_t buf_remain = ept->trans_size - ept->trans_count; 936: 68a2 ldr r2, [r4, #8] memcpy(&ept->trans_buf[ept->trans_count], ept->cache, (buf_remain > last_pkt) ? last_pkt : buf_remain); 938: 6821 ldr r1, [r4, #0] uint16_t buf_remain = ept->trans_size - ept->trans_count; 93a: 1a9b subs r3, r3, r2 memcpy(&ept->trans_buf[ept->trans_count], ept->cache, (buf_remain > last_pkt) ? last_pkt : buf_remain); 93c: 1888 adds r0, r1, r2 93e: 1c1a adds r2, r3, #0 940: b29b uxth r3, r3 942: 42bb cmp r3, r7 944: d900 bls.n 948 <_usb_d_dev_out_next+0x78> 946: 1c3a adds r2, r7, #0 948: 68e1 ldr r1, [r4, #12] 94a: 4b4b ldr r3, [pc, #300] ; (a78 <_usb_d_dev_out_next+0x1a8>) 94c: b292 uxth r2, r2 94e: 4798 blx r3 if (ept->trans_size == 0 && ept->flags.bits.need_zlp) { 950: 6863 ldr r3, [r4, #4] 952: 016a lsls r2, r5, #5 954: 4694 mov ip, r2 956: 2b00 cmp r3, #0 958: d12c bne.n 9b4 <_usb_d_dev_out_next+0xe4> 95a: 7ce2 ldrb r2, [r4, #19] 95c: 06d1 lsls r1, r2, #27 95e: d529 bpl.n 9b4 <_usb_d_dev_out_next+0xe4> ept->flags.bits.need_zlp = 0; 960: 3330 adds r3, #48 ; 0x30 962: 439a bics r2, r3 964: 3b10 subs r3, #16 966: 431a orrs r2, r3 968: 74e2 strb r2, [r4, #19] bank->ADDR.reg = addr; 96a: 4662 mov r2, ip 96c: 68e1 ldr r1, [r4, #12] 96e: 4b3f ldr r3, [pc, #252] ; (a6c <_usb_d_dev_out_next+0x19c>) bank->PCKSIZE.bit.MULTI_PACKET_SIZE = size; 970: 4842 ldr r0, [pc, #264] ; (a7c <_usb_d_dev_out_next+0x1ac>) bank->ADDR.reg = addr; 972: 5099 str r1, [r3, r2] bank->PCKSIZE.bit.MULTI_PACKET_SIZE = size; 974: 8a21 ldrh r1, [r4, #16] 976: 4463 add r3, ip 978: 685a ldr r2, [r3, #4] 97a: 0489 lsls r1, r1, #18 97c: 0909 lsrs r1, r1, #4 97e: 4002 ands r2, r0 980: 430a orrs r2, r1 982: 605a str r2, [r3, #4] bank->PCKSIZE.bit.BYTE_COUNT = count; 984: 685a ldr r2, [r3, #4] 986: 0b92 lsrs r2, r2, #14 988: 0392 lsls r2, r2, #14 98a: 605a str r2, [r3, #4] if (!isr) { 98c: 2e00 cmp r6, #0 98e: d10b bne.n 9a8 <_usb_d_dev_out_next+0xd8> if (is_ctrl) { 990: 9902 ldr r1, [sp, #8] inten = USB_D_BANK0_INT_FLAGS; 992: 2225 movs r2, #37 ; 0x25 994: 016b lsls r3, r5, #5 if (is_ctrl) { 996: 2901 cmp r1, #1 998: d103 bne.n 9a2 <_usb_d_dev_out_next+0xd2> bank->STATUS_BK.reg = 0; 99a: 4a34 ldr r2, [pc, #208] ; (a6c <_usb_d_dev_out_next+0x19c>) 99c: 18d2 adds r2, r2, r3 99e: 7696 strb r6, [r2, #26] inten = USB_D_BANK0_INT_FLAGS | USB_DEVICE_EPINTFLAG_TRFAIL1; 9a0: 222d movs r2, #45 ; 0x2d ((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPINTENSET.reg = mask; 9a2: 4937 ldr r1, [pc, #220] ; (a80 <_usb_d_dev_out_next+0x1b0>) 9a4: 185b adds r3, r3, r1 9a6: 729a strb r2, [r3, #10] ((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPSTATUSCLR.reg = mask; 9a8: 4b32 ldr r3, [pc, #200] ; (a74 <_usb_d_dev_out_next+0x1a4>) 9aa: 016d lsls r5, r5, #5 9ac: 18ed adds r5, r5, r3 9ae: 2340 movs r3, #64 ; 0x40 9b0: 712b strb r3, [r5, #4] } 9b2: e01d b.n 9f0 <_usb_d_dev_out_next+0x120> ept->trans_count += last_trans; 9b4: 68a1 ldr r1, [r4, #8] } else if (isr && last_pkt < ept->size) { 9b6: 2e00 cmp r6, #0 9b8: d01c beq.n 9f4 <_usb_d_dev_out_next+0x124> 9ba: 8a22 ldrh r2, [r4, #16] 9bc: 42ba cmp r2, r7 9be: d919 bls.n 9f4 <_usb_d_dev_out_next+0x124> ept->flags.bits.need_zlp = 0; 9c0: 2210 movs r2, #16 9c2: 7ce3 ldrb r3, [r4, #19] 9c4: 4393 bics r3, r2 9c6: 74e3 strb r3, [r4, #19] ept->trans_count += last_trans; 9c8: 9b01 ldr r3, [sp, #4] 9ca: 1859 adds r1, r3, r1 9cc: 60a1 str r1, [r4, #8] if (is_ctrl) { 9ce: 9a02 ldr r2, [sp, #8] 9d0: 016b lsls r3, r5, #5 9d2: 2a01 cmp r2, #1 9d4: d146 bne.n a64 <_usb_d_dev_out_next+0x194> ((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPINTENCLR.reg = mask; 9d6: 4a2a ldr r2, [pc, #168] ; (a80 <_usb_d_dev_out_next+0x1b0>) 9d8: 189b adds r3, r3, r2 9da: 222d movs r2, #45 ; 0x2d 9dc: 725a strb r2, [r3, #9] if (0 == epn) { 9de: 2d00 cmp r5, #0 9e0: d102 bne.n 9e8 <_usb_d_dev_out_next+0x118> bank->ADDR.reg = addr; 9e2: 4b22 ldr r3, [pc, #136] ; (a6c <_usb_d_dev_out_next+0x19c>) 9e4: 68e2 ldr r2, [r4, #12] 9e6: 601a str r2, [r3, #0] _usb_d_dev_trans_done(ept, USB_TRANS_DONE); 9e8: 2100 movs r1, #0 9ea: 0020 movs r0, r4 9ec: 4b25 ldr r3, [pc, #148] ; (a84 <_usb_d_dev_out_next+0x1b4>) 9ee: 4798 blx r3 } 9f0: b005 add sp, #20 9f2: bdf0 pop {r4, r5, r6, r7, pc} ept->trans_count += trans_size; 9f4: 9a03 ldr r2, [sp, #12] 9f6: 1851 adds r1, r2, r1 9f8: 60a1 str r1, [r4, #8] if (ept->trans_count < ept->trans_size) { 9fa: 428b cmp r3, r1 9fc: d9e7 bls.n 9ce <_usb_d_dev_out_next+0xfe> if (ept->flags.bits.use_cache) { 9fe: 2020 movs r0, #32 a00: 7ce2 ldrb r2, [r4, #19] trans_next = ept->trans_size - ept->trans_count; a02: 1a5b subs r3, r3, r1 _usbd_ep_set_out_trans(epn, 0, ept->size, 0); a04: 8a27 ldrh r7, [r4, #16] trans_next = ept->trans_size - ept->trans_count; a06: b29b uxth r3, r3 if (ept->flags.bits.use_cache) { a08: 4202 tst r2, r0 a0a: d016 beq.n a3a <_usb_d_dev_out_next+0x16a> if (trans_next > ept->size) { a0c: 1c39 adds r1, r7, #0 a0e: 429f cmp r7, r3 a10: d900 bls.n a14 <_usb_d_dev_out_next+0x144> a12: 1c19 adds r1, r3, #0 _usbd_ep_set_buf(epn, 0, (uint32_t)ept->cache); a14: 68e0 ldr r0, [r4, #12] bank->ADDR.reg = addr; a16: 4a15 ldr r2, [pc, #84] ; (a6c <_usb_d_dev_out_next+0x19c>) a18: b28b uxth r3, r1 a1a: 0169 lsls r1, r5, #5 a1c: 5050 str r0, [r2, r1] bank->PCKSIZE.bit.MULTI_PACKET_SIZE = size; a1e: 4a13 ldr r2, [pc, #76] ; (a6c <_usb_d_dev_out_next+0x19c>) a20: 4816 ldr r0, [pc, #88] ; (a7c <_usb_d_dev_out_next+0x1ac>) a22: 4462 add r2, ip a24: 6851 ldr r1, [r2, #4] a26: 049b lsls r3, r3, #18 a28: 091b lsrs r3, r3, #4 a2a: 4001 ands r1, r0 a2c: 430b orrs r3, r1 a2e: 6053 str r3, [r2, #4] bank->PCKSIZE.bit.BYTE_COUNT = count; a30: 6853 ldr r3, [r2, #4] a32: 0b9b lsrs r3, r3, #14 a34: 039b lsls r3, r3, #14 a36: 6053 str r3, [r2, #4] goto _out_rx_exec; a38: e7a8 b.n 98c <_usb_d_dev_out_next+0xbc> if (trans_next > ept->size) { a3a: 429f cmp r7, r3 a3c: d20b bcs.n a56 <_usb_d_dev_out_next+0x186> if (trans_next > USB_D_DEV_TRANS_MAX) { a3e: 2080 movs r0, #128 ; 0x80 a40: 0180 lsls r0, r0, #6 a42: 4283 cmp r3, r0 a44: d80c bhi.n a60 <_usb_d_dev_out_next+0x190> trans_next -= trans_next & size_mask; a46: 9a00 ldr r2, [sp, #0] a48: 4393 bics r3, r2 _usbd_ep_set_buf(epn, 0, (uint32_t)&ept->trans_buf[ept->trans_count]); a4a: 6820 ldr r0, [r4, #0] bank->ADDR.reg = addr; a4c: 4a07 ldr r2, [pc, #28] ; (a6c <_usb_d_dev_out_next+0x19c>) _usbd_ep_set_buf(epn, 0, (uint32_t)&ept->trans_buf[ept->trans_count]); a4e: 1841 adds r1, r0, r1 bank->ADDR.reg = addr; a50: 0168 lsls r0, r5, #5 a52: 5011 str r1, [r2, r0] } a54: e7e3 b.n a1e <_usb_d_dev_out_next+0x14e> } else if (trans_next < ept->size) { a56: 429f cmp r7, r3 a58: d9f7 bls.n a4a <_usb_d_dev_out_next+0x17a> ept->flags.bits.use_cache = 1; a5a: 4310 orrs r0, r2 a5c: 74e0 strb r0, [r4, #19] a5e: e7f4 b.n a4a <_usb_d_dev_out_next+0x17a> trans_next = USB_D_DEV_TRANS_MAX; a60: 0003 movs r3, r0 a62: e7f2 b.n a4a <_usb_d_dev_out_next+0x17a> a64: 4a06 ldr r2, [pc, #24] ; (a80 <_usb_d_dev_out_next+0x1b0>) a66: 189b adds r3, r3, r2 a68: 2225 movs r2, #37 ; 0x25 a6a: e7b7 b.n 9dc <_usb_d_dev_out_next+0x10c> a6c: 200000a8 .word 0x200000a8 a70: 000003ff .word 0x000003ff a74: 41005100 .word 0x41005100 a78: 00002545 .word 0x00002545 a7c: f0003fff .word 0xf0003fff a80: 410050ff .word 0x410050ff a84: 000005c1 .word 0x000005c1 00000a88 <_usbd_ep_pcksize_size>: : ((n > 256) ? 6 : ((n > 128) ? 5 : ((n > 64) ? 4 : ((n > 32) ? 3 : ((n > 16) ? 2 : ((n > 8) ? 1 : 0))))))); a88: 2380 movs r3, #128 ; 0x80 { a8a: 0002 movs r2, r0 : ((n > 256) ? 6 : ((n > 128) ? 5 : ((n > 64) ? 4 : ((n > 32) ? 3 : ((n > 16) ? 2 : ((n > 8) ? 1 : 0))))))); a8c: 009b lsls r3, r3, #2 a8e: 2007 movs r0, #7 a90: 429a cmp r2, r3 a92: d814 bhi.n abe <_usbd_ep_pcksize_size+0x36> a94: 3b01 subs r3, #1 a96: 3bff subs r3, #255 ; 0xff a98: 3801 subs r0, #1 a9a: 429a cmp r2, r3 a9c: d80f bhi.n abe <_usbd_ep_pcksize_size+0x36> a9e: 3801 subs r0, #1 aa0: 2a80 cmp r2, #128 ; 0x80 aa2: d80c bhi.n abe <_usbd_ep_pcksize_size+0x36> aa4: 3801 subs r0, #1 aa6: 2a40 cmp r2, #64 ; 0x40 aa8: d809 bhi.n abe <_usbd_ep_pcksize_size+0x36> aaa: 3801 subs r0, #1 aac: 2a20 cmp r2, #32 aae: d806 bhi.n abe <_usbd_ep_pcksize_size+0x36> ab0: 3801 subs r0, #1 ab2: 2a10 cmp r2, #16 ab4: d803 bhi.n abe <_usbd_ep_pcksize_size+0x36> ab6: 3006 adds r0, #6 ab8: 4290 cmp r0, r2 aba: 4180 sbcs r0, r0 abc: 4240 negs r0, r0 } abe: 4770 bx lr 00000ac0 <_usb_d_dev_init>: { ac0: b510 push {r4, lr} return ((Usb *)hw)->DEVICE.SYNCBUSY.reg & reg; ac2: 4c2a ldr r4, [pc, #168] ; (b6c <_usb_d_dev_init+0xac>) ac4: 78a3 ldrb r3, [r4, #2] if (!hri_usbdevice_is_syncing(hw, USB_SYNCBUSY_SWRST)) { ac6: 07db lsls r3, r3, #31 ac8: d418 bmi.n afc <_usb_d_dev_init+0x3c> while (((Usb *)hw)->DEVICE.SYNCBUSY.reg & reg) { aca: 2303 movs r3, #3 acc: 78a2 ldrb r2, [r4, #2] ace: 421a tst r2, r3 ad0: d1fc bne.n acc <_usb_d_dev_init+0xc> static inline hri_usb_ctrla_reg_t hri_usb_get_CTRLA_reg(const void *const hw, hri_usb_ctrla_reg_t mask) { uint8_t tmp; hri_usb_wait_for_sync(hw, USB_SYNCBUSY_MASK); tmp = ((Usb *)hw)->HOST.CTRLA.reg; tmp &= mask; ad2: 2202 movs r2, #2 tmp = ((Usb *)hw)->HOST.CTRLA.reg; ad4: 7823 ldrb r3, [r4, #0] if (hri_usbdevice_get_CTRLA_reg(hw, USB_CTRLA_ENABLE)) { ad6: 4213 tst r3, r2 ad8: d00a beq.n af0 <_usb_d_dev_init+0x30> ((Usb *)hw)->HOST.CTRLA.reg &= ~USB_CTRLA_ENABLE; ada: 7823 ldrb r3, [r4, #0] adc: 4393 bics r3, r2 ade: 7023 strb r3, [r4, #0] while (((Usb *)hw)->DEVICE.SYNCBUSY.reg & reg) { ae0: 2303 movs r3, #3 ae2: 78a2 ldrb r2, [r4, #2] ae4: 421a tst r2, r3 ae6: d1fc bne.n ae2 <_usb_d_dev_init+0x22> ae8: 2302 movs r3, #2 aea: 78a2 ldrb r2, [r4, #2] aec: 421a tst r2, r3 aee: d1fc bne.n aea <_usb_d_dev_init+0x2a> } static inline void hri_usb_write_CTRLA_reg(const void *const hw, hri_usb_ctrla_reg_t data) { USB_CRITICAL_SECTION_ENTER(); ((Usb *)hw)->HOST.CTRLA.reg = data; af0: 2301 movs r3, #1 af2: 7023 strb r3, [r4, #0] while (((Usb *)hw)->DEVICE.SYNCBUSY.reg & reg) { af4: 3302 adds r3, #2 af6: 78a2 ldrb r2, [r4, #2] af8: 421a tst r2, r3 afa: d1fc bne.n af6 <_usb_d_dev_init+0x36> afc: 2301 movs r3, #1 afe: 78a2 ldrb r2, [r4, #2] b00: 421a tst r2, r3 b02: d1fc bne.n afe <_usb_d_dev_init+0x3e> dev_inst.callbacks.sof = (_usb_d_dev_sof_cb_t)_dummy_func_no_return; b04: 4b1a ldr r3, [pc, #104] ; (b70 <_usb_d_dev_init+0xb0>) b06: 4a1b ldr r2, [pc, #108] ; (b74 <_usb_d_dev_init+0xb4>) b08: 601a str r2, [r3, #0] dev_inst.callbacks.event = (_usb_d_dev_event_cb_t)_dummy_func_no_return; b0a: 605a str r2, [r3, #4] dev_inst.ep_callbacks.setup = (_usb_d_dev_ep_cb_setup_t)_dummy_func_no_return; b0c: 609a str r2, [r3, #8] dev_inst.ep_callbacks.more = (_usb_d_dev_ep_cb_more_t)_dummy_func_no_return; b0e: 60da str r2, [r3, #12] dev_inst.ep_callbacks.done = (_usb_d_dev_ep_cb_done_t)_dummy_func_no_return; b10: 611a str r2, [r3, #16] _usb_d_dev_reset_epts(); b12: 4b19 ldr r3, [pc, #100] ; (b78 <_usb_d_dev_init+0xb8>) b14: 4798 blx r3 uint32_t pad_transn b16: 201f movs r0, #31 = (*((uint32_t *)(NVMCTRL_OTP4) + (NVM_USB_PAD_TRANSN_POS / 32)) >> (NVM_USB_PAD_TRANSN_POS % 32)) b18: 4b18 ldr r3, [pc, #96] ; (b7c <_usb_d_dev_init+0xbc>) b1a: 681a ldr r2, [r3, #0] b1c: 0b53 lsrs r3, r2, #13 = (*((uint32_t *)(NVMCTRL_OTP4) + (NVM_USB_PAD_TRANSP_POS / 32)) >> (NVM_USB_PAD_TRANSP_POS % 32)) b1e: 0c91 lsrs r1, r2, #18 uint32_t pad_trim = (*((uint32_t *)(NVMCTRL_OTP4) + (NVM_USB_PAD_TRIM_POS / 32)) >> (NVM_USB_PAD_TRIM_POS % 32)) b20: 0192 lsls r2, r2, #6 uint32_t pad_transn b22: 4003 ands r3, r0 uint32_t pad_transp b24: 4001 ands r1, r0 uint32_t pad_trim = (*((uint32_t *)(NVMCTRL_OTP4) + (NVM_USB_PAD_TRIM_POS / 32)) >> (NVM_USB_PAD_TRIM_POS % 32)) b26: 0f52 lsrs r2, r2, #29 if (pad_transn == 0x1F) { b28: 4283 cmp r3, r0 b2a: d100 bne.n b2e <_usb_d_dev_init+0x6e> pad_transn = 5; b2c: 2305 movs r3, #5 if (pad_transp == 0x1F) { b2e: 291f cmp r1, #31 b30: d100 bne.n b34 <_usb_d_dev_init+0x74> pad_transp = 29; b32: 3902 subs r1, #2 if (pad_trim == 0x7) { b34: 2a07 cmp r2, #7 b36: d100 bne.n b3a <_usb_d_dev_init+0x7a> pad_trim = 5; b38: 3a02 subs r2, #2 hw->DEVICE.PADCAL.reg = USB_PADCAL_TRANSN(pad_transn) | USB_PADCAL_TRANSP(pad_transp) | USB_PADCAL_TRIM(pad_trim); b3a: 019b lsls r3, r3, #6 b3c: 430b orrs r3, r1 b3e: 0312 lsls r2, r2, #12 b40: 4313 orrs r3, r2 b42: 8523 strh r3, [r4, #40] ; 0x28 hw->DEVICE.QOSCTRL.bit.CQOS = 3; b44: 2303 movs r3, #3 b46: 78e2 ldrb r2, [r4, #3] b48: 431a orrs r2, r3 b4a: 70e2 strb r2, [r4, #3] hw->DEVICE.QOSCTRL.bit.DQOS = 3; b4c: 220c movs r2, #12 b4e: 78e1 ldrb r1, [r4, #3] b50: 430a orrs r2, r1 b52: 70e2 strb r2, [r4, #3] ((Usb *)hw)->HOST.CTRLA.reg = data; b54: 2204 movs r2, #4 b56: 7022 strb r2, [r4, #0] while (((Usb *)hw)->DEVICE.SYNCBUSY.reg & reg) { b58: 78a2 ldrb r2, [r4, #2] b5a: 0010 movs r0, r2 b5c: 4018 ands r0, r3 b5e: 421a tst r2, r3 b60: d1fa bne.n b58 <_usb_d_dev_init+0x98> hri_usbdevice_write_DESCADD_reg(hw, (uint32_t)prvt_inst.desc_table); b62: 4b07 ldr r3, [pc, #28] ; (b80 <_usb_d_dev_init+0xc0>) } static inline void hri_usb_write_DESCADD_reg(const void *const hw, hri_usb_descadd_reg_t data) { USB_CRITICAL_SECTION_ENTER(); ((Usb *)hw)->HOST.DESCADD.reg = data; b64: 6263 str r3, [r4, #36] ; 0x24 ((Usb *)hw)->DEVICE.CTRLB.reg = data; b66: 2301 movs r3, #1 b68: 8123 strh r3, [r4, #8] } b6a: bd10 pop {r4, pc} b6c: 41005000 .word 0x41005000 b70: 20000108 .word 0x20000108 b74: 000004d5 .word 0x000004d5 b78: 0000072d .word 0x0000072d b7c: 00806024 .word 0x00806024 b80: 200000a8 .word 0x200000a8 00000b84 <_usb_d_dev_enable>: tmp &= mask; b84: 2203 movs r2, #3 tmp = ((Usb *)hw)->HOST.SYNCBUSY.reg; b86: 4b0e ldr r3, [pc, #56] ; (bc0 <_usb_d_dev_enable+0x3c>) b88: 7899 ldrb r1, [r3, #2] if (hri_usbdevice_get_SYNCBUSY_reg(hw, (USB_SYNCBUSY_ENABLE | USB_SYNCBUSY_SWRST))) { b8a: 4211 tst r1, r2 b8c: d114 bne.n bb8 <_usb_d_dev_enable+0x34> while (((Usb *)hw)->DEVICE.SYNCBUSY.reg & reg) { b8e: 7899 ldrb r1, [r3, #2] b90: 4211 tst r1, r2 b92: d1fc bne.n b8e <_usb_d_dev_enable+0xa> if ((ctrla & USB_CTRLA_ENABLE) == 0) { b94: 2202 movs r2, #2 return ((Usb *)hw)->HOST.CTRLA.reg; b96: 7819 ldrb r1, [r3, #0] b98: b2c8 uxtb r0, r1 b9a: 4211 tst r1, r2 b9c: d105 bne.n baa <_usb_d_dev_enable+0x26> hri_usbdevice_write_CTRLA_reg(hw, ctrla | USB_CTRLA_ENABLE); b9e: 4302 orrs r2, r0 ((Usb *)hw)->HOST.CTRLA.reg = data; ba0: 701a strb r2, [r3, #0] while (((Usb *)hw)->DEVICE.SYNCBUSY.reg & reg) { ba2: 2203 movs r2, #3 ba4: 7899 ldrb r1, [r3, #2] ba6: 4211 tst r1, r2 ba8: d1fc bne.n ba4 <_usb_d_dev_enable+0x20> */ __STATIC_INLINE void __NVIC_EnableIRQ(IRQn_Type IRQn) { if ((int32_t)(IRQn) >= 0) { NVIC->ISER[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); baa: 2180 movs r1, #128 ; 0x80 return ERR_NONE; bac: 2000 movs r0, #0 bae: 4a05 ldr r2, [pc, #20] ; (bc4 <_usb_d_dev_enable+0x40>) bb0: 6011 str r1, [r2, #0] ((Usb *)hw)->DEVICE.INTENSET.reg = mask; bb2: 4a05 ldr r2, [pc, #20] ; (bc8 <_usb_d_dev_enable+0x44>) bb4: 831a strh r2, [r3, #24] } bb6: 4770 bx lr return -USB_ERR_DENIED; bb8: 2011 movs r0, #17 bba: 4240 negs r0, r0 bbc: e7fb b.n bb6 <_usb_d_dev_enable+0x32> bbe: 46c0 nop ; (mov r8, r8) bc0: 41005000 .word 0x41005000 bc4: e000e100 .word 0xe000e100 bc8: 0000028d .word 0x0000028d 00000bcc <_usb_d_dev_attach>: ((Usb *)hw)->DEVICE.CTRLB.reg &= ~USB_DEVICE_CTRLB_DETACH; bcc: 2101 movs r1, #1 bce: 4a02 ldr r2, [pc, #8] ; (bd8 <_usb_d_dev_attach+0xc>) bd0: 8913 ldrh r3, [r2, #8] bd2: 438b bics r3, r1 bd4: 8113 strh r3, [r2, #8] } bd6: 4770 bx lr bd8: 41005000 .word 0x41005000 00000bdc <_usb_d_dev_set_address>: hri_usbdevice_write_DADD_reg(USB, USB_DEVICE_DADD_ADDEN | USB_DEVICE_DADD_DADD(addr)); bdc: 2380 movs r3, #128 ; 0x80 bde: 4318 orrs r0, r3 ((Usb *)hw)->DEVICE.DADD.reg = data; be0: 4b01 ldr r3, [pc, #4] ; (be8 <_usb_d_dev_set_address+0xc>) be2: 7298 strb r0, [r3, #10] } be4: 4770 bx lr be6: 46c0 nop ; (mov r8, r8) be8: 41005000 .word 0x41005000 00000bec <_usb_d_dev_ep_init>: { bec: b5f7 push {r0, r1, r2, r4, r5, r6, r7, lr} uint8_t epn = USB_EP_GET_N(ep); bee: 240f movs r4, #15 bf0: 4004 ands r4, r0 struct _usb_d_dev_ep *ept = _usb_d_dev_ept(epn, dir); bf2: 4b2e ldr r3, [pc, #184] ; (cac <_usb_d_dev_ep_init+0xc0>) { bf4: 9100 str r1, [sp, #0] bf6: 0006 movs r6, r0 struct _usb_d_dev_ep *ept = _usb_d_dev_ept(epn, dir); bf8: 09c1 lsrs r1, r0, #7 bfa: b247 sxtb r7, r0 bfc: 0020 movs r0, r4 { bfe: 9201 str r2, [sp, #4] struct _usb_d_dev_ep *ept = _usb_d_dev_ept(epn, dir); c00: 4798 blx r3 uint8_t ep_type = attr & USB_EP_XTYPE_MASK; c02: 2103 movs r1, #3 c04: 9b00 ldr r3, [sp, #0] struct _usb_d_dev_ep *ept = _usb_d_dev_ept(epn, dir); c06: 0005 movs r5, r0 uint8_t ep_type = attr & USB_EP_XTYPE_MASK; c08: 400b ands r3, r1 c0a: 9300 str r3, [sp, #0] if (epn > CONF_USB_D_MAX_EP_N) { c0c: 2c02 cmp r4, #2 c0e: d844 bhi.n c9a <_usb_d_dev_ep_init+0xae> if (ept->ep != 0xFF) { c10: 7c83 ldrb r3, [r0, #18] c12: 2bff cmp r3, #255 ; 0xff c14: d144 bne.n ca0 <_usb_d_dev_ep_init+0xb4> if (ep_type == USB_EP_XTYPE_CTRL) { c16: 9b00 ldr r3, [sp, #0] c18: 2b00 cmp r3, #0 c1a: d110 bne.n c3e <_usb_d_dev_ep_init+0x52> struct _usb_d_dev_ep *ept_in = _usb_d_dev_ept(epn, !dir); c1c: 43f9 mvns r1, r7 c1e: b2c9 uxtb r1, r1 c20: 4b22 ldr r3, [pc, #136] ; (cac <_usb_d_dev_ep_init+0xc0>) c22: 0020 movs r0, r4 c24: 09c9 lsrs r1, r1, #7 c26: 4798 blx r3 if (ept_in->ep != 0xFF) { c28: 7c83 ldrb r3, [r0, #18] c2a: 2bff cmp r3, #255 ; 0xff c2c: d138 bne.n ca0 <_usb_d_dev_ep_init+0xb4> if (pcfg->cache == NULL) { c2e: 3bf3 subs r3, #243 ; 0xf3 c30: 4363 muls r3, r4 c32: 4a1f ldr r2, [pc, #124] ; (cb0 <_usb_d_dev_ep_init+0xc4>) c34: 589b ldr r3, [r3, r2] c36: 2b00 cmp r3, #0 c38: d134 bne.n ca4 <_usb_d_dev_ep_init+0xb8> return -USB_ERR_FUNC; c3a: 2013 movs r0, #19 c3c: e02e b.n c9c <_usb_d_dev_ep_init+0xb0> if ((dir ? pcfg->i_cache : pcfg->cache) && ((dir ? pcfg->i_size : pcfg->size) < max_pkt_siz)) { c3e: 2f00 cmp r7, #0 c40: da14 bge.n c6c <_usb_d_dev_ep_init+0x80> c42: 220c movs r2, #12 c44: 4362 muls r2, r4 c46: 4b1a ldr r3, [pc, #104] ; (cb0 <_usb_d_dev_ep_init+0xc4>) c48: 189b adds r3, r3, r2 c4a: 685a ldr r2, [r3, #4] c4c: 2a00 cmp r2, #0 c4e: d119 bne.n c84 <_usb_d_dev_ep_init+0x98> ept->cache = (uint8_t *)(dir ? pcfg->i_cache : pcfg->cache); c50: 230c movs r3, #12 c52: 4363 muls r3, r4 c54: 4c16 ldr r4, [pc, #88] ; (cb0 <_usb_d_dev_ep_init+0xc4>) c56: 18e4 adds r4, r4, r3 c58: 6863 ldr r3, [r4, #4] return USB_OK; c5a: 2000 movs r0, #0 ept->flags.u8 = (ep_type + 1); c5c: 9900 ldr r1, [sp, #0] ept->cache = (uint8_t *)(dir ? pcfg->i_cache : pcfg->cache); c5e: 60eb str r3, [r5, #12] ept->size = max_pkt_siz; c60: 9b01 ldr r3, [sp, #4] ept->flags.u8 = (ep_type + 1); c62: 3101 adds r1, #1 ept->size = max_pkt_siz; c64: 822b strh r3, [r5, #16] ept->flags.u8 = (ep_type + 1); c66: 74e9 strb r1, [r5, #19] ept->ep = ep; c68: 74ae strb r6, [r5, #18] } c6a: bdfe pop {r1, r2, r3, r4, r5, r6, r7, pc} if ((dir ? pcfg->i_cache : pcfg->cache) && ((dir ? pcfg->i_size : pcfg->size) < max_pkt_siz)) { c6c: 230c movs r3, #12 c6e: 4363 muls r3, r4 c70: 4a0f ldr r2, [pc, #60] ; (cb0 <_usb_d_dev_ep_init+0xc4>) c72: 589b ldr r3, [r3, r2] c74: 2b00 cmp r3, #0 c76: d00b beq.n c90 <_usb_d_dev_ep_init+0xa4> c78: 220c movs r2, #12 c7a: 4362 muls r2, r4 c7c: 4b0c ldr r3, [pc, #48] ; (cb0 <_usb_d_dev_ep_init+0xc4>) c7e: 189b adds r3, r3, r2 c80: 891b ldrh r3, [r3, #8] c82: e000 b.n c86 <_usb_d_dev_ep_init+0x9a> c84: 895b ldrh r3, [r3, #10] c86: 9a01 ldr r2, [sp, #4] c88: 429a cmp r2, r3 c8a: dcd6 bgt.n c3a <_usb_d_dev_ep_init+0x4e> ept->cache = (uint8_t *)(dir ? pcfg->i_cache : pcfg->cache); c8c: 2f00 cmp r7, #0 c8e: dbdf blt.n c50 <_usb_d_dev_ep_init+0x64> c90: 230c movs r3, #12 c92: 435c muls r4, r3 c94: 4b06 ldr r3, [pc, #24] ; (cb0 <_usb_d_dev_ep_init+0xc4>) c96: 58e3 ldr r3, [r4, r3] c98: e7df b.n c5a <_usb_d_dev_ep_init+0x6e> return -USB_ERR_PARAM; c9a: 2012 movs r0, #18 return -USB_ERR_FUNC; c9c: 4240 negs r0, r0 c9e: e7e4 b.n c6a <_usb_d_dev_ep_init+0x7e> return -USB_ERR_REDO; ca0: 2014 movs r0, #20 ca2: e7fb b.n c9c <_usb_d_dev_ep_init+0xb0> if ((dir ? pcfg->i_cache : pcfg->cache) && ((dir ? pcfg->i_size : pcfg->size) < max_pkt_siz)) { ca4: 2f00 cmp r7, #0 ca6: dae7 bge.n c78 <_usb_d_dev_ep_init+0x8c> ca8: e7cb b.n c42 <_usb_d_dev_ep_init+0x56> caa: 46c0 nop ; (mov r8, r8) cac: 000004fd .word 0x000004fd cb0: 00002568 .word 0x00002568 00000cb4 <_usb_d_dev_ep_deinit>: { cb4: b5f7 push {r0, r1, r2, r4, r5, r6, r7, lr} uint8_t epn = USB_EP_GET_N(ep); cb6: 250f movs r5, #15 { cb8: 0004 movs r4, r0 uint8_t epn = USB_EP_GET_N(ep); cba: 4005 ands r5, r0 if (epn > CONF_USB_D_MAX_EP_N || !_usb_d_dev_ep_is_used(ept)) { cbc: 2d02 cmp r5, #2 cbe: d81a bhi.n cf6 <_usb_d_dev_ep_deinit+0x42> cc0: b243 sxtb r3, r0 bool dir = USB_EP_GET_DIR(ep); cc2: 09c7 lsrs r7, r0, #7 cc4: 9301 str r3, [sp, #4] struct _usb_d_dev_ep *ept = _usb_d_dev_ept(epn, dir); cc6: 0039 movs r1, r7 cc8: 4b14 ldr r3, [pc, #80] ; (d1c <_usb_d_dev_ep_deinit+0x68>) cca: 0028 movs r0, r5 ccc: 4798 blx r3 if (epn > CONF_USB_D_MAX_EP_N || !_usb_d_dev_ep_is_used(ept)) { cce: 7c83 ldrb r3, [r0, #18] struct _usb_d_dev_ep *ept = _usb_d_dev_ept(epn, dir); cd0: 0006 movs r6, r0 if (epn > CONF_USB_D_MAX_EP_N || !_usb_d_dev_ep_is_used(ept)) { cd2: 2bff cmp r3, #255 ; 0xff cd4: d00f beq.n cf6 <_usb_d_dev_ep_deinit+0x42> _usb_d_dev_trans_stop(ept, dir, USB_TRANS_RESET); cd6: 2203 movs r2, #3 cd8: 4b11 ldr r3, [pc, #68] ; (d20 <_usb_d_dev_ep_deinit+0x6c>) cda: 0039 movs r1, r7 cdc: 4798 blx r3 if (_usb_d_dev_ep_is_ctrl(ept)) { cde: 2207 movs r2, #7 ce0: 7cf3 ldrb r3, [r6, #19] ce2: 4013 ands r3, r2 ce4: 2b01 cmp r3, #1 ce6: d107 bne.n cf8 <_usb_d_dev_ep_deinit+0x44> hw->DEVICE.DeviceEndpoint[ep].EPCFG.reg = 0; ce8: 2200 movs r2, #0 cea: 4b0e ldr r3, [pc, #56] ; (d24 <_usb_d_dev_ep_deinit+0x70>) cec: 3408 adds r4, #8 cee: 0164 lsls r4, r4, #5 cf0: 54e2 strb r2, [r4, r3] ept->ep = 0xFF; cf2: 23ff movs r3, #255 ; 0xff cf4: 8273 strh r3, [r6, #18] } cf6: bdf7 pop {r0, r1, r2, r4, r5, r6, r7, pc} } else if (USB_EP_GET_DIR(ep)) { cf8: b263 sxtb r3, r4 cfa: 2b00 cmp r3, #0 cfc: da07 bge.n d0e <_usb_d_dev_ep_deinit+0x5a> hw->DEVICE.DeviceEndpoint[USB_EP_GET_N(ep)].EPCFG.reg &= ~USB_DEVICE_EPCFG_EPTYPE1_Msk; cfe: 2270 movs r2, #112 ; 0x70 d00: 4b09 ldr r3, [pc, #36] ; (d28 <_usb_d_dev_ep_deinit+0x74>) d02: 016d lsls r5, r5, #5 d04: 18ed adds r5, r5, r3 d06: 786b ldrb r3, [r5, #1] d08: 4393 bics r3, r2 d0a: 706b strb r3, [r5, #1] d0c: e7f1 b.n cf2 <_usb_d_dev_ep_deinit+0x3e> hw->DEVICE.DeviceEndpoint[ep].EPCFG.reg &= ~USB_DEVICE_EPCFG_EPTYPE0_Msk; d0e: 4b06 ldr r3, [pc, #24] ; (d28 <_usb_d_dev_ep_deinit+0x74>) d10: 0164 lsls r4, r4, #5 d12: 18e4 adds r4, r4, r3 d14: 7863 ldrb r3, [r4, #1] d16: 4393 bics r3, r2 d18: 7063 strb r3, [r4, #1] d1a: e7ea b.n cf2 <_usb_d_dev_ep_deinit+0x3e> d1c: 000004fd .word 0x000004fd d20: 000005e5 .word 0x000005e5 d24: 41005000 .word 0x41005000 d28: 410050ff .word 0x410050ff 00000d2c <_usb_d_dev_ep_enable>: { d2c: b5f7 push {r0, r1, r2, r4, r5, r6, r7, lr} uint8_t epn = USB_EP_GET_N(ep); d2e: 240f movs r4, #15 d30: 4004 ands r4, r0 struct _usb_d_dev_ep *ept = _usb_d_dev_ept(epn, dir); d32: 09c1 lsrs r1, r0, #7 d34: 4b47 ldr r3, [pc, #284] ; (e54 <_usb_d_dev_ep_enable+0x128>) d36: b245 sxtb r5, r0 d38: 0020 movs r0, r4 d3a: 4798 blx r3 return ((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPCFG.reg; d3c: 4b46 ldr r3, [pc, #280] ; (e58 <_usb_d_dev_ep_enable+0x12c>) d3e: 0161 lsls r1, r4, #5 d40: 18ce adds r6, r1, r3 d42: 7872 ldrb r2, [r6, #1] d44: 0007 movs r7, r0 d46: b2d2 uxtb r2, r2 if (epn > CONF_USB_D_MAX_EP_N || !_usb_d_dev_ep_is_used(ept)) { d48: 2c02 cmp r4, #2 d4a: d900 bls.n d4e <_usb_d_dev_ep_enable+0x22> d4c: e07d b.n e4a <_usb_d_dev_ep_enable+0x11e> d4e: 7c83 ldrb r3, [r0, #18] d50: 9301 str r3, [sp, #4] d52: 2bff cmp r3, #255 ; 0xff d54: d100 bne.n d58 <_usb_d_dev_ep_enable+0x2c> d56: e078 b.n e4a <_usb_d_dev_ep_enable+0x11e> bank = prvt_inst.desc_table[epn].DeviceDescBank; d58: 4b40 ldr r3, [pc, #256] ; (e5c <_usb_d_dev_ep_enable+0x130>) d5a: 185c adds r4, r3, r1 if (ept->flags.bits.eptype == USB_D_EPTYPE_CTRL) { d5c: 7cc3 ldrb r3, [r0, #19] d5e: 2107 movs r1, #7 d60: 0018 movs r0, r3 d62: 4008 ands r0, r1 d64: 2801 cmp r0, #1 d66: d13b bne.n de0 <_usb_d_dev_ep_enable+0xb4> if (epcfg & (USB_DEVICE_EPCFG_EPTYPE1_Msk | USB_DEVICE_EPCFG_EPTYPE0_Msk)) { d68: 2377 movs r3, #119 ; 0x77 d6a: 0011 movs r1, r2 d6c: 4019 ands r1, r3 d6e: 9100 str r1, [sp, #0] d70: 421a tst r2, r3 d72: d000 beq.n d76 <_usb_d_dev_ep_enable+0x4a> d74: e06c b.n e50 <_usb_d_dev_ep_enable+0x124> ((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPCFG.reg = data; d76: 3b66 subs r3, #102 ; 0x66 d78: 7073 strb r3, [r6, #1] bank[0].PCKSIZE.reg = USB_DEVICE_PCKSIZE_MULTI_PACKET_SIZE(ept->size) d7a: 8a3d ldrh r5, [r7, #16] | USB_DEVICE_PCKSIZE_SIZE(_usbd_ep_pcksize_size(ept->size)); d7c: 4b38 ldr r3, [pc, #224] ; (e60 <_usb_d_dev_ep_enable+0x134>) d7e: 0028 movs r0, r5 d80: 4798 blx r3 d82: 23e0 movs r3, #224 ; 0xe0 bank[0].PCKSIZE.reg = USB_DEVICE_PCKSIZE_MULTI_PACKET_SIZE(ept->size) d84: 4a37 ldr r2, [pc, #220] ; (e64 <_usb_d_dev_ep_enable+0x138>) | USB_DEVICE_PCKSIZE_SIZE(_usbd_ep_pcksize_size(ept->size)); d86: 05db lsls r3, r3, #23 d88: 0700 lsls r0, r0, #28 d8a: 4018 ands r0, r3 bank[0].PCKSIZE.reg = USB_DEVICE_PCKSIZE_MULTI_PACKET_SIZE(ept->size) d8c: 03ab lsls r3, r5, #14 d8e: 4013 ands r3, r2 | USB_DEVICE_PCKSIZE_SIZE(_usbd_ep_pcksize_size(ept->size)); d90: 4303 orrs r3, r0 bank[0].PCKSIZE.reg = USB_DEVICE_PCKSIZE_MULTI_PACKET_SIZE(ept->size) d92: 6063 str r3, [r4, #4] ((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPSTATUSSET.reg = mask; d94: 2140 movs r1, #64 ; 0x40 ((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPSTATUSCLR.reg = mask; d96: 2380 movs r3, #128 ; 0x80 uint8_t epn = USB_EP_GET_N(ept->ep); d98: 220f movs r2, #15 = USB_DEVICE_PCKSIZE_BYTE_COUNT(ept->size) | USB_DEVICE_PCKSIZE_SIZE(_usbd_ep_pcksize_size(ept->size)); d9a: 04ad lsls r5, r5, #18 d9c: 0cad lsrs r5, r5, #18 d9e: 4328 orrs r0, r5 da0: 6160 str r0, [r4, #20] ((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPSTATUSSET.reg = mask; da2: 71b1 strb r1, [r6, #6] ((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPSTATUSCLR.reg = mask; da4: 7173 strb r3, [r6, #5] bank->STATUS_BK.reg = 0; da6: 9b00 ldr r3, [sp, #0] bank->ADDR.reg = addr; da8: 482c ldr r0, [pc, #176] ; (e5c <_usb_d_dev_ep_enable+0x130>) bank->STATUS_BK.reg = 0; daa: 72a3 strb r3, [r4, #10] dac: 76a3 strb r3, [r4, #26] uint8_t epn = USB_EP_GET_N(ept->ep); dae: 9b01 ldr r3, [sp, #4] bank->PCKSIZE.bit.MULTI_PACKET_SIZE = size; db0: 03ac lsls r4, r5, #14 uint8_t epn = USB_EP_GET_N(ept->ep); db2: 4013 ands r3, r2 _usbd_ep_set_buf(epn, 0, (uint32_t)ept->cache); db4: 68fa ldr r2, [r7, #12] bank->ADDR.reg = addr; db6: 015b lsls r3, r3, #5 db8: 501a str r2, [r3, r0] bank->PCKSIZE.bit.MULTI_PACKET_SIZE = size; dba: 18c0 adds r0, r0, r3 dbc: 6842 ldr r2, [r0, #4] dbe: 4d2a ldr r5, [pc, #168] ; (e68 <_usb_d_dev_ep_enable+0x13c>) dc0: 4015 ands r5, r2 dc2: 4325 orrs r5, r4 dc4: 6045 str r5, [r0, #4] bank->PCKSIZE.bit.BYTE_COUNT = count; dc6: 6842 ldr r2, [r0, #4] dc8: 0b92 lsrs r2, r2, #14 dca: 0392 lsls r2, r2, #14 dcc: 6042 str r2, [r0, #4] dce: 4a22 ldr r2, [pc, #136] ; (e58 <_usb_d_dev_ep_enable+0x12c>) return USB_OK; dd0: 9800 ldr r0, [sp, #0] dd2: 189b adds r3, r3, r2 dd4: 22b0 movs r2, #176 ; 0xb0 dd6: 715a strb r2, [r3, #5] ((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPINTENSET.reg = mask; dd8: 3aa0 subs r2, #160 ; 0xa0 ((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPSTATUSSET.reg = mask; dda: 7199 strb r1, [r3, #6] ((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPINTENSET.reg = mask; ddc: 729a strb r2, [r3, #10] } dde: bdfe pop {r1, r2, r3, r4, r5, r6, r7, pc} } else if (dir) { de0: 2d00 cmp r5, #0 de2: da19 bge.n e18 <_usb_d_dev_ep_enable+0xec> if (epcfg & USB_DEVICE_EPCFG_EPTYPE1_Msk) { de4: 2170 movs r1, #112 ; 0x70 de6: 0015 movs r5, r2 de8: 400d ands r5, r1 dea: 420a tst r2, r1 dec: d130 bne.n e50 <_usb_d_dev_ep_enable+0x124> epcfg |= USB_DEVICE_EPCFG_EPTYPE1(ept->flags.bits.eptype); dee: 075b lsls r3, r3, #29 df0: 0e5b lsrs r3, r3, #25 df2: 4313 orrs r3, r2 ((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPCFG.reg = data; df4: 7073 strb r3, [r6, #1] = USB_DEVICE_PCKSIZE_BYTE_COUNT(ept->size) | USB_DEVICE_PCKSIZE_SIZE(_usbd_ep_pcksize_size(ept->size)); df6: 8a3f ldrh r7, [r7, #16] df8: 4b19 ldr r3, [pc, #100] ; (e60 <_usb_d_dev_ep_enable+0x134>) dfa: 0038 movs r0, r7 dfc: 4798 blx r3 dfe: 23e0 movs r3, #224 ; 0xe0 e00: 0700 lsls r0, r0, #28 e02: 05db lsls r3, r3, #23 e04: 4018 ands r0, r3 ((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPSTATUSCLR.reg = mask; e06: 2380 movs r3, #128 ; 0x80 e08: 04bf lsls r7, r7, #18 e0a: 0cbf lsrs r7, r7, #18 e0c: 4338 orrs r0, r7 e0e: 6160 str r0, [r4, #20] e10: 7173 strb r3, [r6, #5] bank->STATUS_BK.reg = 0; e12: 76a5 strb r5, [r4, #26] return USB_OK; e14: 0028 movs r0, r5 } e16: e7e2 b.n dde <_usb_d_dev_ep_enable+0xb2> if (epcfg & USB_DEVICE_EPCFG_EPTYPE0_Msk) { e18: 0015 movs r5, r2 e1a: 400d ands r5, r1 e1c: 420a tst r2, r1 e1e: d117 bne.n e50 <_usb_d_dev_ep_enable+0x124> epcfg |= USB_DEVICE_EPCFG_EPTYPE0(ept->flags.bits.eptype); e20: 075b lsls r3, r3, #29 e22: 0f5b lsrs r3, r3, #29 e24: 4313 orrs r3, r2 ((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPCFG.reg = data; e26: 7073 strb r3, [r6, #1] bank[0].PCKSIZE.reg = USB_DEVICE_PCKSIZE_MULTI_PACKET_SIZE(ept->size) e28: 8a3f ldrh r7, [r7, #16] | USB_DEVICE_PCKSIZE_SIZE(_usbd_ep_pcksize_size(ept->size)); e2a: 4b0d ldr r3, [pc, #52] ; (e60 <_usb_d_dev_ep_enable+0x134>) e2c: 0038 movs r0, r7 e2e: 4798 blx r3 bank[0].PCKSIZE.reg = USB_DEVICE_PCKSIZE_MULTI_PACKET_SIZE(ept->size) e30: 4a0c ldr r2, [pc, #48] ; (e64 <_usb_d_dev_ep_enable+0x138>) e32: 03bb lsls r3, r7, #14 e34: 4013 ands r3, r2 | USB_DEVICE_PCKSIZE_SIZE(_usbd_ep_pcksize_size(ept->size)); e36: 22e0 movs r2, #224 ; 0xe0 e38: 0700 lsls r0, r0, #28 e3a: 05d2 lsls r2, r2, #23 e3c: 4010 ands r0, r2 e3e: 4303 orrs r3, r0 bank[0].PCKSIZE.reg = USB_DEVICE_PCKSIZE_MULTI_PACKET_SIZE(ept->size) e40: 6063 str r3, [r4, #4] ((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPSTATUSSET.reg = mask; e42: 2340 movs r3, #64 ; 0x40 e44: 71b3 strb r3, [r6, #6] bank->STATUS_BK.reg = 0; e46: 72a5 strb r5, [r4, #10] e48: e7e4 b.n e14 <_usb_d_dev_ep_enable+0xe8> return -USB_ERR_PARAM; e4a: 2012 movs r0, #18 return -USB_ERR_REDO; e4c: 4240 negs r0, r0 e4e: e7c6 b.n dde <_usb_d_dev_ep_enable+0xb2> e50: 2014 movs r0, #20 e52: e7fb b.n e4c <_usb_d_dev_ep_enable+0x120> e54: 000004fd .word 0x000004fd e58: 410050ff .word 0x410050ff e5c: 200000a8 .word 0x200000a8 e60: 00000a89 .word 0x00000a89 e64: 0fffc000 .word 0x0fffc000 e68: f0003fff .word 0xf0003fff 00000e6c <_usb_d_dev_ep_stall>: { e6c: b5f8 push {r3, r4, r5, r6, r7, lr} uint8_t epn = USB_EP_GET_N(ep); e6e: 0007 movs r7, r0 e70: 260f movs r6, #15 bool dir = USB_EP_GET_DIR(ep); e72: 09c4 lsrs r4, r0, #7 uint8_t epn = USB_EP_GET_N(ep); e74: 4037 ands r7, r6 { e76: 000d movs r5, r1 struct _usb_d_dev_ep *ept = _usb_d_dev_ept(epn, dir); e78: 0038 movs r0, r7 e7a: 0021 movs r1, r4 e7c: 4b29 ldr r3, [pc, #164] ; (f24 <_usb_d_dev_ep_stall+0xb8>) e7e: 4798 blx r3 e80: 0002 movs r2, r0 if (epn > CONF_USB_D_MAX_EP_N) { e82: 2f02 cmp r7, #2 e84: d84a bhi.n f1c <_usb_d_dev_ep_stall+0xb0> uint8_t epn = USB_EP_GET_N(ept->ep); e86: 7c83 ldrb r3, [r0, #18] hri_usbendpoint_set_EPSTATUS_reg(USB, epn, (USB_DEVICE_EPSTATUS_STALLRQ0 << bank_n)); e88: 2010 movs r0, #16 uint8_t epn = USB_EP_GET_N(ept->ep); e8a: 4033 ands r3, r6 hri_usbendpoint_set_EPSTATUS_reg(USB, epn, (USB_DEVICE_EPSTATUS_STALLRQ0 << bank_n)); e8c: 40a0 lsls r0, r4 if (USB_EP_STALL_SET == ctrl) { e8e: 2d01 cmp r5, #1 e90: d110 bne.n eb4 <_usb_d_dev_ep_stall+0x48> e92: 4d25 ldr r5, [pc, #148] ; (f28 <_usb_d_dev_ep_stall+0xbc>) e94: 0159 lsls r1, r3, #5 hri_usbendpoint_set_EPSTATUS_reg(USB, epn, (USB_DEVICE_EPSTATUS_STALLRQ0 << bank_n)); e96: b2c0 uxtb r0, r0 e98: 1949 adds r1, r1, r5 e9a: 7148 strb r0, [r1, #5] _usbd_ep_int_en(epn, USB_DEVICE_EPINTFLAG_STALL0 << dir); e9c: 2120 movs r1, #32 e9e: 40a1 lsls r1, r4 ((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPINTENSET.reg = mask; ea0: 4822 ldr r0, [pc, #136] ; (f2c <_usb_d_dev_ep_stall+0xc0>) ea2: 015b lsls r3, r3, #5 hri_usbendpoint_set_EPINTEN_reg(USB, epn, flags); ea4: b2c9 uxtb r1, r1 ea6: 181b adds r3, r3, r0 ea8: 7299 strb r1, [r3, #10] ept->flags.bits.is_stalled = 1; eaa: 2308 movs r3, #8 eac: 7cd1 ldrb r1, [r2, #19] eae: 430b orrs r3, r1 ept->flags.bits.is_stalled = 0; eb0: 74d3 strb r3, [r2, #19] eb2: e009 b.n ec8 <_usb_d_dev_ep_stall+0x5c> } else if (USB_EP_STALL_CLR == ctrl) { eb4: 015b lsls r3, r3, #5 eb6: 2d00 cmp r5, #0 eb8: d129 bne.n f0e <_usb_d_dev_ep_stall+0xa2> return ((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPSTATUS.reg; eba: 491d ldr r1, [pc, #116] ; (f30 <_usb_d_dev_ep_stall+0xc4>) ebc: 185d adds r5, r3, r1 ebe: 491b ldr r1, [pc, #108] ; (f2c <_usb_d_dev_ep_stall+0xc0>) ec0: 185b adds r3, r3, r1 ec2: 79d9 ldrb r1, [r3, #7] if (!is_stalled) { ec4: 4208 tst r0, r1 ec6: d101 bne.n ecc <_usb_d_dev_ep_stall+0x60> rc = _usb_d_dev_ep_stall_clr(ept, dir); ec8: 2000 movs r0, #0 eca: e01c b.n f06 <_usb_d_dev_ep_stall+0x9a> _usbd_ep_int_dis(epn, USB_DEVICE_EPINTFLAG_STALL0 << dir); ecc: 2120 movs r1, #32 ece: 40a1 lsls r1, r4 hri_usbendpoint_clear_EPSTATUS_reg(USB, epn, (USB_DEVICE_EPSTATUS_STALLRQ0 << bank_n)); ed0: b2c0 uxtb r0, r0 ((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPSTATUSCLR.reg = mask; ed2: 7158 strb r0, [r3, #5] hri_usbendpoint_clear_EPINTEN_reg(USB, epn, flags); ed4: b2c8 uxtb r0, r1 ((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPINTENCLR.reg = mask; ed6: 7258 strb r0, [r3, #9] return ((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPINTFLAG.reg; ed8: 7a1e ldrb r6, [r3, #8] if (_usbd_ep_is_stall_sent(epn, dir)) { eda: 4231 tst r1, r6 edc: d004 beq.n ee8 <_usb_d_dev_ep_stall+0x7c> hri_usbendpoint_clear_EPSTATUS_reg(USB, epn, (USB_DEVICE_EPSTATUS_DTGLOUT << bank_n)); ede: 2101 movs r1, #1 ee0: 40a1 lsls r1, r4 ee2: b2c9 uxtb r1, r1 ((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPINTFLAG.reg = mask; ee4: 7218 strb r0, [r3, #8] ((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPSTATUSCLR.reg = mask; ee6: 7159 strb r1, [r3, #5] if (_usb_d_dev_ep_is_ctrl(ept)) { ee8: 2107 movs r1, #7 eea: 7cd3 ldrb r3, [r2, #19] eec: 4019 ands r1, r3 eee: 2901 cmp r1, #1 ef0: d10a bne.n f08 <_usb_d_dev_ep_stall+0x9c> return ((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPSTATUS.reg; ef2: 35ff adds r5, #255 ; 0xff ef4: 79ec ldrb r4, [r5, #7] if ((hri_usbendpoint_read_EPSTATUS_reg(USB, epn) & USB_DEVICE_EPSTATUS_STALLRQ_Msk) == 0) { ef6: 312f adds r1, #47 ; 0x2f ef8: 0020 movs r0, r4 efa: 4008 ands r0, r1 efc: 420c tst r4, r1 efe: d1e3 bne.n ec8 <_usb_d_dev_ep_stall+0x5c> ept->flags.bits.is_stalled = 0; f00: 3928 subs r1, #40 ; 0x28 f02: 438b bics r3, r1 f04: 74d3 strb r3, [r2, #19] } f06: bdf8 pop {r3, r4, r5, r6, r7, pc} ept->flags.bits.is_stalled = 0; f08: 2108 movs r1, #8 f0a: 438b bics r3, r1 f0c: e7d0 b.n eb0 <_usb_d_dev_ep_stall+0x44> f0e: 4a06 ldr r2, [pc, #24] ; (f28 <_usb_d_dev_ep_stall+0xbc>) f10: 189b adds r3, r3, r2 f12: 799b ldrb r3, [r3, #6] return (hri_usbendpoint_read_EPSTATUS_reg(hw, epn) & (USB_DEVICE_EPSTATUS_STALLRQ0 << bank_n)); f14: 4018 ands r0, r3 return _usbd_ep_is_stalled(epn, dir); f16: 1e43 subs r3, r0, #1 f18: 4198 sbcs r0, r3 f1a: e7f4 b.n f06 <_usb_d_dev_ep_stall+0x9a> return -USB_ERR_PARAM; f1c: 2012 movs r0, #18 f1e: 4240 negs r0, r0 f20: e7f1 b.n f06 <_usb_d_dev_ep_stall+0x9a> f22: 46c0 nop ; (mov r8, r8) f24: 000004fd .word 0x000004fd f28: 41005100 .word 0x41005100 f2c: 410050ff .word 0x410050ff f30: 41005000 .word 0x41005000 00000f34 <_usb_d_dev_ep_read_req>: int32_t _usb_d_dev_ep_read_req(const uint8_t ep, uint8_t *req_buf) { f34: b5f8 push {r3, r4, r5, r6, r7, lr} uint8_t epn = USB_EP_GET_N(ep); f36: 230f movs r3, #15 f38: 4018 ands r0, r3 UsbDeviceDescBank *bank = prvt_inst.desc_table[epn].DeviceDescBank; f3a: 4b11 ldr r3, [pc, #68] ; (f80 <_usb_d_dev_ep_read_req+0x4c>) f3c: 0144 lsls r4, r0, #5 f3e: 191b adds r3, r3, r4 { f40: 000f movs r7, r1 uint32_t addr = bank[0].ADDR.reg; f42: 6819 ldr r1, [r3, #0] uint16_t bytes = bank[0].PCKSIZE.bit.BYTE_COUNT; f44: 685d ldr r5, [r3, #4] f46: 04ad lsls r5, r5, #18 f48: 0cad lsrs r5, r5, #18 if (epn > CONF_USB_D_MAX_EP_N || !req_buf) { f4a: 2802 cmp r0, #2 f4c: d812 bhi.n f74 <_usb_d_dev_ep_read_req+0x40> f4e: 2f00 cmp r7, #0 f50: d010 beq.n f74 <_usb_d_dev_ep_read_req+0x40> return ((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPCFG.reg; f52: 4b0c ldr r3, [pc, #48] ; (f84 <_usb_d_dev_ep_read_req+0x50>) f54: 18e4 adds r4, r4, r3 f56: 7863 ldrb r3, [r4, #1] return -USB_ERR_PARAM; } if (!_usbd_ep_is_ctrl(epn)) { f58: 2b11 cmp r3, #17 f5a: d10e bne.n f7a <_usb_d_dev_ep_read_req+0x46> tmp &= mask; f5c: 2610 movs r6, #16 tmp = ((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPINTFLAG.reg; f5e: 7a22 ldrb r2, [r4, #8] return -USB_ERR_FUNC; } if (!_usbd_ep_is_setup(epn)) { return ERR_NONE; f60: 2000 movs r0, #0 if (!_usbd_ep_is_setup(epn)) { f62: 4232 tst r2, r6 f64: d005 beq.n f72 <_usb_d_dev_ep_read_req+0x3e> } memcpy(req_buf, (void *)addr, 8); f66: 2208 movs r2, #8 f68: 0038 movs r0, r7 f6a: 4b07 ldr r3, [pc, #28] ; (f88 <_usb_d_dev_ep_read_req+0x54>) f6c: 4798 blx r3 _usbd_ep_ack_setup(epn); return bytes; f6e: 0028 movs r0, r5 ((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPINTFLAG.reg = mask; f70: 7226 strb r6, [r4, #8] } f72: bdf8 pop {r3, r4, r5, r6, r7, pc} return -USB_ERR_PARAM; f74: 2012 movs r0, #18 return -USB_ERR_FUNC; f76: 4240 negs r0, r0 f78: e7fb b.n f72 <_usb_d_dev_ep_read_req+0x3e> f7a: 2013 movs r0, #19 f7c: e7fb b.n f76 <_usb_d_dev_ep_read_req+0x42> f7e: 46c0 nop ; (mov r8, r8) f80: 200000a8 .word 0x200000a8 f84: 410050ff .word 0x410050ff f88: 00002545 .word 0x00002545 00000f8c <_usb_d_dev_ep_trans>: int32_t _usb_d_dev_ep_trans(const struct usb_d_transfer *trans) { f8c: b5f0 push {r4, r5, r6, r7, lr} uint8_t epn = USB_EP_GET_N(trans->ep); f8e: 250f movs r5, #15 f90: 7a07 ldrb r7, [r0, #8] { f92: b087 sub sp, #28 f94: b27b sxtb r3, r7 uint8_t epn = USB_EP_GET_N(trans->ep); f96: 403d ands r5, r7 bool dir = USB_EP_GET_DIR(trans->ep); f98: 09ff lsrs r7, r7, #7 struct _usb_d_dev_ep *ept = _usb_d_dev_ept(epn, dir); f9a: 0039 movs r1, r7 f9c: 9302 str r3, [sp, #8] { f9e: 0006 movs r6, r0 struct _usb_d_dev_ep *ept = _usb_d_dev_ept(epn, dir); fa0: 4b3a ldr r3, [pc, #232] ; (108c <_usb_d_dev_ep_trans+0x100>) fa2: 0028 movs r0, r5 fa4: 4798 blx r3 uint16_t size_mask = (ept->size == 1023) ? 1023 : (ept->size - 1); fa6: 493a ldr r1, [pc, #232] ; (1090 <_usb_d_dev_ep_trans+0x104>) fa8: 8a03 ldrh r3, [r0, #16] struct _usb_d_dev_ep *ept = _usb_d_dev_ept(epn, dir); faa: 0004 movs r4, r0 uint16_t size_mask = (ept->size == 1023) ? 1023 : (ept->size - 1); fac: 001a movs r2, r3 fae: 428b cmp r3, r1 fb0: d001 beq.n fb6 <_usb_d_dev_ep_trans+0x2a> fb2: 1e5a subs r2, r3, #1 fb4: b292 uxth r2, r2 bool size_n_aligned = (trans->size & size_mask); fb6: 6871 ldr r1, [r6, #4] fb8: 400a ands r2, r1 fba: 9201 str r2, [sp, #4] bool use_cache = false; volatile hal_atomic_t flags; if (epn > CONF_USB_D_MAX_EP_N) { fbc: 2d02 cmp r5, #2 fbe: d862 bhi.n 1086 <_usb_d_dev_ep_trans+0xfa> * 1. Buffer not in RAM (cache all). * 2. IN/OUT with unaligned buffer (cache all). * 3. OUT with unaligned packet size (cache last packet). * 4. OUT size < 8 (sub-case for 3). */ if (!_usb_is_addr4dma(trans->buf, trans->size) || (!_usb_is_aligned(trans->buf)) fc0: 2080 movs r0, #128 ; 0x80 fc2: 6832 ldr r2, [r6, #0] fc4: 0580 lsls r0, r0, #22 fc6: 4282 cmp r2, r0 fc8: d30d bcc.n fe6 <_usb_d_dev_ep_trans+0x5a> fca: 4d32 ldr r5, [pc, #200] ; (1094 <_usb_d_dev_ep_trans+0x108>) fcc: 1888 adds r0, r1, r2 fce: 42a8 cmp r0, r5 fd0: d809 bhi.n fe6 <_usb_d_dev_ep_trans+0x5a> fd2: 2003 movs r0, #3 fd4: 0015 movs r5, r2 fd6: 4005 ands r5, r0 fd8: 4202 tst r2, r0 fda: d104 bne.n fe6 <_usb_d_dev_ep_trans+0x5a> || (!dir && (trans->size < ept->size))) { fdc: 9a02 ldr r2, [sp, #8] fde: 2a00 cmp r2, #0 fe0: db0e blt.n 1000 <_usb_d_dev_ep_trans+0x74> fe2: 4299 cmp r1, r3 fe4: d206 bcs.n ff4 <_usb_d_dev_ep_trans+0x68> if (!ept->cache) { fe6: 68e3 ldr r3, [r4, #12] return -USB_ERR_FUNC; } /* Use cache all the time. */ use_cache = true; fe8: 2501 movs r5, #1 if (!ept->cache) { fea: 2b00 cmp r3, #0 fec: d108 bne.n 1000 <_usb_d_dev_ep_trans+0x74> return -USB_ERR_FUNC; fee: 2013 movs r0, #19 return -USB_ERR_PARAM; ff0: 4240 negs r0, r0 ff2: e017 b.n 1024 <_usb_d_dev_ep_trans+0x98> } if (!dir && size_n_aligned) { ff4: 9b01 ldr r3, [sp, #4] ff6: 2b00 cmp r3, #0 ff8: d016 beq.n 1028 <_usb_d_dev_ep_trans+0x9c> if (!ept->cache) { ffa: 68e3 ldr r3, [r4, #12] ffc: 2b00 cmp r3, #0 ffe: d042 beq.n 1086 <_usb_d_dev_ep_trans+0xfa> } /* Set 'use_cache' on last packet. */ } /* Check halt */ if (ept->flags.bits.is_stalled) { 1000: 7ce3 ldrb r3, [r4, #19] return USB_HALTED; 1002: 2002 movs r0, #2 if (ept->flags.bits.is_stalled) { 1004: 071b lsls r3, r3, #28 1006: d40d bmi.n 1024 <_usb_d_dev_ep_trans+0x98> } /* Try to start transactions. */ atomic_enter_critical(&flags); 1008: 4b23 ldr r3, [pc, #140] ; (1098 <_usb_d_dev_ep_trans+0x10c>) 100a: a805 add r0, sp, #20 100c: 4798 blx r3 if (_usb_d_dev_ep_is_busy(ept)) { 100e: 7ce1 ldrb r1, [r4, #19] 1010: 2340 movs r3, #64 ; 0x40 1012: 000a movs r2, r1 1014: 401a ands r2, r3 1016: 9203 str r2, [sp, #12] 1018: 4a20 ldr r2, [pc, #128] ; (109c <_usb_d_dev_ep_trans+0x110>) 101a: 4219 tst r1, r3 101c: d006 beq.n 102c <_usb_d_dev_ep_trans+0xa0> atomic_leave_critical(&flags); 101e: a805 add r0, sp, #20 1020: 4790 blx r2 return USB_BUSY; 1022: 2001 movs r0, #1 } else { _usb_d_dev_out_next(ept, false); } return ERR_NONE; } 1024: b007 add sp, #28 1026: bdf0 pop {r4, r5, r6, r7, pc} bool use_cache = false; 1028: 9d01 ldr r5, [sp, #4] 102a: e7e9 b.n 1000 <_usb_d_dev_ep_trans+0x74> ept->flags.bits.is_busy = 1; 102c: 430b orrs r3, r1 102e: 74e3 strb r3, [r4, #19] atomic_leave_critical(&flags); 1030: a805 add r0, sp, #20 1032: 4790 blx r2 ept->flags.bits.dir = dir; 1034: 217f movs r1, #127 ; 0x7f ept->trans_buf = trans->buf; 1036: 6833 ldr r3, [r6, #0] ept->flags.bits.dir = dir; 1038: 01fa lsls r2, r7, #7 ept->trans_buf = trans->buf; 103a: 6023 str r3, [r4, #0] ept->trans_size = trans->size; 103c: 6873 ldr r3, [r6, #4] ept->flags.bits.need_zlp = (trans->zlp && (!size_n_aligned)); 103e: 9f03 ldr r7, [sp, #12] ept->trans_size = trans->size; 1040: 6063 str r3, [r4, #4] ept->trans_count = 0; 1042: 9b03 ldr r3, [sp, #12] 1044: 60a3 str r3, [r4, #8] ept->flags.bits.dir = dir; 1046: 7ce3 ldrb r3, [r4, #19] 1048: 400b ands r3, r1 ept->flags.bits.use_cache = use_cache; 104a: 4313 orrs r3, r2 104c: 0169 lsls r1, r5, #5 104e: 001d movs r5, r3 1050: 2320 movs r3, #32 1052: 439d bics r5, r3 1054: 430d orrs r5, r1 1056: 74e5 strb r5, [r4, #19] ept->flags.bits.need_zlp = (trans->zlp && (!size_n_aligned)); 1058: 7a73 ldrb r3, [r6, #9] 105a: 2b00 cmp r3, #0 105c: d002 beq.n 1064 <_usb_d_dev_ep_trans+0xd8> 105e: 9f01 ldr r7, [sp, #4] 1060: 427b negs r3, r7 1062: 415f adcs r7, r3 1064: 2210 movs r2, #16 1066: 7ce3 ldrb r3, [r4, #19] 1068: 013f lsls r7, r7, #4 106a: 4393 bics r3, r2 106c: 431f orrs r7, r3 if (dir) { 106e: 9b02 ldr r3, [sp, #8] _usb_d_dev_in_next(ept, false); 1070: 2100 movs r1, #0 1072: 0020 movs r0, r4 ept->flags.bits.need_zlp = (trans->zlp && (!size_n_aligned)); 1074: 74e7 strb r7, [r4, #19] if (dir) { 1076: 2b00 cmp r3, #0 1078: da03 bge.n 1082 <_usb_d_dev_ep_trans+0xf6> _usb_d_dev_in_next(ept, false); 107a: 4b09 ldr r3, [pc, #36] ; (10a0 <_usb_d_dev_ep_trans+0x114>) _usb_d_dev_out_next(ept, false); 107c: 4798 blx r3 return ERR_NONE; 107e: 2000 movs r0, #0 1080: e7d0 b.n 1024 <_usb_d_dev_ep_trans+0x98> _usb_d_dev_out_next(ept, false); 1082: 4b08 ldr r3, [pc, #32] ; (10a4 <_usb_d_dev_ep_trans+0x118>) 1084: e7fa b.n 107c <_usb_d_dev_ep_trans+0xf0> return -USB_ERR_PARAM; 1086: 2012 movs r0, #18 1088: e7b2 b.n ff0 <_usb_d_dev_ep_trans+0x64> 108a: 46c0 nop ; (mov r8, r8) 108c: 000004fd .word 0x000004fd 1090: 000003ff .word 0x000003ff 1094: 20007fff .word 0x20007fff 1098: 000024a5 .word 0x000024a5 109c: 000024b3 .word 0x000024b3 10a0: 0000076d .word 0x0000076d 10a4: 000008d1 .word 0x000008d1 000010a8 <_usb_d_dev_register_callback>: return USB_OK; } void _usb_d_dev_register_callback(const enum usb_d_cb_type type, const FUNC_PTR func) { FUNC_PTR f = (func == NULL) ? (FUNC_PTR)_dummy_func_no_return : (FUNC_PTR)func; 10a8: 2900 cmp r1, #0 10aa: d100 bne.n 10ae <_usb_d_dev_register_callback+0x6> 10ac: 4905 ldr r1, [pc, #20] ; (10c4 <_usb_d_dev_register_callback+0x1c>) if (type == USB_D_CB_EVENT) { 10ae: 2801 cmp r0, #1 10b0: d102 bne.n 10b8 <_usb_d_dev_register_callback+0x10> dev_inst.callbacks.event = (_usb_d_dev_event_cb_t)f; 10b2: 4b05 ldr r3, [pc, #20] ; (10c8 <_usb_d_dev_register_callback+0x20>) 10b4: 6059 str r1, [r3, #4] } else if (type == USB_D_CB_SOF) { dev_inst.callbacks.sof = (_usb_d_dev_sof_cb_t)f; } } 10b6: 4770 bx lr } else if (type == USB_D_CB_SOF) { 10b8: 2800 cmp r0, #0 10ba: d1fc bne.n 10b6 <_usb_d_dev_register_callback+0xe> dev_inst.callbacks.sof = (_usb_d_dev_sof_cb_t)f; 10bc: 4b02 ldr r3, [pc, #8] ; (10c8 <_usb_d_dev_register_callback+0x20>) 10be: 6019 str r1, [r3, #0] } 10c0: e7f9 b.n 10b6 <_usb_d_dev_register_callback+0xe> 10c2: 46c0 nop ; (mov r8, r8) 10c4: 000004d5 .word 0x000004d5 10c8: 20000108 .word 0x20000108 000010cc <_usb_d_dev_register_ep_callback>: void _usb_d_dev_register_ep_callback(const enum usb_d_dev_ep_cb_type type, const FUNC_PTR func) { FUNC_PTR f = (func == NULL) ? (FUNC_PTR)_dummy_func_no_return : (FUNC_PTR)func; 10cc: 2900 cmp r1, #0 10ce: d100 bne.n 10d2 <_usb_d_dev_register_ep_callback+0x6> 10d0: 4907 ldr r1, [pc, #28] ; (10f0 <_usb_d_dev_register_ep_callback+0x24>) if (type == USB_D_DEV_EP_CB_SETUP) { 10d2: 2800 cmp r0, #0 10d4: d102 bne.n 10dc <_usb_d_dev_register_ep_callback+0x10> dev_inst.ep_callbacks.setup = (_usb_d_dev_ep_cb_setup_t)f; 10d6: 4b07 ldr r3, [pc, #28] ; (10f4 <_usb_d_dev_register_ep_callback+0x28>) 10d8: 6099 str r1, [r3, #8] } else if (type == USB_D_DEV_EP_CB_MORE) { dev_inst.ep_callbacks.more = (_usb_d_dev_ep_cb_more_t)f; } else if (type == USB_D_DEV_EP_CB_DONE) { dev_inst.ep_callbacks.done = (_usb_d_dev_ep_cb_done_t)f; } } 10da: 4770 bx lr } else if (type == USB_D_DEV_EP_CB_MORE) { 10dc: 2801 cmp r0, #1 10de: d102 bne.n 10e6 <_usb_d_dev_register_ep_callback+0x1a> dev_inst.ep_callbacks.more = (_usb_d_dev_ep_cb_more_t)f; 10e0: 4b04 ldr r3, [pc, #16] ; (10f4 <_usb_d_dev_register_ep_callback+0x28>) 10e2: 60d9 str r1, [r3, #12] 10e4: e7f9 b.n 10da <_usb_d_dev_register_ep_callback+0xe> } else if (type == USB_D_DEV_EP_CB_DONE) { 10e6: 2802 cmp r0, #2 10e8: d1f7 bne.n 10da <_usb_d_dev_register_ep_callback+0xe> dev_inst.ep_callbacks.done = (_usb_d_dev_ep_cb_done_t)f; 10ea: 4b02 ldr r3, [pc, #8] ; (10f4 <_usb_d_dev_register_ep_callback+0x28>) 10ec: 6119 str r1, [r3, #16] } 10ee: e7f4 b.n 10da <_usb_d_dev_register_ep_callback+0xe> 10f0: 000004d5 .word 0x000004d5 10f4: 20000108 .word 0x20000108 000010f8 : /** * \brief USB interrupt handler */ void USB_Handler(void) { 10f8: b5f7 push {r0, r1, r2, r4, r5, r6, r7, lr} uint16_t epint = hw->DEVICE.EPINTSMRY.reg; 10fa: 4b6c ldr r3, [pc, #432] ; (12ac ) 10fc: 8c1a ldrh r2, [r3, #32] 10fe: b291 uxth r1, r2 1100: 9101 str r1, [sp, #4] if (0 == epint) { 1102: 2a00 cmp r2, #0 1104: d000 beq.n 1108 1106: e066 b.n 11d6 return ((Usb *)hw)->DEVICE.INTFLAG.reg; 1108: 8b9a ldrh r2, [r3, #28] return ((Usb *)hw)->DEVICE.INTENSET.reg; 110a: 8b19 ldrh r1, [r3, #24] if (flags & USB_DEVICE_INTFLAG_SOF) { 110c: 2004 movs r0, #4 flags &= hri_usbdevice_read_INTEN_reg(USB); 110e: 400a ands r2, r1 if (flags & USB_DEVICE_INTFLAG_SOF) { 1110: 0011 movs r1, r2 1112: 4001 ands r1, r0 1114: 4202 tst r2, r0 1116: d004 beq.n 1122 ((Usb *)hw)->DEVICE.INTFLAG.reg = mask; 1118: 8398 strh r0, [r3, #28] dev_inst.callbacks.sof(); 111a: 4b65 ldr r3, [pc, #404] ; (12b0 ) 111c: 681b ldr r3, [r3, #0] 111e: 4798 blx r3 _usb_d_dev_handler(); } 1120: bdf7 pop {r0, r1, r2, r4, r5, r6, r7, pc} if (flags & USB_DEVICE_INTFLAG_LPMSUSP) { 1122: 2480 movs r4, #128 ; 0x80 1124: 0016 movs r6, r2 1126: 00a4 lsls r4, r4, #2 1128: 4026 ands r6, r4 112a: 4222 tst r2, r4 112c: d01d beq.n 116a 112e: 4a61 ldr r2, [pc, #388] ; (12b4 ) 1130: 839a strh r2, [r3, #28] ((Usb *)hw)->DEVICE.INTENCLR.reg = mask; 1132: 829a strh r2, [r3, #20] ((Usb *)hw)->DEVICE.INTENSET.reg = mask; 1134: 3a92 subs r2, #146 ; 0x92 1136: 3aff subs r2, #255 ; 0xff 1138: 831a strh r2, [r3, #24] if (bank->EXTREG.bit.SUBPID == 0x3) { 113a: 4b5f ldr r3, [pc, #380] ; (12b8 ) 113c: 891a ldrh r2, [r3, #8] 113e: 0712 lsls r2, r2, #28 1140: 0f12 lsrs r2, r2, #28 1142: 2a03 cmp r2, #3 1144: d005 beq.n 1152 1146: 8d1a ldrh r2, [r3, #40] ; 0x28 1148: 0712 lsls r2, r2, #28 114a: 0f12 lsrs r2, r2, #28 114c: 2a03 cmp r2, #3 114e: d107 bne.n 1160 UsbDeviceDescBank *bank = &prvt_inst.desc_table[i].DeviceDescBank[0]; 1150: 2101 movs r1, #1 bank->EXTREG.reg = 0; 1152: 2200 movs r2, #0 lpm_variable = bank->EXTREG.bit.VARIABLE; 1154: 0149 lsls r1, r1, #5 1156: 185b adds r3, r3, r1 1158: 8919 ldrh r1, [r3, #8] bank->EXTREG.reg = 0; 115a: 811a strh r2, [r3, #8] lpm_variable = bank->EXTREG.bit.VARIABLE; 115c: 0449 lsls r1, r1, #17 115e: 0d49 lsrs r1, r1, #21 dev_inst.callbacks.event(USB_EV_LPM_SUSPEND, lpm_variable); 1160: 2003 movs r0, #3 1162: 4b53 ldr r3, [pc, #332] ; (12b0 ) 1164: 685b ldr r3, [r3, #4] dev_inst.callbacks.event(USB_EV_SUSPEND, 0); 1166: 4798 blx r3 1168: e7da b.n 1120 } else if (flags & USB_DEVICE_INTFLAG_RAMACER) { 116a: 2480 movs r4, #128 ; 0x80 116c: 0015 movs r5, r2 116e: 4025 ands r5, r4 1170: 4222 tst r2, r4 1172: d005 beq.n 1180 ((Usb *)hw)->DEVICE.INTFLAG.reg = mask; 1174: 839c strh r4, [r3, #28] dev_inst.callbacks.event(USB_EV_ERROR, 0); 1176: 4b4e ldr r3, [pc, #312] ; (12b0 ) 1178: 0031 movs r1, r6 117a: 2005 movs r0, #5 117c: 685b ldr r3, [r3, #4] 117e: e7f2 b.n 1166 } else if (flags & USB_D_WAKEUP_INT_FLAGS) { 1180: 2670 movs r6, #112 ; 0x70 1182: 0014 movs r4, r2 1184: 4034 ands r4, r6 1186: 4232 tst r2, r6 1188: d00a beq.n 11a0 ((Usb *)hw)->DEVICE.INTENSET.reg = mask; 118a: 4a4a ldr r2, [pc, #296] ; (12b4 ) ((Usb *)hw)->DEVICE.INTFLAG.reg = mask; 118c: 839e strh r6, [r3, #28] ((Usb *)hw)->DEVICE.INTENCLR.reg = mask; 118e: 829e strh r6, [r3, #20] ((Usb *)hw)->DEVICE.INTENSET.reg = mask; 1190: 831a strh r2, [r3, #24] _usb_d_dev_wait_dfll_rdy(); 1192: 4b4a ldr r3, [pc, #296] ; (12bc ) 1194: 4798 blx r3 dev_inst.callbacks.event(USB_EV_WAKEUP, 0); 1196: 4b46 ldr r3, [pc, #280] ; (12b0 ) 1198: 0029 movs r1, r5 119a: 2002 movs r0, #2 119c: 685b ldr r3, [r3, #4] 119e: e7e2 b.n 1166 } else if (flags & USB_DEVICE_INTFLAG_EORST) { 11a0: 2508 movs r5, #8 11a2: 0011 movs r1, r2 11a4: 4029 ands r1, r5 11a6: 422a tst r2, r5 11a8: d00c beq.n 11c4 ((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPCFG.reg = data; 11aa: 4a45 ldr r2, [pc, #276] ; (12c0 ) 11ac: 7054 strb r4, [r2, #1] ((Usb *)hw)->DEVICE.INTENSET.reg = mask; 11ae: 4a41 ldr r2, [pc, #260] ; (12b4 ) ((Usb *)hw)->DEVICE.INTFLAG.reg = mask; 11b0: 839d strh r5, [r3, #28] ((Usb *)hw)->DEVICE.INTENCLR.reg = mask; 11b2: 829e strh r6, [r3, #20] ((Usb *)hw)->DEVICE.INTENSET.reg = mask; 11b4: 831a strh r2, [r3, #24] _usb_d_dev_reset_epts(); 11b6: 4b43 ldr r3, [pc, #268] ; (12c4 ) 11b8: 4798 blx r3 dev_inst.callbacks.event(USB_EV_RESET, 0); 11ba: 4b3d ldr r3, [pc, #244] ; (12b0 ) 11bc: 0021 movs r1, r4 11be: 2001 movs r0, #1 11c0: 685b ldr r3, [r3, #4] 11c2: e7d0 b.n 1166 } else if (flags & USB_DEVICE_INTFLAG_SUSPEND) { 11c4: 07d2 lsls r2, r2, #31 11c6: d506 bpl.n 11d6 ((Usb *)hw)->DEVICE.INTFLAG.reg = mask; 11c8: 4a3a ldr r2, [pc, #232] ; (12b4 ) 11ca: 839a strh r2, [r3, #28] ((Usb *)hw)->DEVICE.INTENCLR.reg = mask; 11cc: 829a strh r2, [r3, #20] ((Usb *)hw)->DEVICE.INTENSET.reg = mask; 11ce: 831e strh r6, [r3, #24] dev_inst.callbacks.event(USB_EV_SUSPEND, 0); 11d0: 4b37 ldr r3, [pc, #220] ; (12b0 ) 11d2: 685b ldr r3, [r3, #4] 11d4: e7c7 b.n 1166 uint32_t lpm_variable = 0; 11d6: 2600 movs r6, #0 uint8_t epn = USB_EP_GET_N(ept->ep); 11d8: 270f movs r7, #15 if (!(epint & (1u << epn))) { 11da: 2501 movs r5, #1 11dc: 4c3a ldr r4, [pc, #232] ; (12c8 ) if (ept->ep == 0xFF) { 11de: 7ca3 ldrb r3, [r4, #18] 11e0: 2bff cmp r3, #255 ; 0xff 11e2: d038 beq.n 1256 if (!(epint & (1u << epn))) { 11e4: 002a movs r2, r5 11e6: 403b ands r3, r7 11e8: 409a lsls r2, r3 11ea: 9901 ldr r1, [sp, #4] 11ec: 4211 tst r1, r2 11ee: d032 beq.n 1256 flags = hw->DEVICE.DeviceEndpoint[epn].EPINTFLAG.reg; 11f0: 4936 ldr r1, [pc, #216] ; (12cc ) 11f2: 015a lsls r2, r3, #5 11f4: 1852 adds r2, r2, r1 mask = hw->DEVICE.DeviceEndpoint[epn].EPINTENSET.reg; 11f6: 4932 ldr r1, [pc, #200] ; (12c0 ) 11f8: 015b lsls r3, r3, #5 11fa: 185b adds r3, r3, r1 flags = hw->DEVICE.DeviceEndpoint[epn].EPINTFLAG.reg; 11fc: 7812 ldrb r2, [r2, #0] mask = hw->DEVICE.DeviceEndpoint[epn].EPINTENSET.reg; 11fe: 7a99 ldrb r1, [r3, #10] flags &= mask; 1200: 000b movs r3, r1 1202: 4013 ands r3, r2 if (flags) { 1204: 4211 tst r1, r2 1206: d026 beq.n 1256 if ((ept->flags.bits.eptype == 0x1) && !_usb_d_dev_ep_is_busy(ept)) { 1208: 2114 movs r1, #20 120a: 4371 muls r1, r6 120c: 4a28 ldr r2, [pc, #160] ; (12b0 ) 120e: 1852 adds r2, r2, r1 1210: 2147 movs r1, #71 ; 0x47 1212: 3210 adds r2, #16 1214: 7dd2 ldrb r2, [r2, #23] 1216: 4011 ands r1, r2 1218: 2901 cmp r1, #1 121a: d111 bne.n 1240 if (flags & USB_DEVICE_EPINTFLAG_RXSTP) { 121c: 06da lsls r2, r3, #27 121e: d503 bpl.n 1228 _usb_d_dev_handle_setup(ept); 1220: 0020 movs r0, r4 1222: 4b2b ldr r3, [pc, #172] ; (12d0 ) 1224: 4798 blx r3 1226: e016 b.n 1256 } else if (flags & USB_DEVICE_EPINTFLAG_STALL1) { 1228: 2240 movs r2, #64 ; 0x40 122a: 0019 movs r1, r3 122c: 4011 ands r1, r2 122e: 4213 tst r3, r2 1230: d001 beq.n 1236 _usb_d_dev_handle_stall(ept, 1); 1232: 0029 movs r1, r5 1234: e001 b.n 123a } else if (flags & USB_DEVICE_EPINTFLAG_STALL0) { 1236: 069b lsls r3, r3, #26 1238: d50d bpl.n 1256 _usb_d_dev_handle_stall(ept, 0); 123a: 0020 movs r0, r4 123c: 4b25 ldr r3, [pc, #148] ; (12d4 ) 123e: e009 b.n 1254 } else if (_usb_d_dev_ep_is_in(ept)) { 1240: b251 sxtb r1, r2 1242: 2900 cmp r1, #0 1244: da1c bge.n 1280 if (flags & USB_DEVICE_EPINTFLAG_STALL1) { 1246: 0659 lsls r1, r3, #25 1248: d4f3 bmi.n 1232 } else if (flags & USB_DEVICE_EPINTFLAG_TRFAIL1) { 124a: 0719 lsls r1, r3, #28 124c: d508 bpl.n 1260 _usb_d_dev_handle_trfail(ept, 1); 124e: 0029 movs r1, r5 1250: 0020 movs r0, r4 1252: 4b21 ldr r3, [pc, #132] ; (12d8 ) 1254: 4798 blx r3 for (i = 0; i < USB_D_N_EP; i++) { 1256: 3601 adds r6, #1 1258: 3414 adds r4, #20 125a: 2e1b cmp r6, #27 125c: d1bf bne.n 11de 125e: e75f b.n 1120 } else if (flags & USB_DEVICE_EPINTFLAG_TRCPT1) { 1260: 0799 lsls r1, r3, #30 1262: d503 bpl.n 126c _usb_d_dev_in_next(ept, true); 1264: 0029 movs r1, r5 1266: 0020 movs r0, r4 1268: 4b1c ldr r3, [pc, #112] ; (12dc ) 126a: e7f3 b.n 1254 } else if (_usb_d_dev_ep_is_ctrl(ept)) { 126c: 2107 movs r1, #7 126e: 400a ands r2, r1 1270: 2a01 cmp r2, #1 1272: d1f0 bne.n 1256 _usb_d_dev_handle_trfail(ept, 0); 1274: 2100 movs r1, #0 if (flags & USB_DEVICE_EPINTFLAG_TRFAIL0) { 1276: 075a lsls r2, r3, #29 1278: d4ea bmi.n 1250 } else if (flags & USB_DEVICE_EPINTFLAG_RXSTP) { 127a: 06db lsls r3, r3, #27 127c: d5eb bpl.n 1256 127e: e7cf b.n 1220 if (flags & USB_DEVICE_EPINTFLAG_STALL0) { 1280: 2020 movs r0, #32 1282: 0019 movs r1, r3 1284: 4001 ands r1, r0 1286: 4203 tst r3, r0 1288: d001 beq.n 128e _usb_d_dev_handle_stall(ept, 0); 128a: 2100 movs r1, #0 128c: e7d5 b.n 123a } else if (flags & USB_DEVICE_EPINTFLAG_TRFAIL0) { 128e: 0758 lsls r0, r3, #29 1290: d4de bmi.n 1250 } else if (flags & USB_DEVICE_EPINTFLAG_TRCPT0) { 1292: 422b tst r3, r5 1294: d003 beq.n 129e _usb_d_dev_out_next(ept, true); 1296: 0029 movs r1, r5 1298: 0020 movs r0, r4 129a: 4b11 ldr r3, [pc, #68] ; (12e0 ) 129c: e7da b.n 1254 } else if (_usb_d_dev_ep_is_ctrl(ept)) { 129e: 2107 movs r1, #7 12a0: 400a ands r2, r1 12a2: 2a01 cmp r2, #1 12a4: d1d7 bne.n 1256 if (flags & USB_DEVICE_EPINTFLAG_TRFAIL1) { 12a6: 071a lsls r2, r3, #28 12a8: d5e7 bpl.n 127a 12aa: e7d0 b.n 124e 12ac: 41005000 .word 0x41005000 12b0: 20000108 .word 0x20000108 12b4: 00000201 .word 0x00000201 12b8: 200000a8 .word 0x200000a8 12bc: 000004d9 .word 0x000004d9 12c0: 410050ff .word 0x410050ff 12c4: 0000072d .word 0x0000072d 12c8: 2000011c .word 0x2000011c 12cc: 41005107 .word 0x41005107 12d0: 00000519 .word 0x00000519 12d4: 00000595 .word 0x00000595 12d8: 00000649 .word 0x00000649 12dc: 0000076d .word 0x0000076d 12e0: 000008d1 .word 0x000008d1 000012e4 : /** * \brief Initialize Delay driver */ void delay_init(void *const hw) { 12e4: b510 push {r4, lr} _delay_init(hardware = hw); 12e6: 4b02 ldr r3, [pc, #8] ; (12f0 ) 12e8: 6018 str r0, [r3, #0] 12ea: 4b02 ldr r3, [pc, #8] ; (12f4 ) 12ec: 4798 blx r3 } 12ee: bd10 pop {r4, pc} 12f0: 200003f8 .word 0x200003f8 12f4: 000000fd .word 0x000000fd 000012f8 : /** * \brief Perform delay in ms */ void delay_ms(const uint16_t ms) { _delay_cycles(hardware, _get_cycles_for_ms(ms)); 12f8: 4b04 ldr r3, [pc, #16] ; (130c ) { 12fa: b510 push {r4, lr} _delay_cycles(hardware, _get_cycles_for_ms(ms)); 12fc: 681c ldr r4, [r3, #0] 12fe: 4b04 ldr r3, [pc, #16] ; (1310 ) 1300: 4798 blx r3 1302: 0001 movs r1, r0 1304: 4b03 ldr r3, [pc, #12] ; (1314 ) 1306: 0020 movs r0, r4 1308: 4798 blx r3 } 130a: bd10 pop {r4, pc} 130c: 200003f8 .word 0x200003f8 1310: 000013b9 .word 0x000013b9 1314: 00000111 .word 0x00000111 00001318 <_pm_init>: } static inline void hri_pm_set_CPUSEL_CPUDIV_bf(const void *const hw, hri_pm_cpusel_reg_t mask) { PM_CRITICAL_SECTION_ENTER(); ((Pm *)hw)->CPUSEL.reg |= PM_CPUSEL_CPUDIV(mask); 1318: 4b06 ldr r3, [pc, #24] ; (1334 <_pm_init+0x1c>) 131a: 7a1a ldrb r2, [r3, #8] 131c: b2d2 uxtb r2, r2 131e: 721a strb r2, [r3, #8] } static inline void hri_pm_set_APBASEL_APBADIV_bf(const void *const hw, hri_pm_apbasel_reg_t mask) { PM_CRITICAL_SECTION_ENTER(); ((Pm *)hw)->APBASEL.reg |= PM_APBASEL_APBADIV(mask); 1320: 7a5a ldrb r2, [r3, #9] 1322: b2d2 uxtb r2, r2 1324: 725a strb r2, [r3, #9] } static inline void hri_pm_set_APBBSEL_APBBDIV_bf(const void *const hw, hri_pm_apbbsel_reg_t mask) { PM_CRITICAL_SECTION_ENTER(); ((Pm *)hw)->APBBSEL.reg |= PM_APBBSEL_APBBDIV(mask); 1326: 7a9a ldrb r2, [r3, #10] 1328: b2d2 uxtb r2, r2 132a: 729a strb r2, [r3, #10] } static inline void hri_pm_set_APBCSEL_APBCDIV_bf(const void *const hw, hri_pm_apbcsel_reg_t mask) { PM_CRITICAL_SECTION_ENTER(); ((Pm *)hw)->APBCSEL.reg |= PM_APBCSEL_APBCDIV(mask); 132c: 7ada ldrb r2, [r3, #11] 132e: b2d2 uxtb r2, r2 1330: 72da strb r2, [r3, #11] { hri_pm_set_CPUSEL_CPUDIV_bf(PM, CONF_CPU_DIV); hri_pm_set_APBASEL_APBADIV_bf(PM, CONF_APBA_DIV); hri_pm_set_APBBSEL_APBBDIV_bf(PM, CONF_APBB_DIV); hri_pm_set_APBCSEL_APBCDIV_bf(PM, CONF_APBC_DIV); } 1332: 4770 bx lr 1334: 40000400 .word 0x40000400 00001338 <_init_chip>: } static inline void hri_nvmctrl_set_CTRLB_RWS_bf(const void *const hw, hri_nvmctrl_ctrlb_reg_t mask) { NVMCTRL_CRITICAL_SECTION_ENTER(); ((Nvmctrl *)hw)->CTRLB.reg |= NVMCTRL_CTRLB_RWS(mask); 1338: 4b06 ldr r3, [pc, #24] ; (1354 <_init_chip+0x1c>) /** * \brief Initialize the hardware abstraction layer */ void _init_chip(void) { 133a: b510 push {r4, lr} 133c: 685a ldr r2, [r3, #4] 133e: 605a str r2, [r3, #4] hri_nvmctrl_set_CTRLB_RWS_bf(NVMCTRL, CONF_NVM_WAIT_STATE); _pm_init(); 1340: 4b05 ldr r3, [pc, #20] ; (1358 <_init_chip+0x20>) 1342: 4798 blx r3 _sysctrl_init_sources(); 1344: 4b05 ldr r3, [pc, #20] ; (135c <_init_chip+0x24>) 1346: 4798 blx r3 #if _GCLK_INIT_1ST _gclk_init_generators_by_fref(_GCLK_INIT_1ST); #endif _sysctrl_init_referenced_generators(); 1348: 4b05 ldr r3, [pc, #20] ; (1360 <_init_chip+0x28>) 134a: 4798 blx r3 _gclk_init_generators_by_fref(_GCLK_INIT_LAST); 134c: 20ff movs r0, #255 ; 0xff 134e: 4b05 ldr r3, [pc, #20] ; (1364 <_init_chip+0x2c>) 1350: 4798 blx r3 #if CONF_DMAC_ENABLE _pm_enable_bus_clock(PM_BUS_AHB, DMAC); _pm_enable_bus_clock(PM_BUS_APBB, DMAC); _dma_init(); #endif } 1352: bd10 pop {r4, pc} 1354: 41004000 .word 0x41004000 1358: 00001319 .word 0x00001319 135c: 00001449 .word 0x00001449 1360: 00001489 .word 0x00001489 1364: 000015fd .word 0x000015fd 00001368 : * \brief Check whether element belongs to list */ bool is_list_element(const struct list_descriptor *const list, const void *const element) { struct list_element *it; for (it = list->head; it; it = it->next) { 1368: 6800 ldr r0, [r0, #0] 136a: 2800 cmp r0, #0 136c: d100 bne.n 1370 return true; } } return false; } 136e: 4770 bx lr if (it == element) { 1370: 4288 cmp r0, r1 1372: d1f9 bne.n 1368 return true; 1374: 2001 movs r0, #1 1376: e7fa b.n 136e 00001378 : /** * \brief Insert an element at list end */ void list_insert_at_end(struct list_descriptor *const list, void *const element) { 1378: b570 push {r4, r5, r6, lr} struct list_element *it = list->head; ASSERT(!is_list_element(list, element)); 137a: 4b0c ldr r3, [pc, #48] ; (13ac ) { 137c: 0005 movs r5, r0 137e: 000c movs r4, r1 struct list_element *it = list->head; 1380: 6806 ldr r6, [r0, #0] ASSERT(!is_list_element(list, element)); 1382: 4798 blx r3 1384: 2301 movs r3, #1 1386: 4058 eors r0, r3 1388: 224f movs r2, #79 ; 0x4f 138a: 4b09 ldr r3, [pc, #36] ; (13b0 ) 138c: 4909 ldr r1, [pc, #36] ; (13b4 ) 138e: b2c0 uxtb r0, r0 1390: 4798 blx r3 if (!list->head) { 1392: 682b ldr r3, [r5, #0] 1394: 2b00 cmp r3, #0 1396: d102 bne.n 139e list->head = (struct list_element *)element; 1398: 602c str r4, [r5, #0] ((struct list_element *)element)->next = NULL; 139a: 6023 str r3, [r4, #0] while (it->next) { it = it->next; } it->next = (struct list_element *)element; ((struct list_element *)element)->next = NULL; } 139c: bd70 pop {r4, r5, r6, pc} while (it->next) { 139e: 0033 movs r3, r6 13a0: 6836 ldr r6, [r6, #0] 13a2: 2e00 cmp r6, #0 13a4: d1fb bne.n 139e it->next = (struct list_element *)element; 13a6: 601c str r4, [r3, #0] ((struct list_element *)element)->next = NULL; 13a8: 6026 str r6, [r4, #0] 13aa: e7f7 b.n 139c 13ac: 00001369 .word 0x00001369 13b0: 000013c1 .word 0x000013c1 13b4: 0000258c .word 0x0000258c 000013b8 <_get_cycles_for_ms>: { switch (power) { case 8: return (ms * (freq / 100000)) * 100; case 7: return (ms * (freq / 10000)) * 10; 13b8: 23fa movs r3, #250 ; 0xfa 13ba: 015b lsls r3, r3, #5 13bc: 4358 muls r0, r3 * \brief Retrieve the amount of cycles to delay for the given amount of ms */ uint32_t _get_cycles_for_ms(const uint16_t ms) { return _get_cycles_for_ms_internal(ms, CONF_CPU_FREQUENCY, CPU_FREQ_POWER); } 13be: 4770 bx lr 000013c0 : /** * \brief Assert function */ void assert(const bool condition, const char *const file, const int line) { if (!(condition)) { 13c0: 2800 cmp r0, #0 13c2: d100 bne.n 13c6 __asm("BKPT #0"); 13c4: be00 bkpt 0x0000 } (void)file; (void)line; } 13c6: 4770 bx lr 000013c8 : /** * \brief Callback invoked when Line State Change */ static bool usb_device_cb_state_c(usb_cdc_control_signal_t state) { b_usb_ready = true; 13c8: 2201 movs r2, #1 /* } */ /* No error. */ return false; } 13ca: 2000 movs r0, #0 b_usb_ready = true; 13cc: 4b02 ldr r3, [pc, #8] ; (13d8 ) { 13ce: b082 sub sp, #8 b_usb_ready = true; 13d0: 701a strb r2, [r3, #0] } 13d2: b002 add sp, #8 13d4: 4770 bx lr 13d6: 46c0 nop ; (mov r8, r8) 13d8: 200003fc .word 0x200003fc 000013dc : * \brief CDC ACM Init */ void cdc_device_acm_init(void) { /* usb stack init */ usbdc_init(ctrl_buffer); 13dc: 4806 ldr r0, [pc, #24] ; (13f8 ) { 13de: b510 push {r4, lr} usbdc_init(ctrl_buffer); 13e0: 4b06 ldr r3, [pc, #24] ; (13fc ) 13e2: 3001 adds r0, #1 13e4: 4798 blx r3 /* usbdc_register_funcion inside */ cdcdf_acm_init(); 13e6: 4b06 ldr r3, [pc, #24] ; (1400 ) 13e8: 4798 blx r3 usbdc_start(single_desc); 13ea: 4b06 ldr r3, [pc, #24] ; (1404 ) 13ec: 4806 ldr r0, [pc, #24] ; (1408 ) 13ee: 4798 blx r3 usbdc_attach(); 13f0: 4b06 ldr r3, [pc, #24] ; (140c ) 13f2: 4798 blx r3 } 13f4: bd10 pop {r4, pc} 13f6: 46c0 nop ; (mov r8, r8) 13f8: 200003fc .word 0x200003fc 13fc: 000023cd .word 0x000023cd 1400: 00000425 .word 0x00000425 1404: 00002445 .word 0x00002445 1408: 20000008 .word 0x20000008 140c: 00002479 .word 0x00002479 00001410 : * The application will behave as a virtual COM. * - Open a HyperTerminal or other COM tools in PC side. * - Send out a character or string and it will echo the content received. */ void cdcd_acm_example(void) { 1410: b510 push {r4, lr} while (!cdcdf_acm_is_enabled()) { 1412: 4b04 ldr r3, [pc, #16] ; (1424 ) 1414: 4798 blx r3 1416: 2800 cmp r0, #0 1418: d0fb beq.n 1412 // wait cdc acm to be installed }; cdcdf_acm_register_callback(CDCDF_ACM_CB_STATE_C, (FUNC_PTR)usb_device_cb_state_c); 141a: 2003 movs r0, #3 141c: 4902 ldr r1, [pc, #8] ; (1428 ) 141e: 4b03 ldr r3, [pc, #12] ; (142c ) 1420: 4798 blx r3 } 1422: bd10 pop {r4, pc} 1424: 000004c9 .word 0x000004c9 1428: 000013c9 .word 0x000013c9 142c: 00000491 .word 0x00000491 00001430 : void usb_init(void) { 1430: b510 push {r4, lr} cdc_device_acm_init(); 1432: 4b01 ldr r3, [pc, #4] ; (1438 ) 1434: 4798 blx r3 } 1436: bd10 pop {r4, pc} 1438: 000013dd .word 0x000013dd 0000143c : bool usb_ready() { return b_usb_ready; 143c: 4b01 ldr r3, [pc, #4] ; (1444 ) 143e: 7818 ldrb r0, [r3, #0] 1440: b2c0 uxtb r0, r0 } 1442: 4770 bx lr 1444: 200003fc .word 0x200003fc 00001448 <_sysctrl_init_sources>: } static inline hri_sysctrl_osc8m_reg_t hri_sysctrl_read_OSC8M_CALIB_bf(const void *const hw) { uint32_t tmp; tmp = ((Sysctrl *)hw)->OSC8M.reg; 1448: 4b0d ldr r3, [pc, #52] ; (1480 <_sysctrl_init_sources+0x38>) 144a: 6a18 ldr r0, [r3, #32] } static inline hri_sysctrl_osc8m_reg_t hri_sysctrl_read_OSC8M_FRANGE_bf(const void *const hw) { uint32_t tmp; tmp = ((Sysctrl *)hw)->OSC8M.reg; 144c: 6a19 ldr r1, [r3, #32] #if CONF_OSC8M_CONFIG == 1 calib = hri_sysctrl_read_OSC8M_CALIB_bf(hw); hri_sysctrl_write_OSC8M_reg(hw, SYSCTRL_OSC8M_FRANGE(hri_sysctrl_read_OSC8M_FRANGE_bf(hw)) | 144e: 0f89 lsrs r1, r1, #30 1450: 078a lsls r2, r1, #30 #if CONF_OSC8M_OVERWRITE_CALIBRATION == 1 SYSCTRL_OSC8M_CALIB(CONF_OSC8M_CALIB) | #else SYSCTRL_OSC8M_CALIB(calib) | 1452: 490c ldr r1, [pc, #48] ; (1484 <_sysctrl_init_sources+0x3c>) 1454: 4001 ands r1, r0 #endif SYSCTRL_OSC8M_PRESC(CONF_OSC8M_PRESC) | (CONF_OSC8M_RUNSTDBY << SYSCTRL_OSC8M_RUNSTDBY_Pos) 1456: 430a orrs r2, r1 hri_sysctrl_write_OSC8M_reg(hw, 1458: 2102 movs r1, #2 145a: 430a orrs r2, r1 } static inline void hri_sysctrl_write_OSC8M_reg(const void *const hw, hri_sysctrl_osc8m_reg_t data) { SYSCTRL_CRITICAL_SECTION_ENTER(); ((Sysctrl *)hw)->OSC8M.reg = data; 145c: 621a str r2, [r3, #32] ((Sysctrl *)hw)->OSC32K.reg |= SYSCTRL_OSC32K_ENABLE; 145e: 699a ldr r2, [r3, #24] 1460: 4311 orrs r1, r2 1462: 6199 str r1, [r3, #24] tmp = (tmp & SYSCTRL_OSCULP32K_CALIB_Msk) >> SYSCTRL_OSCULP32K_CALIB_Pos; 1464: 211f movs r1, #31 tmp = ((Sysctrl *)hw)->OSCULP32K.reg; 1466: 7f1a ldrb r2, [r3, #28] tmp = (tmp & SYSCTRL_OSCULP32K_CALIB_Msk) >> SYSCTRL_OSCULP32K_CALIB_Pos; 1468: 400a ands r2, r1 ((Sysctrl *)hw)->OSCULP32K.reg = data; 146a: 771a strb r2, [r3, #28] return (((Sysctrl *)hw)->PCLKSR.reg & SYSCTRL_PCLKSR_OSC8MRDY) >> SYSCTRL_PCLKSR_OSC8MRDY_Pos; 146c: 391e subs r1, #30 146e: 68da ldr r2, [r3, #12] 1470: 08d2 lsrs r2, r2, #3 #endif #endif #if CONF_OSC8M_CONFIG == 1 #if CONF_OSC8M_ENABLE == 1 while (!hri_sysctrl_get_PCLKSR_OSC8MRDY_bit(hw)) 1472: 420a tst r2, r1 1474: d0fb beq.n 146e <_sysctrl_init_sources+0x26> ((Sysctrl *)hw)->OSC8M.reg |= SYSCTRL_OSC8M_ONDEMAND; 1476: 2280 movs r2, #128 ; 0x80 1478: 6a19 ldr r1, [r3, #32] 147a: 430a orrs r2, r1 147c: 621a str r2, [r3, #32] hri_sysctrl_set_OSC8M_ONDEMAND_bit(hw); #endif #endif (void)calib, (void)hw; } 147e: 4770 bx lr 1480: 40000800 .word 0x40000800 1484: 0fff0000 .word 0x0fff0000 00001488 <_sysctrl_init_referenced_generators>: } static inline void hri_sysctrl_write_DFLLCTRL_reg(const void *const hw, hri_sysctrl_dfllctrl_reg_t data) { SYSCTRL_CRITICAL_SECTION_ENTER(); ((Sysctrl *)hw)->DFLLCTRL.reg = data; 1488: 2202 movs r2, #2 return (((Sysctrl *)hw)->PCLKSR.reg & SYSCTRL_PCLKSR_DFLLRDY) >> SYSCTRL_PCLKSR_DFLLRDY_Pos; 148a: 2101 movs r1, #1 ((Sysctrl *)hw)->DFLLCTRL.reg = data; 148c: 4b14 ldr r3, [pc, #80] ; (14e0 <_sysctrl_init_referenced_generators+0x58>) 148e: 849a strh r2, [r3, #36] ; 0x24 return (((Sysctrl *)hw)->PCLKSR.reg & SYSCTRL_PCLKSR_DFLLRDY) >> SYSCTRL_PCLKSR_DFLLRDY_Pos; 1490: 68da ldr r2, [r3, #12] 1492: 0912 lsrs r2, r2, #4 hri_gclk_write_CLKCTRL_reg(GCLK, GCLK_CLKCTRL_ID(0) | GCLK_CLKCTRL_GEN(CONF_DFLL_GCLK) | (1 << GCLK_CLKCTRL_CLKEN_Pos)); #endif hri_sysctrl_write_DFLLCTRL_reg(hw, SYSCTRL_DFLLCTRL_ENABLE); while (!hri_sysctrl_get_PCLKSR_DFLLRDY_bit(hw)) 1494: 420a tst r2, r1 1496: d0fb beq.n 1490 <_sysctrl_init_referenced_generators+0x8> } static inline void hri_sysctrl_write_DFLLMUL_reg(const void *const hw, hri_sysctrl_dfllmul_reg_t data) { SYSCTRL_CRITICAL_SECTION_ENTER(); ((Sysctrl *)hw)->DFLLMUL.reg = data; 1498: 4a12 ldr r2, [pc, #72] ; (14e4 <_sysctrl_init_referenced_generators+0x5c>) 149a: 62da str r2, [r3, #44] ; 0x2c ((Sysctrl *)hw)->DFLLVAL.reg = data; 149c: 22fc movs r2, #252 ; 0xfc 149e: 01d2 lsls r2, r2, #7 14a0: 629a str r2, [r3, #40] ; 0x28 ((Sysctrl *)hw)->DFLLCTRL.reg = data; 14a2: 229b movs r2, #155 ; 0x9b 14a4: 0052 lsls r2, r2, #1 14a6: 849a strh r2, [r3, #36] ; 0x24 tmp = ((Sysctrl *)hw)->DFLLCTRL.reg; 14a8: 8c9a ldrh r2, [r3, #36] ; 0x24 tmp = (tmp & SYSCTRL_DFLLCTRL_MODE) >> SYSCTRL_DFLLCTRL_MODE_Pos; 14aa: 0892 lsrs r2, r2, #2 | SYSCTRL_DPLLCTRLB_FILTER(CONF_DPLL_FILTER)); #endif #if CONF_DFLL_CONFIG == 1 #if CONF_DFLL_ENABLE == 1 if (hri_sysctrl_get_DFLLCTRL_MODE_bit(hw)) { 14ac: 420a tst r2, r1 14ae: d010 beq.n 14d2 <_sysctrl_init_referenced_generators+0x4a> tmp &= mask; 14b0: 2210 movs r2, #16 tmp = ((Sysctrl *)hw)->PCLKSR.reg; 14b2: 68d9 ldr r1, [r3, #12] = SYSCTRL_PCLKSR_DFLLRDY | SYSCTRL_PCLKSR_DFLLLCKF | SYSCTRL_PCLKSR_DFLLLCKC; #else hri_sysctrl_pclksr_reg_t status_mask = SYSCTRL_PCLKSR_DFLLRDY; #endif while (hri_sysctrl_get_PCLKSR_reg(hw, status_mask) != status_mask) 14b4: 4211 tst r1, r2 14b6: d0fc beq.n 14b2 <_sysctrl_init_referenced_generators+0x2a> ((Sysctrl *)hw)->DFLLCTRL.reg |= SYSCTRL_DFLLCTRL_ONDEMAND; 14b8: 2280 movs r2, #128 ; 0x80 14ba: 8c99 ldrh r1, [r3, #36] ; 0x24 14bc: 430a orrs r2, r1 return ((const Gclk *)hw)->STATUS.bit.SYNCBUSY; } static inline bool hri_gclk_get_STATUS_SYNCBUSY_bit(const void *const hw) { return (((Gclk *)hw)->STATUS.reg & GCLK_STATUS_SYNCBUSY) >> GCLK_STATUS_SYNCBUSY_Pos; 14be: 490a ldr r1, [pc, #40] ; (14e8 <_sysctrl_init_referenced_generators+0x60>) 14c0: 849a strh r2, [r3, #36] ; 0x24 14c2: 784a ldrb r2, [r1, #1] 14c4: 09d2 lsrs r2, r2, #7 hri_sysctrl_set_DPLLCTRLA_ONDEMAND_bit(hw); #endif #endif #if CONF_DFLL_CONFIG == 1 while (hri_gclk_get_STATUS_SYNCBUSY_bit(GCLK)) 14c6: d1fc bne.n 14c2 <_sysctrl_init_referenced_generators+0x3a> ((Sysctrl *)hw)->OSC32K.reg &= ~SYSCTRL_OSC32K_ENABLE; 14c8: 2102 movs r1, #2 14ca: 699a ldr r2, [r3, #24] 14cc: 438a bics r2, r1 14ce: 619a str r2, [r3, #24] /* Disable after all possible configurations needs sync written. */ hri_sysctrl_clear_OSC32K_ENABLE_bit(hw); #endif (void)hw; } 14d0: 4770 bx lr return (((Sysctrl *)hw)->PCLKSR.reg & SYSCTRL_PCLKSR_DFLLRDY) >> SYSCTRL_PCLKSR_DFLLRDY_Pos; 14d2: 2101 movs r1, #1 14d4: 68da ldr r2, [r3, #12] 14d6: 0912 lsrs r2, r2, #4 while (!hri_sysctrl_get_PCLKSR_DFLLRDY_bit(hw)) 14d8: 420a tst r2, r1 14da: d0fb beq.n 14d4 <_sysctrl_init_referenced_generators+0x4c> 14dc: e7ec b.n 14b8 <_sysctrl_init_referenced_generators+0x30> 14de: 46c0 nop ; (mov r8, r8) 14e0: 40000800 .word 0x40000800 14e4: 0401bb80 .word 0x0401bb80 14e8: 40000c00 .word 0x40000c00 000014ec : * \param[in] length The number of bytes to write * * \return The number of bytes written. */ static int32_t usart_sync_write(struct io_descriptor *const io_descr, const uint8_t *const buf, const uint16_t length) { 14ec: b5f8 push {r3, r4, r5, r6, r7, lr} 14ee: 0006 movs r6, r0 14f0: 000d movs r5, r1 14f2: 0014 movs r4, r2 uint32_t offset = 0; struct usart_sync_descriptor *descr = CONTAINER_OF(io_descr, struct usart_sync_descriptor, io); ASSERT(io_descr && buf && length); 14f4: 2800 cmp r0, #0 14f6: d004 beq.n 1502 14f8: 1e08 subs r0, r1, #0 14fa: d002 beq.n 1502 14fc: 0010 movs r0, r2 14fe: 1e43 subs r3, r0, #1 1500: 4198 sbcs r0, r3 1502: 22f1 movs r2, #241 ; 0xf1 1504: 4910 ldr r1, [pc, #64] ; (1548 ) 1506: 4b11 ldr r3, [pc, #68] ; (154c ) 1508: 4798 blx r3 while (!_usart_sync_is_ready_to_send(&descr->device)) 150a: 0037 movs r7, r6 150c: 3708 adds r7, #8 150e: 0038 movs r0, r7 1510: 4b0f ldr r3, [pc, #60] ; (1550 ) 1512: 4798 blx r3 1514: 2800 cmp r0, #0 1516: d0f8 beq.n 150a uint32_t offset = 0; 1518: 2600 movs r6, #0 ; do { _usart_sync_write_byte(&descr->device, buf[offset]); 151a: 0038 movs r0, r7 151c: 5da9 ldrb r1, [r5, r6] 151e: 4b0d ldr r3, [pc, #52] ; (1554 ) 1520: 4798 blx r3 while (!_usart_sync_is_ready_to_send(&descr->device)) 1522: 0038 movs r0, r7 1524: 4b0a ldr r3, [pc, #40] ; (1550 ) 1526: 4798 blx r3 1528: 2800 cmp r0, #0 152a: d0fa beq.n 1522 ; } while (++offset < length); 152c: 3601 adds r6, #1 152e: 42b4 cmp r4, r6 1530: d8f3 bhi.n 151a 1532: 2501 movs r5, #1 1534: 2c00 cmp r4, #0 1536: d000 beq.n 153a 1538: 0025 movs r5, r4 while (!_usart_sync_is_transmit_done(&descr->device)) 153a: 0038 movs r0, r7 153c: 4b06 ldr r3, [pc, #24] ; (1558 ) 153e: 4798 blx r3 1540: 2800 cmp r0, #0 1542: d0fa beq.n 153a ; return (int32_t)offset; } 1544: 0028 movs r0, r5 1546: bdf8 pop {r3, r4, r5, r6, r7, pc} 1548: 000025aa .word 0x000025aa 154c: 000013c1 .word 0x000013c1 1550: 00001ea7 .word 0x00001ea7 1554: 00001e99 .word 0x00001e99 1558: 00001eb1 .word 0x00001eb1 0000155c : * \param[in] length The size of a buffer * * \return The number of bytes read. */ static int32_t usart_sync_read(struct io_descriptor *const io_descr, uint8_t *const buf, const uint16_t length) { 155c: b5f7 push {r0, r1, r2, r4, r5, r6, r7, lr} 155e: 0005 movs r5, r0 1560: 0014 movs r4, r2 1562: 9101 str r1, [sp, #4] uint32_t offset = 0; struct usart_sync_descriptor *descr = CONTAINER_OF(io_descr, struct usart_sync_descriptor, io); ASSERT(io_descr && buf && length); 1564: 2800 cmp r0, #0 1566: d004 beq.n 1572 1568: 1e08 subs r0, r1, #0 156a: d002 beq.n 1572 156c: 0010 movs r0, r2 156e: 1e43 subs r3, r0, #1 1570: 4198 sbcs r0, r3 1572: 2286 movs r2, #134 ; 0x86 1574: 490c ldr r1, [pc, #48] ; (15a8 ) 1576: 4b0d ldr r3, [pc, #52] ; (15ac ) 1578: 0052 lsls r2, r2, #1 157a: 4798 blx r3 uint32_t offset = 0; 157c: 2600 movs r6, #0 do { while (!_usart_sync_is_byte_received(&descr->device)) 157e: 002f movs r7, r5 1580: 3708 adds r7, #8 1582: 0038 movs r0, r7 1584: 4b0a ldr r3, [pc, #40] ; (15b0 ) 1586: 4798 blx r3 1588: 2800 cmp r0, #0 158a: d0f8 beq.n 157e ; buf[offset] = _usart_sync_read_byte(&descr->device); 158c: 4b09 ldr r3, [pc, #36] ; (15b4 ) 158e: 0038 movs r0, r7 1590: 4798 blx r3 1592: 9b01 ldr r3, [sp, #4] 1594: 5598 strb r0, [r3, r6] } while (++offset < length); 1596: 3601 adds r6, #1 1598: 42b4 cmp r4, r6 159a: d8f0 bhi.n 157e 159c: 2001 movs r0, #1 159e: 2c00 cmp r4, #0 15a0: d000 beq.n 15a4 15a2: 0020 movs r0, r4 return (int32_t)offset; } 15a4: bdfe pop {r1, r2, r3, r4, r5, r6, r7, pc} 15a6: 46c0 nop ; (mov r8, r8) 15a8: 000025aa .word 0x000025aa 15ac: 000013c1 .word 0x000013c1 15b0: 00001ebb .word 0x00001ebb 15b4: 00001e9f .word 0x00001e9f 000015b8 : { 15b8: b570 push {r4, r5, r6, lr} 15ba: 0004 movs r4, r0 15bc: 000d movs r5, r1 ASSERT(descr && hw); 15be: 2800 cmp r0, #0 15c0: d002 beq.n 15c8 15c2: 0008 movs r0, r1 15c4: 1e43 subs r3, r0, #1 15c6: 4198 sbcs r0, r3 15c8: 4907 ldr r1, [pc, #28] ; (15e8 ) 15ca: 4b08 ldr r3, [pc, #32] ; (15ec ) 15cc: 2234 movs r2, #52 ; 0x34 15ce: 4798 blx r3 init_status = _usart_sync_init(&descr->device, hw); 15d0: 0020 movs r0, r4 15d2: 0029 movs r1, r5 15d4: 4b06 ldr r3, [pc, #24] ; (15f0 ) 15d6: 3008 adds r0, #8 15d8: 4798 blx r3 if (init_status) { 15da: 2800 cmp r0, #0 15dc: d103 bne.n 15e6 descr->io.read = usart_sync_read; 15de: 4b05 ldr r3, [pc, #20] ; (15f4 ) 15e0: 6063 str r3, [r4, #4] descr->io.write = usart_sync_write; 15e2: 4b05 ldr r3, [pc, #20] ; (15f8 ) 15e4: 6023 str r3, [r4, #0] } 15e6: bd70 pop {r4, r5, r6, pc} 15e8: 000025aa .word 0x000025aa 15ec: 000013c1 .word 0x000013c1 15f0: 00001e6d .word 0x00001e6d 15f4: 0000155d .word 0x0000155d 15f8: 000014ed .word 0x000014ed 000015fc <_gclk_init_generators_by_fref>: void _gclk_init_generators_by_fref(uint32_t bm) { #if CONF_GCLK_GENERATOR_0_CONFIG == 1 if (bm & (1ul << 0)) { 15fc: 07c3 lsls r3, r0, #31 15fe: d509 bpl.n 1614 <_gclk_init_generators_by_fref+0x18> } static inline void hri_gclk_write_GENDIV_reg(const void *const hw, hri_gclk_gendiv_reg_t data) { GCLK_CRITICAL_SECTION_ENTER(); ((Gclk *)hw)->GENDIV.reg = data; 1600: 2380 movs r3, #128 ; 0x80 1602: 4a10 ldr r2, [pc, #64] ; (1644 <_gclk_init_generators_by_fref+0x48>) 1604: 005b lsls r3, r3, #1 1606: 6093 str r3, [r2, #8] ((Gclk *)hw)->GENCTRL.reg = data; 1608: 2383 movs r3, #131 ; 0x83 160a: 025b lsls r3, r3, #9 160c: 6053 str r3, [r2, #4] while (((const Gclk *)hw)->STATUS.bit.SYNCBUSY) 160e: 7853 ldrb r3, [r2, #1] 1610: 09db lsrs r3, r3, #7 1612: d1fc bne.n 160e <_gclk_init_generators_by_fref+0x12> | (CONF_GCLK_GENERATOR_2_CONFIG << GCLK_GENCTRL_GENEN_Pos) | CONF_GCLK_GEN_2_SRC | GCLK_GENCTRL_ID(2)); } #endif #if CONF_GCLK_GENERATOR_3_CONFIG == 1 if (bm & (1ul << 3)) { 1614: 0703 lsls r3, r0, #28 1616: d508 bpl.n 162a <_gclk_init_generators_by_fref+0x2e> ((Gclk *)hw)->GENDIV.reg = data; 1618: 2304 movs r3, #4 161a: 4a0a ldr r2, [pc, #40] ; (1644 <_gclk_init_generators_by_fref+0x48>) 161c: 33ff adds r3, #255 ; 0xff 161e: 6093 str r3, [r2, #8] ((Gclk *)hw)->GENCTRL.reg = data; 1620: 4b09 ldr r3, [pc, #36] ; (1648 <_gclk_init_generators_by_fref+0x4c>) 1622: 6053 str r3, [r2, #4] while (((const Gclk *)hw)->STATUS.bit.SYNCBUSY) 1624: 7853 ldrb r3, [r2, #1] 1626: 09db lsrs r3, r3, #7 1628: d1fc bne.n 1624 <_gclk_init_generators_by_fref+0x28> | (CONF_GCLK_GENERATOR_6_CONFIG << GCLK_GENCTRL_GENEN_Pos) | CONF_GCLK_GEN_6_SRC | GCLK_GENCTRL_ID(6)); } #endif #if CONF_GCLK_GENERATOR_7_CONFIG == 1 if (bm & (1ul << 7)) { 162a: 0603 lsls r3, r0, #24 162c: d508 bpl.n 1640 <_gclk_init_generators_by_fref+0x44> ((Gclk *)hw)->GENDIV.reg = data; 162e: 2308 movs r3, #8 1630: 4a04 ldr r2, [pc, #16] ; (1644 <_gclk_init_generators_by_fref+0x48>) 1632: 33ff adds r3, #255 ; 0xff 1634: 6093 str r3, [r2, #8] ((Gclk *)hw)->GENCTRL.reg = data; 1636: 4b05 ldr r3, [pc, #20] ; (164c <_gclk_init_generators_by_fref+0x50>) 1638: 6053 str r3, [r2, #4] while (((const Gclk *)hw)->STATUS.bit.SYNCBUSY) 163a: 7853 ldrb r3, [r2, #1] 163c: 09db lsrs r3, r3, #7 163e: d1fc bne.n 163a <_gclk_init_generators_by_fref+0x3e> | (CONF_GCLK_GEN_8_DIVSEL << GCLK_GENCTRL_DIVSEL_Pos) | (CONF_GCLK_GEN_8_OE << GCLK_GENCTRL_OE_Pos) | (CONF_GCLK_GEN_8_OOV << GCLK_GENCTRL_OOV_Pos) | (CONF_GCLK_GEN_8_IDC << GCLK_GENCTRL_IDC_Pos) | (CONF_GCLK_GENERATOR_8_CONFIG << GCLK_GENCTRL_GENEN_Pos) | CONF_GCLK_GEN_8_SRC | GCLK_GENCTRL_ID(8)); } #endif } 1640: 4770 bx lr 1642: 46c0 nop ; (mov r8, r8) 1644: 40000c00 .word 0x40000c00 1648: 00010303 .word 0x00010303 164c: 00210707 .word 0x00210707 00001650 : #define _param_error_check(cond) ASSERT(cond) #define _desc_len_check() ASSERT(usb_desc_len(desc) >= 2) #endif uint8_t *usb_find_desc(uint8_t *desc, uint8_t *eof, uint8_t type) { 1650: b510 push {r4, lr} _param_error_check(desc && eof && (desc < eof)); while (desc < eof) { 1652: 4288 cmp r0, r1 1654: d301 bcc.n 165a _desc_len_check(); 1656: 2000 movs r0, #0 return desc; } desc = usb_desc_next(desc); } return NULL; } 1658: bd10 pop {r4, pc} return desc[0]; 165a: 7803 ldrb r3, [r0, #0] _desc_len_check(); 165c: 2b01 cmp r3, #1 165e: d9fa bls.n 1656 if (type == usb_desc_type(desc)) { 1660: 7844 ldrb r4, [r0, #1] 1662: 4294 cmp r4, r2 1664: d0f8 beq.n 1658 return (desc + usb_desc_len(desc)); 1666: 18c0 adds r0, r0, r3 1668: e7f3 b.n 1652 0000166a : uint8_t *usb_find_ep_desc(uint8_t *desc, uint8_t *eof) { _param_error_check(desc && eof && (desc < eof)); while (desc < eof) { 166a: 4288 cmp r0, r1 166c: d301 bcc.n 1672 _desc_len_check(); 166e: 2000 movs r0, #0 return desc; } desc = usb_desc_next(desc); } return NULL; } 1670: 4770 bx lr return desc[0]; 1672: 7803 ldrb r3, [r0, #0] _desc_len_check(); 1674: 2b01 cmp r3, #1 1676: d9fa bls.n 166e return desc[1]; 1678: 7842 ldrb r2, [r0, #1] if (USB_DT_INTERFACE == usb_desc_type(desc)) { 167a: 2a04 cmp r2, #4 167c: d0f7 beq.n 166e if (USB_DT_ENDPOINT == usb_desc_type(desc)) { 167e: 2a05 cmp r2, #5 1680: d0f6 beq.n 1670 return (desc + usb_desc_len(desc)); 1682: 18c0 adds r0, r0, r3 1684: e7f1 b.n 166a ... 00001688 : uint8_t *usb_find_cfg_desc(uint8_t *desc, uint8_t *eof, uint8_t cfg_value) { 1688: b570 push {r4, r5, r6, lr} _param_error_check(desc && eof && (desc < eof)); desc = usb_find_desc(desc, eof, USB_DT_CONFIG); 168a: 4b0d ldr r3, [pc, #52] ; (16c0 ) { 168c: 0015 movs r5, r2 desc = usb_find_desc(desc, eof, USB_DT_CONFIG); 168e: 2202 movs r2, #2 { 1690: 000c movs r4, r1 desc = usb_find_desc(desc, eof, USB_DT_CONFIG); 1692: 4798 blx r3 if (!desc) { 1694: 2800 cmp r0, #0 1696: d10f bne.n 16b8 return desc; } desc = usb_cfg_desc_next(desc); } return NULL; } 1698: bd70 pop {r4, r5, r6, pc} _desc_len_check(); 169a: 7803 ldrb r3, [r0, #0] 169c: 2b01 cmp r3, #1 169e: d90d bls.n 16bc if (desc[1] != USB_DT_CONFIG) { 16a0: 7843 ldrb r3, [r0, #1] 16a2: 2b02 cmp r3, #2 16a4: d10a bne.n 16bc if (desc[5] == cfg_value) { 16a6: 7943 ldrb r3, [r0, #5] 16a8: 42ab cmp r3, r5 16aa: d0f5 beq.n 1698 return (ptr[0] + (ptr[1] << 8)); 16ac: 78c2 ldrb r2, [r0, #3] 16ae: 7883 ldrb r3, [r0, #2] 16b0: 0212 lsls r2, r2, #8 16b2: 189b adds r3, r3, r2 * \param[in] cfg_desc Byte pointer to the descriptor start address * \return Byte pointer to descriptor after configuration end */ static inline uint8_t *usb_cfg_desc_next(uint8_t *cfg_desc) { return (cfg_desc + usb_cfg_desc_total_len(cfg_desc)); 16b4: b29b uxth r3, r3 16b6: 18c0 adds r0, r0, r3 while (desc < eof) { 16b8: 42a0 cmp r0, r4 16ba: d3ee bcc.n 169a return NULL; 16bc: 2000 movs r0, #0 16be: e7eb b.n 1698 16c0: 00001651 .word 0x00001651 000016c4 : } return NULL; } uint8_t *usb_find_str_desc(uint8_t *desc, uint8_t *eof, uint8_t str_index) { 16c4: b570 push {r4, r5, r6, lr} 16c6: 000c movs r4, r1 16c8: 0016 movs r6, r2 uint8_t i; _param_error_check(desc && eof && (desc < eof)); for (i = 0; desc < eof;) { 16ca: 2500 movs r5, #0 16cc: 42a0 cmp r0, r4 16ce: d301 bcc.n 16d4 return desc; } i++; desc = usb_desc_next(desc); } else { return NULL; 16d0: 2000 movs r0, #0 } } return NULL; } 16d2: bd70 pop {r4, r5, r6, pc} desc = usb_find_desc(desc, eof, USB_DT_STRING); 16d4: 2203 movs r2, #3 16d6: 0021 movs r1, r4 16d8: 4b05 ldr r3, [pc, #20] ; (16f0 ) 16da: 4798 blx r3 if (desc) { 16dc: 2800 cmp r0, #0 16de: d0f8 beq.n 16d2 return desc[0]; 16e0: 7803 ldrb r3, [r0, #0] _desc_len_check(); 16e2: 2b01 cmp r3, #1 16e4: d9f4 bls.n 16d0 if (i == str_index) { 16e6: 42b5 cmp r5, r6 16e8: d0f3 beq.n 16d2 return (desc + usb_desc_len(desc)); 16ea: 18c0 adds r0, r0, r3 16ec: 3501 adds r5, #1 16ee: e7ed b.n 16cc 16f0: 00001651 .word 0x00001651 000016f4 <_usb_d_find_ep>: * \return Index of endpoint descriptor. * \retval >=0 The index. * \retval <0 Not found (endpoint is not initialized). */ static int8_t _usb_d_find_ep(const uint8_t ep) { 16f4: 0002 movs r2, r0 for (i = 0; i < CONF_USB_D_NUM_EP_SP; i++) { if (usb_d_inst.ep[i].xfer.hdr.ep == ep) { return i; } if (usb_d_inst.ep[i].xfer.hdr.type == USB_EP_XTYPE_CTRL && (ep & USB_EP_N_MASK) == usb_d_inst.ep[i].xfer.hdr.ep) { 16f6: 210f movs r1, #15 for (i = 0; i < CONF_USB_D_NUM_EP_SP; i++) { 16f8: 2000 movs r0, #0 { 16fa: b530 push {r4, r5, lr} 16fc: 4b09 ldr r3, [pc, #36] ; (1724 <_usb_d_find_ep+0x30>) && (ep & USB_EP_N_MASK) == usb_d_inst.ep[i].xfer.hdr.ep) { 16fe: 4011 ands r1, r2 if (usb_d_inst.ep[i].xfer.hdr.ep == ep) { 1700: 785c ldrb r4, [r3, #1] 1702: 4294 cmp r4, r2 1704: d00c beq.n 1720 <_usb_d_find_ep+0x2c> if (usb_d_inst.ep[i].xfer.hdr.type == USB_EP_XTYPE_CTRL 1706: 781d ldrb r5, [r3, #0] 1708: 2d00 cmp r5, #0 170a: d101 bne.n 1710 <_usb_d_find_ep+0x1c> && (ep & USB_EP_N_MASK) == usb_d_inst.ep[i].xfer.hdr.ep) { 170c: 428c cmp r4, r1 170e: d007 beq.n 1720 <_usb_d_find_ep+0x2c> for (i = 0; i < CONF_USB_D_NUM_EP_SP; i++) { 1710: 3001 adds r0, #1 1712: b2c4 uxtb r4, r0 1714: 3320 adds r3, #32 1716: b240 sxtb r0, r0 1718: 2c0d cmp r4, #13 171a: d1f1 bne.n 1700 <_usb_d_find_ep+0xc> return i; } } return -1; 171c: 2001 movs r0, #1 171e: 4240 negs r0, r0 } 1720: bd30 pop {r4, r5, pc} 1722: 46c0 nop ; (mov r8, r8) 1724: 20000440 .word 0x20000440 00001728 : { (void)unused0; (void)unused1; (void)unused2; return false; } 1728: 2000 movs r0, #0 172a: 4770 bx lr 0000172c : * \brief Callback invoked when request more data * \param[in] ep Endpoint number with transfer direction on bit 8. * \param[in] transfered Number of bytes transfered. */ static bool usb_d_cb_trans_more(const uint8_t ep, const uint32_t transfered) { 172c: b570 push {r4, r5, r6, lr} int8_t ep_index = _usb_d_find_ep(ep); 172e: 4b08 ldr r3, [pc, #32] ; (1750 ) { 1730: 0004 movs r4, r0 1732: 000d movs r5, r1 int8_t ep_index = _usb_d_find_ep(ep); 1734: 4798 blx r3 struct usb_d_ep *ept = &usb_d_inst.ep[ep_index]; if (ept->xfer.hdr.state == USB_EP_S_X_DATA) { 1736: 4b07 ldr r3, [pc, #28] ; (1754 ) 1738: 0140 lsls r0, r0, #5 173a: 181b adds r3, r3, r0 173c: 789a ldrb r2, [r3, #2] return ept->callbacks.more(ep, transfered); } return false; 173e: 2000 movs r0, #0 if (ept->xfer.hdr.state == USB_EP_S_X_DATA) { 1740: 2a03 cmp r2, #3 1742: d103 bne.n 174c return ept->callbacks.more(ep, transfered); 1744: 0029 movs r1, r5 1746: 0020 movs r0, r4 1748: 699b ldr r3, [r3, #24] 174a: 4798 blx r3 } 174c: bd70 pop {r4, r5, r6, pc} 174e: 46c0 nop ; (mov r8, r8) 1750: 000016f5 .word 0x000016f5 1754: 20000440 .word 0x20000440 00001758 <_usb_d_cb_trans_done>: /** * Callback when USB transactions are finished. */ static void _usb_d_cb_trans_done(const uint8_t ep, const int32_t code, const uint32_t transferred) { 1758: b5f0 push {r4, r5, r6, r7, lr} int8_t ep_index = _usb_d_find_ep(ep); 175a: 4b37 ldr r3, [pc, #220] ; (1838 <_usb_d_cb_trans_done+0xe0>) { 175c: b087 sub sp, #28 175e: 000f movs r7, r1 1760: 9000 str r0, [sp, #0] 1762: 9201 str r2, [sp, #4] int8_t ep_index = _usb_d_find_ep(ep); 1764: 4798 blx r3 struct usb_d_ep *ept = &usb_d_inst.ep[ep_index]; if (code == USB_TRANS_DONE) { 1766: 4d35 ldr r5, [pc, #212] ; (183c <_usb_d_cb_trans_done+0xe4>) 1768: 0144 lsls r4, r0, #5 176a: 2f00 cmp r7, #0 176c: d141 bne.n 17f2 <_usb_d_cb_trans_done+0x9a> ept->xfer.hdr.status = USB_XFER_DONE; 176e: 192e adds r6, r5, r4 1770: 70f7 strb r7, [r6, #3] if (ept->xfer.hdr.type == USB_EP_XTYPE_CTRL) { 1772: 5d29 ldrb r1, [r5, r4] 1774: 2900 cmp r1, #0 1776: d133 bne.n 17e0 <_usb_d_cb_trans_done+0x88> bool err = ept->callbacks.xfer(ept->xfer.hdr.ep, USB_XFER_DATA, ept->xfer.req); 1778: 0022 movs r2, r4 if (state == USB_EP_S_X_DATA) { 177a: 78b4 ldrb r4, [r6, #2] bool err = ept->callbacks.xfer(ept->xfer.hdr.ep, USB_XFER_DATA, ept->xfer.req); 177c: 320c adds r2, #12 177e: 7870 ldrb r0, [r6, #1] 1780: 69f3 ldr r3, [r6, #28] 1782: 18aa adds r2, r5, r2 if (state == USB_EP_S_X_DATA) { 1784: 2c03 cmp r4, #3 1786: d127 bne.n 17d8 <_usb_d_cb_trans_done+0x80> 1788: 270c movs r7, #12 bool err = ept->callbacks.xfer(ept->xfer.hdr.ep, USB_XFER_DATA, ept->xfer.req); 178a: 3101 adds r1, #1 178c: 57f7 ldrsb r7, [r6, r7] 178e: 4798 blx r3 1790: 0003 movs r3, r0 if (err) { 1792: 7870 ldrb r0, [r6, #1] 1794: 2b00 cmp r3, #0 1796: d00b beq.n 17b0 <_usb_d_cb_trans_done+0x58> ept->xfer.hdr.state = USB_EP_S_HALTED; 1798: 4b29 ldr r3, [pc, #164] ; (1840 <_usb_d_cb_trans_done+0xe8>) 179a: 8073 strh r3, [r6, #2] _usb_d_dev_ep_stall(req_dir ? ept->xfer.hdr.ep : (ept->xfer.hdr.ep | USB_EP_DIR), USB_EP_STALL_SET); 179c: 2f00 cmp r7, #0 179e: db02 blt.n 17a6 <_usb_d_cb_trans_done+0x4e> 17a0: 3b86 subs r3, #134 ; 0x86 17a2: 3bff subs r3, #255 ; 0xff 17a4: 4318 orrs r0, r3 17a6: 2101 movs r1, #1 17a8: 4b26 ldr r3, [pc, #152] ; (1844 <_usb_d_cb_trans_done+0xec>) 17aa: 4798 blx r3 ept->xfer.hdr.state = USB_EP_S_ERROR; ept->xfer.hdr.status = USB_XFER_ERROR; } ept->callbacks.xfer(ep, (enum usb_xfer_code)ept->xfer.hdr.status, (void *)transferred); } 17ac: b007 add sp, #28 17ae: bdf0 pop {r4, r5, r6, r7, pc} ept->xfer.hdr.state = USB_EP_S_X_STATUS; 17b0: 2204 movs r2, #4 struct usb_d_transfer trans 17b2: 9303 str r3, [sp, #12] ept->xfer.hdr.state = USB_EP_S_X_STATUS; 17b4: 70b2 strb r2, [r6, #2] struct usb_d_transfer trans 17b6: 9304 str r3, [sp, #16] 17b8: 2f00 cmp r7, #0 17ba: db0a blt.n 17d2 <_usb_d_cb_trans_done+0x7a> 17bc: 2380 movs r3, #128 ; 0x80 17be: 4318 orrs r0, r3 17c0: ab02 add r3, sp, #8 17c2: 7318 strb r0, [r3, #12] 17c4: 2301 movs r3, #1 17c6: aa02 add r2, sp, #8 17c8: 7353 strb r3, [r2, #13] return _usb_d_dev_ep_trans(&trans); 17ca: a803 add r0, sp, #12 17cc: 4b1e ldr r3, [pc, #120] ; (1848 <_usb_d_cb_trans_done+0xf0>) 17ce: 4798 blx r3 17d0: e7ec b.n 17ac <_usb_d_cb_trans_done+0x54> struct usb_d_transfer trans 17d2: 230f movs r3, #15 17d4: 4018 ands r0, r3 17d6: e7f3 b.n 17c0 <_usb_d_cb_trans_done+0x68> ept->callbacks.xfer(ept->xfer.hdr.ep, USB_XFER_DONE, ept->xfer.req); 17d8: 4798 blx r3 ept->xfer.hdr.state = USB_EP_S_X_SETUP; 17da: 2302 movs r3, #2 17dc: 70b3 strb r3, [r6, #2] 17de: e7e5 b.n 17ac <_usb_d_cb_trans_done+0x54> ept->xfer.hdr.state = USB_EP_S_IDLE; 17e0: 2301 movs r3, #1 17e2: 70b3 strb r3, [r6, #2] ept->callbacks.xfer(ep, (enum usb_xfer_code)ept->xfer.hdr.status, (void *)transferred); 17e4: 192c adds r4, r5, r4 17e6: 78e1 ldrb r1, [r4, #3] 17e8: 69e3 ldr r3, [r4, #28] 17ea: 9a01 ldr r2, [sp, #4] 17ec: 9800 ldr r0, [sp, #0] 17ee: 4798 blx r3 17f0: e7dc b.n 17ac <_usb_d_cb_trans_done+0x54> ept->xfer.hdr.status = USB_XFER_HALT; 17f2: 192b adds r3, r5, r4 } else if (code == USB_TRANS_STALL) { 17f4: 2f01 cmp r7, #1 17f6: d10c bne.n 1812 <_usb_d_cb_trans_done+0xba> ept->xfer.hdr.status = USB_XFER_HALT; 17f8: 2202 movs r2, #2 17fa: 70da strb r2, [r3, #3] if (ept->xfer.hdr.type == USB_EP_XTYPE_CTRL) { 17fc: 5d29 ldrb r1, [r5, r4] 17fe: 2900 cmp r1, #0 1800: d104 bne.n 180c <_usb_d_cb_trans_done+0xb4> ept->xfer.hdr.state = USB_EP_S_X_SETUP; 1802: 709a strb r2, [r3, #2] _usb_d_dev_ep_stall(ep, USB_EP_STALL_CLR); 1804: 9800 ldr r0, [sp, #0] 1806: 4b0f ldr r3, [pc, #60] ; (1844 <_usb_d_cb_trans_done+0xec>) 1808: 4798 blx r3 180a: e7eb b.n 17e4 <_usb_d_cb_trans_done+0x8c> ept->xfer.hdr.state = USB_EP_S_HALTED; 180c: 2205 movs r2, #5 ept->xfer.hdr.state = USB_EP_S_IDLE; 180e: 709a strb r2, [r3, #2] 1810: e7e8 b.n 17e4 <_usb_d_cb_trans_done+0x8c> } else if (code == USB_TRANS_ABORT) { 1812: 2f02 cmp r7, #2 1814: d108 bne.n 1828 <_usb_d_cb_trans_done+0xd0> ept->xfer.hdr.status = USB_XFER_ABORT; 1816: 2204 movs r2, #4 1818: 70da strb r2, [r3, #3] if (ept->xfer.hdr.type == USB_EP_XTYPE_CTRL) { 181a: 5d2a ldrb r2, [r5, r4] 181c: 2a00 cmp r2, #0 181e: d101 bne.n 1824 <_usb_d_cb_trans_done+0xcc> ept->xfer.hdr.state = USB_EP_S_X_SETUP; 1820: 709f strb r7, [r3, #2] return; 1822: e7c3 b.n 17ac <_usb_d_cb_trans_done+0x54> ept->xfer.hdr.state = USB_EP_S_IDLE; 1824: 2201 movs r2, #1 1826: e7f2 b.n 180e <_usb_d_cb_trans_done+0xb6> } else if (code == USB_TRANS_RESET) { 1828: 2f03 cmp r7, #3 182a: d103 bne.n 1834 <_usb_d_cb_trans_done+0xdc> ept->xfer.hdr.state = USB_EP_S_DISABLED; 182c: 22a0 movs r2, #160 ; 0xa0 182e: 00d2 lsls r2, r2, #3 ept->xfer.hdr.state = USB_EP_S_ERROR; 1830: 805a strh r2, [r3, #2] 1832: e7d7 b.n 17e4 <_usb_d_cb_trans_done+0x8c> 1834: 4a05 ldr r2, [pc, #20] ; (184c <_usb_d_cb_trans_done+0xf4>) 1836: e7fb b.n 1830 <_usb_d_cb_trans_done+0xd8> 1838: 000016f5 .word 0x000016f5 183c: 20000440 .word 0x20000440 1840: 00000205 .word 0x00000205 1844: 00000e6d .word 0x00000e6d 1848: 00000f8d .word 0x00000f8d 184c: 00000606 .word 0x00000606 00001850 : { 1850: b5f7 push {r0, r1, r2, r4, r5, r6, r7, lr} int8_t ep_index = _usb_d_find_ep(ep); 1852: 4b18 ldr r3, [pc, #96] ; (18b4 ) { 1854: 0004 movs r4, r0 int8_t ep_index = _usb_d_find_ep(ep); 1856: 4798 blx r3 uint8_t * req = ept->xfer.req; 1858: 0147 lsls r7, r0, #5 185a: 003b movs r3, r7 185c: 4d16 ldr r5, [pc, #88] ; (18b8 ) 185e: 330c adds r3, #12 1860: 195b adds r3, r3, r5 uint8_t n = _usb_d_dev_ep_read_req(ep, req); 1862: 0019 movs r1, r3 uint8_t * req = ept->xfer.req; 1864: 9301 str r3, [sp, #4] uint8_t n = _usb_d_dev_ep_read_req(ep, req); 1866: 0020 movs r0, r4 1868: 4b14 ldr r3, [pc, #80] ; (18bc ) 186a: 4798 blx r3 _usb_d_dev_ep_stall(ep | USB_EP_DIR, USB_EP_STALL_SET); 186c: 2680 movs r6, #128 ; 0x80 if (n != 8) { 186e: b2c0 uxtb r0, r0 _usb_d_dev_ep_stall(ep | USB_EP_DIR, USB_EP_STALL_SET); 1870: 4326 orrs r6, r4 1872: 9600 str r6, [sp, #0] 1874: 4e12 ldr r6, [pc, #72] ; (18c0 ) if (n != 8) { 1876: 2808 cmp r0, #8 1878: d006 beq.n 1888 _usb_d_dev_ep_stall(ep, USB_EP_STALL_SET); 187a: 2101 movs r1, #1 187c: 0020 movs r0, r4 187e: 47b0 blx r6 _usb_d_dev_ep_stall(ep | USB_EP_DIR, USB_EP_STALL_SET); 1880: 2101 movs r1, #1 _usb_d_dev_ep_stall(ep | USB_EP_DIR, USB_EP_STALL_SET); 1882: 9800 ldr r0, [sp, #0] 1884: 47b0 blx r6 } 1886: bdf7 pop {r0, r1, r2, r4, r5, r6, r7, pc} ept->xfer.hdr.state = USB_EP_S_IDLE; 1888: 19ed adds r5, r5, r7 188a: 2701 movs r7, #1 _usb_d_dev_ep_stall(ep, USB_EP_STALL_CLR); 188c: 2100 movs r1, #0 188e: 0020 movs r0, r4 1890: 47b0 blx r6 _usb_d_dev_ep_stall(ep | USB_EP_DIR, USB_EP_STALL_CLR); 1892: 2100 movs r1, #0 1894: 9800 ldr r0, [sp, #0] 1896: 47b0 blx r6 if (!ept->callbacks.req(ep, req)) { 1898: 0020 movs r0, r4 189a: 9901 ldr r1, [sp, #4] 189c: 696b ldr r3, [r5, #20] ept->xfer.hdr.state = USB_EP_S_IDLE; 189e: 70af strb r7, [r5, #2] if (!ept->callbacks.req(ep, req)) { 18a0: 4798 blx r3 18a2: 2800 cmp r0, #0 18a4: d1ef bne.n 1886 ept->xfer.hdr.state = USB_EP_S_HALTED; 18a6: 2305 movs r3, #5 _usb_d_dev_ep_stall(ep, USB_EP_STALL_SET); 18a8: 0039 movs r1, r7 18aa: 0020 movs r0, r4 ept->xfer.hdr.state = USB_EP_S_HALTED; 18ac: 70ab strb r3, [r5, #2] _usb_d_dev_ep_stall(ep, USB_EP_STALL_SET); 18ae: 47b0 blx r6 _usb_d_dev_ep_stall(ep | USB_EP_DIR, USB_EP_STALL_SET); 18b0: 0039 movs r1, r7 18b2: e7e6 b.n 1882 18b4: 000016f5 .word 0x000016f5 18b8: 20000440 .word 0x20000440 18bc: 00000f35 .word 0x00000f35 18c0: 00000e6d .word 0x00000e6d 000018c4 : int32_t usb_d_init(void) { 18c4: b570 push {r4, r5, r6, lr} int32_t rc = _usb_d_dev_init(); 18c6: 4b12 ldr r3, [pc, #72] ; (1910 ) 18c8: 4798 blx r3 uint8_t i; if (rc < 0) { 18ca: 2800 cmp r0, #0 18cc: db1e blt.n 190c return rc; } memset(usb_d_inst.ep, 0x00, sizeof(struct usb_d_ep) * CONF_USB_D_NUM_EP_SP); 18ce: 22d0 movs r2, #208 ; 0xd0 18d0: 4c10 ldr r4, [pc, #64] ; (1914 ) 18d2: 2100 movs r1, #0 18d4: 0020 movs r0, r4 18d6: 4b10 ldr r3, [pc, #64] ; (1918 ) 18d8: 0052 lsls r2, r2, #1 18da: 4798 blx r3 for (i = 0; i < CONF_USB_D_NUM_EP_SP; i++) { 18dc: 0023 movs r3, r4 usb_d_inst.ep[i].xfer.hdr.ep = 0xFF; 18de: 21ff movs r1, #255 ; 0xff memset(usb_d_inst.ep, 0x00, sizeof(struct usb_d_ep) * CONF_USB_D_NUM_EP_SP); 18e0: 240d movs r4, #13 usb_d_inst.ep[i].callbacks.req = (usb_d_ep_cb_setup_t)usb_d_dummy_cb_false; 18e2: 4a0e ldr r2, [pc, #56] ; (191c ) for (i = 0; i < CONF_USB_D_NUM_EP_SP; i++) { 18e4: 3c01 subs r4, #1 18e6: b2e4 uxtb r4, r4 usb_d_inst.ep[i].xfer.hdr.ep = 0xFF; 18e8: 7059 strb r1, [r3, #1] usb_d_inst.ep[i].callbacks.req = (usb_d_ep_cb_setup_t)usb_d_dummy_cb_false; 18ea: 615a str r2, [r3, #20] usb_d_inst.ep[i].callbacks.more = (usb_d_ep_cb_more_t)usb_d_dummy_cb_false; 18ec: 619a str r2, [r3, #24] usb_d_inst.ep[i].callbacks.xfer = (usb_d_ep_cb_xfer_t)usb_d_dummy_cb_false; 18ee: 61da str r2, [r3, #28] for (i = 0; i < CONF_USB_D_NUM_EP_SP; i++) { 18f0: 3320 adds r3, #32 18f2: 2c00 cmp r4, #0 18f4: d1f6 bne.n 18e4 } /* Handles device driver endpoint callbacks to build transfer. */ _usb_d_dev_register_ep_callback(USB_D_DEV_EP_CB_SETUP, (FUNC_PTR)usb_d_cb_trans_setup); 18f6: 4d0a ldr r5, [pc, #40] ; (1920 ) 18f8: 0020 movs r0, r4 18fa: 490a ldr r1, [pc, #40] ; (1924 ) 18fc: 47a8 blx r5 _usb_d_dev_register_ep_callback(USB_D_DEV_EP_CB_MORE, (FUNC_PTR)usb_d_cb_trans_more); 18fe: 2001 movs r0, #1 1900: 4909 ldr r1, [pc, #36] ; (1928 ) 1902: 47a8 blx r5 _usb_d_dev_register_ep_callback(USB_D_DEV_EP_CB_DONE, (FUNC_PTR)_usb_d_cb_trans_done); 1904: 2002 movs r0, #2 1906: 4909 ldr r1, [pc, #36] ; (192c ) 1908: 47a8 blx r5 return ERR_NONE; 190a: 0020 movs r0, r4 } 190c: bd70 pop {r4, r5, r6, pc} 190e: 46c0 nop ; (mov r8, r8) 1910: 00000ac1 .word 0x00000ac1 1914: 20000440 .word 0x20000440 1918: 00002557 .word 0x00002557 191c: 00001729 .word 0x00001729 1920: 000010cd .word 0x000010cd 1924: 00001851 .word 0x00001851 1928: 0000172d .word 0x0000172d 192c: 00001759 .word 0x00001759 00001930 : { _usb_d_dev_deinit(); } void usb_d_register_callback(const enum usb_d_cb_type type, const FUNC_PTR func) { 1930: b510 push {r4, lr} /* Directly uses device driver callback. */ _usb_d_dev_register_callback(type, func); 1932: 4b01 ldr r3, [pc, #4] ; (1938 ) 1934: 4798 blx r3 } 1936: bd10 pop {r4, pc} 1938: 000010a9 .word 0x000010a9 0000193c : int32_t usb_d_enable(void) { 193c: b510 push {r4, lr} return _usb_d_dev_enable(); 193e: 4b01 ldr r3, [pc, #4] ; (1944 ) 1940: 4798 blx r3 } 1942: bd10 pop {r4, pc} 1944: 00000b85 .word 0x00000b85 00001948 : { _usb_d_dev_disable(); } void usb_d_attach(void) { 1948: b510 push {r4, lr} _usb_d_dev_attach(); 194a: 4b01 ldr r3, [pc, #4] ; (1950 ) 194c: 4798 blx r3 } 194e: bd10 pop {r4, pc} 1950: 00000bcd .word 0x00000bcd 00001954 : { return _usb_d_dev_get_uframe_n(); } void usb_d_set_address(const uint8_t addr) { 1954: b510 push {r4, lr} _usb_d_dev_set_address(addr); 1956: 4b01 ldr r3, [pc, #4] ; (195c ) 1958: 4798 blx r3 } 195a: bd10 pop {r4, pc} 195c: 00000bdd .word 0x00000bdd 00001960 : { return usb_d_ep_init(0, USB_EP_XTYPE_CTRL, max_pkt_size); } int32_t usb_d_ep_init(const uint8_t ep, const uint8_t attr, const uint16_t max_pkt_size) { 1960: b5f8 push {r3, r4, r5, r6, r7, lr} int32_t rc; int8_t ep_index = _usb_d_find_ep(ep); 1962: 4c10 ldr r4, [pc, #64] ; (19a4 ) { 1964: 0006 movs r6, r0 1966: 000d movs r5, r1 1968: 0017 movs r7, r2 int8_t ep_index = _usb_d_find_ep(ep); 196a: 47a0 blx r4 struct usb_d_ep *ept = &usb_d_inst.ep[ep_index]; if (ep_index >= 0) { 196c: 2800 cmp r0, #0 196e: da13 bge.n 1998 return -USB_ERR_REDO; } else { ep_index = _usb_d_find_ep(0xFF); 1970: 20ff movs r0, #255 ; 0xff 1972: 47a0 blx r4 1974: 1e04 subs r4, r0, #0 if (ep_index < 0) { 1976: db12 blt.n 199e return -USB_ERR_ALLOC_FAIL; } ept = &usb_d_inst.ep[ep_index]; } rc = _usb_d_dev_ep_init(ep, attr, max_pkt_size); 1978: 003a movs r2, r7 197a: 0029 movs r1, r5 197c: 0030 movs r0, r6 197e: 4b0a ldr r3, [pc, #40] ; (19a8 ) 1980: 4798 blx r3 if (rc < 0) { 1982: 2800 cmp r0, #0 1984: db07 blt.n 1996 return rc; } ept->xfer.hdr.ep = ep; ept->xfer.hdr.type = attr & USB_EP_XTYPE_MASK; 1986: 2103 movs r1, #3 return ERR_NONE; 1988: 2000 movs r0, #0 ept->xfer.hdr.ep = ep; 198a: 4b08 ldr r3, [pc, #32] ; (19ac ) 198c: 0164 lsls r4, r4, #5 198e: 191a adds r2, r3, r4 ept->xfer.hdr.type = attr & USB_EP_XTYPE_MASK; 1990: 400d ands r5, r1 ept->xfer.hdr.ep = ep; 1992: 7056 strb r6, [r2, #1] ept->xfer.hdr.type = attr & USB_EP_XTYPE_MASK; 1994: 54e5 strb r5, [r4, r3] } 1996: bdf8 pop {r3, r4, r5, r6, r7, pc} return -USB_ERR_REDO; 1998: 2014 movs r0, #20 return -USB_ERR_ALLOC_FAIL; 199a: 4240 negs r0, r0 199c: e7fb b.n 1996 199e: 2015 movs r0, #21 19a0: e7fb b.n 199a 19a2: 46c0 nop ; (mov r8, r8) 19a4: 000016f5 .word 0x000016f5 19a8: 00000bed .word 0x00000bed 19ac: 20000440 .word 0x20000440 000019b0 : return usb_d_ep_init(0, USB_EP_XTYPE_CTRL, max_pkt_size); 19b0: 2100 movs r1, #0 { 19b2: b510 push {r4, lr} return usb_d_ep_init(0, USB_EP_XTYPE_CTRL, max_pkt_size); 19b4: 0002 movs r2, r0 19b6: 0008 movs r0, r1 19b8: 4b01 ldr r3, [pc, #4] ; (19c0 ) 19ba: 4798 blx r3 } 19bc: bd10 pop {r4, pc} 19be: 46c0 nop ; (mov r8, r8) 19c0: 00001961 .word 0x00001961 000019c4 : void usb_d_ep_deinit(const uint8_t ep) { 19c4: b570 push {r4, r5, r6, lr} int8_t ep_index = _usb_d_find_ep(ep); 19c6: 4b07 ldr r3, [pc, #28] ; (19e4 ) { 19c8: 0005 movs r5, r0 int8_t ep_index = _usb_d_find_ep(ep); 19ca: 4798 blx r3 19cc: 1e04 subs r4, r0, #0 struct usb_d_ep *ept = &usb_d_inst.ep[ep_index]; if (ep_index < 0) { 19ce: db07 blt.n 19e0 return; } _usb_d_dev_ep_deinit(ep); 19d0: 0028 movs r0, r5 19d2: 4b05 ldr r3, [pc, #20] ; (19e8 ) 19d4: 4798 blx r3 ept->xfer.hdr.ep = 0xFF; 19d6: 23ff movs r3, #255 ; 0xff 19d8: 4804 ldr r0, [pc, #16] ; (19ec ) 19da: 0164 lsls r4, r4, #5 19dc: 1904 adds r4, r0, r4 19de: 7063 strb r3, [r4, #1] } 19e0: bd70 pop {r4, r5, r6, pc} 19e2: 46c0 nop ; (mov r8, r8) 19e4: 000016f5 .word 0x000016f5 19e8: 00000cb5 .word 0x00000cb5 19ec: 20000440 .word 0x20000440 000019f0 : int32_t usb_d_ep_enable(const uint8_t ep) { 19f0: b570 push {r4, r5, r6, lr} int8_t ep_index = _usb_d_find_ep(ep); 19f2: 4b0c ldr r3, [pc, #48] ; (1a24 ) { 19f4: 0004 movs r4, r0 int8_t ep_index = _usb_d_find_ep(ep); 19f6: 4798 blx r3 struct usb_d_ep *ept = &usb_d_inst.ep[ep_index]; int32_t rc; if (ep_index < 0) { 19f8: 2800 cmp r0, #0 19fa: db0f blt.n 1a1c return -USB_ERR_PARAM; } ept->xfer.hdr.state = (ept->xfer.hdr.type == USB_EP_XTYPE_CTRL) ? USB_EP_S_X_SETUP : USB_EP_S_IDLE; 19fc: 4d0a ldr r5, [pc, #40] ; (1a28 ) 19fe: 0140 lsls r0, r0, #5 1a00: 5d42 ldrb r2, [r0, r5] 1a02: 182d adds r5, r5, r0 1a04: 4251 negs r1, r2 1a06: 414a adcs r2, r1 1a08: 3201 adds r2, #1 rc = _usb_d_dev_ep_enable(ep); 1a0a: 0020 movs r0, r4 1a0c: 4b07 ldr r3, [pc, #28] ; (1a2c ) ept->xfer.hdr.state = (ept->xfer.hdr.type == USB_EP_XTYPE_CTRL) ? USB_EP_S_X_SETUP : USB_EP_S_IDLE; 1a0e: 70aa strb r2, [r5, #2] rc = _usb_d_dev_ep_enable(ep); 1a10: 4798 blx r3 if (rc < 0) { 1a12: 2800 cmp r0, #0 1a14: da01 bge.n 1a1a ept->xfer.hdr.state = USB_EP_S_DISABLED; 1a16: 2300 movs r3, #0 1a18: 70ab strb r3, [r5, #2] } return rc; } 1a1a: bd70 pop {r4, r5, r6, pc} return -USB_ERR_PARAM; 1a1c: 2012 movs r0, #18 1a1e: 4240 negs r0, r0 1a20: e7fb b.n 1a1a 1a22: 46c0 nop ; (mov r8, r8) 1a24: 000016f5 .word 0x000016f5 1a28: 20000440 .word 0x20000440 1a2c: 00000d2d .word 0x00000d2d 00001a30 : } return usb_d_inst.ep[ep_index].xfer.req; } int32_t usb_d_ep_transfer(const struct usb_d_transfer *xfer) { 1a30: b5f0 push {r4, r5, r6, r7, lr} int8_t ep_index = _usb_d_find_ep(xfer->ep); 1a32: 7a03 ldrb r3, [r0, #8] { 1a34: 0004 movs r4, r0 1a36: b08b sub sp, #44 ; 0x2c int8_t ep_index = _usb_d_find_ep(xfer->ep); 1a38: 0018 movs r0, r3 1a3a: 9301 str r3, [sp, #4] 1a3c: 4b32 ldr r3, [pc, #200] ; (1b08 ) 1a3e: 4798 blx r3 struct usb_d_ep * ept = &usb_d_inst.ep[ep_index]; bool dir = USB_EP_GET_DIR(xfer->ep), zlp = xfer->zlp; 1a40: 7a63 ldrb r3, [r4, #9] int8_t ep_index = _usb_d_find_ep(xfer->ep); 1a42: 1e06 subs r6, r0, #0 uint32_t len = xfer->size; 1a44: 6865 ldr r5, [r4, #4] bool dir = USB_EP_GET_DIR(xfer->ep), zlp = xfer->zlp; 1a46: 9302 str r3, [sp, #8] int32_t rc; volatile uint8_t state; volatile hal_atomic_t flags; if (ep_index < 0) { 1a48: db5b blt.n 1b02 return -USB_ERR_PARAM; } atomic_enter_critical(&flags); 1a4a: 4b30 ldr r3, [pc, #192] ; (1b0c ) 1a4c: a806 add r0, sp, #24 1a4e: 4798 blx r3 state = ept->xfer.hdr.state; 1a50: 0173 lsls r3, r6, #5 1a52: 9300 str r3, [sp, #0] 1a54: 9a00 ldr r2, [sp, #0] 1a56: 4b2e ldr r3, [pc, #184] ; (1b10 ) 1a58: 189e adds r6, r3, r2 1a5a: 78b3 ldrb r3, [r6, #2] 1a5c: aa04 add r2, sp, #16 1a5e: 1dd7 adds r7, r2, #7 1a60: 703b strb r3, [r7, #0] if (state == USB_EP_S_IDLE) { 1a62: 783a ldrb r2, [r7, #0] 1a64: b2d3 uxtb r3, r2 1a66: 9303 str r3, [sp, #12] 1a68: 4b2a ldr r3, [pc, #168] ; (1b14 ) 1a6a: 2a01 cmp r2, #1 1a6c: d11d bne.n 1aaa ept->xfer.hdr.state = USB_EP_S_X_DATA; 1a6e: 3202 adds r2, #2 1a70: 70b2 strb r2, [r6, #2] atomic_leave_critical(&flags); 1a72: a806 add r0, sp, #24 1a74: 4798 blx r3 default: /* USB_EP_S_X_xxxx */ return USB_BUSY; } } if (ept->xfer.hdr.type == USB_EP_XTYPE_CTRL) { 1a76: 4b26 ldr r3, [pc, #152] ; (1b10 ) 1a78: 9a00 ldr r2, [sp, #0] 1a7a: 5cd3 ldrb r3, [r2, r3] 1a7c: 2b00 cmp r3, #0 1a7e: d01f beq.n 1ac0 bool dir = USB_EP_GET_DIR(xfer->ep), zlp = xfer->zlp; 1a80: 9802 ldr r0, [sp, #8] 1a82: 9b01 ldr r3, [sp, #4] 1a84: 1e42 subs r2, r0, #1 1a86: 4190 sbcs r0, r2 1a88: 09d9 lsrs r1, r3, #7 1a8a: b2c0 uxtb r0, r0 struct usb_d_transfer trans 1a8c: 6823 ldr r3, [r4, #0] zlp = false; } } } rc = _usb_d_trans(xfer->ep, dir, xfer->buf, len, zlp); 1a8e: 7a22 ldrb r2, [r4, #8] struct usb_d_transfer trans 1a90: 9307 str r3, [sp, #28] 1a92: 9508 str r5, [sp, #32] 1a94: 2900 cmp r1, #0 1a96: d031 beq.n 1afc 1a98: 2380 movs r3, #128 ; 0x80 1a9a: 431a orrs r2, r3 1a9c: ab04 add r3, sp, #16 1a9e: 751a strb r2, [r3, #20] 1aa0: 7558 strb r0, [r3, #21] return _usb_d_dev_ep_trans(&trans); 1aa2: 4b1d ldr r3, [pc, #116] ; (1b18 ) 1aa4: a807 add r0, sp, #28 1aa6: 4798 blx r3 return rc; 1aa8: e008 b.n 1abc atomic_leave_critical(&flags); 1aaa: a806 add r0, sp, #24 1aac: 4798 blx r3 switch (state) { 1aae: 783b ldrb r3, [r7, #0] 1ab0: 2001 movs r0, #1 1ab2: b2da uxtb r2, r3 1ab4: 2b06 cmp r3, #6 1ab6: d801 bhi.n 1abc 1ab8: 4b18 ldr r3, [pc, #96] ; (1b1c ) 1aba: 5698 ldrsb r0, [r3, r2] } 1abc: b00b add sp, #44 ; 0x2c 1abe: bdf0 pop {r4, r5, r6, r7, pc} uint16_t req_len = USB_GET_wLength(ept->xfer.req); 1ac0: 7cf2 ldrb r2, [r6, #19] 1ac2: 7cb3 ldrb r3, [r6, #18] 1ac4: 0212 lsls r2, r2, #8 1ac6: 189b adds r3, r3, r2 1ac8: b29b uxth r3, r3 if (req_len == 0) { 1aca: 2b00 cmp r3, #0 1acc: d105 bne.n 1ada ept->xfer.hdr.state = USB_EP_S_X_STATUS; 1ace: 2204 movs r2, #4 zlp = true; 1ad0: 9803 ldr r0, [sp, #12] len = 0; 1ad2: 001d movs r5, r3 dir = true; 1ad4: 0001 movs r1, r0 ept->xfer.hdr.state = USB_EP_S_X_STATUS; 1ad6: 70b2 strb r2, [r6, #2] 1ad8: e7d8 b.n 1a8c if (len > req_len) { 1ada: 429d cmp r5, r3 1adc: d900 bls.n 1ae0 1ade: 001d movs r5, r3 dir = (USB_GET_bmRequestType(ept->xfer.req) & USB_REQ_TYPE_IN); 1ae0: 490b ldr r1, [pc, #44] ; (1b10 ) zlp = false; 1ae2: 2000 movs r0, #0 dir = (USB_GET_bmRequestType(ept->xfer.req) & USB_REQ_TYPE_IN); 1ae4: 468c mov ip, r1 1ae6: 9a00 ldr r2, [sp, #0] 1ae8: 0001 movs r1, r0 1aea: 4462 add r2, ip if (dir) { 1aec: 7b12 ldrb r2, [r2, #12] 1aee: 2a7f cmp r2, #127 ; 0x7f 1af0: d9cc bls.n 1a8c zlp = (req_len > len); 1af2: 429d cmp r5, r3 1af4: 419b sbcs r3, r3 dir = (USB_GET_bmRequestType(ept->xfer.req) & USB_REQ_TYPE_IN); 1af6: 3101 adds r1, #1 zlp = (req_len > len); 1af8: 4258 negs r0, r3 1afa: e7c7 b.n 1a8c struct usb_d_transfer trans 1afc: 230f movs r3, #15 1afe: 401a ands r2, r3 1b00: e7cc b.n 1a9c return -USB_ERR_PARAM; 1b02: 2012 movs r0, #18 1b04: 4240 negs r0, r0 1b06: e7d9 b.n 1abc 1b08: 000016f5 .word 0x000016f5 1b0c: 000024a5 .word 0x000024a5 1b10: 20000440 .word 0x20000440 1b14: 000024b3 .word 0x000024b3 1b18: 00000f8d .word 0x00000f8d 1b1c: 000025c6 .word 0x000025c6 00001b20 : } return ERR_NONE; } int32_t usb_d_ep_halt(const uint8_t ep, const enum usb_ep_halt_ctrl ctrl) { 1b20: b5f8 push {r3, r4, r5, r6, r7, lr} 1b22: 0005 movs r5, r0 1b24: 1e0e subs r6, r1, #0 if (ctrl == USB_EP_HALT_CLR) { 1b26: d11a bne.n 1b5e int8_t ep_index = _usb_d_find_ep(ep); 1b28: 4b12 ldr r3, [pc, #72] ; (1b74 ) 1b2a: 4798 blx r3 1b2c: 1e04 subs r4, r0, #0 if (ep_index < 0) { 1b2e: db1d blt.n 1b6c if (_usb_d_dev_ep_stall(ep, USB_EP_STALL_GET)) { 1b30: 2102 movs r1, #2 1b32: 0028 movs r0, r5 1b34: 4f10 ldr r7, [pc, #64] ; (1b78 ) 1b36: 47b8 blx r7 1b38: 2800 cmp r0, #0 1b3a: d00f beq.n 1b5c rc = _usb_d_dev_ep_stall(ep, USB_EP_STALL_CLR); 1b3c: 0031 movs r1, r6 1b3e: 0028 movs r0, r5 1b40: 47b8 blx r7 if (rc < 0) { 1b42: 2800 cmp r0, #0 1b44: db0a blt.n 1b5c ept->xfer.hdr.state = USB_EP_S_IDLE; 1b46: 480d ldr r0, [pc, #52] ; (1b7c ) 1b48: 4b0d ldr r3, [pc, #52] ; (1b80 ) 1b4a: 0164 lsls r4, r4, #5 1b4c: 1824 adds r4, r4, r0 1b4e: 8063 strh r3, [r4, #2] ept->callbacks.xfer(ep, USB_XFER_UNHALT, NULL); 1b50: 0032 movs r2, r6 1b52: 2103 movs r1, #3 1b54: 0028 movs r0, r5 1b56: 69e3 ldr r3, [r4, #28] 1b58: 4798 blx r3 return ERR_NONE; 1b5a: 0030 movs r0, r6 } else if (ctrl == USB_EP_HALT_SET) { return _usb_d_dev_ep_stall(ep, USB_EP_STALL_SET); } else { return _usb_d_dev_ep_stall(ep, USB_EP_STALL_GET); } } 1b5c: bdf8 pop {r3, r4, r5, r6, r7, pc} } else if (ctrl == USB_EP_HALT_SET) { 1b5e: 4b06 ldr r3, [pc, #24] ; (1b78 ) 1b60: 2901 cmp r1, #1 1b62: d000 beq.n 1b66 return _usb_d_dev_ep_stall(ep, USB_EP_STALL_GET); 1b64: 2102 movs r1, #2 1b66: 0028 movs r0, r5 1b68: 4798 blx r3 1b6a: e7f7 b.n 1b5c return -USB_ERR_PARAM; 1b6c: 2012 movs r0, #18 1b6e: 4240 negs r0, r0 1b70: e7f4 b.n 1b5c 1b72: 46c0 nop ; (mov r8, r8) 1b74: 000016f5 .word 0x000016f5 1b78: 00000e6d .word 0x00000e6d 1b7c: 20000440 .word 0x20000440 1b80: 00000301 .word 0x00000301 00001b84 : void usb_d_ep_register_callback(const uint8_t ep, const enum usb_d_ep_cb_type type, const FUNC_PTR func) { 1b84: b570 push {r4, r5, r6, lr} int8_t ep_index = _usb_d_find_ep(ep); 1b86: 4b0f ldr r3, [pc, #60] ; (1bc4 ) { 1b88: 0014 movs r4, r2 1b8a: 000d movs r5, r1 int8_t ep_index = _usb_d_find_ep(ep); 1b8c: 4798 blx r3 struct usb_d_ep *ept = &usb_d_inst.ep[ep_index]; FUNC_PTR f = func ? (FUNC_PTR)func : (FUNC_PTR)usb_d_dummy_cb_false; 1b8e: 2c00 cmp r4, #0 1b90: d100 bne.n 1b94 1b92: 4c0d ldr r4, [pc, #52] ; (1bc8 ) if (ep_index < 0) { 1b94: 2800 cmp r0, #0 1b96: db09 blt.n 1bac return; } switch (type) { 1b98: 2d01 cmp r5, #1 1b9a: d008 beq.n 1bae 1b9c: 2d02 cmp r5, #2 1b9e: d00b beq.n 1bb8 1ba0: 2d00 cmp r5, #0 1ba2: d103 bne.n 1bac case USB_D_EP_CB_SETUP: ept->callbacks.req = (usb_d_ep_cb_setup_t)f; 1ba4: 4b09 ldr r3, [pc, #36] ; (1bcc ) 1ba6: 0140 lsls r0, r0, #5 1ba8: 1818 adds r0, r3, r0 1baa: 6144 str r4, [r0, #20] ept->callbacks.xfer = (usb_d_ep_cb_xfer_t)f; break; default: break; } } 1bac: bd70 pop {r4, r5, r6, pc} ept->callbacks.more = (usb_d_ep_cb_more_t)f; 1bae: 4b07 ldr r3, [pc, #28] ; (1bcc ) 1bb0: 0140 lsls r0, r0, #5 1bb2: 1818 adds r0, r3, r0 1bb4: 6184 str r4, [r0, #24] break; 1bb6: e7f9 b.n 1bac ept->callbacks.xfer = (usb_d_ep_cb_xfer_t)f; 1bb8: 4b04 ldr r3, [pc, #16] ; (1bcc ) 1bba: 0140 lsls r0, r0, #5 1bbc: 1818 adds r0, r3, r0 1bbe: 61c4 str r4, [r0, #28] break; 1bc0: e7f4 b.n 1bac 1bc2: 46c0 nop ; (mov r8, r8) 1bc4: 000016f5 .word 0x000016f5 1bc8: 00001729 .word 0x00001729 1bcc: 20000440 .word 0x20000440 00001bd0
: #include static uint8_t buffer[64]; int main(void) { 1bd0: b513 push {r0, r1, r4, lr} /* Initializes MCU, drivers and middleware */ atmel_start_init(); 1bd2: 4b0d ldr r3, [pc, #52] ; (1c08 ) 1bd4: 4798 blx r3 usb_init(); 1bd6: 4b0d ldr r3, [pc, #52] ; (1c0c ) 1bd8: 4798 blx r3 cdcd_acm_example(); 1bda: 4b0d ldr r3, [pc, #52] ; (1c10 ) 1bdc: 4798 blx r3 while(!usb_ready()); 1bde: 4b0d ldr r3, [pc, #52] ; (1c14 ) 1be0: 4798 blx r3 1be2: 2800 cmp r0, #0 1be4: d0fb beq.n 1bde delay_ms(2000); 1be6: 20fa movs r0, #250 ; 0xfa 1be8: 4b0b ldr r3, [pc, #44] ; (1c18 ) 1bea: 00c0 lsls r0, r0, #3 1bec: 4798 blx r3 memcpy(buffer, "Hello World\n", sizeof("Hello World\n")); 1bee: 4c0b ldr r4, [pc, #44] ; (1c1c ) 1bf0: 220d movs r2, #13 1bf2: 490b ldr r1, [pc, #44] ; (1c20 ) 1bf4: 4b0b ldr r3, [pc, #44] ; (1c24 ) 1bf6: 0020 movs r0, r4 1bf8: 4798 blx r3 volatile int32_t ret = cdcdf_acm_write(buffer, sizeof("Hello World\n")); 1bfa: 210d movs r1, #13 1bfc: 0020 movs r0, r4 1bfe: 4b0a ldr r3, [pc, #40] ; (1c28 ) 1c00: 4798 blx r3 1c02: 9001 str r0, [sp, #4] /* Replace with your application code */ while (1) { 1c04: e7fe b.n 1c04 1c06: 46c0 nop ; (mov r8, r8) 1c08: 00001ec5 .word 0x00001ec5 1c0c: 00001431 .word 0x00001431 1c10: 00001411 .word 0x00001411 1c14: 0000143d .word 0x0000143d 1c18: 000012f9 .word 0x000012f9 1c1c: 200005e0 .word 0x200005e0 1c20: 000025d4 .word 0x000025d4 1c24: 00002545 .word 0x00002545 1c28: 00000469 .word 0x00000469 00001c2c <_gpio_set_pin_function>: /** * \brief Set gpio pin function */ static inline void _gpio_set_pin_function(const uint32_t gpio, const uint32_t function) { 1c2c: b530 push {r4, r5, lr} bool value) { uint8_t tmp; PORT_CRITICAL_SECTION_ENTER(); tmp = ((Port *)hw)->Group[submodule_index].PINCFG[index].reg; tmp &= ~PORT_PINCFG_PMUXEN; 1c2e: 2401 movs r4, #1 tmp = ((Port *)hw)->Group[submodule_index].PINCFG[index].reg; 1c30: 4b0c ldr r3, [pc, #48] ; (1c64 <_gpio_set_pin_function+0x38>) uint8_t port = GPIO_PORT(gpio); uint8_t pin = GPIO_PIN(gpio); 1c32: b2c5 uxtb r5, r0 1c34: 18c0 adds r0, r0, r3 1c36: 7803 ldrb r3, [r0, #0] } else { hri_port_write_PINCFG_PMUXEN_bit(PORT, port, pin, true); if (pin & 1) { // Odd numbered pin hri_port_write_PMUX_PMUXO_bf(PORT, port, pin >> 1, function & 0xffff); 1c38: b2ca uxtb r2, r1 tmp &= ~PORT_PINCFG_PMUXEN; 1c3a: 43a3 bics r3, r4 tmp = ((Port *)hw)->Group[submodule_index].PMUX[index].reg; 1c3c: 490a ldr r1, [pc, #40] ; (1c68 <_gpio_set_pin_function+0x3c>) tmp |= value << PORT_PINCFG_PMUXEN_Pos; 1c3e: 4323 orrs r3, r4 ((Port *)hw)->Group[submodule_index].PINCFG[index].reg = tmp; 1c40: 7003 strb r3, [r0, #0] tmp = ((Port *)hw)->Group[submodule_index].PMUX[index].reg; 1c42: 086b lsrs r3, r5, #1 1c44: 185b adds r3, r3, r1 tmp &= ~PORT_PMUX_PMUXO_Msk; 1c46: 200f movs r0, #15 tmp = ((Port *)hw)->Group[submodule_index].PMUX[index].reg; 1c48: 7819 ldrb r1, [r3, #0] if (pin & 1) { 1c4a: 4225 tst r5, r4 1c4c: d005 beq.n 1c5a <_gpio_set_pin_function+0x2e> tmp &= ~PORT_PMUX_PMUXO_Msk; 1c4e: 4001 ands r1, r0 tmp |= PORT_PMUX_PMUXO(data); 1c50: 0112 lsls r2, r2, #4 1c52: 4311 orrs r1, r2 1c54: b2c9 uxtb r1, r1 ((Port *)hw)->Group[submodule_index].PMUX[index].reg = tmp; 1c56: 7019 strb r1, [r3, #0] } else { // Even numbered pin hri_port_write_PMUX_PMUXE_bf(PORT, port, pin >> 1, function & 0xffff); } } } 1c58: bd30 pop {r4, r5, pc} tmp &= ~PORT_PMUX_PMUXE_Msk; 1c5a: 4381 bics r1, r0 tmp |= PORT_PMUX_PMUXE(data); 1c5c: 430a orrs r2, r1 ((Port *)hw)->Group[submodule_index].PMUX[index].reg = tmp; 1c5e: 701a strb r2, [r3, #0] 1c60: e7fa b.n 1c58 <_gpio_set_pin_function+0x2c> 1c62: 46c0 nop ; (mov r8, r8) 1c64: 41004440 .word 0x41004440 1c68: 41004430 .word 0x41004430 00001c6c : #include struct usart_sync_descriptor USART_0; void USART_0_PORT_init(void) { 1c6c: b510 push {r4, lr} * found in the header files for the device * */ static inline void gpio_set_pin_function(const uint32_t pin, uint32_t function) { _gpio_set_pin_function(pin, function); 1c6e: 2016 movs r0, #22 1c70: 4c03 ldr r4, [pc, #12] ; (1c80 ) 1c72: 4904 ldr r1, [pc, #16] ; (1c84 ) 1c74: 47a0 blx r4 1c76: 2017 movs r0, #23 1c78: 4903 ldr r1, [pc, #12] ; (1c88 ) 1c7a: 47a0 blx r4 gpio_set_pin_function(PA22, PINMUX_PA22C_SERCOM3_PAD0); gpio_set_pin_function(PA23, PINMUX_PA23C_SERCOM3_PAD1); } 1c7c: bd10 pop {r4, pc} 1c7e: 46c0 nop ; (mov r8, r8) 1c80: 00001c2d .word 0x00001c2d 1c84: 00160002 .word 0x00160002 1c88: 00170002 .word 0x00170002 00001c8c : peripheral = (uint32_t)_pm_get_apbb_index(module); PM->APBBMASK.reg |= 1 << peripheral; } break; case PM_BUS_APBC: PM->APBCMASK.reg |= 1 << peripheral; 1c8c: 2320 movs r3, #32 1c8e: 4a04 ldr r2, [pc, #16] ; (1ca0 ) 1c90: 6a11 ldr r1, [r2, #32] 1c92: 430b orrs r3, r1 1c94: 6213 str r3, [r2, #32] ((Gclk *)hw)->CLKCTRL.reg = data; 1c96: 4b03 ldr r3, [pc, #12] ; (1ca4 ) 1c98: 4a03 ldr r2, [pc, #12] ; (1ca8 ) 1c9a: 805a strh r2, [r3, #2] void USART_0_CLOCK_init(void) { _pm_enable_bus_clock(PM_BUS_APBC, SERCOM3); _gclk_enable_channel(SERCOM3_GCLK_ID_CORE, CONF_GCLK_SERCOM3_CORE_SRC); } 1c9c: 4770 bx lr 1c9e: 46c0 nop ; (mov r8, r8) 1ca0: 40000400 .word 0x40000400 1ca4: 40000c00 .word 0x40000c00 1ca8: 00004017 .word 0x00004017 00001cac : void USART_0_init(void) { 1cac: b510 push {r4, lr} USART_0_CLOCK_init(); 1cae: 4b05 ldr r3, [pc, #20] ; (1cc4 ) 1cb0: 4798 blx r3 usart_sync_init(&USART_0, SERCOM3, (void *)NULL); 1cb2: 2200 movs r2, #0 1cb4: 4904 ldr r1, [pc, #16] ; (1cc8 ) 1cb6: 4b05 ldr r3, [pc, #20] ; (1ccc ) 1cb8: 4805 ldr r0, [pc, #20] ; (1cd0 ) 1cba: 4798 blx r3 USART_0_PORT_init(); 1cbc: 4b05 ldr r3, [pc, #20] ; (1cd4 ) 1cbe: 4798 blx r3 } 1cc0: bd10 pop {r4, pc} 1cc2: 46c0 nop ; (mov r8, r8) 1cc4: 00001c8d .word 0x00001c8d 1cc8: 42001400 .word 0x42001400 1ccc: 000015b9 .word 0x000015b9 1cd0: 20000620 .word 0x20000620 1cd4: 00001c6d .word 0x00001c6d 00001cd8 : void delay_driver_init(void) { 1cd8: b510 push {r4, lr} delay_init(SysTick); 1cda: 4802 ldr r0, [pc, #8] ; (1ce4 ) 1cdc: 4b02 ldr r3, [pc, #8] ; (1ce8 ) 1cde: 4798 blx r3 } 1ce0: bd10 pop {r4, pc} 1ce2: 46c0 nop ; (mov r8, r8) 1ce4: e000e010 .word 0xe000e010 1ce8: 000012e5 .word 0x000012e5 00001cec : void USB_DEVICE_INSTANCE_PORT_init(void) { 1cec: b5f8 push {r3, r4, r5, r6, r7, lr} ((Port *)hw)->Group[submodule_index].DIRSET.reg = mask; 1cee: 25c0 movs r5, #192 ; 0xc0 1cf0: 2380 movs r3, #128 ; 0x80 static inline void hri_port_write_WRCONFIG_reg(const void *const hw, uint8_t submodule_index, hri_port_wrconfig_reg_t data) { PORT_CRITICAL_SECTION_ENTER(); ((Port *)hw)->Group[submodule_index].WRCONFIG.reg = data; 1cf2: 2780 movs r7, #128 ; 0x80 1cf4: 4c11 ldr r4, [pc, #68] ; (1d3c ) 1cf6: 4a12 ldr r2, [pc, #72] ; (1d40 ) ((Port *)hw)->Group[submodule_index].DIRSET.reg = mask; 1cf8: 05ed lsls r5, r5, #23 ((Port *)hw)->Group[submodule_index].WRCONFIG.reg = data; 1cfa: 05ff lsls r7, r7, #23 ((Port *)hw)->Group[submodule_index].DIRSET.reg = mask; 1cfc: 045b lsls r3, r3, #17 1cfe: 60ab str r3, [r5, #8] ((Port *)hw)->Group[submodule_index].WRCONFIG.reg = data; 1d00: 62a7 str r7, [r4, #40] ; 0x28 1d02: 62a2 str r2, [r4, #40] ; 0x28 ((Port *)hw)->Group[submodule_index].PINCFG[index].reg &= ~PORT_PINCFG_PULLEN; 1d04: 0022 movs r2, r4 1d06: 2604 movs r6, #4 ((Port *)hw)->Group[submodule_index].OUTCLR.reg = mask; 1d08: 616b str r3, [r5, #20] ((Port *)hw)->Group[submodule_index].PINCFG[index].reg &= ~PORT_PINCFG_PULLEN; 1d0a: 3258 adds r2, #88 ; 0x58 1d0c: 7813 ldrb r3, [r2, #0] 1d0e: 2018 movs r0, #24 1d10: 43b3 bics r3, r6 1d12: 7013 strb r3, [r2, #0] 1d14: 490b ldr r1, [pc, #44] ; (1d44 ) 1d16: 4b0c ldr r3, [pc, #48] ; (1d48 ) 1d18: 4798 blx r3 ((Port *)hw)->Group[submodule_index].DIRSET.reg = mask; 1d1a: 2380 movs r3, #128 ; 0x80 ((Port *)hw)->Group[submodule_index].WRCONFIG.reg = data; 1d1c: 4a0b ldr r2, [pc, #44] ; (1d4c ) ((Port *)hw)->Group[submodule_index].DIRSET.reg = mask; 1d1e: 049b lsls r3, r3, #18 1d20: 60ab str r3, [r5, #8] ((Port *)hw)->Group[submodule_index].WRCONFIG.reg = data; 1d22: 62a7 str r7, [r4, #40] ; 0x28 1d24: 62a2 str r2, [r4, #40] ; 0x28 ((Port *)hw)->Group[submodule_index].OUTCLR.reg = mask; 1d26: 616b str r3, [r5, #20] ((Port *)hw)->Group[submodule_index].PINCFG[index].reg &= ~PORT_PINCFG_PULLEN; 1d28: 3459 adds r4, #89 ; 0x59 1d2a: 7823 ldrb r3, [r4, #0] 1d2c: 2019 movs r0, #25 1d2e: 43b3 bics r3, r6 1d30: 7023 strb r3, [r4, #0] 1d32: 4907 ldr r1, [pc, #28] ; (1d50 ) 1d34: 4b04 ldr r3, [pc, #16] ; (1d48 ) 1d36: 4798 blx r3 // E // F // G // H PINMUX_PA25G_USB_DP); } 1d38: bdf8 pop {r3, r4, r5, r6, r7, pc} 1d3a: 46c0 nop ; (mov r8, r8) 1d3c: 41004400 .word 0x41004400 1d40: c0000100 .word 0xc0000100 1d44: 00180006 .word 0x00180006 1d48: 00001c2d .word 0x00001c2d 1d4c: c0000200 .word 0xc0000200 1d50: 00190006 .word 0x00190006 00001d54 : PM->APBBMASK.reg |= 1 << peripheral; 1d54: 2220 movs r2, #32 1d56: 4b06 ldr r3, [pc, #24] ; (1d70 ) 1d58: 69d9 ldr r1, [r3, #28] 1d5a: 430a orrs r2, r1 1d5c: 61da str r2, [r3, #28] PM->AHBMASK.reg |= 1 << peripheral; 1d5e: 2240 movs r2, #64 ; 0x40 1d60: 6959 ldr r1, [r3, #20] 1d62: 430a orrs r2, r1 1d64: 615a str r2, [r3, #20] 1d66: 4b03 ldr r3, [pc, #12] ; (1d74 ) 1d68: 4a03 ldr r2, [pc, #12] ; (1d78 ) 1d6a: 805a strh r2, [r3, #2] { _pm_enable_bus_clock(PM_BUS_APBB, USB); _pm_enable_bus_clock(PM_BUS_AHB, USB); _gclk_enable_channel(USB_GCLK_ID, CONF_GCLK_USB_SRC); } 1d6c: 4770 bx lr 1d6e: 46c0 nop ; (mov r8, r8) 1d70: 40000400 .word 0x40000400 1d74: 40000c00 .word 0x40000c00 1d78: 00004706 .word 0x00004706 00001d7c : void USB_DEVICE_INSTANCE_init(void) { 1d7c: b510 push {r4, lr} USB_DEVICE_INSTANCE_CLOCK_init(); 1d7e: 4b03 ldr r3, [pc, #12] ; (1d8c ) 1d80: 4798 blx r3 usb_d_init(); 1d82: 4b03 ldr r3, [pc, #12] ; (1d90 ) 1d84: 4798 blx r3 USB_DEVICE_INSTANCE_PORT_init(); 1d86: 4b03 ldr r3, [pc, #12] ; (1d94 ) 1d88: 4798 blx r3 } 1d8a: bd10 pop {r4, pc} 1d8c: 00001d55 .word 0x00001d55 1d90: 000018c5 .word 0x000018c5 1d94: 00001ced .word 0x00001ced 00001d98 : void system_init(void) { 1d98: b510 push {r4, lr} * Currently the following initialization functions are supported: * - System clock initialization */ static inline void init_mcu(void) { _init_chip(); 1d9a: 4b04 ldr r3, [pc, #16] ; (1dac ) 1d9c: 4798 blx r3 init_mcu(); USART_0_init(); 1d9e: 4b04 ldr r3, [pc, #16] ; (1db0 ) 1da0: 4798 blx r3 delay_driver_init(); 1da2: 4b04 ldr r3, [pc, #16] ; (1db4 ) 1da4: 4798 blx r3 USB_DEVICE_INSTANCE_init(); 1da6: 4b04 ldr r3, [pc, #16] ; (1db8 ) 1da8: 4798 blx r3 } 1daa: bd10 pop {r4, pc} 1dac: 00001339 .word 0x00001339 1db0: 00001cad .word 0x00001cad 1db4: 00001cd9 .word 0x00001cd9 1db8: 00001d7d .word 0x00001d7d 00001dbc : return ((Sercom *)hw)->SPI.SYNCBUSY.reg & reg; } static inline void hri_sercomusart_wait_for_sync(const void *const hw, hri_sercomusart_syncbusy_reg_t reg) { while (((Sercom *)hw)->USART.SYNCBUSY.reg & reg) { 1dbc: 69c3 ldr r3, [r0, #28] 1dbe: 4219 tst r1, r3 1dc0: d1fc bne.n 1dbc }; } 1dc2: 4770 bx lr 00001dc4 : } static inline void hri_sercomusart_clear_CTRLA_ENABLE_bit(const void *const hw) { SERCOM_CRITICAL_SECTION_ENTER(); ((Sercom *)hw)->USART.CTRLA.reg &= ~SERCOM_USART_CTRLA_ENABLE; 1dc4: 2202 movs r2, #2 { 1dc6: b510 push {r4, lr} ((Sercom *)hw)->USART.CTRLA.reg &= ~SERCOM_USART_CTRLA_ENABLE; 1dc8: 6803 ldr r3, [r0, #0] hri_sercomusart_wait_for_sync(hw, SERCOM_USART_SYNCBUSY_SWRST | SERCOM_USART_SYNCBUSY_ENABLE); 1dca: 2103 movs r1, #3 ((Sercom *)hw)->USART.CTRLA.reg &= ~SERCOM_USART_CTRLA_ENABLE; 1dcc: 4393 bics r3, r2 1dce: 6003 str r3, [r0, #0] hri_sercomusart_wait_for_sync(hw, SERCOM_USART_SYNCBUSY_SWRST | SERCOM_USART_SYNCBUSY_ENABLE); 1dd0: 4b01 ldr r3, [pc, #4] ; (1dd8 ) 1dd2: 4798 blx r3 SERCOM_CRITICAL_SECTION_LEAVE(); } 1dd4: bd10 pop {r4, pc} 1dd6: 46c0 nop ; (mov r8, r8) 1dd8: 00001dbd .word 0x00001dbd 00001ddc <_usart_init>: { #ifdef _UNIT_TEST_ return ((uint32_t)hw - (uint32_t)SERCOM0) / sizeof(Sercom); #endif return ((uint32_t)hw - (uint32_t)SERCOM0) >> 10; 1ddc: 4b1b ldr r3, [pc, #108] ; (1e4c <_usart_init+0x70>) * \param[in] hw The pointer to hardware instance * * \return The status of initialization */ static int32_t _usart_init(void *const hw) { 1dde: b570 push {r4, r5, r6, lr} return ((uint32_t)hw - (uint32_t)SERCOM0) >> 10; 1de0: 18c3 adds r3, r0, r3 1de2: 0a9b lsrs r3, r3, #10 if (_usarts[i].number == sercom_offset) { 1de4: b2db uxtb r3, r3 { 1de6: 0004 movs r4, r0 if (_usarts[i].number == sercom_offset) { 1de8: 2b03 cmp r3, #3 1dea: d004 beq.n 1df6 <_usart_init+0x1a> ASSERT(false); 1dec: 2000 movs r0, #0 1dee: 4a18 ldr r2, [pc, #96] ; (1e50 <_usart_init+0x74>) 1df0: 4918 ldr r1, [pc, #96] ; (1e54 <_usart_init+0x78>) 1df2: 4b19 ldr r3, [pc, #100] ; (1e58 <_usart_init+0x7c>) 1df4: 4798 blx r3 return ((Sercom *)hw)->USART.SYNCBUSY.reg & reg; 1df6: 69e3 ldr r3, [r4, #28] 1df8: 4d18 ldr r5, [pc, #96] ; (1e5c <_usart_init+0x80>) uint8_t i = _get_sercom_index(hw); if (!hri_sercomusart_is_syncing(hw, SERCOM_USART_SYNCBUSY_SWRST)) { 1dfa: 07db lsls r3, r3, #31 1dfc: d411 bmi.n 1e22 <_usart_init+0x46> hri_sercomusart_ctrla_reg_t mask) { uint32_t tmp; hri_sercomusart_wait_for_sync(hw, SERCOM_USART_SYNCBUSY_SWRST | SERCOM_USART_SYNCBUSY_ENABLE); tmp = ((Sercom *)hw)->USART.CTRLA.reg; tmp &= mask; 1dfe: 2602 movs r6, #2 hri_sercomusart_wait_for_sync(hw, SERCOM_USART_SYNCBUSY_SWRST | SERCOM_USART_SYNCBUSY_ENABLE); 1e00: 2103 movs r1, #3 1e02: 0020 movs r0, r4 1e04: 47a8 blx r5 tmp = ((Sercom *)hw)->USART.CTRLA.reg; 1e06: 6823 ldr r3, [r4, #0] uint32_t mode = _usarts[i].ctrl_a & SERCOM_USART_CTRLA_MODE_Msk; if (hri_sercomusart_get_CTRLA_reg(hw, SERCOM_USART_CTRLA_ENABLE)) { 1e08: 4233 tst r3, r6 1e0a: d005 beq.n 1e18 <_usart_init+0x3c> hri_sercomusart_clear_CTRLA_ENABLE_bit(hw); 1e0c: 0020 movs r0, r4 1e0e: 4b14 ldr r3, [pc, #80] ; (1e60 <_usart_init+0x84>) 1e10: 4798 blx r3 hri_sercomusart_wait_for_sync(hw, SERCOM_USART_SYNCBUSY_ENABLE); 1e12: 0031 movs r1, r6 1e14: 0020 movs r0, r4 1e16: 47a8 blx r5 } static inline void hri_sercomusart_write_CTRLA_reg(const void *const hw, hri_sercomusart_ctrla_reg_t data) { SERCOM_CRITICAL_SECTION_ENTER(); ((Sercom *)hw)->USART.CTRLA.reg = data; 1e18: 2305 movs r3, #5 hri_sercomusart_wait_for_sync(hw, SERCOM_USART_SYNCBUSY_SWRST | SERCOM_USART_SYNCBUSY_ENABLE); 1e1a: 2103 movs r1, #3 1e1c: 0020 movs r0, r4 ((Sercom *)hw)->USART.CTRLA.reg = data; 1e1e: 6023 str r3, [r4, #0] hri_sercomusart_wait_for_sync(hw, SERCOM_USART_SYNCBUSY_SWRST | SERCOM_USART_SYNCBUSY_ENABLE); 1e20: 47a8 blx r5 } hri_sercomusart_write_CTRLA_reg(hw, SERCOM_USART_CTRLA_SWRST | mode); } hri_sercomusart_wait_for_sync(hw, SERCOM_USART_SYNCBUSY_SWRST); 1e22: 0020 movs r0, r4 1e24: 2101 movs r1, #1 1e26: 47a8 blx r5 ((Sercom *)hw)->USART.CTRLA.reg = data; 1e28: 4b0e ldr r3, [pc, #56] ; (1e64 <_usart_init+0x88>) hri_sercomusart_wait_for_sync(hw, SERCOM_USART_SYNCBUSY_SWRST | SERCOM_USART_SYNCBUSY_ENABLE); 1e2a: 0020 movs r0, r4 ((Sercom *)hw)->USART.CTRLA.reg = data; 1e2c: 6023 str r3, [r4, #0] hri_sercomusart_wait_for_sync(hw, SERCOM_USART_SYNCBUSY_SWRST | SERCOM_USART_SYNCBUSY_ENABLE); 1e2e: 2103 movs r1, #3 1e30: 47a8 blx r5 } static inline void hri_sercomusart_write_CTRLB_reg(const void *const hw, hri_sercomusart_ctrlb_reg_t data) { SERCOM_CRITICAL_SECTION_ENTER(); ((Sercom *)hw)->USART.CTRLB.reg = data; 1e32: 23c0 movs r3, #192 ; 0xc0 1e34: 029b lsls r3, r3, #10 hri_sercomusart_wait_for_sync(hw, SERCOM_USART_SYNCBUSY_MASK); 1e36: 0020 movs r0, r4 ((Sercom *)hw)->USART.CTRLB.reg = data; 1e38: 6063 str r3, [r4, #4] hri_sercomusart_wait_for_sync(hw, SERCOM_USART_SYNCBUSY_MASK); 1e3a: 2107 movs r1, #7 1e3c: 47a8 blx r5 } static inline void hri_sercomusart_write_RXPL_reg(const void *const hw, hri_sercomusart_rxpl_reg_t data) { SERCOM_CRITICAL_SECTION_ENTER(); ((Sercom *)hw)->USART.RXPL.reg = data; 1e3e: 2000 movs r0, #0 ((Sercom *)hw)->USART.BAUD.reg = data; 1e40: 4b09 ldr r3, [pc, #36] ; (1e68 <_usart_init+0x8c>) 1e42: 81a3 strh r3, [r4, #12] ((Sercom *)hw)->USART.RXPL.reg = data; 1e44: 73a0 strb r0, [r4, #14] } static inline void hri_sercomusart_write_DBGCTRL_reg(const void *const hw, hri_sercomusart_dbgctrl_reg_t data) { SERCOM_CRITICAL_SECTION_ENTER(); ((Sercom *)hw)->USART.DBGCTRL.reg = data; 1e46: 3430 adds r4, #48 ; 0x30 1e48: 7020 strb r0, [r4, #0] hri_sercomusart_write_RXPL_reg(hw, _usarts[i].rxpl); hri_sercomusart_write_DBGCTRL_reg(hw, _usarts[i].debug_ctrl); return ERR_NONE; } 1e4a: bd70 pop {r4, r5, r6, pc} 1e4c: bdfff800 .word 0xbdfff800 1e50: 0000023a .word 0x0000023a 1e54: 000025e1 .word 0x000025e1 1e58: 000013c1 .word 0x000013c1 1e5c: 00001dbd .word 0x00001dbd 1e60: 00001dc5 .word 0x00001dc5 1e64: 40100004 .word 0x40100004 1e68: ffffc504 .word 0xffffc504 00001e6c <_usart_sync_init>: { 1e6c: b570 push {r4, r5, r6, lr} 1e6e: 0005 movs r5, r0 ASSERT(device); 1e70: 1e43 subs r3, r0, #1 1e72: 4198 sbcs r0, r3 { 1e74: 000c movs r4, r1 ASSERT(device); 1e76: 22b4 movs r2, #180 ; 0xb4 1e78: 4904 ldr r1, [pc, #16] ; (1e8c <_usart_sync_init+0x20>) 1e7a: 4b05 ldr r3, [pc, #20] ; (1e90 <_usart_sync_init+0x24>) 1e7c: b2c0 uxtb r0, r0 1e7e: 4798 blx r3 device->hw = hw; 1e80: 602c str r4, [r5, #0] return _usart_init(hw); 1e82: 0020 movs r0, r4 1e84: 4b03 ldr r3, [pc, #12] ; (1e94 <_usart_sync_init+0x28>) 1e86: 4798 blx r3 } 1e88: bd70 pop {r4, r5, r6, pc} 1e8a: 46c0 nop ; (mov r8, r8) 1e8c: 000025e1 .word 0x000025e1 1e90: 000013c1 .word 0x000013c1 1e94: 00001ddd .word 0x00001ddd 00001e98 <_usart_sync_write_byte>: hri_sercomusart_write_DATA_reg(device->hw, data); 1e98: 6803 ldr r3, [r0, #0] ((Sercom *)hw)->USART.DATA.reg = data; 1e9a: 8519 strh r1, [r3, #40] ; 0x28 } 1e9c: 4770 bx lr 00001e9e <_usart_sync_read_byte>: return hri_sercomusart_read_DATA_reg(device->hw); 1e9e: 6803 ldr r3, [r0, #0] return ((Sercom *)hw)->USART.DATA.reg; 1ea0: 8d18 ldrh r0, [r3, #40] ; 0x28 1ea2: b2c0 uxtb r0, r0 } 1ea4: 4770 bx lr 00001ea6 <_usart_sync_is_ready_to_send>: return hri_sercomusart_get_interrupt_DRE_bit(device->hw); 1ea6: 6803 ldr r3, [r0, #0] return (((Sercom *)hw)->USART.INTFLAG.reg & SERCOM_USART_INTFLAG_DRE) >> SERCOM_USART_INTFLAG_DRE_Pos; 1ea8: 7e18 ldrb r0, [r3, #24] 1eaa: 2301 movs r3, #1 1eac: 4018 ands r0, r3 } 1eae: 4770 bx lr 00001eb0 <_usart_sync_is_transmit_done>: return hri_sercomusart_get_interrupt_TXC_bit(device->hw); 1eb0: 6803 ldr r3, [r0, #0] return (((Sercom *)hw)->USART.INTFLAG.reg & SERCOM_USART_INTFLAG_TXC) >> SERCOM_USART_INTFLAG_TXC_Pos; 1eb2: 7e18 ldrb r0, [r3, #24] 1eb4: 0780 lsls r0, r0, #30 1eb6: 0fc0 lsrs r0, r0, #31 } 1eb8: 4770 bx lr 00001eba <_usart_sync_is_byte_received>: return hri_sercomusart_get_interrupt_RXC_bit(device->hw); 1eba: 6803 ldr r3, [r0, #0] return (((Sercom *)hw)->USART.INTFLAG.reg & SERCOM_USART_INTFLAG_RXC) >> SERCOM_USART_INTFLAG_RXC_Pos; 1ebc: 7e18 ldrb r0, [r3, #24] 1ebe: 0740 lsls r0, r0, #29 1ec0: 0fc0 lsrs r0, r0, #31 } 1ec2: 4770 bx lr 00001ec4 : /** * Initializes MCU, drivers and middleware in the project **/ void atmel_start_init(void) { 1ec4: b510 push {r4, lr} system_init(); 1ec6: 4b02 ldr r3, [pc, #8] ; (1ed0 ) 1ec8: 4798 blx r3 usb_init(); 1eca: 4b02 ldr r3, [pc, #8] ; (1ed4 ) 1ecc: 4798 blx r3 } 1ece: bd10 pop {r4, pc} 1ed0: 00001d99 .word 0x00001d99 1ed4: 00001431 .word 0x00001431 00001ed8 : /** * \brief Unconfig, close all interfaces */ static void usbdc_unconfig(void) { struct usbdf_driver *func = (struct usbdf_driver *)usbdc.func_list.head; 1ed8: 4b06 ldr r3, [pc, #24] ; (1ef4 ) { 1eda: b510 push {r4, lr} struct usbdf_driver *func = (struct usbdf_driver *)usbdc.func_list.head; 1edc: 691c ldr r4, [r3, #16] while (NULL != func) { 1ede: 2c00 cmp r4, #0 1ee0: d100 bne.n 1ee4 func->ctrl(func, USBDF_DISABLE, NULL); func = func->next; } } 1ee2: bd10 pop {r4, pc} func->ctrl(func, USBDF_DISABLE, NULL); 1ee4: 0020 movs r0, r4 1ee6: 6863 ldr r3, [r4, #4] 1ee8: 2200 movs r2, #0 1eea: 2101 movs r1, #1 1eec: 4798 blx r3 func = func->next; 1eee: 6824 ldr r4, [r4, #0] 1ef0: e7f5 b.n 1ede 1ef2: 46c0 nop ; (mov r8, r8) 1ef4: 2000062c .word 0x2000062c 00001ef8 : } } /** Invoke all registered Change notification callbacks. */ static void usbdc_change_notify(enum usbdc_change_type change, uint32_t value) { 1ef8: b570 push {r4, r5, r6, lr} 1efa: 0005 movs r5, r0 1efc: 000e movs r6, r1 struct usbdc_change_handler *cg = (struct usbdc_change_handler *)usbdc.handlers.change_list.head; 1efe: 4b06 ldr r3, [pc, #24] ; (1f18 ) 1f00: 68dc ldr r4, [r3, #12] while (cg != NULL) { 1f02: 2c00 cmp r4, #0 1f04: d100 bne.n 1f08 if (NULL != cg->cb) { cg->cb(change, value); } cg = cg->next; } } 1f06: bd70 pop {r4, r5, r6, pc} if (NULL != cg->cb) { 1f08: 6863 ldr r3, [r4, #4] 1f0a: 2b00 cmp r3, #0 1f0c: d002 beq.n 1f14 cg->cb(change, value); 1f0e: 0031 movs r1, r6 1f10: 0028 movs r0, r5 1f12: 4798 blx r3 cg = cg->next; 1f14: 6824 ldr r4, [r4, #0] 1f16: e7f4 b.n 1f02 1f18: 2000062c .word 0x2000062c 00001f1c : /** Invoke all registered request callbacks until request handled. */ static int32_t usbdc_request_handler(uint8_t ep, struct usb_req *req, enum usb_ctrl_stage stage) { 1f1c: b5f8 push {r3, r4, r5, r6, r7, lr} 1f1e: 0005 movs r5, r0 1f20: 000e movs r6, r1 1f22: 0017 movs r7, r2 struct usbdc_req_handler *h = (struct usbdc_req_handler *)usbdc.handlers.req_list.head; 1f24: 4b0b ldr r3, [pc, #44] ; (1f54 ) 1f26: 689c ldr r4, [r3, #8] int32_t rc; while (h != NULL) { 1f28: 2c00 cmp r4, #0 1f2a: d101 bne.n 1f30 return -1; } } h = h->next; } return false; 1f2c: 0020 movs r0, r4 } 1f2e: bdf8 pop {r3, r4, r5, r6, r7, pc} if (NULL != h->cb) { 1f30: 6863 ldr r3, [r4, #4] 1f32: 2b00 cmp r3, #0 1f34: d101 bne.n 1f3a h = h->next; 1f36: 6824 ldr r4, [r4, #0] 1f38: e7f6 b.n 1f28 rc = h->cb(ep, req, stage); 1f3a: 003a movs r2, r7 1f3c: 0031 movs r1, r6 1f3e: 0028 movs r0, r5 1f40: 4798 blx r3 if (0 == rc) { 1f42: 2800 cmp r0, #0 1f44: d004 beq.n 1f50 } else if (ERR_NOT_FOUND != rc) { 1f46: 300a adds r0, #10 1f48: d0f5 beq.n 1f36 return -1; 1f4a: 2001 movs r0, #1 1f4c: 4240 negs r0, r0 1f4e: e7ee b.n 1f2e return true; 1f50: 2001 movs r0, #1 1f52: e7ec b.n 1f2e 1f54: 2000062c .word 0x2000062c 00001f58 : struct usbdc_sof_handler *sof = (struct usbdc_sof_handler *)usbdc.handlers.sof_list.head; 1f58: 4b05 ldr r3, [pc, #20] ; (1f70 ) /** * \brief Callback invoked on USB device SOF */ static void usbd_sof_cb(void) { 1f5a: b510 push {r4, lr} struct usbdc_sof_handler *sof = (struct usbdc_sof_handler *)usbdc.handlers.sof_list.head; 1f5c: 685c ldr r4, [r3, #4] while (sof != NULL) { 1f5e: 2c00 cmp r4, #0 1f60: d100 bne.n 1f64 usbdc_sof_notify(); } 1f62: bd10 pop {r4, pc} if (NULL != sof->cb) { 1f64: 6863 ldr r3, [r4, #4] 1f66: 2b00 cmp r3, #0 1f68: d000 beq.n 1f6c sof->cb(); 1f6a: 4798 blx r3 sof = sof->next; 1f6c: 6824 ldr r4, [r4, #0] 1f6e: e7f6 b.n 1f5e 1f70: 2000062c .word 0x2000062c 00001f74 : * \return Data has error or not. * \retval true There is data error, protocol error. * \retval false There is no data error. */ static bool usbdc_cb_ctl_done(const uint8_t ep, const enum usb_xfer_code code, struct usb_req *req) { 1f74: b510 push {r4, lr} 1f76: 0014 movs r4, r2 (void)ep; switch (code) { 1f78: 2900 cmp r1, #0 1f7a: d003 beq.n 1f84 1f7c: 2901 cmp r1, #1 1f7e: d023 beq.n 1fc8 return usbdc_ctrl_data_end(req); default: break; } return false; } 1f80: 2000 movs r0, #0 1f82: bd10 pop {r4, pc} if (req->bmRequestType != USB_REQT_TYPE_STANDARD) { 1f84: 7813 ldrb r3, [r2, #0] 1f86: 2b00 cmp r3, #0 1f88: d1fa bne.n 1f80 switch (req->bRequest) { 1f8a: 7853 ldrb r3, [r2, #1] 1f8c: 2b05 cmp r3, #5 1f8e: d00f beq.n 1fb0 1f90: 2b09 cmp r3, #9 1f92: d1f5 bne.n 1f80 usbdc.cfg_value = req->wValue; 1f94: 78e1 ldrb r1, [r4, #3] 1f96: 7892 ldrb r2, [r2, #2] 1f98: 4b0e ldr r3, [pc, #56] ; (1fd4 ) 1f9a: 0209 lsls r1, r1, #8 1f9c: 4311 orrs r1, r2 1f9e: 76d9 strb r1, [r3, #27] usbdc.state = req->wValue ? USBD_S_CONFIG : USBD_S_ADDRESS; 1fa0: 1e4a subs r2, r1, #1 1fa2: 4191 sbcs r1, r2 1fa4: 3103 adds r1, #3 usbdc.state = req->wValue ? USBD_S_ADDRESS : USBD_S_DEFAULT; 1fa6: 7699 strb r1, [r3, #26] usbdc_change_notify(USBDC_C_STATE, usbdc.state); 1fa8: 2001 movs r0, #1 1faa: 4b0b ldr r3, [pc, #44] ; (1fd8 ) 1fac: 4798 blx r3 break; 1fae: e7e7 b.n 1f80 usb_d_set_address(addr); 1fb0: 4b0a ldr r3, [pc, #40] ; (1fdc ) 1fb2: 7890 ldrb r0, [r2, #2] 1fb4: 4798 blx r3 usbdc.state = req->wValue ? USBD_S_ADDRESS : USBD_S_DEFAULT; 1fb6: 78e1 ldrb r1, [r4, #3] 1fb8: 78a2 ldrb r2, [r4, #2] 1fba: 0209 lsls r1, r1, #8 1fbc: 4311 orrs r1, r2 1fbe: 1e4b subs r3, r1, #1 1fc0: 4199 sbcs r1, r3 1fc2: 4b04 ldr r3, [pc, #16] ; (1fd4 ) 1fc4: 3102 adds r1, #2 1fc6: e7ee b.n 1fa6 usbdc_request_handler(0, req, USB_DATA_STAGE); 1fc8: 000a movs r2, r1 1fca: 4b05 ldr r3, [pc, #20] ; (1fe0 ) 1fcc: 0021 movs r1, r4 1fce: 2000 movs r0, #0 1fd0: 4798 blx r3 return usbdc_ctrl_data_end(req); 1fd2: e7d5 b.n 1f80 1fd4: 2000062c .word 0x2000062c 1fd8: 00001ef9 .word 0x00001ef9 1fdc: 00001955 .word 0x00001955 1fe0: 00001f1d .word 0x00001f1d 00001fe4 : /** * \brief USB Device Core Reset */ void usbdc_reset(void) { 1fe4: b570 push {r4, r5, r6, lr} usbdc_unconfig(); usbdc.state = USBD_S_DEFAULT; usbdc.cfg_value = 0; usbdc.ifc_alt_map = 0; 1fe6: 2400 movs r4, #0 usbdc.state = USBD_S_DEFAULT; 1fe8: 2602 movs r6, #2 usbdc_unconfig(); 1fea: 4b0c ldr r3, [pc, #48] ; (201c ) 1fec: 4798 blx r3 usbdc.state = USBD_S_DEFAULT; 1fee: 4d0c ldr r5, [pc, #48] ; (2020 ) // Setup EP0 usb_d_ep_deinit(0); 1ff0: 0020 movs r0, r4 usbdc.state = USBD_S_DEFAULT; 1ff2: 836e strh r6, [r5, #26] usb_d_ep_deinit(0); 1ff4: 4b0b ldr r3, [pc, #44] ; (2024 ) usbdc.ifc_alt_map = 0; 1ff6: 776c strb r4, [r5, #29] usb_d_ep_deinit(0); 1ff8: 4798 blx r3 usb_d_ep0_init(usbdc.ctrl_size); 1ffa: 4b0b ldr r3, [pc, #44] ; (2028 ) 1ffc: 7f28 ldrb r0, [r5, #28] 1ffe: 4798 blx r3 usb_d_ep_register_callback(0, USB_D_EP_CB_SETUP, (FUNC_PTR)usbdc_cb_ctl_req); 2000: 4d0a ldr r5, [pc, #40] ; (202c ) 2002: 0021 movs r1, r4 2004: 0020 movs r0, r4 2006: 4a0a ldr r2, [pc, #40] ; (2030 ) 2008: 47a8 blx r5 usb_d_ep_register_callback(0, USB_D_EP_CB_XFER, (FUNC_PTR)usbdc_cb_ctl_done); 200a: 0031 movs r1, r6 200c: 0020 movs r0, r4 200e: 4a09 ldr r2, [pc, #36] ; (2034 ) 2010: 47a8 blx r5 usb_d_ep_enable(0); 2012: 0020 movs r0, r4 2014: 4b08 ldr r3, [pc, #32] ; (2038 ) 2016: 4798 blx r3 } 2018: bd70 pop {r4, r5, r6, pc} 201a: 46c0 nop ; (mov r8, r8) 201c: 00001ed9 .word 0x00001ed9 2020: 2000062c .word 0x2000062c 2024: 000019c5 .word 0x000019c5 2028: 000019b1 .word 0x000019b1 202c: 00001b85 .word 0x00001b85 2030: 00002079 .word 0x00002079 2034: 00001f75 .word 0x00001f75 2038: 000019f1 .word 0x000019f1 0000203c : * \brief Callback invoked on USB device events * \param[in] ev Event code. * \param[in] param Event parameter for event handling. */ static void usbd_event_cb(const enum usb_event ev, const uint32_t param) { 203c: b510 push {r4, lr} (void)param; switch (ev) { 203e: 2800 cmp r0, #0 2040: d002 beq.n 2048 2042: 2801 cmp r0, #1 2044: d003 beq.n 204e break; default: break; } } 2046: bd10 pop {r4, pc} usbdc_change_notify(USBDC_C_CONN, param); 2048: 4b02 ldr r3, [pc, #8] ; (2054 ) 204a: 4798 blx r3 break; 204c: e7fb b.n 2046 usbdc_reset(); 204e: 4b02 ldr r3, [pc, #8] ; (2058 ) 2050: 4798 blx r3 } 2052: e7f8 b.n 2046 2054: 00001ef9 .word 0x00001ef9 2058: 00001fe5 .word 0x00001fe5 0000205c : /** * \brief Issue USB device transfer */ int32_t usbdc_xfer(uint8_t ep, uint8_t *buf, uint32_t size, bool zlp) { 205c: b51f push {r0, r1, r2, r3, r4, lr} struct usb_d_transfer xfer = {(uint8_t *)buf, size, ep, zlp}; 205e: 9202 str r2, [sp, #8] 2060: 466a mov r2, sp 2062: 7310 strb r0, [r2, #12] 2064: 7353 strb r3, [r2, #13] return usb_d_ep_transfer(&xfer); 2066: a801 add r0, sp, #4 2068: 4b02 ldr r3, [pc, #8] ; (2074 ) struct usb_d_transfer xfer = {(uint8_t *)buf, size, ep, zlp}; 206a: 9101 str r1, [sp, #4] return usb_d_ep_transfer(&xfer); 206c: 4798 blx r3 } 206e: b005 add sp, #20 2070: bd00 pop {pc} 2072: 46c0 nop ; (mov r8, r8) 2074: 00001a31 .word 0x00001a31 00002078 : { 2078: b5f7 push {r0, r1, r2, r4, r5, r6, r7, lr} switch (usbdc_request_handler(ep, req, USB_SETUP_STAGE)) { 207a: 4bb7 ldr r3, [pc, #732] ; (2358 ) 207c: 2200 movs r2, #0 { 207e: 0004 movs r4, r0 2080: 000d movs r5, r1 switch (usbdc_request_handler(ep, req, USB_SETUP_STAGE)) { 2082: 4798 blx r3 2084: 0003 movs r3, r0 return false; 2086: 2000 movs r0, #0 switch (usbdc_request_handler(ep, req, USB_SETUP_STAGE)) { 2088: 1c5a adds r2, r3, #1 208a: d100 bne.n 208e 208c: e0c1 b.n 2212 208e: 3001 adds r0, #1 2090: 4283 cmp r3, r0 2092: d100 bne.n 2096 2094: e0bd b.n 2212 switch (req->bmRequestType & (USB_REQT_TYPE_MASK | USB_REQT_DIR_IN)) { 2096: 782b ldrb r3, [r5, #0] 2098: 221f movs r2, #31 209a: 0019 movs r1, r3 209c: 4391 bics r1, r2 209e: d004 beq.n 20aa 20a0: 2980 cmp r1, #128 ; 0x80 20a2: d100 bne.n 20a6 20a4: e0b6 b.n 2214 switch (req->bRequest) { 20a6: 2000 movs r0, #0 20a8: e0b3 b.n 2212 switch (req->bRequest) { 20aa: 7868 ldrb r0, [r5, #1] 20ac: 3801 subs r0, #1 20ae: 280a cmp r0, #10 20b0: d8f9 bhi.n 20a6 20b2: f000 fa05 bl 24c0 <__gnu_thumb1_case_sqi> 20b6: f846 .short 0xf846 20b8: f80bf856 .word 0xf80bf856 20bc: f806f8f8 .word 0xf806f8f8 20c0: 60 .byte 0x60 20c1: 00 .byte 0x00 if (!usbdc_set_config(req->wValue)) { 20c2: 78aa ldrb r2, [r5, #2] if (cfg_value == 0) { 20c4: 2a00 cmp r2, #0 20c6: d10b bne.n 20e0 usbdc_unconfig(); 20c8: 4ba4 ldr r3, [pc, #656] ; (235c ) 20ca: 4798 blx r3 return (ERR_NONE == usbdc_xfer(ep, NULL, 0, true)); 20cc: 2200 movs r2, #0 20ce: 2301 movs r3, #1 20d0: 0011 movs r1, r2 if (ERR_NONE != usbdc_xfer(ep, str_desc, length, need_zlp)) { 20d2: 0020 movs r0, r4 20d4: 4ca2 ldr r4, [pc, #648] ; (2360 ) 20d6: 47a0 blx r4 20d8: 4243 negs r3, r0 20da: 4158 adcs r0, r3 20dc: b2c0 uxtb r0, r0 20de: e098 b.n 2212 cfg_desc = usb_find_cfg_desc(usbdc.desces.ls_fs->sod, usbdc.desces.ls_fs->eod, cfg_value); 20e0: 4da0 ldr r5, [pc, #640] ; (2364 ) 20e2: 682b ldr r3, [r5, #0] 20e4: cb03 ldmia r3!, {r0, r1} 20e6: 4ba0 ldr r3, [pc, #640] ; (2368 ) 20e8: 4798 blx r3 if (NULL == cfg_desc) { 20ea: 2800 cmp r0, #0 20ec: d100 bne.n 20f0 20ee: e090 b.n 2212 return (ptr[0] + (ptr[1] << 8)); 20f0: 78c3 ldrb r3, [r0, #3] 20f2: 7881 ldrb r1, [r0, #2] 20f4: 021b lsls r3, r3, #8 20f6: 18c9 adds r1, r1, r3 desc.eod = cfg_desc + total_len; 20f8: b289 uxth r1, r1 20fa: 1841 adds r1, r0, r1 desc.sod = usb_find_desc(cfg_desc, desc.eod, USB_DT_INTERFACE); 20fc: 2204 movs r2, #4 20fe: 4b9b ldr r3, [pc, #620] ; (236c ) desc.eod = cfg_desc + total_len; 2100: 9101 str r1, [sp, #4] desc.sod = usb_find_desc(cfg_desc, desc.eod, USB_DT_INTERFACE); 2102: 4798 blx r3 uint8_t last_iface = 0xFF; 2104: 22ff movs r2, #255 ; 0xff desc.sod = usb_find_desc(cfg_desc, desc.eod, USB_DT_INTERFACE); 2106: 9000 str r0, [sp, #0] while (NULL != desc.sod) { 2108: 9b00 ldr r3, [sp, #0] 210a: 2b00 cmp r3, #0 210c: d0de beq.n 20cc if (last_iface != desc.sod[2] /* bInterfaceNumber */) { 210e: 789e ldrb r6, [r3, #2] 2110: 4296 cmp r6, r2 2112: d002 beq.n 211a func = (struct usbdf_driver *)usbdc.func_list.head; 2114: 692f ldr r7, [r5, #16] while (NULL != func) { 2116: 2f00 cmp r7, #0 2118: d10a bne.n 2130 desc.sod = usb_desc_next(desc.sod); 211a: 9800 ldr r0, [sp, #0] desc.sod = usb_find_desc(desc.sod, desc.eod, USB_DT_INTERFACE); 211c: 2204 movs r2, #4 return (desc + usb_desc_len(desc)); 211e: 7803 ldrb r3, [r0, #0] 2120: 9901 ldr r1, [sp, #4] 2122: 18c0 adds r0, r0, r3 desc.sod = usb_desc_next(desc.sod); 2124: 9000 str r0, [sp, #0] desc.sod = usb_find_desc(desc.sod, desc.eod, USB_DT_INTERFACE); 2126: 4b91 ldr r3, [pc, #580] ; (236c ) 2128: 4798 blx r3 212a: 0032 movs r2, r6 212c: 9000 str r0, [sp, #0] 212e: e7eb b.n 2108 if (func->ctrl(func, USBDF_ENABLE, &desc)) { 2130: 466a mov r2, sp 2132: 2100 movs r1, #0 2134: 0038 movs r0, r7 2136: 687b ldr r3, [r7, #4] 2138: 4798 blx r3 213a: 2800 cmp r0, #0 213c: d0ed beq.n 211a func = func->next; 213e: 683f ldr r7, [r7, #0] 2140: e7e9 b.n 2116 switch (req->bmRequestType & USB_REQT_RECIP_MASK) { 2142: 2b02 cmp r3, #2 2144: d1af bne.n 20a6 if (req->wLength != 0) { 2146: 79ee ldrb r6, [r5, #7] 2148: 79ab ldrb r3, [r5, #6] 214a: 0236 lsls r6, r6, #8 214c: 431e orrs r6, r3 214e: d1aa bne.n 20a6 usb_d_ep_halt(req->wIndex & 0xFF, USB_EP_HALT_CLR); 2150: 0031 movs r1, r6 2152: 7928 ldrb r0, [r5, #4] usb_d_ep_halt(req->wIndex & 0xFF, USB_EP_HALT_SET); 2154: 4b86 ldr r3, [pc, #536] ; (2370 ) 2156: 4798 blx r3 usbdc_xfer(ep, NULL, 0, true); 2158: 2301 movs r3, #1 215a: 0032 movs r2, r6 215c: 0031 movs r1, r6 usbdc_xfer(ep, usbdc.ctrl_buf, 1, false); 215e: 0020 movs r0, r4 2160: e054 b.n 220c switch (req->bmRequestType & USB_REQT_RECIP_MASK) { 2162: 2b02 cmp r3, #2 2164: d19f bne.n 20a6 if (req->wLength != 0) { 2166: 79eb ldrb r3, [r5, #7] 2168: 79ae ldrb r6, [r5, #6] 216a: 021b lsls r3, r3, #8 216c: 431e orrs r6, r3 216e: d19a bne.n 20a6 usb_d_ep_halt(req->wIndex & 0xFF, USB_EP_HALT_SET); 2170: 2101 movs r1, #1 2172: 7928 ldrb r0, [r5, #4] 2174: e7ee b.n 2154 return usbdc_set_interface(req->wValue, req->wIndex); 2176: 78ec ldrb r4, [r5, #3] 2178: 78ab ldrb r3, [r5, #2] 217a: 0224 lsls r4, r4, #8 217c: 431c orrs r4, r3 217e: 792b ldrb r3, [r5, #4] 2180: 796d ldrb r5, [r5, #5] ifc = usb_find_cfg_desc(usbdc.desces.ls_fs->sod, usbdc.desces.ls_fs->eod, usbdc.cfg_value); 2182: 4e78 ldr r6, [pc, #480] ; (2364 ) return usbdc_set_interface(req->wValue, req->wIndex); 2184: 022d lsls r5, r5, #8 2186: 431d orrs r5, r3 ifc = usb_find_cfg_desc(usbdc.desces.ls_fs->sod, usbdc.desces.ls_fs->eod, usbdc.cfg_value); 2188: 6833 ldr r3, [r6, #0] 218a: 7ef2 ldrb r2, [r6, #27] 218c: cb03 ldmia r3!, {r0, r1} 218e: 4b76 ldr r3, [pc, #472] ; (2368 ) 2190: 4798 blx r3 if (NULL == ifc) { 2192: 2800 cmp r0, #0 2194: d087 beq.n 20a6 if (NULL == (ifc = usb_find_desc(desc.sod, desc.eod, USB_DT_INTERFACE))) { 2196: 2204 movs r2, #4 desc.sod = ifc; 2198: 9000 str r0, [sp, #0] return (ptr[0] + (ptr[1] << 8)); 219a: 78c3 ldrb r3, [r0, #3] 219c: 7881 ldrb r1, [r0, #2] 219e: 021b lsls r3, r3, #8 21a0: 18c9 adds r1, r1, r3 desc.eod = ifc + usb_cfg_desc_total_len(ifc); 21a2: b289 uxth r1, r1 21a4: 1841 adds r1, r0, r1 if (NULL == (ifc = usb_find_desc(desc.sod, desc.eod, USB_DT_INTERFACE))) { 21a6: 4f71 ldr r7, [pc, #452] ; (236c ) desc.eod = ifc + usb_cfg_desc_total_len(ifc); 21a8: 9101 str r1, [sp, #4] ifc = usb_find_desc(desc.sod, desc.eod, USB_DT_INTERFACE); 21aa: 47b8 blx r7 if (NULL == ifc) { 21ac: 2800 cmp r0, #0 21ae: d100 bne.n 21b2 21b0: e779 b.n 20a6 while (ifc[2] != ifc_id || ifc[3] != alt_set) { 21b2: 7883 ldrb r3, [r0, #2] 21b4: 42ab cmp r3, r5 21b6: d110 bne.n 21da 21b8: 78c3 ldrb r3, [r0, #3] 21ba: 42a3 cmp r3, r4 21bc: d10d bne.n 21da func = (struct usbdf_driver *)usbdc.func_list.head; 21be: 6937 ldr r7, [r6, #16] desc.sod = ifc; 21c0: 9000 str r0, [sp, #0] while (NULL != func) { 21c2: 2f00 cmp r7, #0 21c4: d100 bne.n 21c8 21c6: e76e b.n 20a6 if (func->ctrl(func, USBDF_DISABLE, &desc)) { 21c8: 2101 movs r1, #1 21ca: 466a mov r2, sp 21cc: 0038 movs r0, r7 21ce: 687b ldr r3, [r7, #4] 21d0: 4798 blx r3 21d2: 1e01 subs r1, r0, #0 21d4: d008 beq.n 21e8 func = func->next; 21d6: 683f ldr r7, [r7, #0] 21d8: e7f3 b.n 21c2 desc.sod = usb_desc_next(desc.sod); 21da: 9800 ldr r0, [sp, #0] ifc = usb_find_desc(desc.sod, desc.eod, USB_DT_INTERFACE); 21dc: 2204 movs r2, #4 return (desc + usb_desc_len(desc)); 21de: 7803 ldrb r3, [r0, #0] 21e0: 9901 ldr r1, [sp, #4] 21e2: 18c0 adds r0, r0, r3 desc.sod = usb_desc_next(desc.sod); 21e4: 9000 str r0, [sp, #0] ifc = usb_find_desc(desc.sod, desc.eod, USB_DT_INTERFACE); 21e6: e7e0 b.n 21aa } else if (ERR_NONE == func->ctrl(func, USBDF_ENABLE, &desc)) { 21e8: 466a mov r2, sp 21ea: 0038 movs r0, r7 21ec: 687b ldr r3, [r7, #4] 21ee: 4798 blx r3 21f0: 2800 cmp r0, #0 21f2: d000 beq.n 21f6 21f4: e757 b.n 20a6 if (alt_set) { 21f6: 2c00 cmp r4, #0 21f8: d004 beq.n 2204 usbdc.ifc_alt_map |= 1 << ifc_id; 21fa: 2201 movs r2, #1 21fc: 40aa lsls r2, r5 21fe: 7f73 ldrb r3, [r6, #29] 2200: 4313 orrs r3, r2 2202: 7773 strb r3, [r6, #29] usbdc_xfer(0, NULL, 0, 0); 2204: 2300 movs r3, #0 2206: 001a movs r2, r3 2208: 0019 movs r1, r3 220a: 0018 movs r0, r3 220c: 4c54 ldr r4, [pc, #336] ; (2360 ) 220e: 47a0 blx r4 return true; 2210: 2001 movs r0, #1 } 2212: bdfe pop {r1, r2, r3, r4, r5, r6, r7, pc} switch (req->bRequest) { 2214: 7868 ldrb r0, [r5, #1] 2216: 280a cmp r0, #10 2218: d900 bls.n 221c 221a: e744 b.n 20a6 221c: f000 f964 bl 24e8 <__gnu_thumb1_case_shi> 2220: ff430062 .word 0xff430062 2224: ff43ff43 .word 0xff43ff43 2228: ff43ff43 .word 0xff43ff43 222c: ff43000b .word 0xff43000b 2230: ff43005a .word 0xff43005a 2234: 0083 .short 0x0083 uint8_t type = (uint8_t)(req->wValue >> 8); 2236: 78e9 ldrb r1, [r5, #3] 2238: 78ab ldrb r3, [r5, #2] 223a: 0209 lsls r1, r1, #8 223c: 430b orrs r3, r1 223e: 0a09 lsrs r1, r1, #8 2240: b2ca uxtb r2, r1 switch (type) { 2242: 2902 cmp r1, #2 2244: d017 beq.n 2276 2246: 2a03 cmp r2, #3 2248: d034 beq.n 22b4 224a: 2000 movs r0, #0 224c: 2a01 cmp r2, #1 224e: d1e0 bne.n 2212 uint16_t length = req->wLength; 2250: 79ab ldrb r3, [r5, #6] 2252: 79ed ldrb r5, [r5, #7] 2254: 022d lsls r5, r5, #8 2256: 431d orrs r5, r3 dev_desc = usb_find_desc(usbdc.desces.ls_fs->sod, usbdc.desces.ls_fs->eod, USB_DT_DEVICE); 2258: 4b42 ldr r3, [pc, #264] ; (2364 ) 225a: 681b ldr r3, [r3, #0] 225c: cb03 ldmia r3!, {r0, r1} 225e: 4b43 ldr r3, [pc, #268] ; (236c ) 2260: 4798 blx r3 2262: 1e01 subs r1, r0, #0 if (!dev_desc) { 2264: d100 bne.n 2268 2266: e71e b.n 20a6 if (ERR_NONE != usbdc_xfer(ep, dev_desc, length, false)) { 2268: 1c2a adds r2, r5, #0 226a: 2d12 cmp r5, #18 226c: d900 bls.n 2270 226e: 2212 movs r2, #18 2270: 2300 movs r3, #0 2272: b292 uxth r2, r2 2274: e72d b.n 20d2 uint16_t length = req->wLength; 2276: 79aa ldrb r2, [r5, #6] 2278: 79ed ldrb r5, [r5, #7] cfg_desc = usb_find_cfg_desc(usbdc.desces.ls_fs->sod, usbdc.desces.ls_fs->eod, index + 1); 227a: 3301 adds r3, #1 uint16_t length = req->wLength; 227c: 022d lsls r5, r5, #8 227e: 4315 orrs r5, r2 bool need_zlp = !(length & (usbdc.ctrl_size - 1)); 2280: 4a38 ldr r2, [pc, #224] ; (2364 ) cfg_desc = usb_find_cfg_desc(usbdc.desces.ls_fs->sod, usbdc.desces.ls_fs->eod, index + 1); 2282: 6810 ldr r0, [r2, #0] bool need_zlp = !(length & (usbdc.ctrl_size - 1)); 2284: 7f16 ldrb r6, [r2, #28] cfg_desc = usb_find_cfg_desc(usbdc.desces.ls_fs->sod, usbdc.desces.ls_fs->eod, index + 1); 2286: c803 ldmia r0, {r0, r1} 2288: b2da uxtb r2, r3 228a: 4b37 ldr r3, [pc, #220] ; (2368 ) 228c: 4798 blx r3 228e: 1e01 subs r1, r0, #0 if (NULL == cfg_desc) { 2290: d100 bne.n 2294 2292: e708 b.n 20a6 return (ptr[0] + (ptr[1] << 8)); 2294: 78c3 ldrb r3, [r0, #3] 2296: 7882 ldrb r2, [r0, #2] 2298: 021b lsls r3, r3, #8 229a: 18d2 adds r2, r2, r3 229c: b292 uxth r2, r2 need_zlp = false; 229e: 2300 movs r3, #0 if (length <= str_desc[0]) { 22a0: 4295 cmp r5, r2 22a2: d905 bls.n 22b0 bool need_zlp = !(length & (usbdc.ctrl_size - 1)); 22a4: 3e01 subs r6, #1 22a6: 4035 ands r5, r6 22a8: 426b negs r3, r5 22aa: 415d adcs r5, r3 22ac: b2eb uxtb r3, r5 22ae: 0015 movs r5, r2 if (ERR_NONE != usbdc_xfer(ep, str_desc, length, need_zlp)) { 22b0: 002a movs r2, r5 22b2: e70e b.n 20d2 uint16_t length = req->wLength; 22b4: 79aa ldrb r2, [r5, #6] 22b6: 79ed ldrb r5, [r5, #7] 22b8: 022d lsls r5, r5, #8 22ba: 4315 orrs r5, r2 bool need_zlp = !(length & (usbdc.ctrl_size - 1)); 22bc: 4a29 ldr r2, [pc, #164] ; (2364 ) str_desc = usb_find_str_desc(usbdc.desces.ls_fs->sod, usbdc.desces.ls_fs->eod, index); 22be: 6810 ldr r0, [r2, #0] bool need_zlp = !(length & (usbdc.ctrl_size - 1)); 22c0: 7f16 ldrb r6, [r2, #28] str_desc = usb_find_str_desc(usbdc.desces.ls_fs->sod, usbdc.desces.ls_fs->eod, index); 22c2: c803 ldmia r0, {r0, r1} 22c4: b2da uxtb r2, r3 22c6: 4b2b ldr r3, [pc, #172] ; (2374 ) 22c8: 4798 blx r3 22ca: 1e01 subs r1, r0, #0 if (NULL == str_desc) { 22cc: d100 bne.n 22d0 22ce: e6ea b.n 20a6 if (length <= str_desc[0]) { 22d0: 7802 ldrb r2, [r0, #0] 22d2: e7e4 b.n 229e *(uint8_t *)usbdc.ctrl_buf = usbdc.cfg_value; 22d4: 4923 ldr r1, [pc, #140] ; (2364 ) 22d6: 7ecb ldrb r3, [r1, #27] 22d8: 694a ldr r2, [r1, #20] 22da: 7013 strb r3, [r2, #0] usbdc_xfer(ep, usbdc.ctrl_buf, 1, false); 22dc: 6949 ldr r1, [r1, #20] 22de: 2300 movs r3, #0 22e0: 2201 movs r2, #1 22e2: e73c b.n 215e switch (req->bmRequestType & USB_REQT_RECIP_MASK) { 22e4: 211f movs r1, #31 22e6: 221e movs r2, #30 22e8: 0018 movs r0, r3 22ea: 4019 ands r1, r3 22ec: 4010 ands r0, r2 22ee: 4213 tst r3, r2 22f0: d00e beq.n 2310 22f2: 2902 cmp r1, #2 22f4: d000 beq.n 22f8 22f6: e6d6 b.n 20a6 st = usb_d_ep_halt(req->wIndex & 0xFF, USB_EP_HALT_GET); 22f8: 4b1d ldr r3, [pc, #116] ; (2370 ) 22fa: 7928 ldrb r0, [r5, #4] 22fc: 4798 blx r3 22fe: 0003 movs r3, r0 return false; 2300: 2000 movs r0, #0 if (st < 0) { 2302: 4283 cmp r3, r0 2304: da00 bge.n 2308 2306: e784 b.n 2212 st = st & 0x1; 2308: 3001 adds r0, #1 230a: 4003 ands r3, r0 230c: 9300 str r3, [sp, #0] break; 230e: e000 b.n 2312 st = 0; 2310: 9000 str r0, [sp, #0] memcpy(usbdc.ctrl_buf, &st, 2); 2312: 4d14 ldr r5, [pc, #80] ; (2364 ) 2314: 2202 movs r2, #2 2316: 4669 mov r1, sp 2318: 4b17 ldr r3, [pc, #92] ; (2378 ) 231a: 6968 ldr r0, [r5, #20] 231c: 4798 blx r3 usbdc_xfer(ep, usbdc.ctrl_buf, 2, false); 231e: 2300 movs r3, #0 2320: 2202 movs r2, #2 2322: 6969 ldr r1, [r5, #20] 2324: e71b b.n 215e if (!(usbdc.ifc_alt_map & (1 << req->wIndex))) { 2326: 4e0f ldr r6, [pc, #60] ; (2364 ) 2328: 796b ldrb r3, [r5, #5] 232a: 7929 ldrb r1, [r5, #4] 232c: 7f72 ldrb r2, [r6, #29] 232e: 021b lsls r3, r3, #8 2330: 430b orrs r3, r1 2332: 411a asrs r2, r3 2334: 2401 movs r4, #1 2336: 0010 movs r0, r2 2338: 4020 ands r0, r4 233a: 4222 tst r2, r4 233c: d01e beq.n 237c struct usbdf_driver *func = (struct usbdf_driver *)usbdc.func_list.head; 233e: 6934 ldr r4, [r6, #16] while (NULL != func) { 2340: 2c00 cmp r4, #0 2342: d100 bne.n 2346 2344: e6af b.n 20a6 if (0 > (rc = func->ctrl(func, USBDF_GET_IFACE, req))) { 2346: 002a movs r2, r5 2348: 2102 movs r1, #2 234a: 0020 movs r0, r4 234c: 6863 ldr r3, [r4, #4] 234e: 4798 blx r3 2350: 2800 cmp r0, #0 2352: da1b bge.n 238c func = func->next; 2354: 6824 ldr r4, [r4, #0] 2356: e7f3 b.n 2340 2358: 00001f1d .word 0x00001f1d 235c: 00001ed9 .word 0x00001ed9 2360: 0000205d .word 0x0000205d 2364: 2000062c .word 0x2000062c 2368: 00001689 .word 0x00001689 236c: 00001651 .word 0x00001651 2370: 00001b21 .word 0x00001b21 2374: 000016c5 .word 0x000016c5 2378: 00002545 .word 0x00002545 usbdc.ctrl_buf[0] = 0; 237c: 6973 ldr r3, [r6, #20] usbdc_xfer(0, usbdc.ctrl_buf, 1, false); 237e: 0022 movs r2, r4 usbdc.ctrl_buf[0] = 0; 2380: 7018 strb r0, [r3, #0] usbdc_xfer(0, usbdc.ctrl_buf, 1, false); 2382: 6971 ldr r1, [r6, #20] 2384: 0003 movs r3, r0 2386: 4d05 ldr r5, [pc, #20] ; (239c ) 2388: 47a8 blx r5 return true; 238a: e741 b.n 2210 usbdc.ctrl_buf[0] = (uint8_t)rc; 238c: 6973 ldr r3, [r6, #20] usbdc_xfer(0, usbdc.ctrl_buf, 1, false); 238e: 2201 movs r2, #1 usbdc.ctrl_buf[0] = (uint8_t)rc; 2390: 7018 strb r0, [r3, #0] usbdc_xfer(0, usbdc.ctrl_buf, 1, false); 2392: 2300 movs r3, #0 2394: 6971 ldr r1, [r6, #20] 2396: 0018 movs r0, r3 2398: e738 b.n 220c 239a: 46c0 nop ; (mov r8, r8) 239c: 0000205d .word 0x0000205d 000023a0 : /** * \brief Register the handler */ void usbdc_register_handler(enum usbdc_handler_type type, const struct usbdc_handler *h) { 23a0: b510 push {r4, lr} switch (type) { 23a2: 2801 cmp r0, #1 23a4: d008 beq.n 23b8 23a6: 2802 cmp r0, #2 23a8: d009 beq.n 23be 23aa: 2800 cmp r0, #0 23ac: d103 bne.n 23b6 case USBDC_HDL_SOF: list_insert_at_end(&usbdc.handlers.sof_list, (void *)h); 23ae: 4805 ldr r0, [pc, #20] ; (23c4 ) 23b0: 3004 adds r0, #4 break; case USBDC_HDL_REQ: list_insert_at_end(&usbdc.handlers.req_list, (void *)h); break; case USBDC_HDL_CHANGE: list_insert_at_end(&usbdc.handlers.change_list, (void *)h); 23b2: 4b05 ldr r3, [pc, #20] ; (23c8 ) 23b4: 4798 blx r3 break; default: break; } } 23b6: bd10 pop {r4, pc} list_insert_at_end(&usbdc.handlers.req_list, (void *)h); 23b8: 4802 ldr r0, [pc, #8] ; (23c4 ) 23ba: 3008 adds r0, #8 23bc: e7f9 b.n 23b2 list_insert_at_end(&usbdc.handlers.change_list, (void *)h); 23be: 4801 ldr r0, [pc, #4] ; (23c4 ) 23c0: 300c adds r0, #12 23c2: e7f6 b.n 23b2 23c4: 2000062c .word 0x2000062c 23c8: 00001379 .word 0x00001379 000023cc : /** * \brief Initialize the USB device core driver */ int32_t usbdc_init(uint8_t *ctrl_buf) { 23cc: b570 push {r4, r5, r6, lr} 23ce: 0004 movs r4, r0 ASSERT(ctrl_buf); 23d0: 1e43 subs r3, r0, #1 23d2: 4198 sbcs r0, r3 23d4: 4a0c ldr r2, [pc, #48] ; (2408 ) 23d6: 4b0d ldr r3, [pc, #52] ; (240c ) 23d8: 490d ldr r1, [pc, #52] ; (2410 ) 23da: b2c0 uxtb r0, r0 23dc: 4798 blx r3 int32_t rc; rc = usb_d_init(); 23de: 4b0d ldr r3, [pc, #52] ; (2414 ) 23e0: 4798 blx r3 if (rc < 0) { 23e2: 2800 cmp r0, #0 23e4: db0e blt.n 2404 return rc; } memset(&usbdc, 0, sizeof(usbdc)); 23e6: 4d0c ldr r5, [pc, #48] ; (2418 ) 23e8: 2220 movs r2, #32 23ea: 4b0c ldr r3, [pc, #48] ; (241c ) 23ec: 2100 movs r1, #0 23ee: 0028 movs r0, r5 23f0: 4798 blx r3 usbdc.ctrl_buf = ctrl_buf; usb_d_register_callback(USB_D_CB_SOF, (FUNC_PTR)usbd_sof_cb); 23f2: 2000 movs r0, #0 23f4: 490a ldr r1, [pc, #40] ; (2420 ) usbdc.ctrl_buf = ctrl_buf; 23f6: 616c str r4, [r5, #20] usb_d_register_callback(USB_D_CB_SOF, (FUNC_PTR)usbd_sof_cb); 23f8: 4c0a ldr r4, [pc, #40] ; (2424 ) 23fa: 47a0 blx r4 usb_d_register_callback(USB_D_CB_EVENT, (FUNC_PTR)usbd_event_cb); 23fc: 2001 movs r0, #1 23fe: 490a ldr r1, [pc, #40] ; (2428 ) 2400: 47a0 blx r4 return 0; 2402: 2000 movs r0, #0 } 2404: bd70 pop {r4, r5, r6, pc} 2406: 46c0 nop ; (mov r8, r8) 2408: 00000355 .word 0x00000355 240c: 000013c1 .word 0x000013c1 2410: 000025fc .word 0x000025fc 2414: 000018c5 .word 0x000018c5 2418: 2000062c .word 0x2000062c 241c: 00002557 .word 0x00002557 2420: 00001f59 .word 0x00001f59 2424: 00001931 .word 0x00001931 2428: 0000203d .word 0x0000203d 0000242c : * \brief Register/unregister function support of a USB device function * * Must be invoked when USB device is stopped. */ void usbdc_register_function(struct usbdf_driver *func) { 242c: b510 push {r4, lr} 242e: 0001 movs r1, r0 list_insert_at_end(&usbdc.func_list, func); 2430: 4802 ldr r0, [pc, #8] ; (243c ) 2432: 4b03 ldr r3, [pc, #12] ; (2440 ) 2434: 3010 adds r0, #16 2436: 4798 blx r3 } 2438: bd10 pop {r4, pc} 243a: 46c0 nop ; (mov r8, r8) 243c: 2000062c .word 0x2000062c 2440: 00001379 .word 0x00001379 00002444 : /** * \brief Start the USB device driver with specific descriptors set */ int32_t usbdc_start(struct usbd_descriptors *desces) { 2444: b510 push {r4, lr} if (usbdc.state >= USBD_S_POWER) { 2446: 4b0a ldr r3, [pc, #40] ; (2470 ) 2448: 7e9c ldrb r4, [r3, #26] 244a: 2c00 cmp r4, #0 244c: d10b bne.n 2466 return ERR_BUSY; } if (desces) { 244e: 2800 cmp r0, #0 2450: d00c beq.n 246c #endif } else { return ERR_BAD_DATA; } usbdc.ctrl_size = desces->sod[7]; 2452: 6802 ldr r2, [r0, #0] usbdc.desces.ls_fs = desces; 2454: 6018 str r0, [r3, #0] usbdc.ctrl_size = desces->sod[7]; 2456: 79d2 ldrb r2, [r2, #7] 2458: 771a strb r2, [r3, #28] usbdc.state = USBD_S_POWER; 245a: 2201 movs r2, #1 245c: 769a strb r2, [r3, #26] usb_d_enable(); 245e: 4b05 ldr r3, [pc, #20] ; (2474 ) 2460: 4798 blx r3 return ERR_NONE; 2462: 0020 movs r0, r4 } 2464: bd10 pop {r4, pc} return ERR_BUSY; 2466: 2004 movs r0, #4 return ERR_BAD_DATA; 2468: 4240 negs r0, r0 246a: e7fb b.n 2464 246c: 2009 movs r0, #9 246e: e7fb b.n 2468 2470: 2000062c .word 0x2000062c 2474: 0000193d .word 0x0000193d 00002478 : /** * \brief Attach the USB device to host */ void usbdc_attach(void) { 2478: b510 push {r4, lr} usb_d_attach(); 247a: 4b01 ldr r3, [pc, #4] ; (2480 ) 247c: 4798 blx r3 } 247e: bd10 pop {r4, pc} 2480: 00001949 .word 0x00001949 00002484 : /** * \brief Return USB Device endpoint0 buffer */ uint8_t *usbdc_get_ctrl_buffer(void) { return usbdc.ctrl_buf; 2484: 4b01 ldr r3, [pc, #4] ; (248c ) 2486: 6958 ldr r0, [r3, #20] } 2488: 4770 bx lr 248a: 46c0 nop ; (mov r8, r8) 248c: 2000062c .word 0x2000062c 00002490 : /** * \brief Return current USB state */ uint8_t usbdc_get_state(void) { if (usbdc.state & USBD_S_SUSPEND) { 2490: 4b03 ldr r3, [pc, #12] ; (24a0 ) 2492: 7e98 ldrb r0, [r3, #26] 2494: 2310 movs r3, #16 2496: 4218 tst r0, r3 2498: d000 beq.n 249c return USBD_S_SUSPEND; 249a: 0018 movs r0, r3 } return usbdc.state; } 249c: 4770 bx lr 249e: 46c0 nop ; (mov r8, r8) 24a0: 2000062c .word 0x2000062c 000024a4 : */ __STATIC_FORCEINLINE uint32_t __get_PRIMASK(void) { uint32_t result; __ASM volatile ("MRS %0, primask" : "=r" (result) :: "memory"); 24a4: f3ef 8310 mrs r3, PRIMASK /** * \brief Disable interrupts, enter critical section */ void atomic_enter_critical(hal_atomic_t volatile *atomic) { *atomic = __get_PRIMASK(); 24a8: 6003 str r3, [r0, #0] __ASM volatile ("cpsid i" : : : "memory"); 24aa: b672 cpsid i \details Ensures the apparent order of the explicit memory operations before and after the instruction, without ensuring their completion. */ __STATIC_FORCEINLINE void __DMB(void) { __ASM volatile ("dmb 0xF":::"memory"); 24ac: f3bf 8f5f dmb sy __disable_irq(); __DMB(); } 24b0: 4770 bx lr 000024b2 : 24b2: f3bf 8f5f dmb sy * \brief Exit atomic section */ void atomic_leave_critical(hal_atomic_t volatile *atomic) { __DMB(); __set_PRIMASK(*atomic); 24b6: 6803 ldr r3, [r0, #0] __ASM volatile ("MSR primask, %0" : : "r" (priMask) : "memory"); 24b8: f383 8810 msr PRIMASK, r3 } 24bc: 4770 bx lr ... 000024c0 <__gnu_thumb1_case_sqi>: 24c0: b402 push {r1} 24c2: 4671 mov r1, lr 24c4: 0849 lsrs r1, r1, #1 24c6: 0049 lsls r1, r1, #1 24c8: 5609 ldrsb r1, [r1, r0] 24ca: 0049 lsls r1, r1, #1 24cc: 448e add lr, r1 24ce: bc02 pop {r1} 24d0: 4770 bx lr 24d2: 46c0 nop ; (mov r8, r8) 000024d4 <__gnu_thumb1_case_uqi>: 24d4: b402 push {r1} 24d6: 4671 mov r1, lr 24d8: 0849 lsrs r1, r1, #1 24da: 0049 lsls r1, r1, #1 24dc: 5c09 ldrb r1, [r1, r0] 24de: 0049 lsls r1, r1, #1 24e0: 448e add lr, r1 24e2: bc02 pop {r1} 24e4: 4770 bx lr 24e6: 46c0 nop ; (mov r8, r8) 000024e8 <__gnu_thumb1_case_shi>: 24e8: b403 push {r0, r1} 24ea: 4671 mov r1, lr 24ec: 0849 lsrs r1, r1, #1 24ee: 0040 lsls r0, r0, #1 24f0: 0049 lsls r1, r1, #1 24f2: 5e09 ldrsh r1, [r1, r0] 24f4: 0049 lsls r1, r1, #1 24f6: 448e add lr, r1 24f8: bc03 pop {r0, r1} 24fa: 4770 bx lr 000024fc <__libc_init_array>: 24fc: b570 push {r4, r5, r6, lr} 24fe: 2600 movs r6, #0 2500: 4d0c ldr r5, [pc, #48] ; (2534 <__libc_init_array+0x38>) 2502: 4c0d ldr r4, [pc, #52] ; (2538 <__libc_init_array+0x3c>) 2504: 1b64 subs r4, r4, r5 2506: 10a4 asrs r4, r4, #2 2508: 42a6 cmp r6, r4 250a: d109 bne.n 2520 <__libc_init_array+0x24> 250c: 2600 movs r6, #0 250e: f000 f881 bl 2614 <_init> 2512: 4d0a ldr r5, [pc, #40] ; (253c <__libc_init_array+0x40>) 2514: 4c0a ldr r4, [pc, #40] ; (2540 <__libc_init_array+0x44>) 2516: 1b64 subs r4, r4, r5 2518: 10a4 asrs r4, r4, #2 251a: 42a6 cmp r6, r4 251c: d105 bne.n 252a <__libc_init_array+0x2e> 251e: bd70 pop {r4, r5, r6, pc} 2520: 00b3 lsls r3, r6, #2 2522: 58eb ldr r3, [r5, r3] 2524: 4798 blx r3 2526: 3601 adds r6, #1 2528: e7ee b.n 2508 <__libc_init_array+0xc> 252a: 00b3 lsls r3, r6, #2 252c: 58eb ldr r3, [r5, r3] 252e: 4798 blx r3 2530: 3601 adds r6, #1 2532: e7f2 b.n 251a <__libc_init_array+0x1e> 2534: 00002620 .word 0x00002620 2538: 00002620 .word 0x00002620 253c: 00002620 .word 0x00002620 2540: 00002624 .word 0x00002624 00002544 : 2544: 2300 movs r3, #0 2546: b510 push {r4, lr} 2548: 429a cmp r2, r3 254a: d100 bne.n 254e 254c: bd10 pop {r4, pc} 254e: 5ccc ldrb r4, [r1, r3] 2550: 54c4 strb r4, [r0, r3] 2552: 3301 adds r3, #1 2554: e7f8 b.n 2548 00002556 : 2556: 0003 movs r3, r0 2558: 1882 adds r2, r0, r2 255a: 4293 cmp r3, r2 255c: d100 bne.n 2560 255e: 4770 bx lr 2560: 7019 strb r1, [r3, #0] 2562: 3301 adds r3, #1 2564: e7f9 b.n 255a ... 00002568 <_usb_ep_cfgs>: 2568: 03b8 2000 0000 0000 0040 0000 0378 2000 ... ....@...x.. 2578: 0000 0000 0040 0000 0338 2000 0000 0000 ....@...8.. .... 2588: 0040 0000 2e2e 682f 6c61 752f 6974 736c @...../hal/utils 2598: 732f 6372 752f 6974 736c 6c5f 7369 2e74 /src/utils_list. 25a8: 0063 2e2e 682f 6c61 732f 6372 682f 6c61 c.../hal/src/hal 25b8: 755f 6173 7472 735f 6e79 2e63 0063 _usart_sync.c. 000025c6 : 25c6: 01ed 0101 0201 ....... 000025cd : 25cd: 00ed 0101 0201 48f0 6c65 6f6c 5720 726f .......Hello Wor 25dd: 646c 000a 2e2e 682f 6c70 732f 7265 6f63 ld..../hpl/serco 25ed: 2f6d 7068 5f6c 6573 6372 6d6f 632e 2e00 m/hpl_sercom.c.. 25fd: 2f2e 7375 2f62 6564 6976 6563 752f 6273 ./usb/device/usb 260d: 6364 632e 0000 dc.c... 00002614 <_init>: 2614: b5f8 push {r3, r4, r5, r6, r7, lr} 2616: 46c0 nop ; (mov r8, r8) 2618: bcf8 pop {r3, r4, r5, r6, r7} 261a: bc08 pop {r3} 261c: 469e mov lr, r3 261e: 4770 bx lr 00002620 <__frame_dummy_init_array_entry>: 2620: 00dd 0000 .... 00002624 <_fini>: 2624: b5f8 push {r3, r4, r5, r6, r7, lr} 2626: 46c0 nop ; (mov r8, r8) 2628: bcf8 pop {r3, r4, r5, r6, r7} 262a: bc08 pop {r3} 262c: 469e mov lr, r3 262e: 4770 bx lr 00002630 <__do_global_dtors_aux_fini_array_entry>: 2630: 00b5 0000 ....