You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Aquatic-Robotic-Courier/software/ARC-FW/gcc/AtmelStart.lss

6844 lines
256 KiB
Plaintext

AtmelStart.elf: file format elf32-littlearm
Sections:
Idx Name Size VMA LMA File off Algn
0 .text 00002438 00000000 00000000 00010000 2**2
CONTENTS, ALLOC, LOAD, READONLY, CODE
1 .relocate 00000068 20000000 00002438 00020000 2**2
CONTENTS, ALLOC, LOAD, DATA
2 .bss 00000354 20000068 000024a0 00020068 2**2
ALLOC
3 .stack 00002004 200003bc 000027f4 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 00028175 00000000 00000000 000200ae 2**0
CONTENTS, READONLY, DEBUGGING, OCTETS
7 .debug_abbrev 0000332c 00000000 00000000 00048223 2**0
CONTENTS, READONLY, DEBUGGING, OCTETS
8 .debug_aranges 00000bc0 00000000 00000000 0004b54f 2**0
CONTENTS, READONLY, DEBUGGING, OCTETS
9 .debug_ranges 00002d80 00000000 00000000 0004c10f 2**0
CONTENTS, READONLY, DEBUGGING, OCTETS
10 .debug_macro 00007c8e 00000000 00000000 0004ee8f 2**0
CONTENTS, READONLY, DEBUGGING, OCTETS
11 .debug_line 000135a2 00000000 00000000 00056b1d 2**0
CONTENTS, READONLY, DEBUGGING, OCTETS
12 .debug_str 00085d73 00000000 00000000 0006a0bf 2**0
CONTENTS, READONLY, DEBUGGING, OCTETS
13 .debug_frame 000020a8 00000000 00000000 000efe34 2**2
CONTENTS, READONLY, DEBUGGING, OCTETS
14 .debug_loc 0000ec67 00000000 00000000 000f1edc 2**0
CONTENTS, READONLY, DEBUGGING, OCTETS
Disassembly of section .text:
00000000 <exception_table>:
0: c0 23 00 20 01 01 00 00 fd 00 00 00 fd 00 00 00 .#. ............
...
2c: fd 00 00 00 00 00 00 00 00 00 00 00 fd 00 00 00 ................
3c: fd 00 00 00 fd 00 00 00 fd 00 00 00 fd 00 00 00 ................
4c: fd 00 00 00 fd 00 00 00 fd 00 00 00 fd 00 00 00 ................
5c: 35 10 00 00 fd 00 00 00 fd 00 00 00 fd 00 00 00 5...............
6c: fd 00 00 00 fd 00 00 00 00 00 00 00 00 00 00 00 ................
7c: fd 00 00 00 fd 00 00 00 fd 00 00 00 fd 00 00 00 ................
8c: fd 00 00 00 fd 00 00 00 00 00 00 00 00 00 00 00 ................
9c: fd 00 00 00 fd 00 00 00 fd 00 00 00 fd 00 00 00 ................
ac: fd 00 00 00 00 00 00 00 ........
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: 00002438 .word 0x00002438
000000dc <frame_dummy>:
dc: 4b04 ldr r3, [pc, #16] ; (f0 <frame_dummy+0x14>)
de: b510 push {r4, lr}
e0: 2b00 cmp r3, #0
e2: d003 beq.n ec <frame_dummy+0x10>
e4: 4903 ldr r1, [pc, #12] ; (f4 <frame_dummy+0x18>)
e6: 4804 ldr r0, [pc, #16] ; (f8 <frame_dummy+0x1c>)
e8: e000 b.n ec <frame_dummy+0x10>
ea: bf00 nop
ec: bd10 pop {r4, pc}
ee: 46c0 nop ; (mov r8, r8)
f0: 00000000 .word 0x00000000
f4: 2000006c .word 0x2000006c
f8: 00002438 .word 0x00002438
000000fc <Dummy_Handler>:
/**
* \brief Default interrupt handler for unused IRQs.
*/
void Dummy_Handler(void)
{
while (1) {
fc: e7fe b.n fc <Dummy_Handler>
...
00000100 <Reset_Handler>:
if (pSrc != pDest) {
100: 4925 ldr r1, [pc, #148] ; (198 <Reset_Handler+0x98>)
102: 4826 ldr r0, [pc, #152] ; (19c <Reset_Handler+0x9c>)
{
104: b570 push {r4, r5, r6, lr}
if (pSrc != pDest) {
106: 4281 cmp r1, r0
108: d00a beq.n 120 <Reset_Handler+0x20>
*pDest++ = *pSrc++;
10a: 4b25 ldr r3, [pc, #148] ; (1a0 <Reset_Handler+0xa0>)
10c: 1ec4 subs r4, r0, #3
10e: 2200 movs r2, #0
110: 42a3 cmp r3, r4
112: d303 bcc.n 11c <Reset_Handler+0x1c>
114: 3303 adds r3, #3
116: 1a1a subs r2, r3, r0
118: 0892 lsrs r2, r2, #2
11a: 0092 lsls r2, r2, #2
11c: 4b21 ldr r3, [pc, #132] ; (1a4 <Reset_Handler+0xa4>)
11e: 4798 blx r3
*pDest++ = 0;
120: 4821 ldr r0, [pc, #132] ; (1a8 <Reset_Handler+0xa8>)
122: 4b22 ldr r3, [pc, #136] ; (1ac <Reset_Handler+0xac>)
124: 1ec1 subs r1, r0, #3
126: 2200 movs r2, #0
128: 4299 cmp r1, r3
12a: d803 bhi.n 134 <Reset_Handler+0x34>
12c: 3303 adds r3, #3
12e: 1a1a subs r2, r3, r0
130: 0892 lsrs r2, r2, #2
132: 0092 lsls r2, r2, #2
134: 2100 movs r1, #0
136: 4b1e ldr r3, [pc, #120] ; (1b0 <Reset_Handler+0xb0>)
138: 4798 blx r3
SCB->VTOR = ((uint32_t)pSrc & SCB_VTOR_TBLOFF_Msk);
13a: 22ff movs r2, #255 ; 0xff
13c: 4b1d ldr r3, [pc, #116] ; (1b4 <Reset_Handler+0xb4>)
USB->DEVICE.QOSCTRL.bit.CQOS = 2;
13e: 2103 movs r1, #3
SCB->VTOR = ((uint32_t)pSrc & SCB_VTOR_TBLOFF_Msk);
140: 4393 bics r3, r2
142: 4a1d ldr r2, [pc, #116] ; (1b8 <Reset_Handler+0xb8>)
USB->DEVICE.QOSCTRL.bit.DQOS = 2;
144: 250c movs r5, #12
SCB->VTOR = ((uint32_t)pSrc & SCB_VTOR_TBLOFF_Msk);
146: 6093 str r3, [r2, #8]
SBMATRIX->SFR[SBMATRIX_SLAVE_HMCRAMC0].reg = 2;
148: 2202 movs r2, #2
USB->DEVICE.QOSCTRL.bit.DQOS = 2;
14a: 2408 movs r4, #8
DMAC->QOSCTRL.bit.DQOS = 2;
14c: 2630 movs r6, #48 ; 0x30
SBMATRIX->SFR[SBMATRIX_SLAVE_HMCRAMC0].reg = 2;
14e: 4b1b ldr r3, [pc, #108] ; (1bc <Reset_Handler+0xbc>)
USB->DEVICE.QOSCTRL.bit.CQOS = 2;
150: 481b ldr r0, [pc, #108] ; (1c0 <Reset_Handler+0xc0>)
SBMATRIX->SFR[SBMATRIX_SLAVE_HMCRAMC0].reg = 2;
152: 625a str r2, [r3, #36] ; 0x24
USB->DEVICE.QOSCTRL.bit.CQOS = 2;
154: 78c3 ldrb r3, [r0, #3]
156: 438b bics r3, r1
158: 4313 orrs r3, r2
15a: 70c3 strb r3, [r0, #3]
USB->DEVICE.QOSCTRL.bit.DQOS = 2;
15c: 78c3 ldrb r3, [r0, #3]
15e: 43ab bics r3, r5
160: 4323 orrs r3, r4
162: 70c3 strb r3, [r0, #3]
DMAC->QOSCTRL.bit.DQOS = 2;
164: 4b17 ldr r3, [pc, #92] ; (1c4 <Reset_Handler+0xc4>)
166: 7b98 ldrb r0, [r3, #14]
168: 43b0 bics r0, r6
16a: 0006 movs r6, r0
16c: 2020 movs r0, #32
16e: 4330 orrs r0, r6
170: 7398 strb r0, [r3, #14]
DMAC->QOSCTRL.bit.FQOS = 2;
172: 7b98 ldrb r0, [r3, #14]
174: 43a8 bics r0, r5
176: 4304 orrs r4, r0
178: 739c strb r4, [r3, #14]
DMAC->QOSCTRL.bit.WRBQOS = 2;
17a: 7b98 ldrb r0, [r3, #14]
17c: 4388 bics r0, r1
17e: 4302 orrs r2, r0
180: 739a strb r2, [r3, #14]
NVMCTRL->CTRLB.bit.MANW = 1;
182: 2380 movs r3, #128 ; 0x80
184: 4a10 ldr r2, [pc, #64] ; (1c8 <Reset_Handler+0xc8>)
186: 6851 ldr r1, [r2, #4]
188: 430b orrs r3, r1
18a: 6053 str r3, [r2, #4]
__libc_init_array();
18c: 4b0f ldr r3, [pc, #60] ; (1cc <Reset_Handler+0xcc>)
18e: 4798 blx r3
main();
190: 4b0f ldr r3, [pc, #60] ; (1d0 <Reset_Handler+0xd0>)
192: 4798 blx r3
while (1)
194: e7fe b.n 194 <Reset_Handler+0x94>
196: 46c0 nop ; (mov r8, r8)
198: 00002438 .word 0x00002438
19c: 20000000 .word 0x20000000
1a0: 20000068 .word 0x20000068
1a4: 00002355 .word 0x00002355
1a8: 20000068 .word 0x20000068
1ac: 200003bc .word 0x200003bc
1b0: 00002367 .word 0x00002367
1b4: 00000000 .word 0x00000000
1b8: e000ed00 .word 0xe000ed00
1bc: 410070fc .word 0x410070fc
1c0: 41005000 .word 0x41005000
1c4: 41004800 .word 0x41004800
1c8: 41004000 .word 0x41004000
1cc: 0000230d .word 0x0000230d
1d0: 00001a61 .word 0x00001a61
000001d4 <cdcdf_acm_req>:
* \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)
{
1d4: b5f0 push {r4, r5, r6, r7, lr}
1d6: 0017 movs r7, r2
if (0x01 != ((req->bmRequestType >> 5) & 0x03)) { // class request
1d8: 780a ldrb r2, [r1, #0]
{
1da: b085 sub sp, #20
if (0x01 != ((req->bmRequestType >> 5) & 0x03)) { // class request
1dc: 0653 lsls r3, r2, #25
{
1de: 000c movs r4, r1
1e0: 9001 str r0, [sp, #4]
if (0x01 != ((req->bmRequestType >> 5) & 0x03)) { // class request
1e2: 0f9b lsrs r3, r3, #30
1e4: 2b01 cmp r3, #1
1e6: d152 bne.n 28e <cdcdf_acm_req+0xba>
return ERR_NOT_FOUND;
}
if ((req->wIndex == _cdcdf_acm_funcd.func_iface[0]) || (req->wIndex == _cdcdf_acm_funcd.func_iface[1])) {
1e8: 7963 ldrb r3, [r4, #5]
1ea: 7909 ldrb r1, [r1, #4]
1ec: 4d2a ldr r5, [pc, #168] ; (298 <cdcdf_acm_req+0xc4>)
1ee: 021b lsls r3, r3, #8
1f0: 430b orrs r3, r1
1f2: 7829 ldrb r1, [r5, #0]
1f4: 4299 cmp r1, r3
1f6: d002 beq.n 1fe <cdcdf_acm_req+0x2a>
1f8: 7869 ldrb r1, [r5, #1]
1fa: 4299 cmp r1, r3
1fc: d147 bne.n 28e <cdcdf_acm_req+0xba>
uint16_t len = req->wLength;
1fe: 79e6 ldrb r6, [r4, #7]
200: 79a3 ldrb r3, [r4, #6]
202: 0236 lsls r6, r6, #8
if (req->bmRequestType & USB_EP_DIR_IN) {
204: b252 sxtb r2, r2
uint16_t len = req->wLength;
206: 431e orrs r6, r3
if (req->bmRequestType & USB_EP_DIR_IN) {
208: 2a00 cmp r2, #0
20a: da0f bge.n 22c <cdcdf_acm_req+0x58>
return ERR_NONE;
20c: 2000 movs r0, #0
if (USB_DATA_STAGE == stage) {
20e: 2f01 cmp r7, #1
210: d00a beq.n 228 <cdcdf_acm_req+0x54>
switch (req->bRequest) {
212: 7863 ldrb r3, [r4, #1]
214: 2b21 cmp r3, #33 ; 0x21
216: d111 bne.n 23c <cdcdf_acm_req+0x68>
if (sizeof(struct usb_cdc_line_coding) != len) {
218: 2e07 cmp r6, #7
21a: d13b bne.n 294 <cdcdf_acm_req+0xc0>
return usbdc_xfer(ep, (uint8_t *)&usbd_cdc_line_coding, len, false);
21c: 0003 movs r3, r0
21e: 1da9 adds r1, r5, #6
return usbdc_xfer(ep, ctrl_buf, len, false);
220: 0032 movs r2, r6
222: 9801 ldr r0, [sp, #4]
224: 4c1d ldr r4, [pc, #116] ; (29c <cdcdf_acm_req+0xc8>)
226: 47a0 blx r4
return cdcdf_acm_set_req(ep, req, stage);
}
} else {
return ERR_NOT_FOUND;
}
}
228: b005 add sp, #20
22a: bdf0 pop {r4, r5, r6, r7, pc}
uint8_t * ctrl_buf = usbdc_get_ctrl_buffer();
22c: 4b1c ldr r3, [pc, #112] ; (2a0 <cdcdf_acm_req+0xcc>)
22e: 4798 blx r3
switch (req->bRequest) {
230: 7863 ldrb r3, [r4, #1]
uint8_t * ctrl_buf = usbdc_get_ctrl_buffer();
232: 0001 movs r1, r0
switch (req->bRequest) {
234: 2b20 cmp r3, #32
236: d003 beq.n 240 <cdcdf_acm_req+0x6c>
238: 2b22 cmp r3, #34 ; 0x22
23a: d019 beq.n 270 <cdcdf_acm_req+0x9c>
return ERR_INVALID_ARG;
23c: 200d movs r0, #13
23e: e027 b.n 290 <cdcdf_acm_req+0xbc>
if (sizeof(struct usb_cdc_line_coding) != len) {
240: 2e07 cmp r6, #7
242: d127 bne.n 294 <cdcdf_acm_req+0xc0>
if (USB_SETUP_STAGE == stage) {
244: 2f00 cmp r7, #0
246: d101 bne.n 24c <cdcdf_acm_req+0x78>
return usbdc_xfer(ep, ctrl_buf, len, false);
248: 003b movs r3, r7
24a: e7e9 b.n 220 <cdcdf_acm_req+0x4c>
memcpy(&line_coding_tmp, ctrl_buf, sizeof(struct usb_cdc_line_coding));
24c: 0032 movs r2, r6
24e: 4c15 ldr r4, [pc, #84] ; (2a4 <cdcdf_acm_req+0xd0>)
250: a802 add r0, sp, #8
252: 47a0 blx r4
if ((NULL == cdcdf_acm_set_line_coding) || (true == cdcdf_acm_set_line_coding(&line_coding_tmp))) {
254: 692b ldr r3, [r5, #16]
256: 2b00 cmp r3, #0
258: d105 bne.n 266 <cdcdf_acm_req+0x92>
usbd_cdc_line_coding = line_coding_tmp;
25a: 2207 movs r2, #7
25c: 1da8 adds r0, r5, #6
25e: a902 add r1, sp, #8
260: 47a0 blx r4
return ERR_NONE;
262: 2000 movs r0, #0
264: e7e0 b.n 228 <cdcdf_acm_req+0x54>
if ((NULL == cdcdf_acm_set_line_coding) || (true == cdcdf_acm_set_line_coding(&line_coding_tmp))) {
266: a802 add r0, sp, #8
268: 4798 blx r3
26a: 2800 cmp r0, #0
26c: d1f5 bne.n 25a <cdcdf_acm_req+0x86>
26e: e7f8 b.n 262 <cdcdf_acm_req+0x8e>
usbdc_xfer(0, NULL, 0, 0);
270: 2300 movs r3, #0
272: 4e0a ldr r6, [pc, #40] ; (29c <cdcdf_acm_req+0xc8>)
274: 001a movs r2, r3
276: 0019 movs r1, r3
278: 0018 movs r0, r3
27a: 47b0 blx r6
if (NULL != cdcdf_acm_notify_state) {
27c: 696b ldr r3, [r5, #20]
27e: 2b00 cmp r3, #0
280: d0ef beq.n 262 <cdcdf_acm_req+0x8e>
cdcdf_acm_notify_state(req->wValue);
282: 78e0 ldrb r0, [r4, #3]
284: 78a2 ldrb r2, [r4, #2]
286: 0200 lsls r0, r0, #8
288: 4310 orrs r0, r2
28a: 4798 blx r3
28c: e7e9 b.n 262 <cdcdf_acm_req+0x8e>
return ERR_NOT_FOUND;
28e: 200a movs r0, #10
return ERR_INVALID_DATA;
290: 4240 negs r0, r0
292: e7c9 b.n 228 <cdcdf_acm_req+0x54>
294: 2001 movs r0, #1
296: e7fb b.n 290 <cdcdf_acm_req+0xbc>
298: 20000084 .word 0x20000084
29c: 00001e81 .word 0x00001e81
2a0: 000022a9 .word 0x000022a9
2a4: 00002355 .word 0x00002355
000002a8 <cdcdf_acm_ctrl>:
{
2a8: b5f7 push {r0, r1, r2, r4, r5, r6, r7, lr}
2aa: 0015 movs r5, r2
switch (ctrl) {
2ac: 2901 cmp r1, #1
2ae: d04f beq.n 350 <cdcdf_acm_ctrl+0xa8>
2b0: 2902 cmp r1, #2
2b2: d100 bne.n 2b6 <cdcdf_acm_ctrl+0xe>
2b4: e076 b.n 3a4 <cdcdf_acm_ctrl+0xfc>
2b6: 2900 cmp r1, #0
2b8: d000 beq.n 2bc <cdcdf_acm_ctrl+0x14>
2ba: e075 b.n 3a8 <cdcdf_acm_ctrl+0x100>
return cdcdf_acm_enable(drv, (struct usbd_descriptors *)param);
2bc: 6883 ldr r3, [r0, #8]
ifc = desc->sod;
2be: 6810 ldr r0, [r2, #0]
2c0: 001e movs r6, r3
2c2: 9300 str r3, [sp, #0]
for (i = 0; i < 2; i++) {
2c4: 3302 adds r3, #2
2c6: 9301 str r3, [sp, #4]
if (NULL == ifc) {
2c8: 2800 cmp r0, #0
2ca: d102 bne.n 2d2 <cdcdf_acm_ctrl+0x2a>
return ERR_NOT_FOUND;
2cc: 200a movs r0, #10
return ERR_NOT_INITIALIZED;
2ce: 4240 negs r0, r0
2d0: e020 b.n 314 <cdcdf_acm_ctrl+0x6c>
if ((CDC_CLASS_COMM == ifc_desc.bInterfaceClass) || (CDC_CLASS_DATA == ifc_desc.bInterfaceClass)) {
2d2: 2108 movs r1, #8
2d4: 7943 ldrb r3, [r0, #5]
ifc_desc.bInterfaceNumber = ifc[2];
2d6: 7882 ldrb r2, [r0, #2]
if ((CDC_CLASS_COMM == ifc_desc.bInterfaceClass) || (CDC_CLASS_DATA == ifc_desc.bInterfaceClass)) {
2d8: 438b bics r3, r1
2da: 2b02 cmp r3, #2
2dc: d1f6 bne.n 2cc <cdcdf_acm_ctrl+0x24>
if (func_data->func_iface[i] == ifc_desc.bInterfaceNumber) { // Initialized
2de: 7833 ldrb r3, [r6, #0]
2e0: 429a cmp r2, r3
2e2: d063 beq.n 3ac <cdcdf_acm_ctrl+0x104>
} else if (func_data->func_iface[i] != 0xFF) { // Occupied
2e4: 2bff cmp r3, #255 ; 0xff
2e6: d163 bne.n 3b0 <cdcdf_acm_ctrl+0x108>
func_data->func_iface[i] = ifc_desc.bInterfaceNumber;
2e8: 7032 strb r2, [r6, #0]
ep = usb_find_desc(ifc, desc->eod, USB_DT_ENDPOINT);
2ea: 6869 ldr r1, [r5, #4]
2ec: 2205 movs r2, #5
2ee: 4b32 ldr r3, [pc, #200] ; (3b8 <cdcdf_acm_ctrl+0x110>)
2f0: 4798 blx r3
ep = usb_find_ep_desc(usb_desc_next(desc->sod), desc->eod);
2f2: 1e04 subs r4, r0, #0
while (NULL != ep) {
2f4: d10f bne.n 316 <cdcdf_acm_ctrl+0x6e>
ifc = usb_find_desc(usb_desc_next(desc->sod), desc->eod, USB_DT_INTERFACE);
2f6: 6828 ldr r0, [r5, #0]
2f8: 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));
2fa: 7803 ldrb r3, [r0, #0]
2fc: 6869 ldr r1, [r5, #4]
2fe: 18c0 adds r0, r0, r3
300: 4b2d ldr r3, [pc, #180] ; (3b8 <cdcdf_acm_ctrl+0x110>)
302: 4798 blx r3
for (i = 0; i < 2; i++) {
304: 9b01 ldr r3, [sp, #4]
306: 3601 adds r6, #1
308: 42b3 cmp r3, r6
30a: d1dd bne.n 2c8 <cdcdf_acm_ctrl+0x20>
_cdcdf_acm_funcd.enabled = true;
30c: 2201 movs r2, #1
return ERR_NONE;
30e: 0020 movs r0, r4
_cdcdf_acm_funcd.enabled = true;
310: 4b2a ldr r3, [pc, #168] ; (3bc <cdcdf_acm_ctrl+0x114>)
312: 715a strb r2, [r3, #5]
}
314: bdfe pop {r1, r2, r3, r4, r5, r6, r7, pc}
return (ptr[0] + (ptr[1] << 8));
316: 7963 ldrb r3, [r4, #5]
318: 7922 ldrb r2, [r4, #4]
31a: 021b lsls r3, r3, #8
ep_desc.bEndpointAddress = ep[2];
31c: 78a7 ldrb r7, [r4, #2]
31e: 18d2 adds r2, r2, r3
if (usb_d_ep_init(ep_desc.bEndpointAddress, ep_desc.bmAttributes, ep_desc.wMaxPacketSize)) {
320: 0038 movs r0, r7
322: 78e1 ldrb r1, [r4, #3]
324: 4b26 ldr r3, [pc, #152] ; (3c0 <cdcdf_acm_ctrl+0x118>)
326: b292 uxth r2, r2
328: 4798 blx r3
32a: 2800 cmp r0, #0
32c: d142 bne.n 3b4 <cdcdf_acm_ctrl+0x10c>
if (ep_desc.bEndpointAddress & USB_EP_DIR_IN) {
32e: b27b sxtb r3, r7
330: 4a24 ldr r2, [pc, #144] ; (3c4 <cdcdf_acm_ctrl+0x11c>)
332: 2b00 cmp r3, #0
334: da09 bge.n 34a <cdcdf_acm_ctrl+0xa2>
func_data->func_ep_in[i] = ep_desc.bEndpointAddress;
336: 70b7 strb r7, [r6, #2]
usb_d_ep_enable(func_data->func_ep_out);
338: 0038 movs r0, r7
33a: 4790 blx r2
desc->sod = ep;
33c: 602c str r4, [r5, #0]
return (desc + usb_desc_len(desc));
33e: 7820 ldrb r0, [r4, #0]
ep = usb_find_ep_desc(usb_desc_next(desc->sod), desc->eod);
340: 6869 ldr r1, [r5, #4]
342: 4b21 ldr r3, [pc, #132] ; (3c8 <cdcdf_acm_ctrl+0x120>)
344: 1820 adds r0, r4, r0
346: 4798 blx r3
348: e7d3 b.n 2f2 <cdcdf_acm_ctrl+0x4a>
func_data->func_ep_out = ep_desc.bEndpointAddress;
34a: 9b00 ldr r3, [sp, #0]
34c: 711f strb r7, [r3, #4]
34e: e7f3 b.n 338 <cdcdf_acm_ctrl+0x90>
return cdcdf_acm_disable(drv, (struct usbd_descriptors *)param);
350: 6884 ldr r4, [r0, #8]
if (desc) {
352: 2a00 cmp r2, #0
354: d005 beq.n 362 <cdcdf_acm_ctrl+0xba>
ifc_desc.bInterfaceClass = desc->sod[5];
356: 6813 ldr r3, [r2, #0]
if ((ifc_desc.bInterfaceClass != CDC_CLASS_COMM) && (ifc_desc.bInterfaceClass != CDC_CLASS_DATA)) {
358: 2208 movs r2, #8
35a: 795b ldrb r3, [r3, #5]
35c: 4393 bics r3, r2
35e: 2b02 cmp r3, #2
360: d1b4 bne.n 2cc <cdcdf_acm_ctrl+0x24>
if (func_data->func_iface[i] == 0xFF) {
362: 7823 ldrb r3, [r4, #0]
364: 2bff cmp r3, #255 ; 0xff
366: d007 beq.n 378 <cdcdf_acm_ctrl+0xd0>
func_data->func_iface[i] = 0xFF;
368: 25ff movs r5, #255 ; 0xff
if (func_data->func_ep_in[i] != 0xFF) {
36a: 78a0 ldrb r0, [r4, #2]
func_data->func_iface[i] = 0xFF;
36c: 7025 strb r5, [r4, #0]
if (func_data->func_ep_in[i] != 0xFF) {
36e: 42a8 cmp r0, r5
370: d002 beq.n 378 <cdcdf_acm_ctrl+0xd0>
usb_d_ep_deinit(func_data->func_ep_in[i]);
372: 4b16 ldr r3, [pc, #88] ; (3cc <cdcdf_acm_ctrl+0x124>)
374: 4798 blx r3
func_data->func_ep_in[i] = 0xFF;
376: 70a5 strb r5, [r4, #2]
if (func_data->func_iface[i] == 0xFF) {
378: 7863 ldrb r3, [r4, #1]
37a: 2bff cmp r3, #255 ; 0xff
37c: d007 beq.n 38e <cdcdf_acm_ctrl+0xe6>
func_data->func_iface[i] = 0xFF;
37e: 25ff movs r5, #255 ; 0xff
if (func_data->func_ep_in[i] != 0xFF) {
380: 78e0 ldrb r0, [r4, #3]
func_data->func_iface[i] = 0xFF;
382: 7065 strb r5, [r4, #1]
if (func_data->func_ep_in[i] != 0xFF) {
384: 42a8 cmp r0, r5
386: d002 beq.n 38e <cdcdf_acm_ctrl+0xe6>
usb_d_ep_deinit(func_data->func_ep_in[i]);
388: 4b10 ldr r3, [pc, #64] ; (3cc <cdcdf_acm_ctrl+0x124>)
38a: 4798 blx r3
func_data->func_ep_in[i] = 0xFF;
38c: 70e5 strb r5, [r4, #3]
if (func_data->func_ep_out != 0xFF) {
38e: 7920 ldrb r0, [r4, #4]
390: 28ff cmp r0, #255 ; 0xff
392: d003 beq.n 39c <cdcdf_acm_ctrl+0xf4>
usb_d_ep_deinit(func_data->func_ep_out);
394: 4b0d ldr r3, [pc, #52] ; (3cc <cdcdf_acm_ctrl+0x124>)
396: 4798 blx r3
func_data->func_ep_out = 0xFF;
398: 23ff movs r3, #255 ; 0xff
39a: 7123 strb r3, [r4, #4]
_cdcdf_acm_funcd.enabled = false;
39c: 2000 movs r0, #0
39e: 4b07 ldr r3, [pc, #28] ; (3bc <cdcdf_acm_ctrl+0x114>)
3a0: 7158 strb r0, [r3, #5]
return ERR_NONE;
3a2: e7b7 b.n 314 <cdcdf_acm_ctrl+0x6c>
return ERR_UNSUPPORTED_OP;
3a4: 201b movs r0, #27
3a6: e792 b.n 2ce <cdcdf_acm_ctrl+0x26>
switch (ctrl) {
3a8: 200d movs r0, #13
3aa: e790 b.n 2ce <cdcdf_acm_ctrl+0x26>
return ERR_ALREADY_INITIALIZED;
3ac: 2012 movs r0, #18
3ae: e78e b.n 2ce <cdcdf_acm_ctrl+0x26>
return ERR_NO_RESOURCE;
3b0: 201c movs r0, #28
3b2: e78c b.n 2ce <cdcdf_acm_ctrl+0x26>
return ERR_NOT_INITIALIZED;
3b4: 2014 movs r0, #20
3b6: e78a b.n 2ce <cdcdf_acm_ctrl+0x26>
3b8: 000014e5 .word 0x000014e5
3bc: 20000084 .word 0x20000084
3c0: 000017f1 .word 0x000017f1
3c4: 00001881 .word 0x00001881
3c8: 000014ff .word 0x000014ff
3cc: 00001855 .word 0x00001855
000003d0 <cdcdf_acm_init>:
/**
* \brief Initialize the USB CDC ACM Function Driver
*/
int32_t cdcdf_acm_init(void)
{
3d0: b510 push {r4, lr}
if (usbdc_get_state() > USBD_S_POWER) {
3d2: 4b0a ldr r3, [pc, #40] ; (3fc <cdcdf_acm_init+0x2c>)
3d4: 4798 blx r3
3d6: 2801 cmp r0, #1
3d8: d80c bhi.n 3f4 <cdcdf_acm_init+0x24>
return ERR_DENIED;
}
_cdcdf_acm.ctrl = cdcdf_acm_ctrl;
3da: 4809 ldr r0, [pc, #36] ; (400 <cdcdf_acm_init+0x30>)
3dc: 4b09 ldr r3, [pc, #36] ; (404 <cdcdf_acm_init+0x34>)
_cdcdf_acm.func_data = &_cdcdf_acm_funcd;
3de: 6200 str r0, [r0, #32]
_cdcdf_acm.ctrl = cdcdf_acm_ctrl;
3e0: 61c3 str r3, [r0, #28]
usbdc_register_function(&_cdcdf_acm);
3e2: 4b09 ldr r3, [pc, #36] ; (408 <cdcdf_acm_init+0x38>)
3e4: 3018 adds r0, #24
3e6: 4798 blx r3
usbdc_register_handler(USBDC_HDL_REQ, &cdcdf_acm_req_h);
3e8: 2001 movs r0, #1
3ea: 4908 ldr r1, [pc, #32] ; (40c <cdcdf_acm_init+0x3c>)
3ec: 4b08 ldr r3, [pc, #32] ; (410 <cdcdf_acm_init+0x40>)
3ee: 4798 blx r3
return ERR_NONE;
3f0: 2000 movs r0, #0
}
3f2: bd10 pop {r4, pc}
return ERR_DENIED;
3f4: 2011 movs r0, #17
3f6: 4240 negs r0, r0
3f8: e7fb b.n 3f2 <cdcdf_acm_init+0x22>
3fa: 46c0 nop ; (mov r8, r8)
3fc: 000022b5 .word 0x000022b5
400: 20000084 .word 0x20000084
404: 000002a9 .word 0x000002a9
408: 00002251 .word 0x00002251
40c: 20000000 .word 0x20000000
410: 000021c5 .word 0x000021c5
00000414 <_dummy_func_no_return>:
static bool _dummy_func_no_return(uint32_t unused0, uint32_t unused1)
{
(void)unused0;
(void)unused1;
return false;
}
414: 2000 movs r0, #0
416: 4770 bx lr
00000418 <_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)) {
418: 4b07 ldr r3, [pc, #28] ; (438 <_usb_d_dev_wait_dfll_rdy+0x20>)
41a: 8c9a ldrh r2, [r3, #36] ; 0x24
41c: 0692 lsls r2, r2, #26
41e: d504 bpl.n 42a <_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;
420: 2210 movs r2, #16
tmp = ((Sysctrl *)hw)->PCLKSR.reg;
422: 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)
424: 4211 tst r1, r2
426: d0fc beq.n 422 <_usb_d_dev_wait_dfll_rdy+0xa>
428: e004 b.n 434 <_usb_d_dev_wait_dfll_rdy+0x1c>
tmp &= mask;
42a: 21d0 movs r1, #208 ; 0xd0
tmp = ((Sysctrl *)hw)->PCLKSR.reg;
42c: 68da ldr r2, [r3, #12]
tmp &= mask;
42e: 400a ands r2, r1
while (hri_sysctrl_get_PCLKSR_reg(SYSCTRL, DFLL_READY_FLAG) != DFLL_READY_FLAG)
430: 2ad0 cmp r2, #208 ; 0xd0
432: d1fb bne.n 42c <_usb_d_dev_wait_dfll_rdy+0x14>
;
}
}
434: 4770 bx lr
436: 46c0 nop ; (mov r8, r8)
438: 40000800 .word 0x40000800
0000043c <_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);
43c: 2800 cmp r0, #0
43e: d003 beq.n 448 <_usb_d_dev_ept+0xc>
440: 2900 cmp r1, #0
442: d001 beq.n 448 <_usb_d_dev_ept+0xc>
444: 3002 adds r0, #2
446: b2c0 uxtb r0, r0
return &dev_inst.ep[ep_index];
448: 2314 movs r3, #20
44a: 3001 adds r0, #1
44c: 4358 muls r0, r3
44e: 4b01 ldr r3, [pc, #4] ; (454 <_usb_d_dev_ept+0x18>)
450: 18c0 adds r0, r0, r3
}
452: 4770 bx lr
454: 20000108 .word 0x20000108
00000458 <_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);
458: 230f movs r3, #15
{
45a: b570 push {r4, r5, r6, lr}
45c: 0001 movs r1, r0
uint8_t epn = USB_EP_GET_N(ept->ep);
45e: 7c80 ldrb r0, [r0, #18]
bool is_ctrl = _usb_d_dev_ep_is_ctrl(ept);
if (!is_ctrl) {
460: 2507 movs r5, #7
uint8_t epn = USB_EP_GET_N(ept->ep);
462: 4003 ands r3, r0
bool is_ctrl = _usb_d_dev_ep_is_ctrl(ept);
464: 001a movs r2, r3
466: 7ccc ldrb r4, [r1, #19]
if (!is_ctrl) {
468: 3208 adds r2, #8
46a: 4025 ands r5, r4
46c: 015b lsls r3, r3, #5
46e: 2d01 cmp r5, #1
470: d008 beq.n 484 <_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;
472: 4914 ldr r1, [pc, #80] ; (4c4 <_usb_d_dev_handle_setup+0x6c>)
474: 0152 lsls r2, r2, #5
476: 1852 adds r2, r2, r1
478: 2110 movs r1, #16
47a: 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;
47c: 4a12 ldr r2, [pc, #72] ; (4c8 <_usb_d_dev_handle_setup+0x70>)
47e: 189b adds r3, r3, r2
480: 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);
}
482: bd70 pop {r4, r5, r6, pc}
if (_usb_d_dev_ep_is_busy(ept)) {
484: 2540 movs r5, #64 ; 0x40
486: 422c tst r4, r5
488: d006 beq.n 498 <_usb_d_dev_handle_setup+0x40>
((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPSTATUSCLR.reg = mask;
48a: 2680 movs r6, #128 ; 0x80
ept->flags.bits.is_busy = 0;
48c: 43ac bics r4, r5
48e: 74cc strb r4, [r1, #19]
490: 4c0d ldr r4, [pc, #52] ; (4c8 <_usb_d_dev_handle_setup+0x70>)
492: 191c adds r4, r3, r4
494: 7166 strb r6, [r4, #5]
((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPSTATUSSET.reg = mask;
496: 71a5 strb r5, [r4, #6]
ept->flags.bits.is_stalled = 0;
498: 2508 movs r5, #8
49a: 7ccc ldrb r4, [r1, #19]
((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPINTFLAG.reg = mask;
49c: 0152 lsls r2, r2, #5
49e: 43ac bics r4, r5
4a0: 74cc strb r4, [r1, #19]
bank->STATUS_BK.reg = 0;
4a2: 2400 movs r4, #0
4a4: 4909 ldr r1, [pc, #36] ; (4cc <_usb_d_dev_handle_setup+0x74>)
4a6: 18c9 adds r1, r1, r3
4a8: 728c strb r4, [r1, #10]
4aa: 768c strb r4, [r1, #26]
4ac: 4905 ldr r1, [pc, #20] ; (4c4 <_usb_d_dev_handle_setup+0x6c>)
4ae: 1852 adds r2, r2, r1
4b0: 216f movs r1, #111 ; 0x6f
4b2: 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;
4b4: 4a04 ldr r2, [pc, #16] ; (4c8 <_usb_d_dev_handle_setup+0x70>)
4b6: 189b adds r3, r3, r2
4b8: 7259 strb r1, [r3, #9]
dev_inst.ep_callbacks.setup(ept->ep);
4ba: 4b05 ldr r3, [pc, #20] ; (4d0 <_usb_d_dev_handle_setup+0x78>)
4bc: 689b ldr r3, [r3, #8]
4be: 4798 blx r3
4c0: e7df b.n 482 <_usb_d_dev_handle_setup+0x2a>
4c2: 46c0 nop ; (mov r8, r8)
4c4: 41005000 .word 0x41005000
4c8: 410050ff .word 0x410050ff
4cc: 200000a8 .word 0x200000a8
4d0: 20000108 .word 0x20000108
000004d4 <_usb_d_dev_handle_stall>:
_usbd_ep_int_dis(epn, USB_DEVICE_EPINTFLAG_STALL0 << bank_n);
4d4: 2320 movs r3, #32
4d6: 408b lsls r3, r1
hri_usbendpoint_clear_EPINTEN_reg(USB, epn, flags);
4d8: b2da uxtb r2, r3
4da: 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)
{
4dc: b510 push {r4, lr}
4de: 0004 movs r4, r0
uint8_t epn = USB_EP_GET_N(ept->ep);
4e0: 7c80 ldrb r0, [r0, #18]
4e2: 4905 ldr r1, [pc, #20] ; (4f8 <_usb_d_dev_handle_stall+0x24>)
4e4: 4003 ands r3, r0
4e6: 015b lsls r3, r3, #5
4e8: 185b adds r3, r3, r1
4ea: 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);
4ec: 4b03 ldr r3, [pc, #12] ; (4fc <_usb_d_dev_handle_stall+0x28>)
4ee: 2101 movs r1, #1
4f0: 691b ldr r3, [r3, #16]
4f2: 68a2 ldr r2, [r4, #8]
4f4: 4798 blx r3
}
4f6: bd10 pop {r4, pc}
4f8: 410050ff .word 0x410050ff
4fc: 20000108 .word 0x20000108
00000500 <_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)
{
500: b510 push {r4, lr}
502: 0003 movs r3, r0
if (!(_usb_d_dev_ep_is_used(ept) && _usb_d_dev_ep_is_busy(ept))) {
504: 7c80 ldrb r0, [r0, #18]
506: 28ff cmp r0, #255 ; 0xff
508: d009 beq.n 51e <_usb_d_dev_trans_done+0x1e>
50a: 2440 movs r4, #64 ; 0x40
50c: 7cda ldrb r2, [r3, #19]
50e: 4222 tst r2, r4
510: d005 beq.n 51e <_usb_d_dev_trans_done+0x1e>
return;
}
ept->flags.bits.is_busy = 0;
512: 43a2 bics r2, r4
514: 74da strb r2, [r3, #19]
dev_inst.ep_callbacks.done(ept->ep, code, ept->trans_count);
516: 4a02 ldr r2, [pc, #8] ; (520 <_usb_d_dev_trans_done+0x20>)
518: 6914 ldr r4, [r2, #16]
51a: 689a ldr r2, [r3, #8]
51c: 47a0 blx r4
}
51e: bd10 pop {r4, pc}
520: 20000108 .word 0x20000108
00000524 <_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)
{
524: b5f7 push {r0, r1, r2, r4, r5, r6, r7, lr}
526: 4694 mov ip, r2
uint8_t epn = USB_EP_GET_N(ept->ep);
528: 7c83 ldrb r3, [r0, #18]
;
const uint8_t intflags[2] = {USB_D_BANK0_INT_FLAGS, USB_D_BANK1_INT_FLAGS};
52a: 4a13 ldr r2, [pc, #76] ; (578 <_usb_d_dev_trans_stop+0x54>)
52c: ae01 add r6, sp, #4
{
52e: 000d movs r5, r1
const uint8_t intflags[2] = {USB_D_BANK0_INT_FLAGS, USB_D_BANK1_INT_FLAGS};
530: 8032 strh r2, [r6, #0]
if (!(_usb_d_dev_ep_is_used(ept) && _usb_d_dev_ep_is_busy(ept))) {
532: 2bff cmp r3, #255 ; 0xff
534: d01a beq.n 56c <_usb_d_dev_trans_stop+0x48>
536: 2740 movs r7, #64 ; 0x40
538: 7cc2 ldrb r2, [r0, #19]
53a: 423a tst r2, r7
53c: d016 beq.n 56c <_usb_d_dev_trans_stop+0x48>
((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPSTATUSCLR.reg = mask;
53e: 220f movs r2, #15
540: 4013 ands r3, r2
542: 001c movs r4, r3
544: 3408 adds r4, #8
546: 0162 lsls r2, r4, #5
return;
}
/* Stop transfer */
if (dir) {
548: 2900 cmp r1, #0
54a: d010 beq.n 56e <_usb_d_dev_trans_stop+0x4a>
54c: 4f0b ldr r7, [pc, #44] ; (57c <_usb_d_dev_trans_stop+0x58>)
54e: 19d2 adds r2, r2, r7
550: 2780 movs r7, #128 ; 0x80
552: 7117 strb r7, [r2, #4]
((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPINTFLAG.reg = mask;
554: 4909 ldr r1, [pc, #36] ; (57c <_usb_d_dev_trans_stop+0x58>)
556: 0164 lsls r4, r4, #5
558: 1864 adds r4, r4, r1
((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPINTENCLR.reg = mask;
55a: 4909 ldr r1, [pc, #36] ; (580 <_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]);
55c: 5d72 ldrb r2, [r6, r5]
55e: 015b lsls r3, r3, #5
560: 185b adds r3, r3, r1
((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPINTFLAG.reg = mask;
562: 71e2 strb r2, [r4, #7]
_usbd_ep_int_dis(epn, intflags[dir]);
_usb_d_dev_trans_done(ept, code);
564: 4661 mov r1, ip
((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPINTENCLR.reg = mask;
566: 725a strb r2, [r3, #9]
568: 4b06 ldr r3, [pc, #24] ; (584 <_usb_d_dev_trans_stop+0x60>)
56a: 4798 blx r3
}
56c: bdf7 pop {r0, r1, r2, r4, r5, r6, r7, pc}
((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPSTATUSSET.reg = mask;
56e: 4903 ldr r1, [pc, #12] ; (57c <_usb_d_dev_trans_stop+0x58>)
570: 1852 adds r2, r2, r1
572: 7157 strb r7, [r2, #5]
}
574: e7ee b.n 554 <_usb_d_dev_trans_stop+0x30>
576: 46c0 nop ; (mov r8, r8)
578: 00004a25 .word 0x00004a25
57c: 41005000 .word 0x41005000
580: 410050ff .word 0x410050ff
584: 00000501 .word 0x00000501
00000588 <_usb_d_dev_handle_trfail>:
{
588: b5f0 push {r4, r5, r6, r7, lr}
58a: 000d movs r5, r1
uint8_t epn = USB_EP_GET_N(ept->ep);
58c: 210f movs r1, #15
58e: 7c83 ldrb r3, [r0, #18]
{
590: b085 sub sp, #20
uint8_t epn = USB_EP_GET_N(ept->ep);
592: 400b ands r3, r1
594: 469c mov ip, r3
const uint8_t fail[2] = {USB_DEVICE_EPINTFLAG_TRFAIL0, USB_DEVICE_EPINTFLAG_TRFAIL1};
596: 4b30 ldr r3, [pc, #192] ; (658 <_usb_d_dev_handle_trfail+0xd0>)
598: ae03 add r6, sp, #12
59a: 8033 strh r3, [r6, #0]
UsbDeviceDescBank *bank = prvt_inst.desc_table[epn].DeviceDescBank;
59c: 4663 mov r3, ip
59e: 015b lsls r3, r3, #5
5a0: 9300 str r3, [sp, #0]
uint8_t eptype
5a2: 4663 mov r3, ip
5a4: 3308 adds r3, #8
5a6: 492d ldr r1, [pc, #180] ; (65c <_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;
5a8: 015c lsls r4, r3, #5
5aa: 2d00 cmp r5, #0
5ac: d020 beq.n 5f0 <_usb_d_dev_handle_trfail+0x68>
5ae: 5d09 ldrb r1, [r1, r4]
tmp = (tmp & USB_DEVICE_EPCFG_EPTYPE1_Msk) >> USB_DEVICE_EPCFG_EPTYPE1_Pos;
5b0: 0649 lsls r1, r1, #25
5b2: 0f49 lsrs r1, r1, #29
st.reg = bank[bank_n].STATUS_BK.reg;
5b4: 9a00 ldr r2, [sp, #0]
5b6: 012c lsls r4, r5, #4
5b8: 18a4 adds r4, r4, r2
5ba: 4a29 ldr r2, [pc, #164] ; (660 <_usb_d_dev_handle_trfail+0xd8>)
hri_usbendpoint_clear_EPINTFLAG_reg(hw, epn, fail[bank_n]);
5bc: 5d76 ldrb r6, [r6, r5]
st.reg = bank[bank_n].STATUS_BK.reg;
5be: 1914 adds r4, r2, r4
5c0: 7aa7 ldrb r7, [r4, #10]
5c2: b2ff uxtb r7, r7
if ((eptype == USB_D_EPTYPE_ISOCH) && st.bit.CRCERR) {
5c4: 2902 cmp r1, #2
5c6: d117 bne.n 5f8 <_usb_d_dev_handle_trfail+0x70>
5c8: 3901 subs r1, #1
5ca: 420f tst r7, r1
5cc: d014 beq.n 5f8 <_usb_d_dev_handle_trfail+0x70>
bank[bank_n].STATUS_BK.bit.CRCERR = 0;
5ce: 7aa7 ldrb r7, [r4, #10]
((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPINTFLAG.reg = mask;
5d0: 4a22 ldr r2, [pc, #136] ; (65c <_usb_d_dev_handle_trfail+0xd4>)
5d2: 015b lsls r3, r3, #5
5d4: 189b adds r3, r3, r2
5d6: 438f bics r7, r1
((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPINTENCLR.reg = mask;
5d8: 9a00 ldr r2, [sp, #0]
5da: 72a7 strb r7, [r4, #10]
((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPINTFLAG.reg = mask;
5dc: 71de strb r6, [r3, #7]
((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPINTENCLR.reg = mask;
5de: 4b21 ldr r3, [pc, #132] ; (664 <_usb_d_dev_handle_trfail+0xdc>)
_usb_d_dev_trans_stop(ept, bank_n, USB_TRANS_ERROR);
5e0: 4029 ands r1, r5
5e2: 18d2 adds r2, r2, r3
5e4: 7256 strb r6, [r2, #9]
5e6: 2204 movs r2, #4
_usb_d_dev_trans_stop(ept, _usb_d_dev_ep_is_in(ept), USB_TRANS_DONE);
5e8: 4b1f ldr r3, [pc, #124] ; (668 <_usb_d_dev_handle_trfail+0xe0>)
5ea: 4798 blx r3
}
5ec: b005 add sp, #20
5ee: bdf0 pop {r4, r5, r6, r7, pc}
tmp = ((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPCFG.reg;
5f0: 5d0c ldrb r4, [r1, r4]
tmp = (tmp & USB_DEVICE_EPCFG_EPTYPE0_Msk) >> USB_DEVICE_EPCFG_EPTYPE0_Pos;
5f2: 2107 movs r1, #7
5f4: 4021 ands r1, r4
return tmp;
5f6: e7dd b.n 5b4 <_usb_d_dev_handle_trfail+0x2c>
} else if (st.bit.ERRORFLOW) {
5f8: 2102 movs r1, #2
5fa: 003a movs r2, r7
5fc: 400a ands r2, r1
5fe: 9201 str r2, [sp, #4]
600: 420f tst r7, r1
602: d017 beq.n 634 <_usb_d_dev_handle_trfail+0xac>
bank[bank_n].STATUS_BK.bit.ERRORFLOW = 0;
604: 7aa2 ldrb r2, [r4, #10]
bool is_ctrl = _usb_d_dev_ep_is_ctrl(ept);
606: 7cc7 ldrb r7, [r0, #19]
bank[bank_n].STATUS_BK.bit.ERRORFLOW = 0;
608: 438a bics r2, r1
60a: 72a2 strb r2, [r4, #10]
((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPINTFLAG.reg = mask;
60c: 4a13 ldr r2, [pc, #76] ; (65c <_usb_d_dev_handle_trfail+0xd4>)
60e: 015b lsls r3, r3, #5
610: 189b adds r3, r3, r2
612: 71de strb r6, [r3, #7]
((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPINTENCLR.reg = mask;
614: 9a00 ldr r2, [sp, #0]
616: 4b13 ldr r3, [pc, #76] ; (664 <_usb_d_dev_handle_trfail+0xdc>)
618: 18d2 adds r2, r2, r3
if (is_ctrl && _usb_d_dev_ep_is_busy(ept)) {
61a: 2307 movs r3, #7
61c: 7256 strb r6, [r2, #9]
61e: 403b ands r3, r7
620: 2b01 cmp r3, #1
622: d1e3 bne.n 5ec <_usb_d_dev_handle_trfail+0x64>
624: 067b lsls r3, r7, #25
626: d5e1 bpl.n 5ec <_usb_d_dev_handle_trfail+0x64>
if (bank_n != _usb_d_dev_ep_is_in(ept)) {
628: 7cc1 ldrb r1, [r0, #19]
62a: 09c9 lsrs r1, r1, #7
62c: 42a9 cmp r1, r5
62e: d0dd beq.n 5ec <_usb_d_dev_handle_trfail+0x64>
_usb_d_dev_trans_stop(ept, _usb_d_dev_ep_is_in(ept), USB_TRANS_DONE);
630: 2200 movs r2, #0
632: e7d9 b.n 5e8 <_usb_d_dev_handle_trfail+0x60>
bank->STATUS_BK.reg = 0;
634: 4662 mov r2, ip
636: 0051 lsls r1, r2, #1
638: 194d adds r5, r1, r5
63a: 4a09 ldr r2, [pc, #36] ; (660 <_usb_d_dev_handle_trfail+0xd8>)
63c: 012d lsls r5, r5, #4
63e: 1955 adds r5, r2, r5
640: 9a01 ldr r2, [sp, #4]
((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPINTFLAG.reg = mask;
642: 015b lsls r3, r3, #5
644: 72aa strb r2, [r5, #10]
646: 4a05 ldr r2, [pc, #20] ; (65c <_usb_d_dev_handle_trfail+0xd4>)
648: 189b adds r3, r3, r2
64a: 71de strb r6, [r3, #7]
((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPINTENCLR.reg = mask;
64c: 9a00 ldr r2, [sp, #0]
64e: 4b05 ldr r3, [pc, #20] ; (664 <_usb_d_dev_handle_trfail+0xdc>)
650: 18d2 adds r2, r2, r3
652: 7256 strb r6, [r2, #9]
}
654: e7ca b.n 5ec <_usb_d_dev_handle_trfail+0x64>
656: 46c0 nop ; (mov r8, r8)
658: 00000804 .word 0x00000804
65c: 41005000 .word 0x41005000
660: 200000a8 .word 0x200000a8
664: 410050ff .word 0x410050ff
668: 00000525 .word 0x00000525
0000066c <_usb_d_dev_reset_epts>:
{
66c: b570 push {r4, r5, r6, lr}
dev_inst.ep[i].ep = 0xFF;
66e: 26ff movs r6, #255 ; 0xff
670: 4d08 ldr r5, [pc, #32] ; (694 <_usb_d_dev_reset_epts+0x28>)
672: 4c09 ldr r4, [pc, #36] ; (698 <_usb_d_dev_reset_epts+0x2c>)
674: 35c8 adds r5, #200 ; 0xc8
_usb_d_dev_trans_done(&dev_inst.ep[i], USB_TRANS_RESET);
676: 2103 movs r1, #3
678: 0020 movs r0, r4
67a: 4b08 ldr r3, [pc, #32] ; (69c <_usb_d_dev_reset_epts+0x30>)
67c: 4798 blx r3
dev_inst.ep[i].flags.u8 = 0;
67e: 2100 movs r1, #0
dev_inst.ep[i].ep = 0xFF;
680: 74a6 strb r6, [r4, #18]
dev_inst.ep[i].flags.u8 = 0;
682: 74e1 strb r1, [r4, #19]
for (i = 0; i < USB_D_N_EP; i++) {
684: 3414 adds r4, #20
686: 42ac cmp r4, r5
688: d1f5 bne.n 676 <_usb_d_dev_reset_epts+0xa>
memset(prvt_inst.desc_table, 0, sizeof(UsbDeviceDescriptor) * (CONF_USB_D_MAX_EP_N + 1));
68a: 2260 movs r2, #96 ; 0x60
68c: 4b04 ldr r3, [pc, #16] ; (6a0 <_usb_d_dev_reset_epts+0x34>)
68e: 4805 ldr r0, [pc, #20] ; (6a4 <_usb_d_dev_reset_epts+0x38>)
690: 4798 blx r3
}
692: bd70 pop {r4, r5, r6, pc}
694: 20000108 .word 0x20000108
698: 2000011c .word 0x2000011c
69c: 00000501 .word 0x00000501
6a0: 00002367 .word 0x00002367
6a4: 200000a8 .word 0x200000a8
000006a8 <_usb_d_dev_in_next>:
{
6a8: b5f0 push {r4, r5, r6, r7, lr}
uint8_t epn = USB_EP_GET_N(ept->ep);
6aa: 270f movs r7, #15
{
6ac: b085 sub sp, #20
6ae: 9101 str r1, [sp, #4]
uint8_t epn = USB_EP_GET_N(ept->ep);
6b0: 7c83 ldrb r3, [r0, #18]
{
6b2: 0004 movs r4, r0
uint8_t epn = USB_EP_GET_N(ept->ep);
6b4: 9302 str r3, [sp, #8]
6b6: 401f ands r7, r3
uint16_t trans_count = isr ? bank[1].PCKSIZE.bit.BYTE_COUNT : 0;
6b8: 2300 movs r3, #0
6ba: 4299 cmp r1, r3
6bc: d005 beq.n 6ca <_usb_d_dev_in_next+0x22>
UsbDeviceDescBank *bank = &prvt_inst.desc_table[epn].DeviceDescBank[0];
6be: 4b4b ldr r3, [pc, #300] ; (7ec <_usb_d_dev_in_next+0x144>)
6c0: 017a lsls r2, r7, #5
6c2: 189b adds r3, r3, r2
uint16_t trans_count = isr ? bank[1].PCKSIZE.bit.BYTE_COUNT : 0;
6c4: 695b ldr r3, [r3, #20]
6c6: 049b lsls r3, r3, #18
6c8: 0c9b lsrs r3, r3, #18
uint16_t last_pkt = trans_count & ((ept->size == 1023) ? ept->size : (ept->size - 1));
6ca: 8a25 ldrh r5, [r4, #16]
6cc: 4a48 ldr r2, [pc, #288] ; (7f0 <_usb_d_dev_in_next+0x148>)
6ce: 46ac mov ip, r5
6d0: 4295 cmp r5, r2
6d2: d002 beq.n 6da <_usb_d_dev_in_next+0x32>
6d4: 1e6a subs r2, r5, #1
6d6: b212 sxth r2, r2
6d8: 4694 mov ip, r2
bool is_ctrl = _usb_d_dev_ep_is_ctrl(ept);
6da: 2207 movs r2, #7
6dc: 7ce0 ldrb r0, [r4, #19]
6de: 4002 ands r2, r0
6e0: 9203 str r2, [sp, #12]
if (isr) {
6e2: 9a01 ldr r2, [sp, #4]
6e4: 2a00 cmp r2, #0
6e6: d004 beq.n 6f2 <_usb_d_dev_in_next+0x4a>
((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPINTFLAG.reg = mask;
6e8: 4942 ldr r1, [pc, #264] ; (7f4 <_usb_d_dev_in_next+0x14c>)
6ea: 017a lsls r2, r7, #5
6ec: 1852 adds r2, r2, r1
6ee: 2102 movs r1, #2
6f0: 71d1 strb r1, [r2, #7]
ept->trans_count += trans_count;
6f2: 68a2 ldr r2, [r4, #8]
6f4: 1899 adds r1, r3, r2
if (ept->trans_count < ept->trans_size) {
6f6: 6862 ldr r2, [r4, #4]
ept->trans_count += trans_count;
6f8: 60a1 str r1, [r4, #8]
if (ept->trans_count < ept->trans_size) {
6fa: 4291 cmp r1, r2
6fc: d240 bcs.n 780 <_usb_d_dev_in_next+0xd8>
memcpy(ept->cache, &ept->trans_buf[ept->trans_count], trans_next);
6fe: 6823 ldr r3, [r4, #0]
trans_next = ept->trans_size - ept->trans_count;
700: 1a52 subs r2, r2, r1
memcpy(ept->cache, &ept->trans_buf[ept->trans_count], trans_next);
702: 1859 adds r1, r3, r1
704: 017b lsls r3, r7, #5
706: 4e39 ldr r6, [pc, #228] ; (7ec <_usb_d_dev_in_next+0x144>)
trans_next = ept->trans_size - ept->trans_count;
708: b292 uxth r2, r2
if (ept->flags.bits.use_cache) {
70a: 9302 str r3, [sp, #8]
70c: 0683 lsls r3, r0, #26
70e: d52c bpl.n 76a <_usb_d_dev_in_next+0xc2>
if (trans_next > ept->size) {
710: 1c2b adds r3, r5, #0
712: 4295 cmp r5, r2
714: d900 bls.n 718 <_usb_d_dev_in_next+0x70>
716: 1c13 adds r3, r2, #0
718: b29d uxth r5, r3
memcpy(ept->cache, &ept->trans_buf[ept->trans_count], trans_next);
71a: 002a movs r2, r5
71c: 4b36 ldr r3, [pc, #216] ; (7f8 <_usb_d_dev_in_next+0x150>)
71e: 68e0 ldr r0, [r4, #12]
720: 4798 blx r3
bank->ADDR.reg = addr;
722: 4b32 ldr r3, [pc, #200] ; (7ec <_usb_d_dev_in_next+0x144>)
_usbd_ep_set_buf(epn, 1, (uint32_t)ept->cache);
724: 68e2 ldr r2, [r4, #12]
bank->ADDR.reg = addr;
726: 0179 lsls r1, r7, #5
728: 185b adds r3, r3, r1
72a: 611a str r2, [r3, #16]
bank->PCKSIZE.bit.BYTE_COUNT = size;
72c: 017b lsls r3, r7, #5
72e: 18f6 adds r6, r6, r3
730: 6973 ldr r3, [r6, #20]
732: 04ad lsls r5, r5, #18
734: 0b9b lsrs r3, r3, #14
736: 0caa lsrs r2, r5, #18
738: 039d lsls r5, r3, #14
73a: 4315 orrs r5, r2
73c: 6175 str r5, [r6, #20]
bank->PCKSIZE.bit.MULTI_PACKET_SIZE = count;
73e: 6973 ldr r3, [r6, #20]
740: 4a2e ldr r2, [pc, #184] ; (7fc <_usb_d_dev_in_next+0x154>)
742: 4013 ands r3, r2
744: 6173 str r3, [r6, #20]
if (!isr) {
746: 9b01 ldr r3, [sp, #4]
748: 2b00 cmp r3, #0
74a: d108 bne.n 75e <_usb_d_dev_in_next+0xb6>
if (is_ctrl) {
74c: 9b03 ldr r3, [sp, #12]
inten = USB_D_BANK1_INT_FLAGS | USB_DEVICE_EPINTFLAG_TRFAIL0;
74e: 224e movs r2, #78 ; 0x4e
if (is_ctrl) {
750: 2b01 cmp r3, #1
752: d000 beq.n 756 <_usb_d_dev_in_next+0xae>
inten = USB_D_BANK1_INT_FLAGS;
754: 3a04 subs r2, #4
((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPINTENSET.reg = mask;
756: 492a ldr r1, [pc, #168] ; (800 <_usb_d_dev_in_next+0x158>)
758: 017b lsls r3, r7, #5
75a: 185b adds r3, r3, r1
75c: 729a strb r2, [r3, #10]
((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPSTATUSSET.reg = mask;
75e: 4a25 ldr r2, [pc, #148] ; (7f4 <_usb_d_dev_in_next+0x14c>)
760: 017b lsls r3, r7, #5
762: 189b adds r3, r3, r2
764: 2280 movs r2, #128 ; 0x80
766: 715a strb r2, [r3, #5]
}
768: e039 b.n 7de <_usb_d_dev_in_next+0x136>
if (trans_next > USB_D_DEV_TRANS_MAX) {
76a: 2380 movs r3, #128 ; 0x80
76c: 1c15 adds r5, r2, #0
76e: 019b lsls r3, r3, #6
770: 429a cmp r2, r3
772: d900 bls.n 776 <_usb_d_dev_in_next+0xce>
774: 1c1d adds r5, r3, #0
bank->ADDR.reg = addr;
776: 017b lsls r3, r7, #5
778: 18f3 adds r3, r6, r3
77a: b2ad uxth r5, r5
77c: 6119 str r1, [r3, #16]
}
77e: e7d5 b.n 72c <_usb_d_dev_in_next+0x84>
} else if (ept->flags.bits.need_zlp) {
780: 2610 movs r6, #16
782: 017a lsls r2, r7, #5
784: 4230 tst r0, r6
786: d00e beq.n 7a6 <_usb_d_dev_in_next+0xfe>
ept->flags.bits.need_zlp = 0;
788: 7ce3 ldrb r3, [r4, #19]
bank->PCKSIZE.bit.MULTI_PACKET_SIZE = count;
78a: 491c ldr r1, [pc, #112] ; (7fc <_usb_d_dev_in_next+0x154>)
ept->flags.bits.need_zlp = 0;
78c: 43b3 bics r3, r6
78e: 74e3 strb r3, [r4, #19]
bank->PCKSIZE.bit.BYTE_COUNT = size;
790: 4b16 ldr r3, [pc, #88] ; (7ec <_usb_d_dev_in_next+0x144>)
792: 189a adds r2, r3, r2
794: 1992 adds r2, r2, r6
796: 6853 ldr r3, [r2, #4]
798: 0b9b lsrs r3, r3, #14
79a: 039b lsls r3, r3, #14
79c: 6053 str r3, [r2, #4]
bank->PCKSIZE.bit.MULTI_PACKET_SIZE = count;
79e: 6853 ldr r3, [r2, #4]
7a0: 400b ands r3, r1
7a2: 6053 str r3, [r2, #4]
goto _in_tx_exec;
7a4: e7cf b.n 746 <_usb_d_dev_in_next+0x9e>
if (is_ctrl) {
7a6: 9803 ldr r0, [sp, #12]
7a8: 2801 cmp r0, #1
7aa: d11a bne.n 7e2 <_usb_d_dev_in_next+0x13a>
((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPINTENCLR.reg = mask;
7ac: 4814 ldr r0, [pc, #80] ; (800 <_usb_d_dev_in_next+0x158>)
7ae: 1812 adds r2, r2, r0
7b0: 204b movs r0, #75 ; 0x4b
7b2: 7250 strb r0, [r2, #9]
if (last_pkt == ept->size) {
7b4: 4662 mov r2, ip
7b6: 4013 ands r3, r2
7b8: 429d cmp r5, r3
7ba: d10c bne.n 7d6 <_usb_d_dev_in_next+0x12e>
ept->flags.bits.is_busy = 0;
7bc: 2540 movs r5, #64 ; 0x40
7be: 7ce3 ldrb r3, [r4, #19]
if (dev_inst.ep_callbacks.more(ept->ep, ept->trans_count)) {
7c0: 9802 ldr r0, [sp, #8]
ept->flags.bits.is_busy = 0;
7c2: 43ab bics r3, r5
7c4: 74e3 strb r3, [r4, #19]
if (dev_inst.ep_callbacks.more(ept->ep, ept->trans_count)) {
7c6: 4b0f ldr r3, [pc, #60] ; (804 <_usb_d_dev_in_next+0x15c>)
7c8: 68db ldr r3, [r3, #12]
7ca: 4798 blx r3
7cc: 2800 cmp r0, #0
7ce: d106 bne.n 7de <_usb_d_dev_in_next+0x136>
ept->flags.bits.is_busy = 1;
7d0: 7ce3 ldrb r3, [r4, #19]
7d2: 432b orrs r3, r5
7d4: 74e3 strb r3, [r4, #19]
_usb_d_dev_trans_done(ept, USB_TRANS_DONE);
7d6: 2100 movs r1, #0
7d8: 0020 movs r0, r4
7da: 4b0b ldr r3, [pc, #44] ; (808 <_usb_d_dev_in_next+0x160>)
7dc: 4798 blx r3
}
7de: b005 add sp, #20
7e0: bdf0 pop {r4, r5, r6, r7, pc}
7e2: 4807 ldr r0, [pc, #28] ; (800 <_usb_d_dev_in_next+0x158>)
7e4: 1812 adds r2, r2, r0
7e6: 204a movs r0, #74 ; 0x4a
7e8: e7e3 b.n 7b2 <_usb_d_dev_in_next+0x10a>
7ea: 46c0 nop ; (mov r8, r8)
7ec: 200000a8 .word 0x200000a8
7f0: 000003ff .word 0x000003ff
7f4: 41005100 .word 0x41005100
7f8: 00002355 .word 0x00002355
7fc: f0003fff .word 0xf0003fff
800: 410050ff .word 0x410050ff
804: 20000108 .word 0x20000108
808: 00000501 .word 0x00000501
0000080c <_usb_d_dev_out_next>:
uint8_t epn = USB_EP_GET_N(ept->ep);
80c: 230f movs r3, #15
{
80e: b5f0 push {r4, r5, r6, r7, lr}
uint8_t epn = USB_EP_GET_N(ept->ep);
810: 7c85 ldrb r5, [r0, #18]
{
812: b085 sub sp, #20
814: 0004 movs r4, r0
816: 000e movs r6, r1
uint8_t epn = USB_EP_GET_N(ept->ep);
818: 401d ands r5, r3
uint16_t trans_size = isr ? bank->PCKSIZE.bit.MULTI_PACKET_SIZE : 0;
81a: 9103 str r1, [sp, #12]
uint16_t last_trans = isr ? bank->PCKSIZE.bit.BYTE_COUNT : 0;
81c: 9101 str r1, [sp, #4]
uint16_t trans_size = isr ? bank->PCKSIZE.bit.MULTI_PACKET_SIZE : 0;
81e: 2900 cmp r1, #0
820: d00a beq.n 838 <_usb_d_dev_out_next+0x2c>
822: 4b61 ldr r3, [pc, #388] ; (9a8 <_usb_d_dev_out_next+0x19c>)
824: 016a lsls r2, r5, #5
826: 189b adds r3, r3, r2
828: 6859 ldr r1, [r3, #4]
82a: 0109 lsls r1, r1, #4
82c: 0c8a lsrs r2, r1, #18
82e: 9203 str r2, [sp, #12]
uint16_t last_trans = isr ? bank->PCKSIZE.bit.BYTE_COUNT : 0;
830: 6859 ldr r1, [r3, #4]
832: 0489 lsls r1, r1, #18
834: 0c8b lsrs r3, r1, #18
836: 9301 str r3, [sp, #4]
uint16_t size_mask = (ept->size == 1023) ? 1023 : (ept->size - 1);
838: 8a23 ldrh r3, [r4, #16]
83a: 9300 str r3, [sp, #0]
83c: 9a00 ldr r2, [sp, #0]
83e: 4b5b ldr r3, [pc, #364] ; (9ac <_usb_d_dev_out_next+0x1a0>)
840: 429a cmp r2, r3
842: d003 beq.n 84c <_usb_d_dev_out_next+0x40>
844: 0013 movs r3, r2
846: 3b01 subs r3, #1
848: b29b uxth r3, r3
84a: 9300 str r3, [sp, #0]
uint16_t last_pkt = last_trans & size_mask;
84c: 9b01 ldr r3, [sp, #4]
84e: 9f00 ldr r7, [sp, #0]
bool is_ctrl = _usb_d_dev_ep_is_ctrl(ept);
850: 7ce2 ldrb r2, [r4, #19]
uint16_t last_pkt = last_trans & size_mask;
852: 401f ands r7, r3
bool is_ctrl = _usb_d_dev_ep_is_ctrl(ept);
854: 2307 movs r3, #7
856: 4013 ands r3, r2
858: 9302 str r3, [sp, #8]
if (isr) {
85a: 2e00 cmp r6, #0
85c: d004 beq.n 868 <_usb_d_dev_out_next+0x5c>
((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPINTFLAG.reg = mask;
85e: 4954 ldr r1, [pc, #336] ; (9b0 <_usb_d_dev_out_next+0x1a4>)
860: 016b lsls r3, r5, #5
862: 185b adds r3, r3, r1
864: 2101 movs r1, #1
866: 71d9 strb r1, [r3, #7]
if (ept->flags.bits.use_cache && ept->trans_size) {
868: 0693 lsls r3, r2, #26
86a: d50f bpl.n 88c <_usb_d_dev_out_next+0x80>
86c: 6863 ldr r3, [r4, #4]
86e: 2b00 cmp r3, #0
870: d00c beq.n 88c <_usb_d_dev_out_next+0x80>
uint16_t buf_remain = ept->trans_size - ept->trans_count;
872: 68a2 ldr r2, [r4, #8]
memcpy(&ept->trans_buf[ept->trans_count], ept->cache, (buf_remain > last_pkt) ? last_pkt : buf_remain);
874: 6821 ldr r1, [r4, #0]
uint16_t buf_remain = ept->trans_size - ept->trans_count;
876: 1a9b subs r3, r3, r2
memcpy(&ept->trans_buf[ept->trans_count], ept->cache, (buf_remain > last_pkt) ? last_pkt : buf_remain);
878: 1888 adds r0, r1, r2
87a: 1c1a adds r2, r3, #0
87c: b29b uxth r3, r3
87e: 42bb cmp r3, r7
880: d900 bls.n 884 <_usb_d_dev_out_next+0x78>
882: 1c3a adds r2, r7, #0
884: 68e1 ldr r1, [r4, #12]
886: 4b4b ldr r3, [pc, #300] ; (9b4 <_usb_d_dev_out_next+0x1a8>)
888: b292 uxth r2, r2
88a: 4798 blx r3
if (ept->trans_size == 0 && ept->flags.bits.need_zlp) {
88c: 6863 ldr r3, [r4, #4]
88e: 016a lsls r2, r5, #5
890: 4694 mov ip, r2
892: 2b00 cmp r3, #0
894: d12c bne.n 8f0 <_usb_d_dev_out_next+0xe4>
896: 7ce2 ldrb r2, [r4, #19]
898: 06d1 lsls r1, r2, #27
89a: d529 bpl.n 8f0 <_usb_d_dev_out_next+0xe4>
ept->flags.bits.need_zlp = 0;
89c: 3330 adds r3, #48 ; 0x30
89e: 439a bics r2, r3
8a0: 3b10 subs r3, #16
8a2: 431a orrs r2, r3
8a4: 74e2 strb r2, [r4, #19]
bank->ADDR.reg = addr;
8a6: 4662 mov r2, ip
8a8: 68e1 ldr r1, [r4, #12]
8aa: 4b3f ldr r3, [pc, #252] ; (9a8 <_usb_d_dev_out_next+0x19c>)
bank->PCKSIZE.bit.MULTI_PACKET_SIZE = size;
8ac: 4842 ldr r0, [pc, #264] ; (9b8 <_usb_d_dev_out_next+0x1ac>)
bank->ADDR.reg = addr;
8ae: 5099 str r1, [r3, r2]
bank->PCKSIZE.bit.MULTI_PACKET_SIZE = size;
8b0: 8a21 ldrh r1, [r4, #16]
8b2: 4463 add r3, ip
8b4: 685a ldr r2, [r3, #4]
8b6: 0489 lsls r1, r1, #18
8b8: 0909 lsrs r1, r1, #4
8ba: 4002 ands r2, r0
8bc: 430a orrs r2, r1
8be: 605a str r2, [r3, #4]
bank->PCKSIZE.bit.BYTE_COUNT = count;
8c0: 685a ldr r2, [r3, #4]
8c2: 0b92 lsrs r2, r2, #14
8c4: 0392 lsls r2, r2, #14
8c6: 605a str r2, [r3, #4]
if (!isr) {
8c8: 2e00 cmp r6, #0
8ca: d10b bne.n 8e4 <_usb_d_dev_out_next+0xd8>
if (is_ctrl) {
8cc: 9902 ldr r1, [sp, #8]
inten = USB_D_BANK0_INT_FLAGS;
8ce: 2225 movs r2, #37 ; 0x25
8d0: 016b lsls r3, r5, #5
if (is_ctrl) {
8d2: 2901 cmp r1, #1
8d4: d103 bne.n 8de <_usb_d_dev_out_next+0xd2>
bank->STATUS_BK.reg = 0;
8d6: 4a34 ldr r2, [pc, #208] ; (9a8 <_usb_d_dev_out_next+0x19c>)
8d8: 18d2 adds r2, r2, r3
8da: 7696 strb r6, [r2, #26]
inten = USB_D_BANK0_INT_FLAGS | USB_DEVICE_EPINTFLAG_TRFAIL1;
8dc: 222d movs r2, #45 ; 0x2d
((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPINTENSET.reg = mask;
8de: 4937 ldr r1, [pc, #220] ; (9bc <_usb_d_dev_out_next+0x1b0>)
8e0: 185b adds r3, r3, r1
8e2: 729a strb r2, [r3, #10]
((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPSTATUSCLR.reg = mask;
8e4: 4b32 ldr r3, [pc, #200] ; (9b0 <_usb_d_dev_out_next+0x1a4>)
8e6: 016d lsls r5, r5, #5
8e8: 18ed adds r5, r5, r3
8ea: 2340 movs r3, #64 ; 0x40
8ec: 712b strb r3, [r5, #4]
}
8ee: e01d b.n 92c <_usb_d_dev_out_next+0x120>
ept->trans_count += last_trans;
8f0: 68a1 ldr r1, [r4, #8]
} else if (isr && last_pkt < ept->size) {
8f2: 2e00 cmp r6, #0
8f4: d01c beq.n 930 <_usb_d_dev_out_next+0x124>
8f6: 8a22 ldrh r2, [r4, #16]
8f8: 42ba cmp r2, r7
8fa: d919 bls.n 930 <_usb_d_dev_out_next+0x124>
ept->flags.bits.need_zlp = 0;
8fc: 2210 movs r2, #16
8fe: 7ce3 ldrb r3, [r4, #19]
900: 4393 bics r3, r2
902: 74e3 strb r3, [r4, #19]
ept->trans_count += last_trans;
904: 9b01 ldr r3, [sp, #4]
906: 1859 adds r1, r3, r1
908: 60a1 str r1, [r4, #8]
if (is_ctrl) {
90a: 9a02 ldr r2, [sp, #8]
90c: 016b lsls r3, r5, #5
90e: 2a01 cmp r2, #1
910: d146 bne.n 9a0 <_usb_d_dev_out_next+0x194>
((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPINTENCLR.reg = mask;
912: 4a2a ldr r2, [pc, #168] ; (9bc <_usb_d_dev_out_next+0x1b0>)
914: 189b adds r3, r3, r2
916: 222d movs r2, #45 ; 0x2d
918: 725a strb r2, [r3, #9]
if (0 == epn) {
91a: 2d00 cmp r5, #0
91c: d102 bne.n 924 <_usb_d_dev_out_next+0x118>
bank->ADDR.reg = addr;
91e: 4b22 ldr r3, [pc, #136] ; (9a8 <_usb_d_dev_out_next+0x19c>)
920: 68e2 ldr r2, [r4, #12]
922: 601a str r2, [r3, #0]
_usb_d_dev_trans_done(ept, USB_TRANS_DONE);
924: 2100 movs r1, #0
926: 0020 movs r0, r4
928: 4b25 ldr r3, [pc, #148] ; (9c0 <_usb_d_dev_out_next+0x1b4>)
92a: 4798 blx r3
}
92c: b005 add sp, #20
92e: bdf0 pop {r4, r5, r6, r7, pc}
ept->trans_count += trans_size;
930: 9a03 ldr r2, [sp, #12]
932: 1851 adds r1, r2, r1
934: 60a1 str r1, [r4, #8]
if (ept->trans_count < ept->trans_size) {
936: 428b cmp r3, r1
938: d9e7 bls.n 90a <_usb_d_dev_out_next+0xfe>
if (ept->flags.bits.use_cache) {
93a: 2020 movs r0, #32
93c: 7ce2 ldrb r2, [r4, #19]
trans_next = ept->trans_size - ept->trans_count;
93e: 1a5b subs r3, r3, r1
_usbd_ep_set_out_trans(epn, 0, ept->size, 0);
940: 8a27 ldrh r7, [r4, #16]
trans_next = ept->trans_size - ept->trans_count;
942: b29b uxth r3, r3
if (ept->flags.bits.use_cache) {
944: 4202 tst r2, r0
946: d016 beq.n 976 <_usb_d_dev_out_next+0x16a>
if (trans_next > ept->size) {
948: 1c39 adds r1, r7, #0
94a: 429f cmp r7, r3
94c: d900 bls.n 950 <_usb_d_dev_out_next+0x144>
94e: 1c19 adds r1, r3, #0
_usbd_ep_set_buf(epn, 0, (uint32_t)ept->cache);
950: 68e0 ldr r0, [r4, #12]
bank->ADDR.reg = addr;
952: 4a15 ldr r2, [pc, #84] ; (9a8 <_usb_d_dev_out_next+0x19c>)
954: b28b uxth r3, r1
956: 0169 lsls r1, r5, #5
958: 5050 str r0, [r2, r1]
bank->PCKSIZE.bit.MULTI_PACKET_SIZE = size;
95a: 4a13 ldr r2, [pc, #76] ; (9a8 <_usb_d_dev_out_next+0x19c>)
95c: 4816 ldr r0, [pc, #88] ; (9b8 <_usb_d_dev_out_next+0x1ac>)
95e: 4462 add r2, ip
960: 6851 ldr r1, [r2, #4]
962: 049b lsls r3, r3, #18
964: 091b lsrs r3, r3, #4
966: 4001 ands r1, r0
968: 430b orrs r3, r1
96a: 6053 str r3, [r2, #4]
bank->PCKSIZE.bit.BYTE_COUNT = count;
96c: 6853 ldr r3, [r2, #4]
96e: 0b9b lsrs r3, r3, #14
970: 039b lsls r3, r3, #14
972: 6053 str r3, [r2, #4]
goto _out_rx_exec;
974: e7a8 b.n 8c8 <_usb_d_dev_out_next+0xbc>
if (trans_next > ept->size) {
976: 429f cmp r7, r3
978: d20b bcs.n 992 <_usb_d_dev_out_next+0x186>
if (trans_next > USB_D_DEV_TRANS_MAX) {
97a: 2080 movs r0, #128 ; 0x80
97c: 0180 lsls r0, r0, #6
97e: 4283 cmp r3, r0
980: d80c bhi.n 99c <_usb_d_dev_out_next+0x190>
trans_next -= trans_next & size_mask;
982: 9a00 ldr r2, [sp, #0]
984: 4393 bics r3, r2
_usbd_ep_set_buf(epn, 0, (uint32_t)&ept->trans_buf[ept->trans_count]);
986: 6820 ldr r0, [r4, #0]
bank->ADDR.reg = addr;
988: 4a07 ldr r2, [pc, #28] ; (9a8 <_usb_d_dev_out_next+0x19c>)
_usbd_ep_set_buf(epn, 0, (uint32_t)&ept->trans_buf[ept->trans_count]);
98a: 1841 adds r1, r0, r1
bank->ADDR.reg = addr;
98c: 0168 lsls r0, r5, #5
98e: 5011 str r1, [r2, r0]
}
990: e7e3 b.n 95a <_usb_d_dev_out_next+0x14e>
} else if (trans_next < ept->size) {
992: 429f cmp r7, r3
994: d9f7 bls.n 986 <_usb_d_dev_out_next+0x17a>
ept->flags.bits.use_cache = 1;
996: 4310 orrs r0, r2
998: 74e0 strb r0, [r4, #19]
99a: e7f4 b.n 986 <_usb_d_dev_out_next+0x17a>
trans_next = USB_D_DEV_TRANS_MAX;
99c: 0003 movs r3, r0
99e: e7f2 b.n 986 <_usb_d_dev_out_next+0x17a>
9a0: 4a06 ldr r2, [pc, #24] ; (9bc <_usb_d_dev_out_next+0x1b0>)
9a2: 189b adds r3, r3, r2
9a4: 2225 movs r2, #37 ; 0x25
9a6: e7b7 b.n 918 <_usb_d_dev_out_next+0x10c>
9a8: 200000a8 .word 0x200000a8
9ac: 000003ff .word 0x000003ff
9b0: 41005100 .word 0x41005100
9b4: 00002355 .word 0x00002355
9b8: f0003fff .word 0xf0003fff
9bc: 410050ff .word 0x410050ff
9c0: 00000501 .word 0x00000501
000009c4 <_usbd_ep_pcksize_size>:
: ((n > 256) ? 6 : ((n > 128) ? 5 : ((n > 64) ? 4 : ((n > 32) ? 3 : ((n > 16) ? 2 : ((n > 8) ? 1 : 0)))))));
9c4: 2380 movs r3, #128 ; 0x80
{
9c6: 0002 movs r2, r0
: ((n > 256) ? 6 : ((n > 128) ? 5 : ((n > 64) ? 4 : ((n > 32) ? 3 : ((n > 16) ? 2 : ((n > 8) ? 1 : 0)))))));
9c8: 009b lsls r3, r3, #2
9ca: 2007 movs r0, #7
9cc: 429a cmp r2, r3
9ce: d814 bhi.n 9fa <_usbd_ep_pcksize_size+0x36>
9d0: 3b01 subs r3, #1
9d2: 3bff subs r3, #255 ; 0xff
9d4: 3801 subs r0, #1
9d6: 429a cmp r2, r3
9d8: d80f bhi.n 9fa <_usbd_ep_pcksize_size+0x36>
9da: 3801 subs r0, #1
9dc: 2a80 cmp r2, #128 ; 0x80
9de: d80c bhi.n 9fa <_usbd_ep_pcksize_size+0x36>
9e0: 3801 subs r0, #1
9e2: 2a40 cmp r2, #64 ; 0x40
9e4: d809 bhi.n 9fa <_usbd_ep_pcksize_size+0x36>
9e6: 3801 subs r0, #1
9e8: 2a20 cmp r2, #32
9ea: d806 bhi.n 9fa <_usbd_ep_pcksize_size+0x36>
9ec: 3801 subs r0, #1
9ee: 2a10 cmp r2, #16
9f0: d803 bhi.n 9fa <_usbd_ep_pcksize_size+0x36>
9f2: 3006 adds r0, #6
9f4: 4290 cmp r0, r2
9f6: 4180 sbcs r0, r0
9f8: 4240 negs r0, r0
}
9fa: 4770 bx lr
000009fc <_usb_d_dev_init>:
{
9fc: b510 push {r4, lr}
return ((Usb *)hw)->DEVICE.SYNCBUSY.reg & reg;
9fe: 4c2a ldr r4, [pc, #168] ; (aa8 <_usb_d_dev_init+0xac>)
a00: 78a3 ldrb r3, [r4, #2]
if (!hri_usbdevice_is_syncing(hw, USB_SYNCBUSY_SWRST)) {
a02: 07db lsls r3, r3, #31
a04: d418 bmi.n a38 <_usb_d_dev_init+0x3c>
while (((Usb *)hw)->DEVICE.SYNCBUSY.reg & reg) {
a06: 2303 movs r3, #3
a08: 78a2 ldrb r2, [r4, #2]
a0a: 421a tst r2, r3
a0c: d1fc bne.n a08 <_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;
a0e: 2202 movs r2, #2
tmp = ((Usb *)hw)->HOST.CTRLA.reg;
a10: 7823 ldrb r3, [r4, #0]
if (hri_usbdevice_get_CTRLA_reg(hw, USB_CTRLA_ENABLE)) {
a12: 4213 tst r3, r2
a14: d00a beq.n a2c <_usb_d_dev_init+0x30>
((Usb *)hw)->HOST.CTRLA.reg &= ~USB_CTRLA_ENABLE;
a16: 7823 ldrb r3, [r4, #0]
a18: 4393 bics r3, r2
a1a: 7023 strb r3, [r4, #0]
while (((Usb *)hw)->DEVICE.SYNCBUSY.reg & reg) {
a1c: 2303 movs r3, #3
a1e: 78a2 ldrb r2, [r4, #2]
a20: 421a tst r2, r3
a22: d1fc bne.n a1e <_usb_d_dev_init+0x22>
a24: 2302 movs r3, #2
a26: 78a2 ldrb r2, [r4, #2]
a28: 421a tst r2, r3
a2a: d1fc bne.n a26 <_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;
a2c: 2301 movs r3, #1
a2e: 7023 strb r3, [r4, #0]
while (((Usb *)hw)->DEVICE.SYNCBUSY.reg & reg) {
a30: 3302 adds r3, #2
a32: 78a2 ldrb r2, [r4, #2]
a34: 421a tst r2, r3
a36: d1fc bne.n a32 <_usb_d_dev_init+0x36>
a38: 2301 movs r3, #1
a3a: 78a2 ldrb r2, [r4, #2]
a3c: 421a tst r2, r3
a3e: d1fc bne.n a3a <_usb_d_dev_init+0x3e>
dev_inst.callbacks.sof = (_usb_d_dev_sof_cb_t)_dummy_func_no_return;
a40: 4b1a ldr r3, [pc, #104] ; (aac <_usb_d_dev_init+0xb0>)
a42: 4a1b ldr r2, [pc, #108] ; (ab0 <_usb_d_dev_init+0xb4>)
a44: 601a str r2, [r3, #0]
dev_inst.callbacks.event = (_usb_d_dev_event_cb_t)_dummy_func_no_return;
a46: 605a str r2, [r3, #4]
dev_inst.ep_callbacks.setup = (_usb_d_dev_ep_cb_setup_t)_dummy_func_no_return;
a48: 609a str r2, [r3, #8]
dev_inst.ep_callbacks.more = (_usb_d_dev_ep_cb_more_t)_dummy_func_no_return;
a4a: 60da str r2, [r3, #12]
dev_inst.ep_callbacks.done = (_usb_d_dev_ep_cb_done_t)_dummy_func_no_return;
a4c: 611a str r2, [r3, #16]
_usb_d_dev_reset_epts();
a4e: 4b19 ldr r3, [pc, #100] ; (ab4 <_usb_d_dev_init+0xb8>)
a50: 4798 blx r3
uint32_t pad_transn
a52: 201f movs r0, #31
= (*((uint32_t *)(NVMCTRL_OTP4) + (NVM_USB_PAD_TRANSN_POS / 32)) >> (NVM_USB_PAD_TRANSN_POS % 32))
a54: 4b18 ldr r3, [pc, #96] ; (ab8 <_usb_d_dev_init+0xbc>)
a56: 681a ldr r2, [r3, #0]
a58: 0b53 lsrs r3, r2, #13
= (*((uint32_t *)(NVMCTRL_OTP4) + (NVM_USB_PAD_TRANSP_POS / 32)) >> (NVM_USB_PAD_TRANSP_POS % 32))
a5a: 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))
a5c: 0192 lsls r2, r2, #6
uint32_t pad_transn
a5e: 4003 ands r3, r0
uint32_t pad_transp
a60: 4001 ands r1, r0
uint32_t pad_trim = (*((uint32_t *)(NVMCTRL_OTP4) + (NVM_USB_PAD_TRIM_POS / 32)) >> (NVM_USB_PAD_TRIM_POS % 32))
a62: 0f52 lsrs r2, r2, #29
if (pad_transn == 0x1F) {
a64: 4283 cmp r3, r0
a66: d100 bne.n a6a <_usb_d_dev_init+0x6e>
pad_transn = 5;
a68: 2305 movs r3, #5
if (pad_transp == 0x1F) {
a6a: 291f cmp r1, #31
a6c: d100 bne.n a70 <_usb_d_dev_init+0x74>
pad_transp = 29;
a6e: 3902 subs r1, #2
if (pad_trim == 0x7) {
a70: 2a07 cmp r2, #7
a72: d100 bne.n a76 <_usb_d_dev_init+0x7a>
pad_trim = 5;
a74: 3a02 subs r2, #2
hw->DEVICE.PADCAL.reg = USB_PADCAL_TRANSN(pad_transn) | USB_PADCAL_TRANSP(pad_transp) | USB_PADCAL_TRIM(pad_trim);
a76: 019b lsls r3, r3, #6
a78: 430b orrs r3, r1
a7a: 0312 lsls r2, r2, #12
a7c: 4313 orrs r3, r2
a7e: 8523 strh r3, [r4, #40] ; 0x28
hw->DEVICE.QOSCTRL.bit.CQOS = 3;
a80: 2303 movs r3, #3
a82: 78e2 ldrb r2, [r4, #3]
a84: 431a orrs r2, r3
a86: 70e2 strb r2, [r4, #3]
hw->DEVICE.QOSCTRL.bit.DQOS = 3;
a88: 220c movs r2, #12
a8a: 78e1 ldrb r1, [r4, #3]
a8c: 430a orrs r2, r1
a8e: 70e2 strb r2, [r4, #3]
((Usb *)hw)->HOST.CTRLA.reg = data;
a90: 2204 movs r2, #4
a92: 7022 strb r2, [r4, #0]
while (((Usb *)hw)->DEVICE.SYNCBUSY.reg & reg) {
a94: 78a2 ldrb r2, [r4, #2]
a96: 0010 movs r0, r2
a98: 4018 ands r0, r3
a9a: 421a tst r2, r3
a9c: d1fa bne.n a94 <_usb_d_dev_init+0x98>
hri_usbdevice_write_DESCADD_reg(hw, (uint32_t)prvt_inst.desc_table);
a9e: 4b07 ldr r3, [pc, #28] ; (abc <_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;
aa0: 6263 str r3, [r4, #36] ; 0x24
((Usb *)hw)->DEVICE.CTRLB.reg = data;
aa2: 2301 movs r3, #1
aa4: 8123 strh r3, [r4, #8]
}
aa6: bd10 pop {r4, pc}
aa8: 41005000 .word 0x41005000
aac: 20000108 .word 0x20000108
ab0: 00000415 .word 0x00000415
ab4: 0000066d .word 0x0000066d
ab8: 00806024 .word 0x00806024
abc: 200000a8 .word 0x200000a8
00000ac0 <_usb_d_dev_enable>:
tmp &= mask;
ac0: 2203 movs r2, #3
tmp = ((Usb *)hw)->HOST.SYNCBUSY.reg;
ac2: 4b0e ldr r3, [pc, #56] ; (afc <_usb_d_dev_enable+0x3c>)
ac4: 7899 ldrb r1, [r3, #2]
if (hri_usbdevice_get_SYNCBUSY_reg(hw, (USB_SYNCBUSY_ENABLE | USB_SYNCBUSY_SWRST))) {
ac6: 4211 tst r1, r2
ac8: d114 bne.n af4 <_usb_d_dev_enable+0x34>
while (((Usb *)hw)->DEVICE.SYNCBUSY.reg & reg) {
aca: 7899 ldrb r1, [r3, #2]
acc: 4211 tst r1, r2
ace: d1fc bne.n aca <_usb_d_dev_enable+0xa>
if ((ctrla & USB_CTRLA_ENABLE) == 0) {
ad0: 2202 movs r2, #2
return ((Usb *)hw)->HOST.CTRLA.reg;
ad2: 7819 ldrb r1, [r3, #0]
ad4: b2c8 uxtb r0, r1
ad6: 4211 tst r1, r2
ad8: d105 bne.n ae6 <_usb_d_dev_enable+0x26>
hri_usbdevice_write_CTRLA_reg(hw, ctrla | USB_CTRLA_ENABLE);
ada: 4302 orrs r2, r0
((Usb *)hw)->HOST.CTRLA.reg = data;
adc: 701a strb r2, [r3, #0]
while (((Usb *)hw)->DEVICE.SYNCBUSY.reg & reg) {
ade: 2203 movs r2, #3
ae0: 7899 ldrb r1, [r3, #2]
ae2: 4211 tst r1, r2
ae4: d1fc bne.n ae0 <_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));
ae6: 2180 movs r1, #128 ; 0x80
return ERR_NONE;
ae8: 2000 movs r0, #0
aea: 4a05 ldr r2, [pc, #20] ; (b00 <_usb_d_dev_enable+0x40>)
aec: 6011 str r1, [r2, #0]
((Usb *)hw)->DEVICE.INTENSET.reg = mask;
aee: 4a05 ldr r2, [pc, #20] ; (b04 <_usb_d_dev_enable+0x44>)
af0: 831a strh r2, [r3, #24]
}
af2: 4770 bx lr
return -USB_ERR_DENIED;
af4: 2011 movs r0, #17
af6: 4240 negs r0, r0
af8: e7fb b.n af2 <_usb_d_dev_enable+0x32>
afa: 46c0 nop ; (mov r8, r8)
afc: 41005000 .word 0x41005000
b00: e000e100 .word 0xe000e100
b04: 0000028d .word 0x0000028d
00000b08 <_usb_d_dev_attach>:
((Usb *)hw)->DEVICE.CTRLB.reg &= ~USB_DEVICE_CTRLB_DETACH;
b08: 2101 movs r1, #1
b0a: 4a02 ldr r2, [pc, #8] ; (b14 <_usb_d_dev_attach+0xc>)
b0c: 8913 ldrh r3, [r2, #8]
b0e: 438b bics r3, r1
b10: 8113 strh r3, [r2, #8]
}
b12: 4770 bx lr
b14: 41005000 .word 0x41005000
00000b18 <_usb_d_dev_set_address>:
hri_usbdevice_write_DADD_reg(USB, USB_DEVICE_DADD_ADDEN | USB_DEVICE_DADD_DADD(addr));
b18: 2380 movs r3, #128 ; 0x80
b1a: 4318 orrs r0, r3
((Usb *)hw)->DEVICE.DADD.reg = data;
b1c: 4b01 ldr r3, [pc, #4] ; (b24 <_usb_d_dev_set_address+0xc>)
b1e: 7298 strb r0, [r3, #10]
}
b20: 4770 bx lr
b22: 46c0 nop ; (mov r8, r8)
b24: 41005000 .word 0x41005000
00000b28 <_usb_d_dev_ep_init>:
{
b28: b5f7 push {r0, r1, r2, r4, r5, r6, r7, lr}
uint8_t epn = USB_EP_GET_N(ep);
b2a: 240f movs r4, #15
b2c: 4004 ands r4, r0
struct _usb_d_dev_ep *ept = _usb_d_dev_ept(epn, dir);
b2e: 4b2e ldr r3, [pc, #184] ; (be8 <_usb_d_dev_ep_init+0xc0>)
{
b30: 9100 str r1, [sp, #0]
b32: 0006 movs r6, r0
struct _usb_d_dev_ep *ept = _usb_d_dev_ept(epn, dir);
b34: 09c1 lsrs r1, r0, #7
b36: b247 sxtb r7, r0
b38: 0020 movs r0, r4
{
b3a: 9201 str r2, [sp, #4]
struct _usb_d_dev_ep *ept = _usb_d_dev_ept(epn, dir);
b3c: 4798 blx r3
uint8_t ep_type = attr & USB_EP_XTYPE_MASK;
b3e: 2103 movs r1, #3
b40: 9b00 ldr r3, [sp, #0]
struct _usb_d_dev_ep *ept = _usb_d_dev_ept(epn, dir);
b42: 0005 movs r5, r0
uint8_t ep_type = attr & USB_EP_XTYPE_MASK;
b44: 400b ands r3, r1
b46: 9300 str r3, [sp, #0]
if (epn > CONF_USB_D_MAX_EP_N) {
b48: 2c02 cmp r4, #2
b4a: d844 bhi.n bd6 <_usb_d_dev_ep_init+0xae>
if (ept->ep != 0xFF) {
b4c: 7c83 ldrb r3, [r0, #18]
b4e: 2bff cmp r3, #255 ; 0xff
b50: d144 bne.n bdc <_usb_d_dev_ep_init+0xb4>
if (ep_type == USB_EP_XTYPE_CTRL) {
b52: 9b00 ldr r3, [sp, #0]
b54: 2b00 cmp r3, #0
b56: d110 bne.n b7a <_usb_d_dev_ep_init+0x52>
struct _usb_d_dev_ep *ept_in = _usb_d_dev_ept(epn, !dir);
b58: 43f9 mvns r1, r7
b5a: b2c9 uxtb r1, r1
b5c: 4b22 ldr r3, [pc, #136] ; (be8 <_usb_d_dev_ep_init+0xc0>)
b5e: 0020 movs r0, r4
b60: 09c9 lsrs r1, r1, #7
b62: 4798 blx r3
if (ept_in->ep != 0xFF) {
b64: 7c83 ldrb r3, [r0, #18]
b66: 2bff cmp r3, #255 ; 0xff
b68: d138 bne.n bdc <_usb_d_dev_ep_init+0xb4>
if (pcfg->cache == NULL) {
b6a: 3bf3 subs r3, #243 ; 0xf3
b6c: 4363 muls r3, r4
b6e: 4a1f ldr r2, [pc, #124] ; (bec <_usb_d_dev_ep_init+0xc4>)
b70: 589b ldr r3, [r3, r2]
b72: 2b00 cmp r3, #0
b74: d134 bne.n be0 <_usb_d_dev_ep_init+0xb8>
return -USB_ERR_FUNC;
b76: 2013 movs r0, #19
b78: e02e b.n bd8 <_usb_d_dev_ep_init+0xb0>
if ((dir ? pcfg->i_cache : pcfg->cache) && ((dir ? pcfg->i_size : pcfg->size) < max_pkt_siz)) {
b7a: 2f00 cmp r7, #0
b7c: da14 bge.n ba8 <_usb_d_dev_ep_init+0x80>
b7e: 220c movs r2, #12
b80: 4362 muls r2, r4
b82: 4b1a ldr r3, [pc, #104] ; (bec <_usb_d_dev_ep_init+0xc4>)
b84: 189b adds r3, r3, r2
b86: 685a ldr r2, [r3, #4]
b88: 2a00 cmp r2, #0
b8a: d119 bne.n bc0 <_usb_d_dev_ep_init+0x98>
ept->cache = (uint8_t *)(dir ? pcfg->i_cache : pcfg->cache);
b8c: 230c movs r3, #12
b8e: 4363 muls r3, r4
b90: 4c16 ldr r4, [pc, #88] ; (bec <_usb_d_dev_ep_init+0xc4>)
b92: 18e4 adds r4, r4, r3
b94: 6863 ldr r3, [r4, #4]
return USB_OK;
b96: 2000 movs r0, #0
ept->flags.u8 = (ep_type + 1);
b98: 9900 ldr r1, [sp, #0]
ept->cache = (uint8_t *)(dir ? pcfg->i_cache : pcfg->cache);
b9a: 60eb str r3, [r5, #12]
ept->size = max_pkt_siz;
b9c: 9b01 ldr r3, [sp, #4]
ept->flags.u8 = (ep_type + 1);
b9e: 3101 adds r1, #1
ept->size = max_pkt_siz;
ba0: 822b strh r3, [r5, #16]
ept->flags.u8 = (ep_type + 1);
ba2: 74e9 strb r1, [r5, #19]
ept->ep = ep;
ba4: 74ae strb r6, [r5, #18]
}
ba6: 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)) {
ba8: 230c movs r3, #12
baa: 4363 muls r3, r4
bac: 4a0f ldr r2, [pc, #60] ; (bec <_usb_d_dev_ep_init+0xc4>)
bae: 589b ldr r3, [r3, r2]
bb0: 2b00 cmp r3, #0
bb2: d00b beq.n bcc <_usb_d_dev_ep_init+0xa4>
bb4: 220c movs r2, #12
bb6: 4362 muls r2, r4
bb8: 4b0c ldr r3, [pc, #48] ; (bec <_usb_d_dev_ep_init+0xc4>)
bba: 189b adds r3, r3, r2
bbc: 891b ldrh r3, [r3, #8]
bbe: e000 b.n bc2 <_usb_d_dev_ep_init+0x9a>
bc0: 895b ldrh r3, [r3, #10]
bc2: 9a01 ldr r2, [sp, #4]
bc4: 429a cmp r2, r3
bc6: dcd6 bgt.n b76 <_usb_d_dev_ep_init+0x4e>
ept->cache = (uint8_t *)(dir ? pcfg->i_cache : pcfg->cache);
bc8: 2f00 cmp r7, #0
bca: dbdf blt.n b8c <_usb_d_dev_ep_init+0x64>
bcc: 230c movs r3, #12
bce: 435c muls r4, r3
bd0: 4b06 ldr r3, [pc, #24] ; (bec <_usb_d_dev_ep_init+0xc4>)
bd2: 58e3 ldr r3, [r4, r3]
bd4: e7df b.n b96 <_usb_d_dev_ep_init+0x6e>
return -USB_ERR_PARAM;
bd6: 2012 movs r0, #18
return -USB_ERR_FUNC;
bd8: 4240 negs r0, r0
bda: e7e4 b.n ba6 <_usb_d_dev_ep_init+0x7e>
return -USB_ERR_REDO;
bdc: 2014 movs r0, #20
bde: e7fb b.n bd8 <_usb_d_dev_ep_init+0xb0>
if ((dir ? pcfg->i_cache : pcfg->cache) && ((dir ? pcfg->i_size : pcfg->size) < max_pkt_siz)) {
be0: 2f00 cmp r7, #0
be2: dae7 bge.n bb4 <_usb_d_dev_ep_init+0x8c>
be4: e7cb b.n b7e <_usb_d_dev_ep_init+0x56>
be6: 46c0 nop ; (mov r8, r8)
be8: 0000043d .word 0x0000043d
bec: 00002378 .word 0x00002378
00000bf0 <_usb_d_dev_ep_deinit>:
{
bf0: b5f7 push {r0, r1, r2, r4, r5, r6, r7, lr}
uint8_t epn = USB_EP_GET_N(ep);
bf2: 250f movs r5, #15
{
bf4: 0004 movs r4, r0
uint8_t epn = USB_EP_GET_N(ep);
bf6: 4005 ands r5, r0
if (epn > CONF_USB_D_MAX_EP_N || !_usb_d_dev_ep_is_used(ept)) {
bf8: 2d02 cmp r5, #2
bfa: d81a bhi.n c32 <_usb_d_dev_ep_deinit+0x42>
bfc: b243 sxtb r3, r0
bool dir = USB_EP_GET_DIR(ep);
bfe: 09c7 lsrs r7, r0, #7
c00: 9301 str r3, [sp, #4]
struct _usb_d_dev_ep *ept = _usb_d_dev_ept(epn, dir);
c02: 0039 movs r1, r7
c04: 4b14 ldr r3, [pc, #80] ; (c58 <_usb_d_dev_ep_deinit+0x68>)
c06: 0028 movs r0, r5
c08: 4798 blx r3
if (epn > CONF_USB_D_MAX_EP_N || !_usb_d_dev_ep_is_used(ept)) {
c0a: 7c83 ldrb r3, [r0, #18]
struct _usb_d_dev_ep *ept = _usb_d_dev_ept(epn, dir);
c0c: 0006 movs r6, r0
if (epn > CONF_USB_D_MAX_EP_N || !_usb_d_dev_ep_is_used(ept)) {
c0e: 2bff cmp r3, #255 ; 0xff
c10: d00f beq.n c32 <_usb_d_dev_ep_deinit+0x42>
_usb_d_dev_trans_stop(ept, dir, USB_TRANS_RESET);
c12: 2203 movs r2, #3
c14: 4b11 ldr r3, [pc, #68] ; (c5c <_usb_d_dev_ep_deinit+0x6c>)
c16: 0039 movs r1, r7
c18: 4798 blx r3
if (_usb_d_dev_ep_is_ctrl(ept)) {
c1a: 2207 movs r2, #7
c1c: 7cf3 ldrb r3, [r6, #19]
c1e: 4013 ands r3, r2
c20: 2b01 cmp r3, #1
c22: d107 bne.n c34 <_usb_d_dev_ep_deinit+0x44>
hw->DEVICE.DeviceEndpoint[ep].EPCFG.reg = 0;
c24: 2200 movs r2, #0
c26: 4b0e ldr r3, [pc, #56] ; (c60 <_usb_d_dev_ep_deinit+0x70>)
c28: 3408 adds r4, #8
c2a: 0164 lsls r4, r4, #5
c2c: 54e2 strb r2, [r4, r3]
ept->ep = 0xFF;
c2e: 23ff movs r3, #255 ; 0xff
c30: 8273 strh r3, [r6, #18]
}
c32: bdf7 pop {r0, r1, r2, r4, r5, r6, r7, pc}
} else if (USB_EP_GET_DIR(ep)) {
c34: b263 sxtb r3, r4
c36: 2b00 cmp r3, #0
c38: da07 bge.n c4a <_usb_d_dev_ep_deinit+0x5a>
hw->DEVICE.DeviceEndpoint[USB_EP_GET_N(ep)].EPCFG.reg &= ~USB_DEVICE_EPCFG_EPTYPE1_Msk;
c3a: 2270 movs r2, #112 ; 0x70
c3c: 4b09 ldr r3, [pc, #36] ; (c64 <_usb_d_dev_ep_deinit+0x74>)
c3e: 016d lsls r5, r5, #5
c40: 18ed adds r5, r5, r3
c42: 786b ldrb r3, [r5, #1]
c44: 4393 bics r3, r2
c46: 706b strb r3, [r5, #1]
c48: e7f1 b.n c2e <_usb_d_dev_ep_deinit+0x3e>
hw->DEVICE.DeviceEndpoint[ep].EPCFG.reg &= ~USB_DEVICE_EPCFG_EPTYPE0_Msk;
c4a: 4b06 ldr r3, [pc, #24] ; (c64 <_usb_d_dev_ep_deinit+0x74>)
c4c: 0164 lsls r4, r4, #5
c4e: 18e4 adds r4, r4, r3
c50: 7863 ldrb r3, [r4, #1]
c52: 4393 bics r3, r2
c54: 7063 strb r3, [r4, #1]
c56: e7ea b.n c2e <_usb_d_dev_ep_deinit+0x3e>
c58: 0000043d .word 0x0000043d
c5c: 00000525 .word 0x00000525
c60: 41005000 .word 0x41005000
c64: 410050ff .word 0x410050ff
00000c68 <_usb_d_dev_ep_enable>:
{
c68: b5f7 push {r0, r1, r2, r4, r5, r6, r7, lr}
uint8_t epn = USB_EP_GET_N(ep);
c6a: 240f movs r4, #15
c6c: 4004 ands r4, r0
struct _usb_d_dev_ep *ept = _usb_d_dev_ept(epn, dir);
c6e: 09c1 lsrs r1, r0, #7
c70: 4b47 ldr r3, [pc, #284] ; (d90 <_usb_d_dev_ep_enable+0x128>)
c72: b245 sxtb r5, r0
c74: 0020 movs r0, r4
c76: 4798 blx r3
return ((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPCFG.reg;
c78: 4b46 ldr r3, [pc, #280] ; (d94 <_usb_d_dev_ep_enable+0x12c>)
c7a: 0161 lsls r1, r4, #5
c7c: 18ce adds r6, r1, r3
c7e: 7872 ldrb r2, [r6, #1]
c80: 0007 movs r7, r0
c82: b2d2 uxtb r2, r2
if (epn > CONF_USB_D_MAX_EP_N || !_usb_d_dev_ep_is_used(ept)) {
c84: 2c02 cmp r4, #2
c86: d900 bls.n c8a <_usb_d_dev_ep_enable+0x22>
c88: e07d b.n d86 <_usb_d_dev_ep_enable+0x11e>
c8a: 7c83 ldrb r3, [r0, #18]
c8c: 9301 str r3, [sp, #4]
c8e: 2bff cmp r3, #255 ; 0xff
c90: d100 bne.n c94 <_usb_d_dev_ep_enable+0x2c>
c92: e078 b.n d86 <_usb_d_dev_ep_enable+0x11e>
bank = prvt_inst.desc_table[epn].DeviceDescBank;
c94: 4b40 ldr r3, [pc, #256] ; (d98 <_usb_d_dev_ep_enable+0x130>)
c96: 185c adds r4, r3, r1
if (ept->flags.bits.eptype == USB_D_EPTYPE_CTRL) {
c98: 7cc3 ldrb r3, [r0, #19]
c9a: 2107 movs r1, #7
c9c: 0018 movs r0, r3
c9e: 4008 ands r0, r1
ca0: 2801 cmp r0, #1
ca2: d13b bne.n d1c <_usb_d_dev_ep_enable+0xb4>
if (epcfg & (USB_DEVICE_EPCFG_EPTYPE1_Msk | USB_DEVICE_EPCFG_EPTYPE0_Msk)) {
ca4: 2377 movs r3, #119 ; 0x77
ca6: 0011 movs r1, r2
ca8: 4019 ands r1, r3
caa: 9100 str r1, [sp, #0]
cac: 421a tst r2, r3
cae: d000 beq.n cb2 <_usb_d_dev_ep_enable+0x4a>
cb0: e06c b.n d8c <_usb_d_dev_ep_enable+0x124>
((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPCFG.reg = data;
cb2: 3b66 subs r3, #102 ; 0x66
cb4: 7073 strb r3, [r6, #1]
bank[0].PCKSIZE.reg = USB_DEVICE_PCKSIZE_MULTI_PACKET_SIZE(ept->size)
cb6: 8a3d ldrh r5, [r7, #16]
| USB_DEVICE_PCKSIZE_SIZE(_usbd_ep_pcksize_size(ept->size));
cb8: 4b38 ldr r3, [pc, #224] ; (d9c <_usb_d_dev_ep_enable+0x134>)
cba: 0028 movs r0, r5
cbc: 4798 blx r3
cbe: 23e0 movs r3, #224 ; 0xe0
bank[0].PCKSIZE.reg = USB_DEVICE_PCKSIZE_MULTI_PACKET_SIZE(ept->size)
cc0: 4a37 ldr r2, [pc, #220] ; (da0 <_usb_d_dev_ep_enable+0x138>)
| USB_DEVICE_PCKSIZE_SIZE(_usbd_ep_pcksize_size(ept->size));
cc2: 05db lsls r3, r3, #23
cc4: 0700 lsls r0, r0, #28
cc6: 4018 ands r0, r3
bank[0].PCKSIZE.reg = USB_DEVICE_PCKSIZE_MULTI_PACKET_SIZE(ept->size)
cc8: 03ab lsls r3, r5, #14
cca: 4013 ands r3, r2
| USB_DEVICE_PCKSIZE_SIZE(_usbd_ep_pcksize_size(ept->size));
ccc: 4303 orrs r3, r0
bank[0].PCKSIZE.reg = USB_DEVICE_PCKSIZE_MULTI_PACKET_SIZE(ept->size)
cce: 6063 str r3, [r4, #4]
((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPSTATUSSET.reg = mask;
cd0: 2140 movs r1, #64 ; 0x40
((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPSTATUSCLR.reg = mask;
cd2: 2380 movs r3, #128 ; 0x80
uint8_t epn = USB_EP_GET_N(ept->ep);
cd4: 220f movs r2, #15
= USB_DEVICE_PCKSIZE_BYTE_COUNT(ept->size) | USB_DEVICE_PCKSIZE_SIZE(_usbd_ep_pcksize_size(ept->size));
cd6: 04ad lsls r5, r5, #18
cd8: 0cad lsrs r5, r5, #18
cda: 4328 orrs r0, r5
cdc: 6160 str r0, [r4, #20]
((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPSTATUSSET.reg = mask;
cde: 71b1 strb r1, [r6, #6]
((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPSTATUSCLR.reg = mask;
ce0: 7173 strb r3, [r6, #5]
bank->STATUS_BK.reg = 0;
ce2: 9b00 ldr r3, [sp, #0]
bank->ADDR.reg = addr;
ce4: 482c ldr r0, [pc, #176] ; (d98 <_usb_d_dev_ep_enable+0x130>)
bank->STATUS_BK.reg = 0;
ce6: 72a3 strb r3, [r4, #10]
ce8: 76a3 strb r3, [r4, #26]
uint8_t epn = USB_EP_GET_N(ept->ep);
cea: 9b01 ldr r3, [sp, #4]
bank->PCKSIZE.bit.MULTI_PACKET_SIZE = size;
cec: 03ac lsls r4, r5, #14
uint8_t epn = USB_EP_GET_N(ept->ep);
cee: 4013 ands r3, r2
_usbd_ep_set_buf(epn, 0, (uint32_t)ept->cache);
cf0: 68fa ldr r2, [r7, #12]
bank->ADDR.reg = addr;
cf2: 015b lsls r3, r3, #5
cf4: 501a str r2, [r3, r0]
bank->PCKSIZE.bit.MULTI_PACKET_SIZE = size;
cf6: 18c0 adds r0, r0, r3
cf8: 6842 ldr r2, [r0, #4]
cfa: 4d2a ldr r5, [pc, #168] ; (da4 <_usb_d_dev_ep_enable+0x13c>)
cfc: 4015 ands r5, r2
cfe: 4325 orrs r5, r4
d00: 6045 str r5, [r0, #4]
bank->PCKSIZE.bit.BYTE_COUNT = count;
d02: 6842 ldr r2, [r0, #4]
d04: 0b92 lsrs r2, r2, #14
d06: 0392 lsls r2, r2, #14
d08: 6042 str r2, [r0, #4]
d0a: 4a22 ldr r2, [pc, #136] ; (d94 <_usb_d_dev_ep_enable+0x12c>)
return USB_OK;
d0c: 9800 ldr r0, [sp, #0]
d0e: 189b adds r3, r3, r2
d10: 22b0 movs r2, #176 ; 0xb0
d12: 715a strb r2, [r3, #5]
((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPINTENSET.reg = mask;
d14: 3aa0 subs r2, #160 ; 0xa0
((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPSTATUSSET.reg = mask;
d16: 7199 strb r1, [r3, #6]
((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPINTENSET.reg = mask;
d18: 729a strb r2, [r3, #10]
}
d1a: bdfe pop {r1, r2, r3, r4, r5, r6, r7, pc}
} else if (dir) {
d1c: 2d00 cmp r5, #0
d1e: da19 bge.n d54 <_usb_d_dev_ep_enable+0xec>
if (epcfg & USB_DEVICE_EPCFG_EPTYPE1_Msk) {
d20: 2170 movs r1, #112 ; 0x70
d22: 0015 movs r5, r2
d24: 400d ands r5, r1
d26: 420a tst r2, r1
d28: d130 bne.n d8c <_usb_d_dev_ep_enable+0x124>
epcfg |= USB_DEVICE_EPCFG_EPTYPE1(ept->flags.bits.eptype);
d2a: 075b lsls r3, r3, #29
d2c: 0e5b lsrs r3, r3, #25
d2e: 4313 orrs r3, r2
((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPCFG.reg = data;
d30: 7073 strb r3, [r6, #1]
= USB_DEVICE_PCKSIZE_BYTE_COUNT(ept->size) | USB_DEVICE_PCKSIZE_SIZE(_usbd_ep_pcksize_size(ept->size));
d32: 8a3f ldrh r7, [r7, #16]
d34: 4b19 ldr r3, [pc, #100] ; (d9c <_usb_d_dev_ep_enable+0x134>)
d36: 0038 movs r0, r7
d38: 4798 blx r3
d3a: 23e0 movs r3, #224 ; 0xe0
d3c: 0700 lsls r0, r0, #28
d3e: 05db lsls r3, r3, #23
d40: 4018 ands r0, r3
((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPSTATUSCLR.reg = mask;
d42: 2380 movs r3, #128 ; 0x80
d44: 04bf lsls r7, r7, #18
d46: 0cbf lsrs r7, r7, #18
d48: 4338 orrs r0, r7
d4a: 6160 str r0, [r4, #20]
d4c: 7173 strb r3, [r6, #5]
bank->STATUS_BK.reg = 0;
d4e: 76a5 strb r5, [r4, #26]
return USB_OK;
d50: 0028 movs r0, r5
}
d52: e7e2 b.n d1a <_usb_d_dev_ep_enable+0xb2>
if (epcfg & USB_DEVICE_EPCFG_EPTYPE0_Msk) {
d54: 0015 movs r5, r2
d56: 400d ands r5, r1
d58: 420a tst r2, r1
d5a: d117 bne.n d8c <_usb_d_dev_ep_enable+0x124>
epcfg |= USB_DEVICE_EPCFG_EPTYPE0(ept->flags.bits.eptype);
d5c: 075b lsls r3, r3, #29
d5e: 0f5b lsrs r3, r3, #29
d60: 4313 orrs r3, r2
((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPCFG.reg = data;
d62: 7073 strb r3, [r6, #1]
bank[0].PCKSIZE.reg = USB_DEVICE_PCKSIZE_MULTI_PACKET_SIZE(ept->size)
d64: 8a3f ldrh r7, [r7, #16]
| USB_DEVICE_PCKSIZE_SIZE(_usbd_ep_pcksize_size(ept->size));
d66: 4b0d ldr r3, [pc, #52] ; (d9c <_usb_d_dev_ep_enable+0x134>)
d68: 0038 movs r0, r7
d6a: 4798 blx r3
bank[0].PCKSIZE.reg = USB_DEVICE_PCKSIZE_MULTI_PACKET_SIZE(ept->size)
d6c: 4a0c ldr r2, [pc, #48] ; (da0 <_usb_d_dev_ep_enable+0x138>)
d6e: 03bb lsls r3, r7, #14
d70: 4013 ands r3, r2
| USB_DEVICE_PCKSIZE_SIZE(_usbd_ep_pcksize_size(ept->size));
d72: 22e0 movs r2, #224 ; 0xe0
d74: 0700 lsls r0, r0, #28
d76: 05d2 lsls r2, r2, #23
d78: 4010 ands r0, r2
d7a: 4303 orrs r3, r0
bank[0].PCKSIZE.reg = USB_DEVICE_PCKSIZE_MULTI_PACKET_SIZE(ept->size)
d7c: 6063 str r3, [r4, #4]
((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPSTATUSSET.reg = mask;
d7e: 2340 movs r3, #64 ; 0x40
d80: 71b3 strb r3, [r6, #6]
bank->STATUS_BK.reg = 0;
d82: 72a5 strb r5, [r4, #10]
d84: e7e4 b.n d50 <_usb_d_dev_ep_enable+0xe8>
return -USB_ERR_PARAM;
d86: 2012 movs r0, #18
return -USB_ERR_REDO;
d88: 4240 negs r0, r0
d8a: e7c6 b.n d1a <_usb_d_dev_ep_enable+0xb2>
d8c: 2014 movs r0, #20
d8e: e7fb b.n d88 <_usb_d_dev_ep_enable+0x120>
d90: 0000043d .word 0x0000043d
d94: 410050ff .word 0x410050ff
d98: 200000a8 .word 0x200000a8
d9c: 000009c5 .word 0x000009c5
da0: 0fffc000 .word 0x0fffc000
da4: f0003fff .word 0xf0003fff
00000da8 <_usb_d_dev_ep_stall>:
{
da8: b5f8 push {r3, r4, r5, r6, r7, lr}
uint8_t epn = USB_EP_GET_N(ep);
daa: 0007 movs r7, r0
dac: 260f movs r6, #15
bool dir = USB_EP_GET_DIR(ep);
dae: 09c4 lsrs r4, r0, #7
uint8_t epn = USB_EP_GET_N(ep);
db0: 4037 ands r7, r6
{
db2: 000d movs r5, r1
struct _usb_d_dev_ep *ept = _usb_d_dev_ept(epn, dir);
db4: 0038 movs r0, r7
db6: 0021 movs r1, r4
db8: 4b29 ldr r3, [pc, #164] ; (e60 <_usb_d_dev_ep_stall+0xb8>)
dba: 4798 blx r3
dbc: 0002 movs r2, r0
if (epn > CONF_USB_D_MAX_EP_N) {
dbe: 2f02 cmp r7, #2
dc0: d84a bhi.n e58 <_usb_d_dev_ep_stall+0xb0>
uint8_t epn = USB_EP_GET_N(ept->ep);
dc2: 7c83 ldrb r3, [r0, #18]
hri_usbendpoint_set_EPSTATUS_reg(USB, epn, (USB_DEVICE_EPSTATUS_STALLRQ0 << bank_n));
dc4: 2010 movs r0, #16
uint8_t epn = USB_EP_GET_N(ept->ep);
dc6: 4033 ands r3, r6
hri_usbendpoint_set_EPSTATUS_reg(USB, epn, (USB_DEVICE_EPSTATUS_STALLRQ0 << bank_n));
dc8: 40a0 lsls r0, r4
if (USB_EP_STALL_SET == ctrl) {
dca: 2d01 cmp r5, #1
dcc: d110 bne.n df0 <_usb_d_dev_ep_stall+0x48>
dce: 4d25 ldr r5, [pc, #148] ; (e64 <_usb_d_dev_ep_stall+0xbc>)
dd0: 0159 lsls r1, r3, #5
hri_usbendpoint_set_EPSTATUS_reg(USB, epn, (USB_DEVICE_EPSTATUS_STALLRQ0 << bank_n));
dd2: b2c0 uxtb r0, r0
dd4: 1949 adds r1, r1, r5
dd6: 7148 strb r0, [r1, #5]
_usbd_ep_int_en(epn, USB_DEVICE_EPINTFLAG_STALL0 << dir);
dd8: 2120 movs r1, #32
dda: 40a1 lsls r1, r4
((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPINTENSET.reg = mask;
ddc: 4822 ldr r0, [pc, #136] ; (e68 <_usb_d_dev_ep_stall+0xc0>)
dde: 015b lsls r3, r3, #5
hri_usbendpoint_set_EPINTEN_reg(USB, epn, flags);
de0: b2c9 uxtb r1, r1
de2: 181b adds r3, r3, r0
de4: 7299 strb r1, [r3, #10]
ept->flags.bits.is_stalled = 1;
de6: 2308 movs r3, #8
de8: 7cd1 ldrb r1, [r2, #19]
dea: 430b orrs r3, r1
ept->flags.bits.is_stalled = 0;
dec: 74d3 strb r3, [r2, #19]
dee: e009 b.n e04 <_usb_d_dev_ep_stall+0x5c>
} else if (USB_EP_STALL_CLR == ctrl) {
df0: 015b lsls r3, r3, #5
df2: 2d00 cmp r5, #0
df4: d129 bne.n e4a <_usb_d_dev_ep_stall+0xa2>
return ((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPSTATUS.reg;
df6: 491d ldr r1, [pc, #116] ; (e6c <_usb_d_dev_ep_stall+0xc4>)
df8: 185d adds r5, r3, r1
dfa: 491b ldr r1, [pc, #108] ; (e68 <_usb_d_dev_ep_stall+0xc0>)
dfc: 185b adds r3, r3, r1
dfe: 79d9 ldrb r1, [r3, #7]
if (!is_stalled) {
e00: 4208 tst r0, r1
e02: d101 bne.n e08 <_usb_d_dev_ep_stall+0x60>
rc = _usb_d_dev_ep_stall_clr(ept, dir);
e04: 2000 movs r0, #0
e06: e01c b.n e42 <_usb_d_dev_ep_stall+0x9a>
_usbd_ep_int_dis(epn, USB_DEVICE_EPINTFLAG_STALL0 << dir);
e08: 2120 movs r1, #32
e0a: 40a1 lsls r1, r4
hri_usbendpoint_clear_EPSTATUS_reg(USB, epn, (USB_DEVICE_EPSTATUS_STALLRQ0 << bank_n));
e0c: b2c0 uxtb r0, r0
((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPSTATUSCLR.reg = mask;
e0e: 7158 strb r0, [r3, #5]
hri_usbendpoint_clear_EPINTEN_reg(USB, epn, flags);
e10: b2c8 uxtb r0, r1
((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPINTENCLR.reg = mask;
e12: 7258 strb r0, [r3, #9]
return ((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPINTFLAG.reg;
e14: 7a1e ldrb r6, [r3, #8]
if (_usbd_ep_is_stall_sent(epn, dir)) {
e16: 4231 tst r1, r6
e18: d004 beq.n e24 <_usb_d_dev_ep_stall+0x7c>
hri_usbendpoint_clear_EPSTATUS_reg(USB, epn, (USB_DEVICE_EPSTATUS_DTGLOUT << bank_n));
e1a: 2101 movs r1, #1
e1c: 40a1 lsls r1, r4
e1e: b2c9 uxtb r1, r1
((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPINTFLAG.reg = mask;
e20: 7218 strb r0, [r3, #8]
((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPSTATUSCLR.reg = mask;
e22: 7159 strb r1, [r3, #5]
if (_usb_d_dev_ep_is_ctrl(ept)) {
e24: 2107 movs r1, #7
e26: 7cd3 ldrb r3, [r2, #19]
e28: 4019 ands r1, r3
e2a: 2901 cmp r1, #1
e2c: d10a bne.n e44 <_usb_d_dev_ep_stall+0x9c>
return ((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPSTATUS.reg;
e2e: 35ff adds r5, #255 ; 0xff
e30: 79ec ldrb r4, [r5, #7]
if ((hri_usbendpoint_read_EPSTATUS_reg(USB, epn) & USB_DEVICE_EPSTATUS_STALLRQ_Msk) == 0) {
e32: 312f adds r1, #47 ; 0x2f
e34: 0020 movs r0, r4
e36: 4008 ands r0, r1
e38: 420c tst r4, r1
e3a: d1e3 bne.n e04 <_usb_d_dev_ep_stall+0x5c>
ept->flags.bits.is_stalled = 0;
e3c: 3928 subs r1, #40 ; 0x28
e3e: 438b bics r3, r1
e40: 74d3 strb r3, [r2, #19]
}
e42: bdf8 pop {r3, r4, r5, r6, r7, pc}
ept->flags.bits.is_stalled = 0;
e44: 2108 movs r1, #8
e46: 438b bics r3, r1
e48: e7d0 b.n dec <_usb_d_dev_ep_stall+0x44>
e4a: 4a06 ldr r2, [pc, #24] ; (e64 <_usb_d_dev_ep_stall+0xbc>)
e4c: 189b adds r3, r3, r2
e4e: 799b ldrb r3, [r3, #6]
return (hri_usbendpoint_read_EPSTATUS_reg(hw, epn) & (USB_DEVICE_EPSTATUS_STALLRQ0 << bank_n));
e50: 4018 ands r0, r3
return _usbd_ep_is_stalled(epn, dir);
e52: 1e43 subs r3, r0, #1
e54: 4198 sbcs r0, r3
e56: e7f4 b.n e42 <_usb_d_dev_ep_stall+0x9a>
return -USB_ERR_PARAM;
e58: 2012 movs r0, #18
e5a: 4240 negs r0, r0
e5c: e7f1 b.n e42 <_usb_d_dev_ep_stall+0x9a>
e5e: 46c0 nop ; (mov r8, r8)
e60: 0000043d .word 0x0000043d
e64: 41005100 .word 0x41005100
e68: 410050ff .word 0x410050ff
e6c: 41005000 .word 0x41005000
00000e70 <_usb_d_dev_ep_read_req>:
int32_t _usb_d_dev_ep_read_req(const uint8_t ep, uint8_t *req_buf)
{
e70: b5f8 push {r3, r4, r5, r6, r7, lr}
uint8_t epn = USB_EP_GET_N(ep);
e72: 230f movs r3, #15
e74: 4018 ands r0, r3
UsbDeviceDescBank *bank = prvt_inst.desc_table[epn].DeviceDescBank;
e76: 4b11 ldr r3, [pc, #68] ; (ebc <_usb_d_dev_ep_read_req+0x4c>)
e78: 0144 lsls r4, r0, #5
e7a: 191b adds r3, r3, r4
{
e7c: 000f movs r7, r1
uint32_t addr = bank[0].ADDR.reg;
e7e: 6819 ldr r1, [r3, #0]
uint16_t bytes = bank[0].PCKSIZE.bit.BYTE_COUNT;
e80: 685d ldr r5, [r3, #4]
e82: 04ad lsls r5, r5, #18
e84: 0cad lsrs r5, r5, #18
if (epn > CONF_USB_D_MAX_EP_N || !req_buf) {
e86: 2802 cmp r0, #2
e88: d812 bhi.n eb0 <_usb_d_dev_ep_read_req+0x40>
e8a: 2f00 cmp r7, #0
e8c: d010 beq.n eb0 <_usb_d_dev_ep_read_req+0x40>
return ((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPCFG.reg;
e8e: 4b0c ldr r3, [pc, #48] ; (ec0 <_usb_d_dev_ep_read_req+0x50>)
e90: 18e4 adds r4, r4, r3
e92: 7863 ldrb r3, [r4, #1]
return -USB_ERR_PARAM;
}
if (!_usbd_ep_is_ctrl(epn)) {
e94: 2b11 cmp r3, #17
e96: d10e bne.n eb6 <_usb_d_dev_ep_read_req+0x46>
tmp &= mask;
e98: 2610 movs r6, #16
tmp = ((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPINTFLAG.reg;
e9a: 7a22 ldrb r2, [r4, #8]
return -USB_ERR_FUNC;
}
if (!_usbd_ep_is_setup(epn)) {
return ERR_NONE;
e9c: 2000 movs r0, #0
if (!_usbd_ep_is_setup(epn)) {
e9e: 4232 tst r2, r6
ea0: d005 beq.n eae <_usb_d_dev_ep_read_req+0x3e>
}
memcpy(req_buf, (void *)addr, 8);
ea2: 2208 movs r2, #8
ea4: 0038 movs r0, r7
ea6: 4b07 ldr r3, [pc, #28] ; (ec4 <_usb_d_dev_ep_read_req+0x54>)
ea8: 4798 blx r3
_usbd_ep_ack_setup(epn);
return bytes;
eaa: 0028 movs r0, r5
((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPINTFLAG.reg = mask;
eac: 7226 strb r6, [r4, #8]
}
eae: bdf8 pop {r3, r4, r5, r6, r7, pc}
return -USB_ERR_PARAM;
eb0: 2012 movs r0, #18
return -USB_ERR_FUNC;
eb2: 4240 negs r0, r0
eb4: e7fb b.n eae <_usb_d_dev_ep_read_req+0x3e>
eb6: 2013 movs r0, #19
eb8: e7fb b.n eb2 <_usb_d_dev_ep_read_req+0x42>
eba: 46c0 nop ; (mov r8, r8)
ebc: 200000a8 .word 0x200000a8
ec0: 410050ff .word 0x410050ff
ec4: 00002355 .word 0x00002355
00000ec8 <_usb_d_dev_ep_trans>:
int32_t _usb_d_dev_ep_trans(const struct usb_d_transfer *trans)
{
ec8: b5f0 push {r4, r5, r6, r7, lr}
uint8_t epn = USB_EP_GET_N(trans->ep);
eca: 250f movs r5, #15
ecc: 7a07 ldrb r7, [r0, #8]
{
ece: b087 sub sp, #28
ed0: b27b sxtb r3, r7
uint8_t epn = USB_EP_GET_N(trans->ep);
ed2: 403d ands r5, r7
bool dir = USB_EP_GET_DIR(trans->ep);
ed4: 09ff lsrs r7, r7, #7
struct _usb_d_dev_ep *ept = _usb_d_dev_ept(epn, dir);
ed6: 0039 movs r1, r7
ed8: 9302 str r3, [sp, #8]
{
eda: 0006 movs r6, r0
struct _usb_d_dev_ep *ept = _usb_d_dev_ept(epn, dir);
edc: 4b3a ldr r3, [pc, #232] ; (fc8 <_usb_d_dev_ep_trans+0x100>)
ede: 0028 movs r0, r5
ee0: 4798 blx r3
uint16_t size_mask = (ept->size == 1023) ? 1023 : (ept->size - 1);
ee2: 493a ldr r1, [pc, #232] ; (fcc <_usb_d_dev_ep_trans+0x104>)
ee4: 8a03 ldrh r3, [r0, #16]
struct _usb_d_dev_ep *ept = _usb_d_dev_ept(epn, dir);
ee6: 0004 movs r4, r0
uint16_t size_mask = (ept->size == 1023) ? 1023 : (ept->size - 1);
ee8: 001a movs r2, r3
eea: 428b cmp r3, r1
eec: d001 beq.n ef2 <_usb_d_dev_ep_trans+0x2a>
eee: 1e5a subs r2, r3, #1
ef0: b292 uxth r2, r2
bool size_n_aligned = (trans->size & size_mask);
ef2: 6871 ldr r1, [r6, #4]
ef4: 400a ands r2, r1
ef6: 9201 str r2, [sp, #4]
bool use_cache = false;
volatile hal_atomic_t flags;
if (epn > CONF_USB_D_MAX_EP_N) {
ef8: 2d02 cmp r5, #2
efa: d862 bhi.n fc2 <_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))
efc: 2080 movs r0, #128 ; 0x80
efe: 6832 ldr r2, [r6, #0]
f00: 0580 lsls r0, r0, #22
f02: 4282 cmp r2, r0
f04: d30d bcc.n f22 <_usb_d_dev_ep_trans+0x5a>
f06: 4d32 ldr r5, [pc, #200] ; (fd0 <_usb_d_dev_ep_trans+0x108>)
f08: 1888 adds r0, r1, r2
f0a: 42a8 cmp r0, r5
f0c: d809 bhi.n f22 <_usb_d_dev_ep_trans+0x5a>
f0e: 2003 movs r0, #3
f10: 0015 movs r5, r2
f12: 4005 ands r5, r0
f14: 4202 tst r2, r0
f16: d104 bne.n f22 <_usb_d_dev_ep_trans+0x5a>
|| (!dir && (trans->size < ept->size))) {
f18: 9a02 ldr r2, [sp, #8]
f1a: 2a00 cmp r2, #0
f1c: db0e blt.n f3c <_usb_d_dev_ep_trans+0x74>
f1e: 4299 cmp r1, r3
f20: d206 bcs.n f30 <_usb_d_dev_ep_trans+0x68>
if (!ept->cache) {
f22: 68e3 ldr r3, [r4, #12]
return -USB_ERR_FUNC;
}
/* Use cache all the time. */
use_cache = true;
f24: 2501 movs r5, #1
if (!ept->cache) {
f26: 2b00 cmp r3, #0
f28: d108 bne.n f3c <_usb_d_dev_ep_trans+0x74>
return -USB_ERR_FUNC;
f2a: 2013 movs r0, #19
return -USB_ERR_PARAM;
f2c: 4240 negs r0, r0
f2e: e017 b.n f60 <_usb_d_dev_ep_trans+0x98>
}
if (!dir && size_n_aligned) {
f30: 9b01 ldr r3, [sp, #4]
f32: 2b00 cmp r3, #0
f34: d016 beq.n f64 <_usb_d_dev_ep_trans+0x9c>
if (!ept->cache) {
f36: 68e3 ldr r3, [r4, #12]
f38: 2b00 cmp r3, #0
f3a: d042 beq.n fc2 <_usb_d_dev_ep_trans+0xfa>
}
/* Set 'use_cache' on last packet. */
}
/* Check halt */
if (ept->flags.bits.is_stalled) {
f3c: 7ce3 ldrb r3, [r4, #19]
return USB_HALTED;
f3e: 2002 movs r0, #2
if (ept->flags.bits.is_stalled) {
f40: 071b lsls r3, r3, #28
f42: d40d bmi.n f60 <_usb_d_dev_ep_trans+0x98>
}
/* Try to start transactions. */
atomic_enter_critical(&flags);
f44: 4b23 ldr r3, [pc, #140] ; (fd4 <_usb_d_dev_ep_trans+0x10c>)
f46: a805 add r0, sp, #20
f48: 4798 blx r3
if (_usb_d_dev_ep_is_busy(ept)) {
f4a: 7ce1 ldrb r1, [r4, #19]
f4c: 2340 movs r3, #64 ; 0x40
f4e: 000a movs r2, r1
f50: 401a ands r2, r3
f52: 9203 str r2, [sp, #12]
f54: 4a20 ldr r2, [pc, #128] ; (fd8 <_usb_d_dev_ep_trans+0x110>)
f56: 4219 tst r1, r3
f58: d006 beq.n f68 <_usb_d_dev_ep_trans+0xa0>
atomic_leave_critical(&flags);
f5a: a805 add r0, sp, #20
f5c: 4790 blx r2
return USB_BUSY;
f5e: 2001 movs r0, #1
} else {
_usb_d_dev_out_next(ept, false);
}
return ERR_NONE;
}
f60: b007 add sp, #28
f62: bdf0 pop {r4, r5, r6, r7, pc}
bool use_cache = false;
f64: 9d01 ldr r5, [sp, #4]
f66: e7e9 b.n f3c <_usb_d_dev_ep_trans+0x74>
ept->flags.bits.is_busy = 1;
f68: 430b orrs r3, r1
f6a: 74e3 strb r3, [r4, #19]
atomic_leave_critical(&flags);
f6c: a805 add r0, sp, #20
f6e: 4790 blx r2
ept->flags.bits.dir = dir;
f70: 217f movs r1, #127 ; 0x7f
ept->trans_buf = trans->buf;
f72: 6833 ldr r3, [r6, #0]
ept->flags.bits.dir = dir;
f74: 01fa lsls r2, r7, #7
ept->trans_buf = trans->buf;
f76: 6023 str r3, [r4, #0]
ept->trans_size = trans->size;
f78: 6873 ldr r3, [r6, #4]
ept->flags.bits.need_zlp = (trans->zlp && (!size_n_aligned));
f7a: 9f03 ldr r7, [sp, #12]
ept->trans_size = trans->size;
f7c: 6063 str r3, [r4, #4]
ept->trans_count = 0;
f7e: 9b03 ldr r3, [sp, #12]
f80: 60a3 str r3, [r4, #8]
ept->flags.bits.dir = dir;
f82: 7ce3 ldrb r3, [r4, #19]
f84: 400b ands r3, r1
ept->flags.bits.use_cache = use_cache;
f86: 4313 orrs r3, r2
f88: 0169 lsls r1, r5, #5
f8a: 001d movs r5, r3
f8c: 2320 movs r3, #32
f8e: 439d bics r5, r3
f90: 430d orrs r5, r1
f92: 74e5 strb r5, [r4, #19]
ept->flags.bits.need_zlp = (trans->zlp && (!size_n_aligned));
f94: 7a73 ldrb r3, [r6, #9]
f96: 2b00 cmp r3, #0
f98: d002 beq.n fa0 <_usb_d_dev_ep_trans+0xd8>
f9a: 9f01 ldr r7, [sp, #4]
f9c: 427b negs r3, r7
f9e: 415f adcs r7, r3
fa0: 2210 movs r2, #16
fa2: 7ce3 ldrb r3, [r4, #19]
fa4: 013f lsls r7, r7, #4
fa6: 4393 bics r3, r2
fa8: 431f orrs r7, r3
if (dir) {
faa: 9b02 ldr r3, [sp, #8]
_usb_d_dev_in_next(ept, false);
fac: 2100 movs r1, #0
fae: 0020 movs r0, r4
ept->flags.bits.need_zlp = (trans->zlp && (!size_n_aligned));
fb0: 74e7 strb r7, [r4, #19]
if (dir) {
fb2: 2b00 cmp r3, #0
fb4: da03 bge.n fbe <_usb_d_dev_ep_trans+0xf6>
_usb_d_dev_in_next(ept, false);
fb6: 4b09 ldr r3, [pc, #36] ; (fdc <_usb_d_dev_ep_trans+0x114>)
_usb_d_dev_out_next(ept, false);
fb8: 4798 blx r3
return ERR_NONE;
fba: 2000 movs r0, #0
fbc: e7d0 b.n f60 <_usb_d_dev_ep_trans+0x98>
_usb_d_dev_out_next(ept, false);
fbe: 4b08 ldr r3, [pc, #32] ; (fe0 <_usb_d_dev_ep_trans+0x118>)
fc0: e7fa b.n fb8 <_usb_d_dev_ep_trans+0xf0>
return -USB_ERR_PARAM;
fc2: 2012 movs r0, #18
fc4: e7b2 b.n f2c <_usb_d_dev_ep_trans+0x64>
fc6: 46c0 nop ; (mov r8, r8)
fc8: 0000043d .word 0x0000043d
fcc: 000003ff .word 0x000003ff
fd0: 20007fff .word 0x20007fff
fd4: 000022c9 .word 0x000022c9
fd8: 000022d7 .word 0x000022d7
fdc: 000006a9 .word 0x000006a9
fe0: 0000080d .word 0x0000080d
00000fe4 <_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;
fe4: 2900 cmp r1, #0
fe6: d100 bne.n fea <_usb_d_dev_register_callback+0x6>
fe8: 4905 ldr r1, [pc, #20] ; (1000 <_usb_d_dev_register_callback+0x1c>)
if (type == USB_D_CB_EVENT) {
fea: 2801 cmp r0, #1
fec: d102 bne.n ff4 <_usb_d_dev_register_callback+0x10>
dev_inst.callbacks.event = (_usb_d_dev_event_cb_t)f;
fee: 4b05 ldr r3, [pc, #20] ; (1004 <_usb_d_dev_register_callback+0x20>)
ff0: 6059 str r1, [r3, #4]
} else if (type == USB_D_CB_SOF) {
dev_inst.callbacks.sof = (_usb_d_dev_sof_cb_t)f;
}
}
ff2: 4770 bx lr
} else if (type == USB_D_CB_SOF) {
ff4: 2800 cmp r0, #0
ff6: d1fc bne.n ff2 <_usb_d_dev_register_callback+0xe>
dev_inst.callbacks.sof = (_usb_d_dev_sof_cb_t)f;
ff8: 4b02 ldr r3, [pc, #8] ; (1004 <_usb_d_dev_register_callback+0x20>)
ffa: 6019 str r1, [r3, #0]
}
ffc: e7f9 b.n ff2 <_usb_d_dev_register_callback+0xe>
ffe: 46c0 nop ; (mov r8, r8)
1000: 00000415 .word 0x00000415
1004: 20000108 .word 0x20000108
00001008 <_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;
1008: 2900 cmp r1, #0
100a: d100 bne.n 100e <_usb_d_dev_register_ep_callback+0x6>
100c: 4907 ldr r1, [pc, #28] ; (102c <_usb_d_dev_register_ep_callback+0x24>)
if (type == USB_D_DEV_EP_CB_SETUP) {
100e: 2800 cmp r0, #0
1010: d102 bne.n 1018 <_usb_d_dev_register_ep_callback+0x10>
dev_inst.ep_callbacks.setup = (_usb_d_dev_ep_cb_setup_t)f;
1012: 4b07 ldr r3, [pc, #28] ; (1030 <_usb_d_dev_register_ep_callback+0x28>)
1014: 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;
}
}
1016: 4770 bx lr
} else if (type == USB_D_DEV_EP_CB_MORE) {
1018: 2801 cmp r0, #1
101a: d102 bne.n 1022 <_usb_d_dev_register_ep_callback+0x1a>
dev_inst.ep_callbacks.more = (_usb_d_dev_ep_cb_more_t)f;
101c: 4b04 ldr r3, [pc, #16] ; (1030 <_usb_d_dev_register_ep_callback+0x28>)
101e: 60d9 str r1, [r3, #12]
1020: e7f9 b.n 1016 <_usb_d_dev_register_ep_callback+0xe>
} else if (type == USB_D_DEV_EP_CB_DONE) {
1022: 2802 cmp r0, #2
1024: d1f7 bne.n 1016 <_usb_d_dev_register_ep_callback+0xe>
dev_inst.ep_callbacks.done = (_usb_d_dev_ep_cb_done_t)f;
1026: 4b02 ldr r3, [pc, #8] ; (1030 <_usb_d_dev_register_ep_callback+0x28>)
1028: 6119 str r1, [r3, #16]
}
102a: e7f4 b.n 1016 <_usb_d_dev_register_ep_callback+0xe>
102c: 00000415 .word 0x00000415
1030: 20000108 .word 0x20000108
00001034 <USB_Handler>:
/**
* \brief USB interrupt handler
*/
void USB_Handler(void)
{
1034: b5f7 push {r0, r1, r2, r4, r5, r6, r7, lr}
uint16_t epint = hw->DEVICE.EPINTSMRY.reg;
1036: 4b6c ldr r3, [pc, #432] ; (11e8 <USB_Handler+0x1b4>)
1038: 8c1a ldrh r2, [r3, #32]
103a: b291 uxth r1, r2
103c: 9101 str r1, [sp, #4]
if (0 == epint) {
103e: 2a00 cmp r2, #0
1040: d000 beq.n 1044 <USB_Handler+0x10>
1042: e066 b.n 1112 <USB_Handler+0xde>
return ((Usb *)hw)->DEVICE.INTFLAG.reg;
1044: 8b9a ldrh r2, [r3, #28]
return ((Usb *)hw)->DEVICE.INTENSET.reg;
1046: 8b19 ldrh r1, [r3, #24]
if (flags & USB_DEVICE_INTFLAG_SOF) {
1048: 2004 movs r0, #4
flags &= hri_usbdevice_read_INTEN_reg(USB);
104a: 400a ands r2, r1
if (flags & USB_DEVICE_INTFLAG_SOF) {
104c: 0011 movs r1, r2
104e: 4001 ands r1, r0
1050: 4202 tst r2, r0
1052: d004 beq.n 105e <USB_Handler+0x2a>
((Usb *)hw)->DEVICE.INTFLAG.reg = mask;
1054: 8398 strh r0, [r3, #28]
dev_inst.callbacks.sof();
1056: 4b65 ldr r3, [pc, #404] ; (11ec <USB_Handler+0x1b8>)
1058: 681b ldr r3, [r3, #0]
105a: 4798 blx r3
_usb_d_dev_handler();
}
105c: bdf7 pop {r0, r1, r2, r4, r5, r6, r7, pc}
if (flags & USB_DEVICE_INTFLAG_LPMSUSP) {
105e: 2480 movs r4, #128 ; 0x80
1060: 0016 movs r6, r2
1062: 00a4 lsls r4, r4, #2
1064: 4026 ands r6, r4
1066: 4222 tst r2, r4
1068: d01d beq.n 10a6 <USB_Handler+0x72>
106a: 4a61 ldr r2, [pc, #388] ; (11f0 <USB_Handler+0x1bc>)
106c: 839a strh r2, [r3, #28]
((Usb *)hw)->DEVICE.INTENCLR.reg = mask;
106e: 829a strh r2, [r3, #20]
((Usb *)hw)->DEVICE.INTENSET.reg = mask;
1070: 3a92 subs r2, #146 ; 0x92
1072: 3aff subs r2, #255 ; 0xff
1074: 831a strh r2, [r3, #24]
if (bank->EXTREG.bit.SUBPID == 0x3) {
1076: 4b5f ldr r3, [pc, #380] ; (11f4 <USB_Handler+0x1c0>)
1078: 891a ldrh r2, [r3, #8]
107a: 0712 lsls r2, r2, #28
107c: 0f12 lsrs r2, r2, #28
107e: 2a03 cmp r2, #3
1080: d005 beq.n 108e <USB_Handler+0x5a>
1082: 8d1a ldrh r2, [r3, #40] ; 0x28
1084: 0712 lsls r2, r2, #28
1086: 0f12 lsrs r2, r2, #28
1088: 2a03 cmp r2, #3
108a: d107 bne.n 109c <USB_Handler+0x68>
UsbDeviceDescBank *bank = &prvt_inst.desc_table[i].DeviceDescBank[0];
108c: 2101 movs r1, #1
bank->EXTREG.reg = 0;
108e: 2200 movs r2, #0
lpm_variable = bank->EXTREG.bit.VARIABLE;
1090: 0149 lsls r1, r1, #5
1092: 185b adds r3, r3, r1
1094: 8919 ldrh r1, [r3, #8]
bank->EXTREG.reg = 0;
1096: 811a strh r2, [r3, #8]
lpm_variable = bank->EXTREG.bit.VARIABLE;
1098: 0449 lsls r1, r1, #17
109a: 0d49 lsrs r1, r1, #21
dev_inst.callbacks.event(USB_EV_LPM_SUSPEND, lpm_variable);
109c: 2003 movs r0, #3
109e: 4b53 ldr r3, [pc, #332] ; (11ec <USB_Handler+0x1b8>)
10a0: 685b ldr r3, [r3, #4]
dev_inst.callbacks.event(USB_EV_SUSPEND, 0);
10a2: 4798 blx r3
10a4: e7da b.n 105c <USB_Handler+0x28>
} else if (flags & USB_DEVICE_INTFLAG_RAMACER) {
10a6: 2480 movs r4, #128 ; 0x80
10a8: 0015 movs r5, r2
10aa: 4025 ands r5, r4
10ac: 4222 tst r2, r4
10ae: d005 beq.n 10bc <USB_Handler+0x88>
((Usb *)hw)->DEVICE.INTFLAG.reg = mask;
10b0: 839c strh r4, [r3, #28]
dev_inst.callbacks.event(USB_EV_ERROR, 0);
10b2: 4b4e ldr r3, [pc, #312] ; (11ec <USB_Handler+0x1b8>)
10b4: 0031 movs r1, r6
10b6: 2005 movs r0, #5
10b8: 685b ldr r3, [r3, #4]
10ba: e7f2 b.n 10a2 <USB_Handler+0x6e>
} else if (flags & USB_D_WAKEUP_INT_FLAGS) {
10bc: 2670 movs r6, #112 ; 0x70
10be: 0014 movs r4, r2
10c0: 4034 ands r4, r6
10c2: 4232 tst r2, r6
10c4: d00a beq.n 10dc <USB_Handler+0xa8>
((Usb *)hw)->DEVICE.INTENSET.reg = mask;
10c6: 4a4a ldr r2, [pc, #296] ; (11f0 <USB_Handler+0x1bc>)
((Usb *)hw)->DEVICE.INTFLAG.reg = mask;
10c8: 839e strh r6, [r3, #28]
((Usb *)hw)->DEVICE.INTENCLR.reg = mask;
10ca: 829e strh r6, [r3, #20]
((Usb *)hw)->DEVICE.INTENSET.reg = mask;
10cc: 831a strh r2, [r3, #24]
_usb_d_dev_wait_dfll_rdy();
10ce: 4b4a ldr r3, [pc, #296] ; (11f8 <USB_Handler+0x1c4>)
10d0: 4798 blx r3
dev_inst.callbacks.event(USB_EV_WAKEUP, 0);
10d2: 4b46 ldr r3, [pc, #280] ; (11ec <USB_Handler+0x1b8>)
10d4: 0029 movs r1, r5
10d6: 2002 movs r0, #2
10d8: 685b ldr r3, [r3, #4]
10da: e7e2 b.n 10a2 <USB_Handler+0x6e>
} else if (flags & USB_DEVICE_INTFLAG_EORST) {
10dc: 2508 movs r5, #8
10de: 0011 movs r1, r2
10e0: 4029 ands r1, r5
10e2: 422a tst r2, r5
10e4: d00c beq.n 1100 <USB_Handler+0xcc>
((UsbDevice *)hw)->DeviceEndpoint[submodule_index].EPCFG.reg = data;
10e6: 4a45 ldr r2, [pc, #276] ; (11fc <USB_Handler+0x1c8>)
10e8: 7054 strb r4, [r2, #1]
((Usb *)hw)->DEVICE.INTENSET.reg = mask;
10ea: 4a41 ldr r2, [pc, #260] ; (11f0 <USB_Handler+0x1bc>)
((Usb *)hw)->DEVICE.INTFLAG.reg = mask;
10ec: 839d strh r5, [r3, #28]
((Usb *)hw)->DEVICE.INTENCLR.reg = mask;
10ee: 829e strh r6, [r3, #20]
((Usb *)hw)->DEVICE.INTENSET.reg = mask;
10f0: 831a strh r2, [r3, #24]
_usb_d_dev_reset_epts();
10f2: 4b43 ldr r3, [pc, #268] ; (1200 <USB_Handler+0x1cc>)
10f4: 4798 blx r3
dev_inst.callbacks.event(USB_EV_RESET, 0);
10f6: 4b3d ldr r3, [pc, #244] ; (11ec <USB_Handler+0x1b8>)
10f8: 0021 movs r1, r4
10fa: 2001 movs r0, #1
10fc: 685b ldr r3, [r3, #4]
10fe: e7d0 b.n 10a2 <USB_Handler+0x6e>
} else if (flags & USB_DEVICE_INTFLAG_SUSPEND) {
1100: 07d2 lsls r2, r2, #31
1102: d506 bpl.n 1112 <USB_Handler+0xde>
((Usb *)hw)->DEVICE.INTFLAG.reg = mask;
1104: 4a3a ldr r2, [pc, #232] ; (11f0 <USB_Handler+0x1bc>)
1106: 839a strh r2, [r3, #28]
((Usb *)hw)->DEVICE.INTENCLR.reg = mask;
1108: 829a strh r2, [r3, #20]
((Usb *)hw)->DEVICE.INTENSET.reg = mask;
110a: 831e strh r6, [r3, #24]
dev_inst.callbacks.event(USB_EV_SUSPEND, 0);
110c: 4b37 ldr r3, [pc, #220] ; (11ec <USB_Handler+0x1b8>)
110e: 685b ldr r3, [r3, #4]
1110: e7c7 b.n 10a2 <USB_Handler+0x6e>
uint32_t lpm_variable = 0;
1112: 2600 movs r6, #0
uint8_t epn = USB_EP_GET_N(ept->ep);
1114: 270f movs r7, #15
if (!(epint & (1u << epn))) {
1116: 2501 movs r5, #1
1118: 4c3a ldr r4, [pc, #232] ; (1204 <USB_Handler+0x1d0>)
if (ept->ep == 0xFF) {
111a: 7ca3 ldrb r3, [r4, #18]
111c: 2bff cmp r3, #255 ; 0xff
111e: d038 beq.n 1192 <USB_Handler+0x15e>
if (!(epint & (1u << epn))) {
1120: 002a movs r2, r5
1122: 403b ands r3, r7
1124: 409a lsls r2, r3
1126: 9901 ldr r1, [sp, #4]
1128: 4211 tst r1, r2
112a: d032 beq.n 1192 <USB_Handler+0x15e>
flags = hw->DEVICE.DeviceEndpoint[epn].EPINTFLAG.reg;
112c: 4936 ldr r1, [pc, #216] ; (1208 <USB_Handler+0x1d4>)
112e: 015a lsls r2, r3, #5
1130: 1852 adds r2, r2, r1
mask = hw->DEVICE.DeviceEndpoint[epn].EPINTENSET.reg;
1132: 4932 ldr r1, [pc, #200] ; (11fc <USB_Handler+0x1c8>)
1134: 015b lsls r3, r3, #5
1136: 185b adds r3, r3, r1
flags = hw->DEVICE.DeviceEndpoint[epn].EPINTFLAG.reg;
1138: 7812 ldrb r2, [r2, #0]
mask = hw->DEVICE.DeviceEndpoint[epn].EPINTENSET.reg;
113a: 7a99 ldrb r1, [r3, #10]
flags &= mask;
113c: 000b movs r3, r1
113e: 4013 ands r3, r2
if (flags) {
1140: 4211 tst r1, r2
1142: d026 beq.n 1192 <USB_Handler+0x15e>
if ((ept->flags.bits.eptype == 0x1) && !_usb_d_dev_ep_is_busy(ept)) {
1144: 2114 movs r1, #20
1146: 4371 muls r1, r6
1148: 4a28 ldr r2, [pc, #160] ; (11ec <USB_Handler+0x1b8>)
114a: 1852 adds r2, r2, r1
114c: 2147 movs r1, #71 ; 0x47
114e: 3210 adds r2, #16
1150: 7dd2 ldrb r2, [r2, #23]
1152: 4011 ands r1, r2
1154: 2901 cmp r1, #1
1156: d111 bne.n 117c <USB_Handler+0x148>
if (flags & USB_DEVICE_EPINTFLAG_RXSTP) {
1158: 06da lsls r2, r3, #27
115a: d503 bpl.n 1164 <USB_Handler+0x130>
_usb_d_dev_handle_setup(ept);
115c: 0020 movs r0, r4
115e: 4b2b ldr r3, [pc, #172] ; (120c <USB_Handler+0x1d8>)
1160: 4798 blx r3
1162: e016 b.n 1192 <USB_Handler+0x15e>
} else if (flags & USB_DEVICE_EPINTFLAG_STALL1) {
1164: 2240 movs r2, #64 ; 0x40
1166: 0019 movs r1, r3
1168: 4011 ands r1, r2
116a: 4213 tst r3, r2
116c: d001 beq.n 1172 <USB_Handler+0x13e>
_usb_d_dev_handle_stall(ept, 1);
116e: 0029 movs r1, r5
1170: e001 b.n 1176 <USB_Handler+0x142>
} else if (flags & USB_DEVICE_EPINTFLAG_STALL0) {
1172: 069b lsls r3, r3, #26
1174: d50d bpl.n 1192 <USB_Handler+0x15e>
_usb_d_dev_handle_stall(ept, 0);
1176: 0020 movs r0, r4
1178: 4b25 ldr r3, [pc, #148] ; (1210 <USB_Handler+0x1dc>)
117a: e009 b.n 1190 <USB_Handler+0x15c>
} else if (_usb_d_dev_ep_is_in(ept)) {
117c: b251 sxtb r1, r2
117e: 2900 cmp r1, #0
1180: da1c bge.n 11bc <USB_Handler+0x188>
if (flags & USB_DEVICE_EPINTFLAG_STALL1) {
1182: 0659 lsls r1, r3, #25
1184: d4f3 bmi.n 116e <USB_Handler+0x13a>
} else if (flags & USB_DEVICE_EPINTFLAG_TRFAIL1) {
1186: 0719 lsls r1, r3, #28
1188: d508 bpl.n 119c <USB_Handler+0x168>
_usb_d_dev_handle_trfail(ept, 1);
118a: 0029 movs r1, r5
118c: 0020 movs r0, r4
118e: 4b21 ldr r3, [pc, #132] ; (1214 <USB_Handler+0x1e0>)
1190: 4798 blx r3
for (i = 0; i < USB_D_N_EP; i++) {
1192: 3601 adds r6, #1
1194: 3414 adds r4, #20
1196: 2e09 cmp r6, #9
1198: d1bf bne.n 111a <USB_Handler+0xe6>
119a: e75f b.n 105c <USB_Handler+0x28>
} else if (flags & USB_DEVICE_EPINTFLAG_TRCPT1) {
119c: 0799 lsls r1, r3, #30
119e: d503 bpl.n 11a8 <USB_Handler+0x174>
_usb_d_dev_in_next(ept, true);
11a0: 0029 movs r1, r5
11a2: 0020 movs r0, r4
11a4: 4b1c ldr r3, [pc, #112] ; (1218 <USB_Handler+0x1e4>)
11a6: e7f3 b.n 1190 <USB_Handler+0x15c>
} else if (_usb_d_dev_ep_is_ctrl(ept)) {
11a8: 2107 movs r1, #7
11aa: 400a ands r2, r1
11ac: 2a01 cmp r2, #1
11ae: d1f0 bne.n 1192 <USB_Handler+0x15e>
_usb_d_dev_handle_trfail(ept, 0);
11b0: 2100 movs r1, #0
if (flags & USB_DEVICE_EPINTFLAG_TRFAIL0) {
11b2: 075a lsls r2, r3, #29
11b4: d4ea bmi.n 118c <USB_Handler+0x158>
} else if (flags & USB_DEVICE_EPINTFLAG_RXSTP) {
11b6: 06db lsls r3, r3, #27
11b8: d5eb bpl.n 1192 <USB_Handler+0x15e>
11ba: e7cf b.n 115c <USB_Handler+0x128>
if (flags & USB_DEVICE_EPINTFLAG_STALL0) {
11bc: 2020 movs r0, #32
11be: 0019 movs r1, r3
11c0: 4001 ands r1, r0
11c2: 4203 tst r3, r0
11c4: d001 beq.n 11ca <USB_Handler+0x196>
_usb_d_dev_handle_stall(ept, 0);
11c6: 2100 movs r1, #0
11c8: e7d5 b.n 1176 <USB_Handler+0x142>
} else if (flags & USB_DEVICE_EPINTFLAG_TRFAIL0) {
11ca: 0758 lsls r0, r3, #29
11cc: d4de bmi.n 118c <USB_Handler+0x158>
} else if (flags & USB_DEVICE_EPINTFLAG_TRCPT0) {
11ce: 422b tst r3, r5
11d0: d003 beq.n 11da <USB_Handler+0x1a6>
_usb_d_dev_out_next(ept, true);
11d2: 0029 movs r1, r5
11d4: 0020 movs r0, r4
11d6: 4b11 ldr r3, [pc, #68] ; (121c <USB_Handler+0x1e8>)
11d8: e7da b.n 1190 <USB_Handler+0x15c>
} else if (_usb_d_dev_ep_is_ctrl(ept)) {
11da: 2107 movs r1, #7
11dc: 400a ands r2, r1
11de: 2a01 cmp r2, #1
11e0: d1d7 bne.n 1192 <USB_Handler+0x15e>
if (flags & USB_DEVICE_EPINTFLAG_TRFAIL1) {
11e2: 071a lsls r2, r3, #28
11e4: d5e7 bpl.n 11b6 <USB_Handler+0x182>
11e6: e7d0 b.n 118a <USB_Handler+0x156>
11e8: 41005000 .word 0x41005000
11ec: 20000108 .word 0x20000108
11f0: 00000201 .word 0x00000201
11f4: 200000a8 .word 0x200000a8
11f8: 00000419 .word 0x00000419
11fc: 410050ff .word 0x410050ff
1200: 0000066d .word 0x0000066d
1204: 2000011c .word 0x2000011c
1208: 41005107 .word 0x41005107
120c: 00000459 .word 0x00000459
1210: 000004d5 .word 0x000004d5
1214: 00000589 .word 0x00000589
1218: 000006a9 .word 0x000006a9
121c: 0000080d .word 0x0000080d
00001220 <_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);
1220: 4b06 ldr r3, [pc, #24] ; (123c <_pm_init+0x1c>)
1222: 7a1a ldrb r2, [r3, #8]
1224: b2d2 uxtb r2, r2
1226: 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);
1228: 7a5a ldrb r2, [r3, #9]
122a: b2d2 uxtb r2, r2
122c: 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);
122e: 7a9a ldrb r2, [r3, #10]
1230: b2d2 uxtb r2, r2
1232: 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);
1234: 7ada ldrb r2, [r3, #11]
1236: b2d2 uxtb r2, r2
1238: 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);
}
123a: 4770 bx lr
123c: 40000400 .word 0x40000400
00001240 <_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);
1240: 2304 movs r3, #4
1242: 4a07 ldr r2, [pc, #28] ; (1260 <_init_chip+0x20>)
/**
* \brief Initialize the hardware abstraction layer
*/
void _init_chip(void)
{
1244: b510 push {r4, lr}
1246: 6851 ldr r1, [r2, #4]
1248: 430b orrs r3, r1
124a: 6053 str r3, [r2, #4]
hri_nvmctrl_set_CTRLB_RWS_bf(NVMCTRL, CONF_NVM_WAIT_STATE);
_pm_init();
124c: 4b05 ldr r3, [pc, #20] ; (1264 <_init_chip+0x24>)
124e: 4798 blx r3
_sysctrl_init_sources();
1250: 4b05 ldr r3, [pc, #20] ; (1268 <_init_chip+0x28>)
1252: 4798 blx r3
#if _GCLK_INIT_1ST
_gclk_init_generators_by_fref(_GCLK_INIT_1ST);
#endif
_sysctrl_init_referenced_generators();
1254: 4b05 ldr r3, [pc, #20] ; (126c <_init_chip+0x2c>)
1256: 4798 blx r3
_gclk_init_generators_by_fref(_GCLK_INIT_LAST);
1258: 20ff movs r0, #255 ; 0xff
125a: 4b05 ldr r3, [pc, #20] ; (1270 <_init_chip+0x30>)
125c: 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
}
125e: bd10 pop {r4, pc}
1260: 41004000 .word 0x41004000
1264: 00001221 .word 0x00001221
1268: 0000130d .word 0x0000130d
126c: 00001335 .word 0x00001335
1270: 000014a9 .word 0x000014a9
00001274 <is_list_element>:
* \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) {
1274: 6800 ldr r0, [r0, #0]
1276: 2800 cmp r0, #0
1278: d100 bne.n 127c <is_list_element+0x8>
return true;
}
}
return false;
}
127a: 4770 bx lr
if (it == element) {
127c: 4288 cmp r0, r1
127e: d1f9 bne.n 1274 <is_list_element>
return true;
1280: 2001 movs r0, #1
1282: e7fa b.n 127a <is_list_element+0x6>
00001284 <list_insert_at_end>:
/**
* \brief Insert an element at list end
*/
void list_insert_at_end(struct list_descriptor *const list, void *const element)
{
1284: b570 push {r4, r5, r6, lr}
struct list_element *it = list->head;
ASSERT(!is_list_element(list, element));
1286: 4b0c ldr r3, [pc, #48] ; (12b8 <list_insert_at_end+0x34>)
{
1288: 0005 movs r5, r0
128a: 000c movs r4, r1
struct list_element *it = list->head;
128c: 6806 ldr r6, [r0, #0]
ASSERT(!is_list_element(list, element));
128e: 4798 blx r3
1290: 2301 movs r3, #1
1292: 4058 eors r0, r3
1294: 224f movs r2, #79 ; 0x4f
1296: 4b09 ldr r3, [pc, #36] ; (12bc <list_insert_at_end+0x38>)
1298: 4909 ldr r1, [pc, #36] ; (12c0 <list_insert_at_end+0x3c>)
129a: b2c0 uxtb r0, r0
129c: 4798 blx r3
if (!list->head) {
129e: 682b ldr r3, [r5, #0]
12a0: 2b00 cmp r3, #0
12a2: d102 bne.n 12aa <list_insert_at_end+0x26>
list->head = (struct list_element *)element;
12a4: 602c str r4, [r5, #0]
((struct list_element *)element)->next = NULL;
12a6: 6023 str r3, [r4, #0]
while (it->next) {
it = it->next;
}
it->next = (struct list_element *)element;
((struct list_element *)element)->next = NULL;
}
12a8: bd70 pop {r4, r5, r6, pc}
while (it->next) {
12aa: 0033 movs r3, r6
12ac: 6836 ldr r6, [r6, #0]
12ae: 2e00 cmp r6, #0
12b0: d1fb bne.n 12aa <list_insert_at_end+0x26>
it->next = (struct list_element *)element;
12b2: 601c str r4, [r3, #0]
((struct list_element *)element)->next = NULL;
12b4: 6026 str r6, [r4, #0]
12b6: e7f7 b.n 12a8 <list_insert_at_end+0x24>
12b8: 00001275 .word 0x00001275
12bc: 000012c5 .word 0x000012c5
12c0: 0000239c .word 0x0000239c
000012c4 <assert>:
/**
* \brief Assert function
*/
void assert(const bool condition, const char *const file, const int line)
{
if (!(condition)) {
12c4: 2800 cmp r0, #0
12c6: d100 bne.n 12ca <assert+0x6>
__asm("BKPT #0");
12c8: be00 bkpt 0x0000
}
(void)file;
(void)line;
}
12ca: 4770 bx lr
000012cc <cdc_device_acm_init>:
* \brief CDC ACM Init
*/
void cdc_device_acm_init(void)
{
/* usb stack init */
usbdc_init(ctrl_buffer);
12cc: 4806 ldr r0, [pc, #24] ; (12e8 <cdc_device_acm_init+0x1c>)
{
12ce: b510 push {r4, lr}
usbdc_init(ctrl_buffer);
12d0: 4b06 ldr r3, [pc, #24] ; (12ec <cdc_device_acm_init+0x20>)
12d2: 3040 adds r0, #64 ; 0x40
12d4: 4798 blx r3
/* usbdc_register_funcion inside */
cdcdf_acm_init();
12d6: 4b06 ldr r3, [pc, #24] ; (12f0 <cdc_device_acm_init+0x24>)
12d8: 4798 blx r3
usbdc_start(single_desc);
12da: 4b06 ldr r3, [pc, #24] ; (12f4 <cdc_device_acm_init+0x28>)
12dc: 4806 ldr r0, [pc, #24] ; (12f8 <cdc_device_acm_init+0x2c>)
12de: 4798 blx r3
usbdc_attach();
12e0: 4b06 ldr r3, [pc, #24] ; (12fc <cdc_device_acm_init+0x30>)
12e2: 4798 blx r3
}
12e4: bd10 pop {r4, pc}
12e6: 46c0 nop ; (mov r8, r8)
12e8: 20000290 .word 0x20000290
12ec: 000021f1 .word 0x000021f1
12f0: 000003d1 .word 0x000003d1
12f4: 00002269 .word 0x00002269
12f8: 20000008 .word 0x20000008
12fc: 0000229d .word 0x0000229d
00001300 <usb_init>:
while (1) {
}
}
void usb_init(void)
{
1300: b510 push {r4, lr}
cdc_device_acm_init();
1302: 4b01 ldr r3, [pc, #4] ; (1308 <usb_init+0x8>)
1304: 4798 blx r3
}
1306: bd10 pop {r4, pc}
1308: 000012cd .word 0x000012cd
0000130c <_sysctrl_init_sources>:
}
static inline void hri_sysctrl_write_XOSC32K_reg(const void *const hw, hri_sysctrl_xosc32k_reg_t data)
{
SYSCTRL_CRITICAL_SECTION_ENTER();
((Sysctrl *)hw)->XOSC32K.reg = data;
130c: 220e movs r2, #14
130e: 4b08 ldr r3, [pc, #32] ; (1330 <_sysctrl_init_sources+0x24>)
1310: 829a strh r2, [r3, #20]
}
static inline void hri_sysctrl_set_OSC32K_ENABLE_bit(const void *const hw)
{
SYSCTRL_CRITICAL_SECTION_ENTER();
((Sysctrl *)hw)->OSC32K.reg |= SYSCTRL_OSC32K_ENABLE;
1312: 6999 ldr r1, [r3, #24]
1314: 3a0c subs r2, #12
1316: 430a orrs r2, r1
static inline hri_sysctrl_osculp32k_reg_t hri_sysctrl_read_OSCULP32K_CALIB_bf(const void *const hw)
{
uint8_t tmp;
tmp = ((Sysctrl *)hw)->OSCULP32K.reg;
tmp = (tmp & SYSCTRL_OSCULP32K_CALIB_Msk) >> SYSCTRL_OSCULP32K_CALIB_Pos;
1318: 211f movs r1, #31
((Sysctrl *)hw)->OSC32K.reg |= SYSCTRL_OSC32K_ENABLE;
131a: 619a str r2, [r3, #24]
tmp = ((Sysctrl *)hw)->OSCULP32K.reg;
131c: 7f1a ldrb r2, [r3, #28]
tmp = (tmp & SYSCTRL_OSCULP32K_CALIB_Msk) >> SYSCTRL_OSCULP32K_CALIB_Pos;
131e: 400a ands r2, r1
}
static inline void hri_sysctrl_write_OSCULP32K_reg(const void *const hw, hri_sysctrl_osculp32k_reg_t data)
{
SYSCTRL_CRITICAL_SECTION_ENTER();
((Sysctrl *)hw)->OSCULP32K.reg = data;
1320: 771a strb r2, [r3, #28]
return (((Sysctrl *)hw)->PCLKSR.reg & SYSCTRL_PCLKSR_XOSC32KRDY) >> SYSCTRL_PCLKSR_XOSC32KRDY_Pos;
1322: 391e subs r1, #30
1324: 68da ldr r2, [r3, #12]
1326: 0852 lsrs r2, r2, #1
(CONF_OSC32K_WRTLOCK << SYSCTRL_OSCULP32K_WRTLOCK_Pos));
#endif
#if CONF_XOSC32K_CONFIG == 1
#if CONF_XOSC32K_ENABLE == 1
while (!hri_sysctrl_get_PCLKSR_XOSC32KRDY_bit(hw))
1328: 420a tst r2, r1
132a: d0fb beq.n 1324 <_sysctrl_init_sources+0x18>
hri_sysctrl_set_OSC8M_ONDEMAND_bit(hw);
#endif
#endif
(void)calib, (void)hw;
}
132c: 4770 bx lr
132e: 46c0 nop ; (mov r8, r8)
1330: 40000800 .word 0x40000800
00001334 <_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;
1334: 2202 movs r2, #2
return (((Sysctrl *)hw)->PCLKSR.reg & SYSCTRL_PCLKSR_DFLLRDY) >> SYSCTRL_PCLKSR_DFLLRDY_Pos;
1336: 2101 movs r1, #1
((Sysctrl *)hw)->DFLLCTRL.reg = data;
1338: 4b14 ldr r3, [pc, #80] ; (138c <_sysctrl_init_referenced_generators+0x58>)
133a: 849a strh r2, [r3, #36] ; 0x24
return (((Sysctrl *)hw)->PCLKSR.reg & SYSCTRL_PCLKSR_DFLLRDY) >> SYSCTRL_PCLKSR_DFLLRDY_Pos;
133c: 68da ldr r2, [r3, #12]
133e: 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))
1340: 420a tst r2, r1
1342: d0fb beq.n 133c <_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;
1344: 4a12 ldr r2, [pc, #72] ; (1390 <_sysctrl_init_referenced_generators+0x5c>)
1346: 62da str r2, [r3, #44] ; 0x2c
((Sysctrl *)hw)->DFLLVAL.reg = data;
1348: 22fc movs r2, #252 ; 0xfc
134a: 01d2 lsls r2, r2, #7
134c: 629a str r2, [r3, #40] ; 0x28
((Sysctrl *)hw)->DFLLCTRL.reg = data;
134e: 2297 movs r2, #151 ; 0x97
1350: 0052 lsls r2, r2, #1
1352: 849a strh r2, [r3, #36] ; 0x24
tmp = ((Sysctrl *)hw)->DFLLCTRL.reg;
1354: 8c9a ldrh r2, [r3, #36] ; 0x24
tmp = (tmp & SYSCTRL_DFLLCTRL_MODE) >> SYSCTRL_DFLLCTRL_MODE_Pos;
1356: 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)) {
1358: 420a tst r2, r1
135a: d010 beq.n 137e <_sysctrl_init_referenced_generators+0x4a>
tmp &= mask;
135c: 2210 movs r2, #16
tmp = ((Sysctrl *)hw)->PCLKSR.reg;
135e: 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)
1360: 4211 tst r1, r2
1362: d0fc beq.n 135e <_sysctrl_init_referenced_generators+0x2a>
((Sysctrl *)hw)->DFLLCTRL.reg |= SYSCTRL_DFLLCTRL_ONDEMAND;
1364: 2280 movs r2, #128 ; 0x80
1366: 8c99 ldrh r1, [r3, #36] ; 0x24
1368: 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;
136a: 490a ldr r1, [pc, #40] ; (1394 <_sysctrl_init_referenced_generators+0x60>)
136c: 849a strh r2, [r3, #36] ; 0x24
136e: 784a ldrb r2, [r1, #1]
1370: 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))
1372: d1fc bne.n 136e <_sysctrl_init_referenced_generators+0x3a>
((Sysctrl *)hw)->OSC32K.reg &= ~SYSCTRL_OSC32K_ENABLE;
1374: 2102 movs r1, #2
1376: 699a ldr r2, [r3, #24]
1378: 438a bics r2, r1
137a: 619a str r2, [r3, #24]
/* Disable after all possible configurations needs sync written. */
hri_sysctrl_clear_OSC32K_ENABLE_bit(hw);
#endif
(void)hw;
}
137c: 4770 bx lr
return (((Sysctrl *)hw)->PCLKSR.reg & SYSCTRL_PCLKSR_DFLLRDY) >> SYSCTRL_PCLKSR_DFLLRDY_Pos;
137e: 2101 movs r1, #1
1380: 68da ldr r2, [r3, #12]
1382: 0912 lsrs r2, r2, #4
while (!hri_sysctrl_get_PCLKSR_DFLLRDY_bit(hw))
1384: 420a tst r2, r1
1386: d0fb beq.n 1380 <_sysctrl_init_referenced_generators+0x4c>
1388: e7ec b.n 1364 <_sysctrl_init_referenced_generators+0x30>
138a: 46c0 nop ; (mov r8, r8)
138c: 40000800 .word 0x40000800
1390: 0401bb80 .word 0x0401bb80
1394: 40000c00 .word 0x40000c00
00001398 <usart_sync_write>:
* \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)
{
1398: b5f8 push {r3, r4, r5, r6, r7, lr}
139a: 0006 movs r6, r0
139c: 000d movs r5, r1
139e: 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);
13a0: 2800 cmp r0, #0
13a2: d004 beq.n 13ae <usart_sync_write+0x16>
13a4: 1e08 subs r0, r1, #0
13a6: d002 beq.n 13ae <usart_sync_write+0x16>
13a8: 0010 movs r0, r2
13aa: 1e43 subs r3, r0, #1
13ac: 4198 sbcs r0, r3
13ae: 22f1 movs r2, #241 ; 0xf1
13b0: 4910 ldr r1, [pc, #64] ; (13f4 <usart_sync_write+0x5c>)
13b2: 4b11 ldr r3, [pc, #68] ; (13f8 <usart_sync_write+0x60>)
13b4: 4798 blx r3
while (!_usart_sync_is_ready_to_send(&descr->device))
13b6: 0037 movs r7, r6
13b8: 3708 adds r7, #8
13ba: 0038 movs r0, r7
13bc: 4b0f ldr r3, [pc, #60] ; (13fc <usart_sync_write+0x64>)
13be: 4798 blx r3
13c0: 2800 cmp r0, #0
13c2: d0f8 beq.n 13b6 <usart_sync_write+0x1e>
uint32_t offset = 0;
13c4: 2600 movs r6, #0
;
do {
_usart_sync_write_byte(&descr->device, buf[offset]);
13c6: 0038 movs r0, r7
13c8: 5da9 ldrb r1, [r5, r6]
13ca: 4b0d ldr r3, [pc, #52] ; (1400 <usart_sync_write+0x68>)
13cc: 4798 blx r3
while (!_usart_sync_is_ready_to_send(&descr->device))
13ce: 0038 movs r0, r7
13d0: 4b0a ldr r3, [pc, #40] ; (13fc <usart_sync_write+0x64>)
13d2: 4798 blx r3
13d4: 2800 cmp r0, #0
13d6: d0fa beq.n 13ce <usart_sync_write+0x36>
;
} while (++offset < length);
13d8: 3601 adds r6, #1
13da: 42b4 cmp r4, r6
13dc: d8f3 bhi.n 13c6 <usart_sync_write+0x2e>
13de: 2501 movs r5, #1
13e0: 2c00 cmp r4, #0
13e2: d000 beq.n 13e6 <usart_sync_write+0x4e>
13e4: 0025 movs r5, r4
while (!_usart_sync_is_transmit_done(&descr->device))
13e6: 0038 movs r0, r7
13e8: 4b06 ldr r3, [pc, #24] ; (1404 <usart_sync_write+0x6c>)
13ea: 4798 blx r3
13ec: 2800 cmp r0, #0
13ee: d0fa beq.n 13e6 <usart_sync_write+0x4e>
;
return (int32_t)offset;
}
13f0: 0028 movs r0, r5
13f2: bdf8 pop {r3, r4, r5, r6, r7, pc}
13f4: 000023ba .word 0x000023ba
13f8: 000012c5 .word 0x000012c5
13fc: 00001ccb .word 0x00001ccb
1400: 00001cbd .word 0x00001cbd
1404: 00001cd5 .word 0x00001cd5
00001408 <usart_sync_read>:
* \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)
{
1408: b5f7 push {r0, r1, r2, r4, r5, r6, r7, lr}
140a: 0005 movs r5, r0
140c: 0014 movs r4, r2
140e: 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);
1410: 2800 cmp r0, #0
1412: d004 beq.n 141e <usart_sync_read+0x16>
1414: 1e08 subs r0, r1, #0
1416: d002 beq.n 141e <usart_sync_read+0x16>
1418: 0010 movs r0, r2
141a: 1e43 subs r3, r0, #1
141c: 4198 sbcs r0, r3
141e: 2286 movs r2, #134 ; 0x86
1420: 490c ldr r1, [pc, #48] ; (1454 <usart_sync_read+0x4c>)
1422: 4b0d ldr r3, [pc, #52] ; (1458 <usart_sync_read+0x50>)
1424: 0052 lsls r2, r2, #1
1426: 4798 blx r3
uint32_t offset = 0;
1428: 2600 movs r6, #0
do {
while (!_usart_sync_is_byte_received(&descr->device))
142a: 002f movs r7, r5
142c: 3708 adds r7, #8
142e: 0038 movs r0, r7
1430: 4b0a ldr r3, [pc, #40] ; (145c <usart_sync_read+0x54>)
1432: 4798 blx r3
1434: 2800 cmp r0, #0
1436: d0f8 beq.n 142a <usart_sync_read+0x22>
;
buf[offset] = _usart_sync_read_byte(&descr->device);
1438: 4b09 ldr r3, [pc, #36] ; (1460 <usart_sync_read+0x58>)
143a: 0038 movs r0, r7
143c: 4798 blx r3
143e: 9b01 ldr r3, [sp, #4]
1440: 5598 strb r0, [r3, r6]
} while (++offset < length);
1442: 3601 adds r6, #1
1444: 42b4 cmp r4, r6
1446: d8f0 bhi.n 142a <usart_sync_read+0x22>
1448: 2001 movs r0, #1
144a: 2c00 cmp r4, #0
144c: d000 beq.n 1450 <usart_sync_read+0x48>
144e: 0020 movs r0, r4
return (int32_t)offset;
}
1450: bdfe pop {r1, r2, r3, r4, r5, r6, r7, pc}
1452: 46c0 nop ; (mov r8, r8)
1454: 000023ba .word 0x000023ba
1458: 000012c5 .word 0x000012c5
145c: 00001cdf .word 0x00001cdf
1460: 00001cc3 .word 0x00001cc3
00001464 <usart_sync_init>:
{
1464: b570 push {r4, r5, r6, lr}
1466: 0004 movs r4, r0
1468: 000d movs r5, r1
ASSERT(descr && hw);
146a: 2800 cmp r0, #0
146c: d002 beq.n 1474 <usart_sync_init+0x10>
146e: 0008 movs r0, r1
1470: 1e43 subs r3, r0, #1
1472: 4198 sbcs r0, r3
1474: 4907 ldr r1, [pc, #28] ; (1494 <usart_sync_init+0x30>)
1476: 4b08 ldr r3, [pc, #32] ; (1498 <usart_sync_init+0x34>)
1478: 2234 movs r2, #52 ; 0x34
147a: 4798 blx r3
init_status = _usart_sync_init(&descr->device, hw);
147c: 0020 movs r0, r4
147e: 0029 movs r1, r5
1480: 4b06 ldr r3, [pc, #24] ; (149c <usart_sync_init+0x38>)
1482: 3008 adds r0, #8
1484: 4798 blx r3
if (init_status) {
1486: 2800 cmp r0, #0
1488: d103 bne.n 1492 <usart_sync_init+0x2e>
descr->io.read = usart_sync_read;
148a: 4b05 ldr r3, [pc, #20] ; (14a0 <usart_sync_init+0x3c>)
148c: 6063 str r3, [r4, #4]
descr->io.write = usart_sync_write;
148e: 4b05 ldr r3, [pc, #20] ; (14a4 <usart_sync_init+0x40>)
1490: 6023 str r3, [r4, #0]
}
1492: bd70 pop {r4, r5, r6, pc}
1494: 000023ba .word 0x000023ba
1498: 000012c5 .word 0x000012c5
149c: 00001c91 .word 0x00001c91
14a0: 00001409 .word 0x00001409
14a4: 00001399 .word 0x00001399
000014a8 <_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)) {
14a8: 07c3 lsls r3, r0, #31
14aa: d508 bpl.n 14be <_gclk_init_generators_by_fref+0x16>
}
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;
14ac: 2380 movs r3, #128 ; 0x80
14ae: 4a0a ldr r2, [pc, #40] ; (14d8 <_gclk_init_generators_by_fref+0x30>)
14b0: 005b lsls r3, r3, #1
14b2: 6093 str r3, [r2, #8]
((Gclk *)hw)->GENCTRL.reg = data;
14b4: 4b09 ldr r3, [pc, #36] ; (14dc <_gclk_init_generators_by_fref+0x34>)
14b6: 6053 str r3, [r2, #4]
while (((const Gclk *)hw)->STATUS.bit.SYNCBUSY)
14b8: 7853 ldrb r3, [r2, #1]
14ba: 09db lsrs r3, r3, #7
14bc: d1fc bne.n 14b8 <_gclk_init_generators_by_fref+0x10>
| (CONF_GCLK_GENERATOR_0_CONFIG << GCLK_GENCTRL_GENEN_Pos) | CONF_GCLK_GEN_0_SRC | GCLK_GENCTRL_ID(0));
}
#endif
#if CONF_GCLK_GENERATOR_1_CONFIG == 1
if (bm & (1ul << 1)) {
14be: 0783 lsls r3, r0, #30
14c0: d508 bpl.n 14d4 <_gclk_init_generators_by_fref+0x2c>
((Gclk *)hw)->GENDIV.reg = data;
14c2: 2302 movs r3, #2
14c4: 4a04 ldr r2, [pc, #16] ; (14d8 <_gclk_init_generators_by_fref+0x30>)
14c6: 33ff adds r3, #255 ; 0xff
14c8: 6093 str r3, [r2, #8]
((Gclk *)hw)->GENCTRL.reg = data;
14ca: 4b05 ldr r3, [pc, #20] ; (14e0 <_gclk_init_generators_by_fref+0x38>)
14cc: 6053 str r3, [r2, #4]
while (((const Gclk *)hw)->STATUS.bit.SYNCBUSY)
14ce: 7853 ldrb r3, [r2, #1]
14d0: 09db lsrs r3, r3, #7
14d2: d1fc bne.n 14ce <_gclk_init_generators_by_fref+0x26>
| (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
}
14d4: 4770 bx lr
14d6: 46c0 nop ; (mov r8, r8)
14d8: 40000c00 .word 0x40000c00
14dc: 00010700 .word 0x00010700
14e0: 00010501 .word 0x00010501
000014e4 <usb_find_desc>:
#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)
{
14e4: b510 push {r4, lr}
_param_error_check(desc && eof && (desc < eof));
while (desc < eof) {
14e6: 4288 cmp r0, r1
14e8: d301 bcc.n 14ee <usb_find_desc+0xa>
_desc_len_check();
14ea: 2000 movs r0, #0
return desc;
}
desc = usb_desc_next(desc);
}
return NULL;
}
14ec: bd10 pop {r4, pc}
return desc[0];
14ee: 7803 ldrb r3, [r0, #0]
_desc_len_check();
14f0: 2b01 cmp r3, #1
14f2: d9fa bls.n 14ea <usb_find_desc+0x6>
if (type == usb_desc_type(desc)) {
14f4: 7844 ldrb r4, [r0, #1]
14f6: 4294 cmp r4, r2
14f8: d0f8 beq.n 14ec <usb_find_desc+0x8>
return (desc + usb_desc_len(desc));
14fa: 18c0 adds r0, r0, r3
14fc: e7f3 b.n 14e6 <usb_find_desc+0x2>
000014fe <usb_find_ep_desc>:
uint8_t *usb_find_ep_desc(uint8_t *desc, uint8_t *eof)
{
_param_error_check(desc && eof && (desc < eof));
while (desc < eof) {
14fe: 4288 cmp r0, r1
1500: d301 bcc.n 1506 <usb_find_ep_desc+0x8>
_desc_len_check();
1502: 2000 movs r0, #0
return desc;
}
desc = usb_desc_next(desc);
}
return NULL;
}
1504: 4770 bx lr
return desc[0];
1506: 7803 ldrb r3, [r0, #0]
_desc_len_check();
1508: 2b01 cmp r3, #1
150a: d9fa bls.n 1502 <usb_find_ep_desc+0x4>
return desc[1];
150c: 7842 ldrb r2, [r0, #1]
if (USB_DT_INTERFACE == usb_desc_type(desc)) {
150e: 2a04 cmp r2, #4
1510: d0f7 beq.n 1502 <usb_find_ep_desc+0x4>
if (USB_DT_ENDPOINT == usb_desc_type(desc)) {
1512: 2a05 cmp r2, #5
1514: d0f6 beq.n 1504 <usb_find_ep_desc+0x6>
return (desc + usb_desc_len(desc));
1516: 18c0 adds r0, r0, r3
1518: e7f1 b.n 14fe <usb_find_ep_desc>
...
0000151c <usb_find_cfg_desc>:
uint8_t *usb_find_cfg_desc(uint8_t *desc, uint8_t *eof, uint8_t cfg_value)
{
151c: b570 push {r4, r5, r6, lr}
_param_error_check(desc && eof && (desc < eof));
desc = usb_find_desc(desc, eof, USB_DT_CONFIG);
151e: 4b0d ldr r3, [pc, #52] ; (1554 <usb_find_cfg_desc+0x38>)
{
1520: 0015 movs r5, r2
desc = usb_find_desc(desc, eof, USB_DT_CONFIG);
1522: 2202 movs r2, #2
{
1524: 000c movs r4, r1
desc = usb_find_desc(desc, eof, USB_DT_CONFIG);
1526: 4798 blx r3
if (!desc) {
1528: 2800 cmp r0, #0
152a: d10f bne.n 154c <usb_find_cfg_desc+0x30>
return desc;
}
desc = usb_cfg_desc_next(desc);
}
return NULL;
}
152c: bd70 pop {r4, r5, r6, pc}
_desc_len_check();
152e: 7803 ldrb r3, [r0, #0]
1530: 2b01 cmp r3, #1
1532: d90d bls.n 1550 <usb_find_cfg_desc+0x34>
if (desc[1] != USB_DT_CONFIG) {
1534: 7843 ldrb r3, [r0, #1]
1536: 2b02 cmp r3, #2
1538: d10a bne.n 1550 <usb_find_cfg_desc+0x34>
if (desc[5] == cfg_value) {
153a: 7943 ldrb r3, [r0, #5]
153c: 42ab cmp r3, r5
153e: d0f5 beq.n 152c <usb_find_cfg_desc+0x10>
return (ptr[0] + (ptr[1] << 8));
1540: 78c2 ldrb r2, [r0, #3]
1542: 7883 ldrb r3, [r0, #2]
1544: 0212 lsls r2, r2, #8
1546: 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));
1548: b29b uxth r3, r3
154a: 18c0 adds r0, r0, r3
while (desc < eof) {
154c: 42a0 cmp r0, r4
154e: d3ee bcc.n 152e <usb_find_cfg_desc+0x12>
return NULL;
1550: 2000 movs r0, #0
1552: e7eb b.n 152c <usb_find_cfg_desc+0x10>
1554: 000014e5 .word 0x000014e5
00001558 <usb_find_str_desc>:
}
return NULL;
}
uint8_t *usb_find_str_desc(uint8_t *desc, uint8_t *eof, uint8_t str_index)
{
1558: b570 push {r4, r5, r6, lr}
155a: 000c movs r4, r1
155c: 0016 movs r6, r2
uint8_t i;
_param_error_check(desc && eof && (desc < eof));
for (i = 0; desc < eof;) {
155e: 2500 movs r5, #0
1560: 42a0 cmp r0, r4
1562: d301 bcc.n 1568 <usb_find_str_desc+0x10>
return desc;
}
i++;
desc = usb_desc_next(desc);
} else {
return NULL;
1564: 2000 movs r0, #0
}
}
return NULL;
}
1566: bd70 pop {r4, r5, r6, pc}
desc = usb_find_desc(desc, eof, USB_DT_STRING);
1568: 2203 movs r2, #3
156a: 0021 movs r1, r4
156c: 4b05 ldr r3, [pc, #20] ; (1584 <usb_find_str_desc+0x2c>)
156e: 4798 blx r3
if (desc) {
1570: 2800 cmp r0, #0
1572: d0f8 beq.n 1566 <usb_find_str_desc+0xe>
return desc[0];
1574: 7803 ldrb r3, [r0, #0]
_desc_len_check();
1576: 2b01 cmp r3, #1
1578: d9f4 bls.n 1564 <usb_find_str_desc+0xc>
if (i == str_index) {
157a: 42b5 cmp r5, r6
157c: d0f3 beq.n 1566 <usb_find_str_desc+0xe>
return (desc + usb_desc_len(desc));
157e: 18c0 adds r0, r0, r3
1580: 3501 adds r5, #1
1582: e7ed b.n 1560 <usb_find_str_desc+0x8>
1584: 000014e5 .word 0x000014e5
00001588 <_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)
{
1588: 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) {
158a: 210f movs r1, #15
for (i = 0; i < CONF_USB_D_NUM_EP_SP; i++) {
158c: 2000 movs r0, #0
{
158e: b530 push {r4, r5, lr}
1590: 4b09 ldr r3, [pc, #36] ; (15b8 <_usb_d_find_ep+0x30>)
&& (ep & USB_EP_N_MASK) == usb_d_inst.ep[i].xfer.hdr.ep) {
1592: 4011 ands r1, r2
if (usb_d_inst.ep[i].xfer.hdr.ep == ep) {
1594: 785c ldrb r4, [r3, #1]
1596: 4294 cmp r4, r2
1598: d00c beq.n 15b4 <_usb_d_find_ep+0x2c>
if (usb_d_inst.ep[i].xfer.hdr.type == USB_EP_XTYPE_CTRL
159a: 781d ldrb r5, [r3, #0]
159c: 2d00 cmp r5, #0
159e: d101 bne.n 15a4 <_usb_d_find_ep+0x1c>
&& (ep & USB_EP_N_MASK) == usb_d_inst.ep[i].xfer.hdr.ep) {
15a0: 428c cmp r4, r1
15a2: d007 beq.n 15b4 <_usb_d_find_ep+0x2c>
for (i = 0; i < CONF_USB_D_NUM_EP_SP; i++) {
15a4: 3001 adds r0, #1
15a6: b2c4 uxtb r4, r0
15a8: 3320 adds r3, #32
15aa: b240 sxtb r0, r0
15ac: 2c04 cmp r4, #4
15ae: d1f1 bne.n 1594 <_usb_d_find_ep+0xc>
return i;
}
}
return -1;
15b0: 2001 movs r0, #1
15b2: 4240 negs r0, r0
}
15b4: bd30 pop {r4, r5, pc}
15b6: 46c0 nop ; (mov r8, r8)
15b8: 20000310 .word 0x20000310
000015bc <usb_d_dummy_cb_false>:
{
(void)unused0;
(void)unused1;
(void)unused2;
return false;
}
15bc: 2000 movs r0, #0
15be: 4770 bx lr
000015c0 <usb_d_cb_trans_more>:
* \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)
{
15c0: b570 push {r4, r5, r6, lr}
int8_t ep_index = _usb_d_find_ep(ep);
15c2: 4b08 ldr r3, [pc, #32] ; (15e4 <usb_d_cb_trans_more+0x24>)
{
15c4: 0004 movs r4, r0
15c6: 000d movs r5, r1
int8_t ep_index = _usb_d_find_ep(ep);
15c8: 4798 blx r3
struct usb_d_ep *ept = &usb_d_inst.ep[ep_index];
if (ept->xfer.hdr.state == USB_EP_S_X_DATA) {
15ca: 4b07 ldr r3, [pc, #28] ; (15e8 <usb_d_cb_trans_more+0x28>)
15cc: 0140 lsls r0, r0, #5
15ce: 181b adds r3, r3, r0
15d0: 789a ldrb r2, [r3, #2]
return ept->callbacks.more(ep, transfered);
}
return false;
15d2: 2000 movs r0, #0
if (ept->xfer.hdr.state == USB_EP_S_X_DATA) {
15d4: 2a03 cmp r2, #3
15d6: d103 bne.n 15e0 <usb_d_cb_trans_more+0x20>
return ept->callbacks.more(ep, transfered);
15d8: 0029 movs r1, r5
15da: 0020 movs r0, r4
15dc: 699b ldr r3, [r3, #24]
15de: 4798 blx r3
}
15e0: bd70 pop {r4, r5, r6, pc}
15e2: 46c0 nop ; (mov r8, r8)
15e4: 00001589 .word 0x00001589
15e8: 20000310 .word 0x20000310
000015ec <_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)
{
15ec: b5f0 push {r4, r5, r6, r7, lr}
int8_t ep_index = _usb_d_find_ep(ep);
15ee: 4b37 ldr r3, [pc, #220] ; (16cc <_usb_d_cb_trans_done+0xe0>)
{
15f0: b087 sub sp, #28
15f2: 000f movs r7, r1
15f4: 9000 str r0, [sp, #0]
15f6: 9201 str r2, [sp, #4]
int8_t ep_index = _usb_d_find_ep(ep);
15f8: 4798 blx r3
struct usb_d_ep *ept = &usb_d_inst.ep[ep_index];
if (code == USB_TRANS_DONE) {
15fa: 4d35 ldr r5, [pc, #212] ; (16d0 <_usb_d_cb_trans_done+0xe4>)
15fc: 0144 lsls r4, r0, #5
15fe: 2f00 cmp r7, #0
1600: d141 bne.n 1686 <_usb_d_cb_trans_done+0x9a>
ept->xfer.hdr.status = USB_XFER_DONE;
1602: 192e adds r6, r5, r4
1604: 70f7 strb r7, [r6, #3]
if (ept->xfer.hdr.type == USB_EP_XTYPE_CTRL) {
1606: 5d29 ldrb r1, [r5, r4]
1608: 2900 cmp r1, #0
160a: d133 bne.n 1674 <_usb_d_cb_trans_done+0x88>
bool err = ept->callbacks.xfer(ept->xfer.hdr.ep, USB_XFER_DATA, ept->xfer.req);
160c: 0022 movs r2, r4
if (state == USB_EP_S_X_DATA) {
160e: 78b4 ldrb r4, [r6, #2]
bool err = ept->callbacks.xfer(ept->xfer.hdr.ep, USB_XFER_DATA, ept->xfer.req);
1610: 320c adds r2, #12
1612: 7870 ldrb r0, [r6, #1]
1614: 69f3 ldr r3, [r6, #28]
1616: 18aa adds r2, r5, r2
if (state == USB_EP_S_X_DATA) {
1618: 2c03 cmp r4, #3
161a: d127 bne.n 166c <_usb_d_cb_trans_done+0x80>
161c: 270c movs r7, #12
bool err = ept->callbacks.xfer(ept->xfer.hdr.ep, USB_XFER_DATA, ept->xfer.req);
161e: 3101 adds r1, #1
1620: 57f7 ldrsb r7, [r6, r7]
1622: 4798 blx r3
1624: 0003 movs r3, r0
if (err) {
1626: 7870 ldrb r0, [r6, #1]
1628: 2b00 cmp r3, #0
162a: d00b beq.n 1644 <_usb_d_cb_trans_done+0x58>
ept->xfer.hdr.state = USB_EP_S_HALTED;
162c: 4b29 ldr r3, [pc, #164] ; (16d4 <_usb_d_cb_trans_done+0xe8>)
162e: 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);
1630: 2f00 cmp r7, #0
1632: db02 blt.n 163a <_usb_d_cb_trans_done+0x4e>
1634: 3b86 subs r3, #134 ; 0x86
1636: 3bff subs r3, #255 ; 0xff
1638: 4318 orrs r0, r3
163a: 2101 movs r1, #1
163c: 4b26 ldr r3, [pc, #152] ; (16d8 <_usb_d_cb_trans_done+0xec>)
163e: 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);
}
1640: b007 add sp, #28
1642: bdf0 pop {r4, r5, r6, r7, pc}
ept->xfer.hdr.state = USB_EP_S_X_STATUS;
1644: 2204 movs r2, #4
struct usb_d_transfer trans
1646: 9303 str r3, [sp, #12]
ept->xfer.hdr.state = USB_EP_S_X_STATUS;
1648: 70b2 strb r2, [r6, #2]
struct usb_d_transfer trans
164a: 9304 str r3, [sp, #16]
164c: 2f00 cmp r7, #0
164e: db0a blt.n 1666 <_usb_d_cb_trans_done+0x7a>
1650: 2380 movs r3, #128 ; 0x80
1652: 4318 orrs r0, r3
1654: ab02 add r3, sp, #8
1656: 7318 strb r0, [r3, #12]
1658: 2301 movs r3, #1
165a: aa02 add r2, sp, #8
165c: 7353 strb r3, [r2, #13]
return _usb_d_dev_ep_trans(&trans);
165e: a803 add r0, sp, #12
1660: 4b1e ldr r3, [pc, #120] ; (16dc <_usb_d_cb_trans_done+0xf0>)
1662: 4798 blx r3
1664: e7ec b.n 1640 <_usb_d_cb_trans_done+0x54>
struct usb_d_transfer trans
1666: 230f movs r3, #15
1668: 4018 ands r0, r3
166a: e7f3 b.n 1654 <_usb_d_cb_trans_done+0x68>
ept->callbacks.xfer(ept->xfer.hdr.ep, USB_XFER_DONE, ept->xfer.req);
166c: 4798 blx r3
ept->xfer.hdr.state = USB_EP_S_X_SETUP;
166e: 2302 movs r3, #2
1670: 70b3 strb r3, [r6, #2]
1672: e7e5 b.n 1640 <_usb_d_cb_trans_done+0x54>
ept->xfer.hdr.state = USB_EP_S_IDLE;
1674: 2301 movs r3, #1
1676: 70b3 strb r3, [r6, #2]
ept->callbacks.xfer(ep, (enum usb_xfer_code)ept->xfer.hdr.status, (void *)transferred);
1678: 192c adds r4, r5, r4
167a: 78e1 ldrb r1, [r4, #3]
167c: 69e3 ldr r3, [r4, #28]
167e: 9a01 ldr r2, [sp, #4]
1680: 9800 ldr r0, [sp, #0]
1682: 4798 blx r3
1684: e7dc b.n 1640 <_usb_d_cb_trans_done+0x54>
ept->xfer.hdr.status = USB_XFER_HALT;
1686: 192b adds r3, r5, r4
} else if (code == USB_TRANS_STALL) {
1688: 2f01 cmp r7, #1
168a: d10c bne.n 16a6 <_usb_d_cb_trans_done+0xba>
ept->xfer.hdr.status = USB_XFER_HALT;
168c: 2202 movs r2, #2
168e: 70da strb r2, [r3, #3]
if (ept->xfer.hdr.type == USB_EP_XTYPE_CTRL) {
1690: 5d29 ldrb r1, [r5, r4]
1692: 2900 cmp r1, #0
1694: d104 bne.n 16a0 <_usb_d_cb_trans_done+0xb4>
ept->xfer.hdr.state = USB_EP_S_X_SETUP;
1696: 709a strb r2, [r3, #2]
_usb_d_dev_ep_stall(ep, USB_EP_STALL_CLR);
1698: 9800 ldr r0, [sp, #0]
169a: 4b0f ldr r3, [pc, #60] ; (16d8 <_usb_d_cb_trans_done+0xec>)
169c: 4798 blx r3
169e: e7eb b.n 1678 <_usb_d_cb_trans_done+0x8c>
ept->xfer.hdr.state = USB_EP_S_HALTED;
16a0: 2205 movs r2, #5
ept->xfer.hdr.state = USB_EP_S_IDLE;
16a2: 709a strb r2, [r3, #2]
16a4: e7e8 b.n 1678 <_usb_d_cb_trans_done+0x8c>
} else if (code == USB_TRANS_ABORT) {
16a6: 2f02 cmp r7, #2
16a8: d108 bne.n 16bc <_usb_d_cb_trans_done+0xd0>
ept->xfer.hdr.status = USB_XFER_ABORT;
16aa: 2204 movs r2, #4
16ac: 70da strb r2, [r3, #3]
if (ept->xfer.hdr.type == USB_EP_XTYPE_CTRL) {
16ae: 5d2a ldrb r2, [r5, r4]
16b0: 2a00 cmp r2, #0
16b2: d101 bne.n 16b8 <_usb_d_cb_trans_done+0xcc>
ept->xfer.hdr.state = USB_EP_S_X_SETUP;
16b4: 709f strb r7, [r3, #2]
return;
16b6: e7c3 b.n 1640 <_usb_d_cb_trans_done+0x54>
ept->xfer.hdr.state = USB_EP_S_IDLE;
16b8: 2201 movs r2, #1
16ba: e7f2 b.n 16a2 <_usb_d_cb_trans_done+0xb6>
} else if (code == USB_TRANS_RESET) {
16bc: 2f03 cmp r7, #3
16be: d103 bne.n 16c8 <_usb_d_cb_trans_done+0xdc>
ept->xfer.hdr.state = USB_EP_S_DISABLED;
16c0: 22a0 movs r2, #160 ; 0xa0
16c2: 00d2 lsls r2, r2, #3
ept->xfer.hdr.state = USB_EP_S_ERROR;
16c4: 805a strh r2, [r3, #2]
16c6: e7d7 b.n 1678 <_usb_d_cb_trans_done+0x8c>
16c8: 4a05 ldr r2, [pc, #20] ; (16e0 <_usb_d_cb_trans_done+0xf4>)
16ca: e7fb b.n 16c4 <_usb_d_cb_trans_done+0xd8>
16cc: 00001589 .word 0x00001589
16d0: 20000310 .word 0x20000310
16d4: 00000205 .word 0x00000205
16d8: 00000da9 .word 0x00000da9
16dc: 00000ec9 .word 0x00000ec9
16e0: 00000606 .word 0x00000606
000016e4 <usb_d_cb_trans_setup>:
{
16e4: b5f7 push {r0, r1, r2, r4, r5, r6, r7, lr}
int8_t ep_index = _usb_d_find_ep(ep);
16e6: 4b18 ldr r3, [pc, #96] ; (1748 <usb_d_cb_trans_setup+0x64>)
{
16e8: 0004 movs r4, r0
int8_t ep_index = _usb_d_find_ep(ep);
16ea: 4798 blx r3
uint8_t * req = ept->xfer.req;
16ec: 0147 lsls r7, r0, #5
16ee: 003b movs r3, r7
16f0: 4d16 ldr r5, [pc, #88] ; (174c <usb_d_cb_trans_setup+0x68>)
16f2: 330c adds r3, #12
16f4: 195b adds r3, r3, r5
uint8_t n = _usb_d_dev_ep_read_req(ep, req);
16f6: 0019 movs r1, r3
uint8_t * req = ept->xfer.req;
16f8: 9301 str r3, [sp, #4]
uint8_t n = _usb_d_dev_ep_read_req(ep, req);
16fa: 0020 movs r0, r4
16fc: 4b14 ldr r3, [pc, #80] ; (1750 <usb_d_cb_trans_setup+0x6c>)
16fe: 4798 blx r3
_usb_d_dev_ep_stall(ep | USB_EP_DIR, USB_EP_STALL_SET);
1700: 2680 movs r6, #128 ; 0x80
if (n != 8) {
1702: b2c0 uxtb r0, r0
_usb_d_dev_ep_stall(ep | USB_EP_DIR, USB_EP_STALL_SET);
1704: 4326 orrs r6, r4
1706: 9600 str r6, [sp, #0]
1708: 4e12 ldr r6, [pc, #72] ; (1754 <usb_d_cb_trans_setup+0x70>)
if (n != 8) {
170a: 2808 cmp r0, #8
170c: d006 beq.n 171c <usb_d_cb_trans_setup+0x38>
_usb_d_dev_ep_stall(ep, USB_EP_STALL_SET);
170e: 2101 movs r1, #1
1710: 0020 movs r0, r4
1712: 47b0 blx r6
_usb_d_dev_ep_stall(ep | USB_EP_DIR, USB_EP_STALL_SET);
1714: 2101 movs r1, #1
_usb_d_dev_ep_stall(ep | USB_EP_DIR, USB_EP_STALL_SET);
1716: 9800 ldr r0, [sp, #0]
1718: 47b0 blx r6
}
171a: bdf7 pop {r0, r1, r2, r4, r5, r6, r7, pc}
ept->xfer.hdr.state = USB_EP_S_IDLE;
171c: 19ed adds r5, r5, r7
171e: 2701 movs r7, #1
_usb_d_dev_ep_stall(ep, USB_EP_STALL_CLR);
1720: 2100 movs r1, #0
1722: 0020 movs r0, r4
1724: 47b0 blx r6
_usb_d_dev_ep_stall(ep | USB_EP_DIR, USB_EP_STALL_CLR);
1726: 2100 movs r1, #0
1728: 9800 ldr r0, [sp, #0]
172a: 47b0 blx r6
if (!ept->callbacks.req(ep, req)) {
172c: 0020 movs r0, r4
172e: 9901 ldr r1, [sp, #4]
1730: 696b ldr r3, [r5, #20]
ept->xfer.hdr.state = USB_EP_S_IDLE;
1732: 70af strb r7, [r5, #2]
if (!ept->callbacks.req(ep, req)) {
1734: 4798 blx r3
1736: 2800 cmp r0, #0
1738: d1ef bne.n 171a <usb_d_cb_trans_setup+0x36>
ept->xfer.hdr.state = USB_EP_S_HALTED;
173a: 2305 movs r3, #5
_usb_d_dev_ep_stall(ep, USB_EP_STALL_SET);
173c: 0039 movs r1, r7
173e: 0020 movs r0, r4
ept->xfer.hdr.state = USB_EP_S_HALTED;
1740: 70ab strb r3, [r5, #2]
_usb_d_dev_ep_stall(ep, USB_EP_STALL_SET);
1742: 47b0 blx r6
_usb_d_dev_ep_stall(ep | USB_EP_DIR, USB_EP_STALL_SET);
1744: 0039 movs r1, r7
1746: e7e6 b.n 1716 <usb_d_cb_trans_setup+0x32>
1748: 00001589 .word 0x00001589
174c: 20000310 .word 0x20000310
1750: 00000e71 .word 0x00000e71
1754: 00000da9 .word 0x00000da9
00001758 <usb_d_init>:
int32_t usb_d_init(void)
{
1758: b570 push {r4, r5, r6, lr}
int32_t rc = _usb_d_dev_init();
175a: 4b11 ldr r3, [pc, #68] ; (17a0 <usb_d_init+0x48>)
175c: 4798 blx r3
uint8_t i;
if (rc < 0) {
175e: 2800 cmp r0, #0
1760: db1d blt.n 179e <usb_d_init+0x46>
return rc;
}
memset(usb_d_inst.ep, 0x00, sizeof(struct usb_d_ep) * CONF_USB_D_NUM_EP_SP);
1762: 4c10 ldr r4, [pc, #64] ; (17a4 <usb_d_init+0x4c>)
1764: 2280 movs r2, #128 ; 0x80
1766: 2100 movs r1, #0
1768: 0020 movs r0, r4
176a: 4b0f ldr r3, [pc, #60] ; (17a8 <usb_d_init+0x50>)
176c: 4798 blx r3
for (i = 0; i < CONF_USB_D_NUM_EP_SP; i++) {
176e: 0023 movs r3, r4
usb_d_inst.ep[i].xfer.hdr.ep = 0xFF;
1770: 21ff movs r1, #255 ; 0xff
memset(usb_d_inst.ep, 0x00, sizeof(struct usb_d_ep) * CONF_USB_D_NUM_EP_SP);
1772: 2404 movs r4, #4
usb_d_inst.ep[i].callbacks.req = (usb_d_ep_cb_setup_t)usb_d_dummy_cb_false;
1774: 4a0d ldr r2, [pc, #52] ; (17ac <usb_d_init+0x54>)
for (i = 0; i < CONF_USB_D_NUM_EP_SP; i++) {
1776: 3c01 subs r4, #1
1778: b2e4 uxtb r4, r4
usb_d_inst.ep[i].xfer.hdr.ep = 0xFF;
177a: 7059 strb r1, [r3, #1]
usb_d_inst.ep[i].callbacks.req = (usb_d_ep_cb_setup_t)usb_d_dummy_cb_false;
177c: 615a str r2, [r3, #20]
usb_d_inst.ep[i].callbacks.more = (usb_d_ep_cb_more_t)usb_d_dummy_cb_false;
177e: 619a str r2, [r3, #24]
usb_d_inst.ep[i].callbacks.xfer = (usb_d_ep_cb_xfer_t)usb_d_dummy_cb_false;
1780: 61da str r2, [r3, #28]
for (i = 0; i < CONF_USB_D_NUM_EP_SP; i++) {
1782: 3320 adds r3, #32
1784: 2c00 cmp r4, #0
1786: d1f6 bne.n 1776 <usb_d_init+0x1e>
}
/* 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);
1788: 4d09 ldr r5, [pc, #36] ; (17b0 <usb_d_init+0x58>)
178a: 0020 movs r0, r4
178c: 4909 ldr r1, [pc, #36] ; (17b4 <usb_d_init+0x5c>)
178e: 47a8 blx r5
_usb_d_dev_register_ep_callback(USB_D_DEV_EP_CB_MORE, (FUNC_PTR)usb_d_cb_trans_more);
1790: 2001 movs r0, #1
1792: 4909 ldr r1, [pc, #36] ; (17b8 <usb_d_init+0x60>)
1794: 47a8 blx r5
_usb_d_dev_register_ep_callback(USB_D_DEV_EP_CB_DONE, (FUNC_PTR)_usb_d_cb_trans_done);
1796: 2002 movs r0, #2
1798: 4908 ldr r1, [pc, #32] ; (17bc <usb_d_init+0x64>)
179a: 47a8 blx r5
return ERR_NONE;
179c: 0020 movs r0, r4
}
179e: bd70 pop {r4, r5, r6, pc}
17a0: 000009fd .word 0x000009fd
17a4: 20000310 .word 0x20000310
17a8: 00002367 .word 0x00002367
17ac: 000015bd .word 0x000015bd
17b0: 00001009 .word 0x00001009
17b4: 000016e5 .word 0x000016e5
17b8: 000015c1 .word 0x000015c1
17bc: 000015ed .word 0x000015ed
000017c0 <usb_d_register_callback>:
{
_usb_d_dev_deinit();
}
void usb_d_register_callback(const enum usb_d_cb_type type, const FUNC_PTR func)
{
17c0: b510 push {r4, lr}
/* Directly uses device driver callback. */
_usb_d_dev_register_callback(type, func);
17c2: 4b01 ldr r3, [pc, #4] ; (17c8 <usb_d_register_callback+0x8>)
17c4: 4798 blx r3
}
17c6: bd10 pop {r4, pc}
17c8: 00000fe5 .word 0x00000fe5
000017cc <usb_d_enable>:
int32_t usb_d_enable(void)
{
17cc: b510 push {r4, lr}
return _usb_d_dev_enable();
17ce: 4b01 ldr r3, [pc, #4] ; (17d4 <usb_d_enable+0x8>)
17d0: 4798 blx r3
}
17d2: bd10 pop {r4, pc}
17d4: 00000ac1 .word 0x00000ac1
000017d8 <usb_d_attach>:
{
_usb_d_dev_disable();
}
void usb_d_attach(void)
{
17d8: b510 push {r4, lr}
_usb_d_dev_attach();
17da: 4b01 ldr r3, [pc, #4] ; (17e0 <usb_d_attach+0x8>)
17dc: 4798 blx r3
}
17de: bd10 pop {r4, pc}
17e0: 00000b09 .word 0x00000b09
000017e4 <usb_d_set_address>:
{
return _usb_d_dev_get_uframe_n();
}
void usb_d_set_address(const uint8_t addr)
{
17e4: b510 push {r4, lr}
_usb_d_dev_set_address(addr);
17e6: 4b01 ldr r3, [pc, #4] ; (17ec <usb_d_set_address+0x8>)
17e8: 4798 blx r3
}
17ea: bd10 pop {r4, pc}
17ec: 00000b19 .word 0x00000b19
000017f0 <usb_d_ep_init>:
{
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)
{
17f0: b5f8 push {r3, r4, r5, r6, r7, lr}
int32_t rc;
int8_t ep_index = _usb_d_find_ep(ep);
17f2: 4c10 ldr r4, [pc, #64] ; (1834 <usb_d_ep_init+0x44>)
{
17f4: 0006 movs r6, r0
17f6: 000d movs r5, r1
17f8: 0017 movs r7, r2
int8_t ep_index = _usb_d_find_ep(ep);
17fa: 47a0 blx r4
struct usb_d_ep *ept = &usb_d_inst.ep[ep_index];
if (ep_index >= 0) {
17fc: 2800 cmp r0, #0
17fe: da13 bge.n 1828 <usb_d_ep_init+0x38>
return -USB_ERR_REDO;
} else {
ep_index = _usb_d_find_ep(0xFF);
1800: 20ff movs r0, #255 ; 0xff
1802: 47a0 blx r4
1804: 1e04 subs r4, r0, #0
if (ep_index < 0) {
1806: db12 blt.n 182e <usb_d_ep_init+0x3e>
return -USB_ERR_ALLOC_FAIL;
}
ept = &usb_d_inst.ep[ep_index];
}
rc = _usb_d_dev_ep_init(ep, attr, max_pkt_size);
1808: 003a movs r2, r7
180a: 0029 movs r1, r5
180c: 0030 movs r0, r6
180e: 4b0a ldr r3, [pc, #40] ; (1838 <usb_d_ep_init+0x48>)
1810: 4798 blx r3
if (rc < 0) {
1812: 2800 cmp r0, #0
1814: db07 blt.n 1826 <usb_d_ep_init+0x36>
return rc;
}
ept->xfer.hdr.ep = ep;
ept->xfer.hdr.type = attr & USB_EP_XTYPE_MASK;
1816: 2103 movs r1, #3
return ERR_NONE;
1818: 2000 movs r0, #0
ept->xfer.hdr.ep = ep;
181a: 4b08 ldr r3, [pc, #32] ; (183c <usb_d_ep_init+0x4c>)
181c: 0164 lsls r4, r4, #5
181e: 191a adds r2, r3, r4
ept->xfer.hdr.type = attr & USB_EP_XTYPE_MASK;
1820: 400d ands r5, r1
ept->xfer.hdr.ep = ep;
1822: 7056 strb r6, [r2, #1]
ept->xfer.hdr.type = attr & USB_EP_XTYPE_MASK;
1824: 54e5 strb r5, [r4, r3]
}
1826: bdf8 pop {r3, r4, r5, r6, r7, pc}
return -USB_ERR_REDO;
1828: 2014 movs r0, #20
return -USB_ERR_ALLOC_FAIL;
182a: 4240 negs r0, r0
182c: e7fb b.n 1826 <usb_d_ep_init+0x36>
182e: 2015 movs r0, #21
1830: e7fb b.n 182a <usb_d_ep_init+0x3a>
1832: 46c0 nop ; (mov r8, r8)
1834: 00001589 .word 0x00001589
1838: 00000b29 .word 0x00000b29
183c: 20000310 .word 0x20000310
00001840 <usb_d_ep0_init>:
return usb_d_ep_init(0, USB_EP_XTYPE_CTRL, max_pkt_size);
1840: 2100 movs r1, #0
{
1842: b510 push {r4, lr}
return usb_d_ep_init(0, USB_EP_XTYPE_CTRL, max_pkt_size);
1844: 0002 movs r2, r0
1846: 0008 movs r0, r1
1848: 4b01 ldr r3, [pc, #4] ; (1850 <usb_d_ep0_init+0x10>)
184a: 4798 blx r3
}
184c: bd10 pop {r4, pc}
184e: 46c0 nop ; (mov r8, r8)
1850: 000017f1 .word 0x000017f1
00001854 <usb_d_ep_deinit>:
void usb_d_ep_deinit(const uint8_t ep)
{
1854: b570 push {r4, r5, r6, lr}
int8_t ep_index = _usb_d_find_ep(ep);
1856: 4b07 ldr r3, [pc, #28] ; (1874 <usb_d_ep_deinit+0x20>)
{
1858: 0005 movs r5, r0
int8_t ep_index = _usb_d_find_ep(ep);
185a: 4798 blx r3
185c: 1e04 subs r4, r0, #0
struct usb_d_ep *ept = &usb_d_inst.ep[ep_index];
if (ep_index < 0) {
185e: db07 blt.n 1870 <usb_d_ep_deinit+0x1c>
return;
}
_usb_d_dev_ep_deinit(ep);
1860: 0028 movs r0, r5
1862: 4b05 ldr r3, [pc, #20] ; (1878 <usb_d_ep_deinit+0x24>)
1864: 4798 blx r3
ept->xfer.hdr.ep = 0xFF;
1866: 23ff movs r3, #255 ; 0xff
1868: 4804 ldr r0, [pc, #16] ; (187c <usb_d_ep_deinit+0x28>)
186a: 0164 lsls r4, r4, #5
186c: 1904 adds r4, r0, r4
186e: 7063 strb r3, [r4, #1]
}
1870: bd70 pop {r4, r5, r6, pc}
1872: 46c0 nop ; (mov r8, r8)
1874: 00001589 .word 0x00001589
1878: 00000bf1 .word 0x00000bf1
187c: 20000310 .word 0x20000310
00001880 <usb_d_ep_enable>:
int32_t usb_d_ep_enable(const uint8_t ep)
{
1880: b570 push {r4, r5, r6, lr}
int8_t ep_index = _usb_d_find_ep(ep);
1882: 4b0c ldr r3, [pc, #48] ; (18b4 <usb_d_ep_enable+0x34>)
{
1884: 0004 movs r4, r0
int8_t ep_index = _usb_d_find_ep(ep);
1886: 4798 blx r3
struct usb_d_ep *ept = &usb_d_inst.ep[ep_index];
int32_t rc;
if (ep_index < 0) {
1888: 2800 cmp r0, #0
188a: db0f blt.n 18ac <usb_d_ep_enable+0x2c>
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;
188c: 4d0a ldr r5, [pc, #40] ; (18b8 <usb_d_ep_enable+0x38>)
188e: 0140 lsls r0, r0, #5
1890: 5d42 ldrb r2, [r0, r5]
1892: 182d adds r5, r5, r0
1894: 4251 negs r1, r2
1896: 414a adcs r2, r1
1898: 3201 adds r2, #1
rc = _usb_d_dev_ep_enable(ep);
189a: 0020 movs r0, r4
189c: 4b07 ldr r3, [pc, #28] ; (18bc <usb_d_ep_enable+0x3c>)
ept->xfer.hdr.state = (ept->xfer.hdr.type == USB_EP_XTYPE_CTRL) ? USB_EP_S_X_SETUP : USB_EP_S_IDLE;
189e: 70aa strb r2, [r5, #2]
rc = _usb_d_dev_ep_enable(ep);
18a0: 4798 blx r3
if (rc < 0) {
18a2: 2800 cmp r0, #0
18a4: da01 bge.n 18aa <usb_d_ep_enable+0x2a>
ept->xfer.hdr.state = USB_EP_S_DISABLED;
18a6: 2300 movs r3, #0
18a8: 70ab strb r3, [r5, #2]
}
return rc;
}
18aa: bd70 pop {r4, r5, r6, pc}
return -USB_ERR_PARAM;
18ac: 2012 movs r0, #18
18ae: 4240 negs r0, r0
18b0: e7fb b.n 18aa <usb_d_ep_enable+0x2a>
18b2: 46c0 nop ; (mov r8, r8)
18b4: 00001589 .word 0x00001589
18b8: 20000310 .word 0x20000310
18bc: 00000c69 .word 0x00000c69
000018c0 <usb_d_ep_transfer>:
}
return usb_d_inst.ep[ep_index].xfer.req;
}
int32_t usb_d_ep_transfer(const struct usb_d_transfer *xfer)
{
18c0: b5f0 push {r4, r5, r6, r7, lr}
int8_t ep_index = _usb_d_find_ep(xfer->ep);
18c2: 7a03 ldrb r3, [r0, #8]
{
18c4: 0004 movs r4, r0
18c6: b08b sub sp, #44 ; 0x2c
int8_t ep_index = _usb_d_find_ep(xfer->ep);
18c8: 0018 movs r0, r3
18ca: 9301 str r3, [sp, #4]
18cc: 4b32 ldr r3, [pc, #200] ; (1998 <usb_d_ep_transfer+0xd8>)
18ce: 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;
18d0: 7a63 ldrb r3, [r4, #9]
int8_t ep_index = _usb_d_find_ep(xfer->ep);
18d2: 1e06 subs r6, r0, #0
uint32_t len = xfer->size;
18d4: 6865 ldr r5, [r4, #4]
bool dir = USB_EP_GET_DIR(xfer->ep), zlp = xfer->zlp;
18d6: 9302 str r3, [sp, #8]
int32_t rc;
volatile uint8_t state;
volatile hal_atomic_t flags;
if (ep_index < 0) {
18d8: db5b blt.n 1992 <usb_d_ep_transfer+0xd2>
return -USB_ERR_PARAM;
}
atomic_enter_critical(&flags);
18da: 4b30 ldr r3, [pc, #192] ; (199c <usb_d_ep_transfer+0xdc>)
18dc: a806 add r0, sp, #24
18de: 4798 blx r3
state = ept->xfer.hdr.state;
18e0: 0173 lsls r3, r6, #5
18e2: 9300 str r3, [sp, #0]
18e4: 9a00 ldr r2, [sp, #0]
18e6: 4b2e ldr r3, [pc, #184] ; (19a0 <usb_d_ep_transfer+0xe0>)
18e8: 189e adds r6, r3, r2
18ea: 78b3 ldrb r3, [r6, #2]
18ec: aa04 add r2, sp, #16
18ee: 1dd7 adds r7, r2, #7
18f0: 703b strb r3, [r7, #0]
if (state == USB_EP_S_IDLE) {
18f2: 783a ldrb r2, [r7, #0]
18f4: b2d3 uxtb r3, r2
18f6: 9303 str r3, [sp, #12]
18f8: 4b2a ldr r3, [pc, #168] ; (19a4 <usb_d_ep_transfer+0xe4>)
18fa: 2a01 cmp r2, #1
18fc: d11d bne.n 193a <usb_d_ep_transfer+0x7a>
ept->xfer.hdr.state = USB_EP_S_X_DATA;
18fe: 3202 adds r2, #2
1900: 70b2 strb r2, [r6, #2]
atomic_leave_critical(&flags);
1902: a806 add r0, sp, #24
1904: 4798 blx r3
default: /* USB_EP_S_X_xxxx */
return USB_BUSY;
}
}
if (ept->xfer.hdr.type == USB_EP_XTYPE_CTRL) {
1906: 4b26 ldr r3, [pc, #152] ; (19a0 <usb_d_ep_transfer+0xe0>)
1908: 9a00 ldr r2, [sp, #0]
190a: 5cd3 ldrb r3, [r2, r3]
190c: 2b00 cmp r3, #0
190e: d01f beq.n 1950 <usb_d_ep_transfer+0x90>
bool dir = USB_EP_GET_DIR(xfer->ep), zlp = xfer->zlp;
1910: 9802 ldr r0, [sp, #8]
1912: 9b01 ldr r3, [sp, #4]
1914: 1e42 subs r2, r0, #1
1916: 4190 sbcs r0, r2
1918: 09d9 lsrs r1, r3, #7
191a: b2c0 uxtb r0, r0
struct usb_d_transfer trans
191c: 6823 ldr r3, [r4, #0]
zlp = false;
}
}
}
rc = _usb_d_trans(xfer->ep, dir, xfer->buf, len, zlp);
191e: 7a22 ldrb r2, [r4, #8]
struct usb_d_transfer trans
1920: 9307 str r3, [sp, #28]
1922: 9508 str r5, [sp, #32]
1924: 2900 cmp r1, #0
1926: d031 beq.n 198c <usb_d_ep_transfer+0xcc>
1928: 2380 movs r3, #128 ; 0x80
192a: 431a orrs r2, r3
192c: ab04 add r3, sp, #16
192e: 751a strb r2, [r3, #20]
1930: 7558 strb r0, [r3, #21]
return _usb_d_dev_ep_trans(&trans);
1932: 4b1d ldr r3, [pc, #116] ; (19a8 <usb_d_ep_transfer+0xe8>)
1934: a807 add r0, sp, #28
1936: 4798 blx r3
return rc;
1938: e008 b.n 194c <usb_d_ep_transfer+0x8c>
atomic_leave_critical(&flags);
193a: a806 add r0, sp, #24
193c: 4798 blx r3
switch (state) {
193e: 783b ldrb r3, [r7, #0]
1940: 2001 movs r0, #1
1942: b2da uxtb r2, r3
1944: 2b06 cmp r3, #6
1946: d801 bhi.n 194c <usb_d_ep_transfer+0x8c>
1948: 4b18 ldr r3, [pc, #96] ; (19ac <usb_d_ep_transfer+0xec>)
194a: 5698 ldrsb r0, [r3, r2]
}
194c: b00b add sp, #44 ; 0x2c
194e: bdf0 pop {r4, r5, r6, r7, pc}
uint16_t req_len = USB_GET_wLength(ept->xfer.req);
1950: 7cf2 ldrb r2, [r6, #19]
1952: 7cb3 ldrb r3, [r6, #18]
1954: 0212 lsls r2, r2, #8
1956: 189b adds r3, r3, r2
1958: b29b uxth r3, r3
if (req_len == 0) {
195a: 2b00 cmp r3, #0
195c: d105 bne.n 196a <usb_d_ep_transfer+0xaa>
ept->xfer.hdr.state = USB_EP_S_X_STATUS;
195e: 2204 movs r2, #4
zlp = true;
1960: 9803 ldr r0, [sp, #12]
len = 0;
1962: 001d movs r5, r3
dir = true;
1964: 0001 movs r1, r0
ept->xfer.hdr.state = USB_EP_S_X_STATUS;
1966: 70b2 strb r2, [r6, #2]
1968: e7d8 b.n 191c <usb_d_ep_transfer+0x5c>
if (len > req_len) {
196a: 429d cmp r5, r3
196c: d900 bls.n 1970 <usb_d_ep_transfer+0xb0>
196e: 001d movs r5, r3
dir = (USB_GET_bmRequestType(ept->xfer.req) & USB_REQ_TYPE_IN);
1970: 490b ldr r1, [pc, #44] ; (19a0 <usb_d_ep_transfer+0xe0>)
zlp = false;
1972: 2000 movs r0, #0
dir = (USB_GET_bmRequestType(ept->xfer.req) & USB_REQ_TYPE_IN);
1974: 468c mov ip, r1
1976: 9a00 ldr r2, [sp, #0]
1978: 0001 movs r1, r0
197a: 4462 add r2, ip
if (dir) {
197c: 7b12 ldrb r2, [r2, #12]
197e: 2a7f cmp r2, #127 ; 0x7f
1980: d9cc bls.n 191c <usb_d_ep_transfer+0x5c>
zlp = (req_len > len);
1982: 429d cmp r5, r3
1984: 419b sbcs r3, r3
dir = (USB_GET_bmRequestType(ept->xfer.req) & USB_REQ_TYPE_IN);
1986: 3101 adds r1, #1
zlp = (req_len > len);
1988: 4258 negs r0, r3
198a: e7c7 b.n 191c <usb_d_ep_transfer+0x5c>
struct usb_d_transfer trans
198c: 230f movs r3, #15
198e: 401a ands r2, r3
1990: e7cc b.n 192c <usb_d_ep_transfer+0x6c>
return -USB_ERR_PARAM;
1992: 2012 movs r0, #18
1994: 4240 negs r0, r0
1996: e7d9 b.n 194c <usb_d_ep_transfer+0x8c>
1998: 00001589 .word 0x00001589
199c: 000022c9 .word 0x000022c9
19a0: 20000310 .word 0x20000310
19a4: 000022d7 .word 0x000022d7
19a8: 00000ec9 .word 0x00000ec9
19ac: 000023d6 .word 0x000023d6
000019b0 <usb_d_ep_halt>:
}
return ERR_NONE;
}
int32_t usb_d_ep_halt(const uint8_t ep, const enum usb_ep_halt_ctrl ctrl)
{
19b0: b5f8 push {r3, r4, r5, r6, r7, lr}
19b2: 0005 movs r5, r0
19b4: 1e0e subs r6, r1, #0
if (ctrl == USB_EP_HALT_CLR) {
19b6: d11a bne.n 19ee <usb_d_ep_halt+0x3e>
int8_t ep_index = _usb_d_find_ep(ep);
19b8: 4b12 ldr r3, [pc, #72] ; (1a04 <usb_d_ep_halt+0x54>)
19ba: 4798 blx r3
19bc: 1e04 subs r4, r0, #0
if (ep_index < 0) {
19be: db1d blt.n 19fc <usb_d_ep_halt+0x4c>
if (_usb_d_dev_ep_stall(ep, USB_EP_STALL_GET)) {
19c0: 2102 movs r1, #2
19c2: 0028 movs r0, r5
19c4: 4f10 ldr r7, [pc, #64] ; (1a08 <usb_d_ep_halt+0x58>)
19c6: 47b8 blx r7
19c8: 2800 cmp r0, #0
19ca: d00f beq.n 19ec <usb_d_ep_halt+0x3c>
rc = _usb_d_dev_ep_stall(ep, USB_EP_STALL_CLR);
19cc: 0031 movs r1, r6
19ce: 0028 movs r0, r5
19d0: 47b8 blx r7
if (rc < 0) {
19d2: 2800 cmp r0, #0
19d4: db0a blt.n 19ec <usb_d_ep_halt+0x3c>
ept->xfer.hdr.state = USB_EP_S_IDLE;
19d6: 480d ldr r0, [pc, #52] ; (1a0c <usb_d_ep_halt+0x5c>)
19d8: 4b0d ldr r3, [pc, #52] ; (1a10 <usb_d_ep_halt+0x60>)
19da: 0164 lsls r4, r4, #5
19dc: 1824 adds r4, r4, r0
19de: 8063 strh r3, [r4, #2]
ept->callbacks.xfer(ep, USB_XFER_UNHALT, NULL);
19e0: 0032 movs r2, r6
19e2: 2103 movs r1, #3
19e4: 0028 movs r0, r5
19e6: 69e3 ldr r3, [r4, #28]
19e8: 4798 blx r3
return ERR_NONE;
19ea: 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);
}
}
19ec: bdf8 pop {r3, r4, r5, r6, r7, pc}
} else if (ctrl == USB_EP_HALT_SET) {
19ee: 4b06 ldr r3, [pc, #24] ; (1a08 <usb_d_ep_halt+0x58>)
19f0: 2901 cmp r1, #1
19f2: d000 beq.n 19f6 <usb_d_ep_halt+0x46>
return _usb_d_dev_ep_stall(ep, USB_EP_STALL_GET);
19f4: 2102 movs r1, #2
19f6: 0028 movs r0, r5
19f8: 4798 blx r3
19fa: e7f7 b.n 19ec <usb_d_ep_halt+0x3c>
return -USB_ERR_PARAM;
19fc: 2012 movs r0, #18
19fe: 4240 negs r0, r0
1a00: e7f4 b.n 19ec <usb_d_ep_halt+0x3c>
1a02: 46c0 nop ; (mov r8, r8)
1a04: 00001589 .word 0x00001589
1a08: 00000da9 .word 0x00000da9
1a0c: 20000310 .word 0x20000310
1a10: 00000301 .word 0x00000301
00001a14 <usb_d_ep_register_callback>:
void usb_d_ep_register_callback(const uint8_t ep, const enum usb_d_ep_cb_type type, const FUNC_PTR func)
{
1a14: b570 push {r4, r5, r6, lr}
int8_t ep_index = _usb_d_find_ep(ep);
1a16: 4b0f ldr r3, [pc, #60] ; (1a54 <usb_d_ep_register_callback+0x40>)
{
1a18: 0014 movs r4, r2
1a1a: 000d movs r5, r1
int8_t ep_index = _usb_d_find_ep(ep);
1a1c: 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;
1a1e: 2c00 cmp r4, #0
1a20: d100 bne.n 1a24 <usb_d_ep_register_callback+0x10>
1a22: 4c0d ldr r4, [pc, #52] ; (1a58 <usb_d_ep_register_callback+0x44>)
if (ep_index < 0) {
1a24: 2800 cmp r0, #0
1a26: db09 blt.n 1a3c <usb_d_ep_register_callback+0x28>
return;
}
switch (type) {
1a28: 2d01 cmp r5, #1
1a2a: d008 beq.n 1a3e <usb_d_ep_register_callback+0x2a>
1a2c: 2d02 cmp r5, #2
1a2e: d00b beq.n 1a48 <usb_d_ep_register_callback+0x34>
1a30: 2d00 cmp r5, #0
1a32: d103 bne.n 1a3c <usb_d_ep_register_callback+0x28>
case USB_D_EP_CB_SETUP:
ept->callbacks.req = (usb_d_ep_cb_setup_t)f;
1a34: 4b09 ldr r3, [pc, #36] ; (1a5c <usb_d_ep_register_callback+0x48>)
1a36: 0140 lsls r0, r0, #5
1a38: 1818 adds r0, r3, r0
1a3a: 6144 str r4, [r0, #20]
ept->callbacks.xfer = (usb_d_ep_cb_xfer_t)f;
break;
default:
break;
}
}
1a3c: bd70 pop {r4, r5, r6, pc}
ept->callbacks.more = (usb_d_ep_cb_more_t)f;
1a3e: 4b07 ldr r3, [pc, #28] ; (1a5c <usb_d_ep_register_callback+0x48>)
1a40: 0140 lsls r0, r0, #5
1a42: 1818 adds r0, r3, r0
1a44: 6184 str r4, [r0, #24]
break;
1a46: e7f9 b.n 1a3c <usb_d_ep_register_callback+0x28>
ept->callbacks.xfer = (usb_d_ep_cb_xfer_t)f;
1a48: 4b04 ldr r3, [pc, #16] ; (1a5c <usb_d_ep_register_callback+0x48>)
1a4a: 0140 lsls r0, r0, #5
1a4c: 1818 adds r0, r3, r0
1a4e: 61c4 str r4, [r0, #28]
break;
1a50: e7f4 b.n 1a3c <usb_d_ep_register_callback+0x28>
1a52: 46c0 nop ; (mov r8, r8)
1a54: 00001589 .word 0x00001589
1a58: 000015bd .word 0x000015bd
1a5c: 20000310 .word 0x20000310
00001a60 <main>:
#include <atmel_start.h>
int main(void)
{
1a60: b510 push {r4, lr}
/* Initializes MCU, drivers and middleware */
atmel_start_init();
1a62: 4b01 ldr r3, [pc, #4] ; (1a68 <main+0x8>)
1a64: 4798 blx r3
/* Replace with your application code */
while (1) {
1a66: e7fe b.n 1a66 <main+0x6>
1a68: 00001ce9 .word 0x00001ce9
00001a6c <_gpio_set_pin_function>:
/**
* \brief Set gpio pin function
*/
static inline void _gpio_set_pin_function(const uint32_t gpio, const uint32_t function)
{
1a6c: 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;
1a6e: 2401 movs r4, #1
tmp = ((Port *)hw)->Group[submodule_index].PINCFG[index].reg;
1a70: 4b0c ldr r3, [pc, #48] ; (1aa4 <_gpio_set_pin_function+0x38>)
uint8_t port = GPIO_PORT(gpio);
uint8_t pin = GPIO_PIN(gpio);
1a72: b2c5 uxtb r5, r0
1a74: 18c0 adds r0, r0, r3
1a76: 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);
1a78: b2ca uxtb r2, r1
tmp &= ~PORT_PINCFG_PMUXEN;
1a7a: 43a3 bics r3, r4
tmp = ((Port *)hw)->Group[submodule_index].PMUX[index].reg;
1a7c: 490a ldr r1, [pc, #40] ; (1aa8 <_gpio_set_pin_function+0x3c>)
tmp |= value << PORT_PINCFG_PMUXEN_Pos;
1a7e: 4323 orrs r3, r4
((Port *)hw)->Group[submodule_index].PINCFG[index].reg = tmp;
1a80: 7003 strb r3, [r0, #0]
tmp = ((Port *)hw)->Group[submodule_index].PMUX[index].reg;
1a82: 086b lsrs r3, r5, #1
1a84: 185b adds r3, r3, r1
tmp &= ~PORT_PMUX_PMUXO_Msk;
1a86: 200f movs r0, #15
tmp = ((Port *)hw)->Group[submodule_index].PMUX[index].reg;
1a88: 7819 ldrb r1, [r3, #0]
if (pin & 1) {
1a8a: 4225 tst r5, r4
1a8c: d005 beq.n 1a9a <_gpio_set_pin_function+0x2e>
tmp &= ~PORT_PMUX_PMUXO_Msk;
1a8e: 4001 ands r1, r0
tmp |= PORT_PMUX_PMUXO(data);
1a90: 0112 lsls r2, r2, #4
1a92: 4311 orrs r1, r2
1a94: b2c9 uxtb r1, r1
((Port *)hw)->Group[submodule_index].PMUX[index].reg = tmp;
1a96: 7019 strb r1, [r3, #0]
} else {
// Even numbered pin
hri_port_write_PMUX_PMUXE_bf(PORT, port, pin >> 1, function & 0xffff);
}
}
}
1a98: bd30 pop {r4, r5, pc}
tmp &= ~PORT_PMUX_PMUXE_Msk;
1a9a: 4381 bics r1, r0
tmp |= PORT_PMUX_PMUXE(data);
1a9c: 430a orrs r2, r1
((Port *)hw)->Group[submodule_index].PMUX[index].reg = tmp;
1a9e: 701a strb r2, [r3, #0]
1aa0: e7fa b.n 1a98 <_gpio_set_pin_function+0x2c>
1aa2: 46c0 nop ; (mov r8, r8)
1aa4: 41004440 .word 0x41004440
1aa8: 41004430 .word 0x41004430
00001aac <USART_0_PORT_init>:
#include <hpl_pm_base.h>
struct usart_sync_descriptor USART_0;
void USART_0_PORT_init(void)
{
1aac: 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);
1aae: 2016 movs r0, #22
1ab0: 4c03 ldr r4, [pc, #12] ; (1ac0 <USART_0_PORT_init+0x14>)
1ab2: 4904 ldr r1, [pc, #16] ; (1ac4 <USART_0_PORT_init+0x18>)
1ab4: 47a0 blx r4
1ab6: 2017 movs r0, #23
1ab8: 4903 ldr r1, [pc, #12] ; (1ac8 <USART_0_PORT_init+0x1c>)
1aba: 47a0 blx r4
gpio_set_pin_function(PA22, PINMUX_PA22C_SERCOM3_PAD0);
gpio_set_pin_function(PA23, PINMUX_PA23C_SERCOM3_PAD1);
}
1abc: bd10 pop {r4, pc}
1abe: 46c0 nop ; (mov r8, r8)
1ac0: 00001a6d .word 0x00001a6d
1ac4: 00160002 .word 0x00160002
1ac8: 00170002 .word 0x00170002
00001acc <USART_0_CLOCK_init>:
peripheral = (uint32_t)_pm_get_apbb_index(module);
PM->APBBMASK.reg |= 1 << peripheral;
}
break;
case PM_BUS_APBC:
PM->APBCMASK.reg |= 1 << peripheral;
1acc: 2320 movs r3, #32
1ace: 4a04 ldr r2, [pc, #16] ; (1ae0 <USART_0_CLOCK_init+0x14>)
1ad0: 6a11 ldr r1, [r2, #32]
1ad2: 430b orrs r3, r1
1ad4: 6213 str r3, [r2, #32]
((Gclk *)hw)->CLKCTRL.reg = data;
1ad6: 4b03 ldr r3, [pc, #12] ; (1ae4 <USART_0_CLOCK_init+0x18>)
1ad8: 4a03 ldr r2, [pc, #12] ; (1ae8 <USART_0_CLOCK_init+0x1c>)
1ada: 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);
}
1adc: 4770 bx lr
1ade: 46c0 nop ; (mov r8, r8)
1ae0: 40000400 .word 0x40000400
1ae4: 40000c00 .word 0x40000c00
1ae8: 00004017 .word 0x00004017
00001aec <USART_0_init>:
void USART_0_init(void)
{
1aec: b510 push {r4, lr}
USART_0_CLOCK_init();
1aee: 4b05 ldr r3, [pc, #20] ; (1b04 <USART_0_init+0x18>)
1af0: 4798 blx r3
usart_sync_init(&USART_0, SERCOM3, (void *)NULL);
1af2: 2200 movs r2, #0
1af4: 4904 ldr r1, [pc, #16] ; (1b08 <USART_0_init+0x1c>)
1af6: 4b05 ldr r3, [pc, #20] ; (1b0c <USART_0_init+0x20>)
1af8: 4805 ldr r0, [pc, #20] ; (1b10 <USART_0_init+0x24>)
1afa: 4798 blx r3
USART_0_PORT_init();
1afc: 4b05 ldr r3, [pc, #20] ; (1b14 <USART_0_init+0x28>)
1afe: 4798 blx r3
}
1b00: bd10 pop {r4, pc}
1b02: 46c0 nop ; (mov r8, r8)
1b04: 00001acd .word 0x00001acd
1b08: 42001400 .word 0x42001400
1b0c: 00001465 .word 0x00001465
1b10: 20000390 .word 0x20000390
1b14: 00001aad .word 0x00001aad
00001b18 <USB_DEVICE_INSTANCE_PORT_init>:
void USB_DEVICE_INSTANCE_PORT_init(void)
{
1b18: b5f8 push {r3, r4, r5, r6, r7, lr}
((Port *)hw)->Group[submodule_index].DIRSET.reg = mask;
1b1a: 25c0 movs r5, #192 ; 0xc0
1b1c: 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;
1b1e: 2780 movs r7, #128 ; 0x80
1b20: 4c11 ldr r4, [pc, #68] ; (1b68 <USB_DEVICE_INSTANCE_PORT_init+0x50>)
1b22: 4a12 ldr r2, [pc, #72] ; (1b6c <USB_DEVICE_INSTANCE_PORT_init+0x54>)
((Port *)hw)->Group[submodule_index].DIRSET.reg = mask;
1b24: 05ed lsls r5, r5, #23
((Port *)hw)->Group[submodule_index].WRCONFIG.reg = data;
1b26: 05ff lsls r7, r7, #23
((Port *)hw)->Group[submodule_index].DIRSET.reg = mask;
1b28: 045b lsls r3, r3, #17
1b2a: 60ab str r3, [r5, #8]
((Port *)hw)->Group[submodule_index].WRCONFIG.reg = data;
1b2c: 62a7 str r7, [r4, #40] ; 0x28
1b2e: 62a2 str r2, [r4, #40] ; 0x28
((Port *)hw)->Group[submodule_index].PINCFG[index].reg &= ~PORT_PINCFG_PULLEN;
1b30: 0022 movs r2, r4
1b32: 2604 movs r6, #4
((Port *)hw)->Group[submodule_index].OUTCLR.reg = mask;
1b34: 616b str r3, [r5, #20]
((Port *)hw)->Group[submodule_index].PINCFG[index].reg &= ~PORT_PINCFG_PULLEN;
1b36: 3258 adds r2, #88 ; 0x58
1b38: 7813 ldrb r3, [r2, #0]
1b3a: 2018 movs r0, #24
1b3c: 43b3 bics r3, r6
1b3e: 7013 strb r3, [r2, #0]
1b40: 490b ldr r1, [pc, #44] ; (1b70 <USB_DEVICE_INSTANCE_PORT_init+0x58>)
1b42: 4b0c ldr r3, [pc, #48] ; (1b74 <USB_DEVICE_INSTANCE_PORT_init+0x5c>)
1b44: 4798 blx r3
((Port *)hw)->Group[submodule_index].DIRSET.reg = mask;
1b46: 2380 movs r3, #128 ; 0x80
((Port *)hw)->Group[submodule_index].WRCONFIG.reg = data;
1b48: 4a0b ldr r2, [pc, #44] ; (1b78 <USB_DEVICE_INSTANCE_PORT_init+0x60>)
((Port *)hw)->Group[submodule_index].DIRSET.reg = mask;
1b4a: 049b lsls r3, r3, #18
1b4c: 60ab str r3, [r5, #8]
((Port *)hw)->Group[submodule_index].WRCONFIG.reg = data;
1b4e: 62a7 str r7, [r4, #40] ; 0x28
1b50: 62a2 str r2, [r4, #40] ; 0x28
((Port *)hw)->Group[submodule_index].OUTCLR.reg = mask;
1b52: 616b str r3, [r5, #20]
((Port *)hw)->Group[submodule_index].PINCFG[index].reg &= ~PORT_PINCFG_PULLEN;
1b54: 3459 adds r4, #89 ; 0x59
1b56: 7823 ldrb r3, [r4, #0]
1b58: 2019 movs r0, #25
1b5a: 43b3 bics r3, r6
1b5c: 7023 strb r3, [r4, #0]
1b5e: 4907 ldr r1, [pc, #28] ; (1b7c <USB_DEVICE_INSTANCE_PORT_init+0x64>)
1b60: 4b04 ldr r3, [pc, #16] ; (1b74 <USB_DEVICE_INSTANCE_PORT_init+0x5c>)
1b62: 4798 blx r3
// <GPIO_PIN_FUNCTION_E"> E
// <GPIO_PIN_FUNCTION_F"> F
// <GPIO_PIN_FUNCTION_G"> G
// <GPIO_PIN_FUNCTION_H"> H
PINMUX_PA25G_USB_DP);
}
1b64: bdf8 pop {r3, r4, r5, r6, r7, pc}
1b66: 46c0 nop ; (mov r8, r8)
1b68: 41004400 .word 0x41004400
1b6c: c0000100 .word 0xc0000100
1b70: 00180006 .word 0x00180006
1b74: 00001a6d .word 0x00001a6d
1b78: c0000200 .word 0xc0000200
1b7c: 00190006 .word 0x00190006
00001b80 <USB_DEVICE_INSTANCE_CLOCK_init>:
PM->APBBMASK.reg |= 1 << peripheral;
1b80: 2220 movs r2, #32
1b82: 4b06 ldr r3, [pc, #24] ; (1b9c <USB_DEVICE_INSTANCE_CLOCK_init+0x1c>)
1b84: 69d9 ldr r1, [r3, #28]
1b86: 430a orrs r2, r1
1b88: 61da str r2, [r3, #28]
PM->AHBMASK.reg |= 1 << peripheral;
1b8a: 2240 movs r2, #64 ; 0x40
1b8c: 6959 ldr r1, [r3, #20]
1b8e: 430a orrs r2, r1
1b90: 615a str r2, [r3, #20]
1b92: 4b03 ldr r3, [pc, #12] ; (1ba0 <USB_DEVICE_INSTANCE_CLOCK_init+0x20>)
1b94: 4a03 ldr r2, [pc, #12] ; (1ba4 <USB_DEVICE_INSTANCE_CLOCK_init+0x24>)
1b96: 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);
}
1b98: 4770 bx lr
1b9a: 46c0 nop ; (mov r8, r8)
1b9c: 40000400 .word 0x40000400
1ba0: 40000c00 .word 0x40000c00
1ba4: 00004006 .word 0x00004006
00001ba8 <USB_DEVICE_INSTANCE_init>:
void USB_DEVICE_INSTANCE_init(void)
{
1ba8: b510 push {r4, lr}
USB_DEVICE_INSTANCE_CLOCK_init();
1baa: 4b03 ldr r3, [pc, #12] ; (1bb8 <USB_DEVICE_INSTANCE_init+0x10>)
1bac: 4798 blx r3
usb_d_init();
1bae: 4b03 ldr r3, [pc, #12] ; (1bbc <USB_DEVICE_INSTANCE_init+0x14>)
1bb0: 4798 blx r3
USB_DEVICE_INSTANCE_PORT_init();
1bb2: 4b03 ldr r3, [pc, #12] ; (1bc0 <USB_DEVICE_INSTANCE_init+0x18>)
1bb4: 4798 blx r3
}
1bb6: bd10 pop {r4, pc}
1bb8: 00001b81 .word 0x00001b81
1bbc: 00001759 .word 0x00001759
1bc0: 00001b19 .word 0x00001b19
00001bc4 <system_init>:
void system_init(void)
{
1bc4: b510 push {r4, lr}
* Currently the following initialization functions are supported:
* - System clock initialization
*/
static inline void init_mcu(void)
{
_init_chip();
1bc6: 4b03 ldr r3, [pc, #12] ; (1bd4 <system_init+0x10>)
1bc8: 4798 blx r3
init_mcu();
USART_0_init();
1bca: 4b03 ldr r3, [pc, #12] ; (1bd8 <system_init+0x14>)
1bcc: 4798 blx r3
USB_DEVICE_INSTANCE_init();
1bce: 4b03 ldr r3, [pc, #12] ; (1bdc <system_init+0x18>)
1bd0: 4798 blx r3
}
1bd2: bd10 pop {r4, pc}
1bd4: 00001241 .word 0x00001241
1bd8: 00001aed .word 0x00001aed
1bdc: 00001ba9 .word 0x00001ba9
00001be0 <hri_sercomusart_wait_for_sync>:
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) {
1be0: 69c3 ldr r3, [r0, #28]
1be2: 4219 tst r1, r3
1be4: d1fc bne.n 1be0 <hri_sercomusart_wait_for_sync>
};
}
1be6: 4770 bx lr
00001be8 <hri_sercomusart_clear_CTRLA_ENABLE_bit>:
}
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;
1be8: 2202 movs r2, #2
{
1bea: b510 push {r4, lr}
((Sercom *)hw)->USART.CTRLA.reg &= ~SERCOM_USART_CTRLA_ENABLE;
1bec: 6803 ldr r3, [r0, #0]
hri_sercomusart_wait_for_sync(hw, SERCOM_USART_SYNCBUSY_SWRST | SERCOM_USART_SYNCBUSY_ENABLE);
1bee: 2103 movs r1, #3
((Sercom *)hw)->USART.CTRLA.reg &= ~SERCOM_USART_CTRLA_ENABLE;
1bf0: 4393 bics r3, r2
1bf2: 6003 str r3, [r0, #0]
hri_sercomusart_wait_for_sync(hw, SERCOM_USART_SYNCBUSY_SWRST | SERCOM_USART_SYNCBUSY_ENABLE);
1bf4: 4b01 ldr r3, [pc, #4] ; (1bfc <hri_sercomusart_clear_CTRLA_ENABLE_bit+0x14>)
1bf6: 4798 blx r3
SERCOM_CRITICAL_SECTION_LEAVE();
}
1bf8: bd10 pop {r4, pc}
1bfa: 46c0 nop ; (mov r8, r8)
1bfc: 00001be1 .word 0x00001be1
00001c00 <_usart_init>:
{
#ifdef _UNIT_TEST_
return ((uint32_t)hw - (uint32_t)SERCOM0) / sizeof(Sercom);
#endif
return ((uint32_t)hw - (uint32_t)SERCOM0) >> 10;
1c00: 4b1b ldr r3, [pc, #108] ; (1c70 <_usart_init+0x70>)
* \param[in] hw The pointer to hardware instance
*
* \return The status of initialization
*/
static int32_t _usart_init(void *const hw)
{
1c02: b570 push {r4, r5, r6, lr}
return ((uint32_t)hw - (uint32_t)SERCOM0) >> 10;
1c04: 18c3 adds r3, r0, r3
1c06: 0a9b lsrs r3, r3, #10
if (_usarts[i].number == sercom_offset) {
1c08: b2db uxtb r3, r3
{
1c0a: 0004 movs r4, r0
if (_usarts[i].number == sercom_offset) {
1c0c: 2b03 cmp r3, #3
1c0e: d004 beq.n 1c1a <_usart_init+0x1a>
ASSERT(false);
1c10: 2000 movs r0, #0
1c12: 4a18 ldr r2, [pc, #96] ; (1c74 <_usart_init+0x74>)
1c14: 4918 ldr r1, [pc, #96] ; (1c78 <_usart_init+0x78>)
1c16: 4b19 ldr r3, [pc, #100] ; (1c7c <_usart_init+0x7c>)
1c18: 4798 blx r3
return ((Sercom *)hw)->USART.SYNCBUSY.reg & reg;
1c1a: 69e3 ldr r3, [r4, #28]
1c1c: 4d18 ldr r5, [pc, #96] ; (1c80 <_usart_init+0x80>)
uint8_t i = _get_sercom_index(hw);
if (!hri_sercomusart_is_syncing(hw, SERCOM_USART_SYNCBUSY_SWRST)) {
1c1e: 07db lsls r3, r3, #31
1c20: d411 bmi.n 1c46 <_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;
1c22: 2602 movs r6, #2
hri_sercomusart_wait_for_sync(hw, SERCOM_USART_SYNCBUSY_SWRST | SERCOM_USART_SYNCBUSY_ENABLE);
1c24: 2103 movs r1, #3
1c26: 0020 movs r0, r4
1c28: 47a8 blx r5
tmp = ((Sercom *)hw)->USART.CTRLA.reg;
1c2a: 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)) {
1c2c: 4233 tst r3, r6
1c2e: d005 beq.n 1c3c <_usart_init+0x3c>
hri_sercomusart_clear_CTRLA_ENABLE_bit(hw);
1c30: 0020 movs r0, r4
1c32: 4b14 ldr r3, [pc, #80] ; (1c84 <_usart_init+0x84>)
1c34: 4798 blx r3
hri_sercomusart_wait_for_sync(hw, SERCOM_USART_SYNCBUSY_ENABLE);
1c36: 0031 movs r1, r6
1c38: 0020 movs r0, r4
1c3a: 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;
1c3c: 2305 movs r3, #5
hri_sercomusart_wait_for_sync(hw, SERCOM_USART_SYNCBUSY_SWRST | SERCOM_USART_SYNCBUSY_ENABLE);
1c3e: 2103 movs r1, #3
1c40: 0020 movs r0, r4
((Sercom *)hw)->USART.CTRLA.reg = data;
1c42: 6023 str r3, [r4, #0]
hri_sercomusart_wait_for_sync(hw, SERCOM_USART_SYNCBUSY_SWRST | SERCOM_USART_SYNCBUSY_ENABLE);
1c44: 47a8 blx r5
}
hri_sercomusart_write_CTRLA_reg(hw, SERCOM_USART_CTRLA_SWRST | mode);
}
hri_sercomusart_wait_for_sync(hw, SERCOM_USART_SYNCBUSY_SWRST);
1c46: 0020 movs r0, r4
1c48: 2101 movs r1, #1
1c4a: 47a8 blx r5
((Sercom *)hw)->USART.CTRLA.reg = data;
1c4c: 4b0e ldr r3, [pc, #56] ; (1c88 <_usart_init+0x88>)
hri_sercomusart_wait_for_sync(hw, SERCOM_USART_SYNCBUSY_SWRST | SERCOM_USART_SYNCBUSY_ENABLE);
1c4e: 0020 movs r0, r4
((Sercom *)hw)->USART.CTRLA.reg = data;
1c50: 6023 str r3, [r4, #0]
hri_sercomusart_wait_for_sync(hw, SERCOM_USART_SYNCBUSY_SWRST | SERCOM_USART_SYNCBUSY_ENABLE);
1c52: 2103 movs r1, #3
1c54: 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;
1c56: 23c0 movs r3, #192 ; 0xc0
1c58: 029b lsls r3, r3, #10
hri_sercomusart_wait_for_sync(hw, SERCOM_USART_SYNCBUSY_MASK);
1c5a: 0020 movs r0, r4
((Sercom *)hw)->USART.CTRLB.reg = data;
1c5c: 6063 str r3, [r4, #4]
hri_sercomusart_wait_for_sync(hw, SERCOM_USART_SYNCBUSY_MASK);
1c5e: 2107 movs r1, #7
1c60: 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;
1c62: 2000 movs r0, #0
((Sercom *)hw)->USART.BAUD.reg = data;
1c64: 4b09 ldr r3, [pc, #36] ; (1c8c <_usart_init+0x8c>)
1c66: 81a3 strh r3, [r4, #12]
((Sercom *)hw)->USART.RXPL.reg = data;
1c68: 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;
1c6a: 3430 adds r4, #48 ; 0x30
1c6c: 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;
}
1c6e: bd70 pop {r4, r5, r6, pc}
1c70: bdfff800 .word 0xbdfff800
1c74: 0000023a .word 0x0000023a
1c78: 000023e4 .word 0x000023e4
1c7c: 000012c5 .word 0x000012c5
1c80: 00001be1 .word 0x00001be1
1c84: 00001be9 .word 0x00001be9
1c88: 40100004 .word 0x40100004
1c8c: fffff62b .word 0xfffff62b
00001c90 <_usart_sync_init>:
{
1c90: b570 push {r4, r5, r6, lr}
1c92: 0005 movs r5, r0
ASSERT(device);
1c94: 1e43 subs r3, r0, #1
1c96: 4198 sbcs r0, r3
{
1c98: 000c movs r4, r1
ASSERT(device);
1c9a: 22b4 movs r2, #180 ; 0xb4
1c9c: 4904 ldr r1, [pc, #16] ; (1cb0 <_usart_sync_init+0x20>)
1c9e: 4b05 ldr r3, [pc, #20] ; (1cb4 <_usart_sync_init+0x24>)
1ca0: b2c0 uxtb r0, r0
1ca2: 4798 blx r3
device->hw = hw;
1ca4: 602c str r4, [r5, #0]
return _usart_init(hw);
1ca6: 0020 movs r0, r4
1ca8: 4b03 ldr r3, [pc, #12] ; (1cb8 <_usart_sync_init+0x28>)
1caa: 4798 blx r3
}
1cac: bd70 pop {r4, r5, r6, pc}
1cae: 46c0 nop ; (mov r8, r8)
1cb0: 000023e4 .word 0x000023e4
1cb4: 000012c5 .word 0x000012c5
1cb8: 00001c01 .word 0x00001c01
00001cbc <_usart_sync_write_byte>:
hri_sercomusart_write_DATA_reg(device->hw, data);
1cbc: 6803 ldr r3, [r0, #0]
((Sercom *)hw)->USART.DATA.reg = data;
1cbe: 8519 strh r1, [r3, #40] ; 0x28
}
1cc0: 4770 bx lr
00001cc2 <_usart_sync_read_byte>:
return hri_sercomusart_read_DATA_reg(device->hw);
1cc2: 6803 ldr r3, [r0, #0]
return ((Sercom *)hw)->USART.DATA.reg;
1cc4: 8d18 ldrh r0, [r3, #40] ; 0x28
1cc6: b2c0 uxtb r0, r0
}
1cc8: 4770 bx lr
00001cca <_usart_sync_is_ready_to_send>:
return hri_sercomusart_get_interrupt_DRE_bit(device->hw);
1cca: 6803 ldr r3, [r0, #0]
return (((Sercom *)hw)->USART.INTFLAG.reg & SERCOM_USART_INTFLAG_DRE) >> SERCOM_USART_INTFLAG_DRE_Pos;
1ccc: 7e18 ldrb r0, [r3, #24]
1cce: 2301 movs r3, #1
1cd0: 4018 ands r0, r3
}
1cd2: 4770 bx lr
00001cd4 <_usart_sync_is_transmit_done>:
return hri_sercomusart_get_interrupt_TXC_bit(device->hw);
1cd4: 6803 ldr r3, [r0, #0]
return (((Sercom *)hw)->USART.INTFLAG.reg & SERCOM_USART_INTFLAG_TXC) >> SERCOM_USART_INTFLAG_TXC_Pos;
1cd6: 7e18 ldrb r0, [r3, #24]
1cd8: 0780 lsls r0, r0, #30
1cda: 0fc0 lsrs r0, r0, #31
}
1cdc: 4770 bx lr
00001cde <_usart_sync_is_byte_received>:
return hri_sercomusart_get_interrupt_RXC_bit(device->hw);
1cde: 6803 ldr r3, [r0, #0]
return (((Sercom *)hw)->USART.INTFLAG.reg & SERCOM_USART_INTFLAG_RXC) >> SERCOM_USART_INTFLAG_RXC_Pos;
1ce0: 7e18 ldrb r0, [r3, #24]
1ce2: 0740 lsls r0, r0, #29
1ce4: 0fc0 lsrs r0, r0, #31
}
1ce6: 4770 bx lr
00001ce8 <atmel_start_init>:
/**
* Initializes MCU, drivers and middleware in the project
**/
void atmel_start_init(void)
{
1ce8: b510 push {r4, lr}
system_init();
1cea: 4b02 ldr r3, [pc, #8] ; (1cf4 <atmel_start_init+0xc>)
1cec: 4798 blx r3
usb_init();
1cee: 4b02 ldr r3, [pc, #8] ; (1cf8 <atmel_start_init+0x10>)
1cf0: 4798 blx r3
}
1cf2: bd10 pop {r4, pc}
1cf4: 00001bc5 .word 0x00001bc5
1cf8: 00001301 .word 0x00001301
00001cfc <usbdc_unconfig>:
/**
* \brief Unconfig, close all interfaces
*/
static void usbdc_unconfig(void)
{
struct usbdf_driver *func = (struct usbdf_driver *)usbdc.func_list.head;
1cfc: 4b06 ldr r3, [pc, #24] ; (1d18 <usbdc_unconfig+0x1c>)
{
1cfe: b510 push {r4, lr}
struct usbdf_driver *func = (struct usbdf_driver *)usbdc.func_list.head;
1d00: 691c ldr r4, [r3, #16]
while (NULL != func) {
1d02: 2c00 cmp r4, #0
1d04: d100 bne.n 1d08 <usbdc_unconfig+0xc>
func->ctrl(func, USBDF_DISABLE, NULL);
func = func->next;
}
}
1d06: bd10 pop {r4, pc}
func->ctrl(func, USBDF_DISABLE, NULL);
1d08: 0020 movs r0, r4
1d0a: 6863 ldr r3, [r4, #4]
1d0c: 2200 movs r2, #0
1d0e: 2101 movs r1, #1
1d10: 4798 blx r3
func = func->next;
1d12: 6824 ldr r4, [r4, #0]
1d14: e7f5 b.n 1d02 <usbdc_unconfig+0x6>
1d16: 46c0 nop ; (mov r8, r8)
1d18: 2000039c .word 0x2000039c
00001d1c <usbdc_change_notify>:
}
}
/** Invoke all registered Change notification callbacks. */
static void usbdc_change_notify(enum usbdc_change_type change, uint32_t value)
{
1d1c: b570 push {r4, r5, r6, lr}
1d1e: 0005 movs r5, r0
1d20: 000e movs r6, r1
struct usbdc_change_handler *cg = (struct usbdc_change_handler *)usbdc.handlers.change_list.head;
1d22: 4b06 ldr r3, [pc, #24] ; (1d3c <usbdc_change_notify+0x20>)
1d24: 68dc ldr r4, [r3, #12]
while (cg != NULL) {
1d26: 2c00 cmp r4, #0
1d28: d100 bne.n 1d2c <usbdc_change_notify+0x10>
if (NULL != cg->cb) {
cg->cb(change, value);
}
cg = cg->next;
}
}
1d2a: bd70 pop {r4, r5, r6, pc}
if (NULL != cg->cb) {
1d2c: 6863 ldr r3, [r4, #4]
1d2e: 2b00 cmp r3, #0
1d30: d002 beq.n 1d38 <usbdc_change_notify+0x1c>
cg->cb(change, value);
1d32: 0031 movs r1, r6
1d34: 0028 movs r0, r5
1d36: 4798 blx r3
cg = cg->next;
1d38: 6824 ldr r4, [r4, #0]
1d3a: e7f4 b.n 1d26 <usbdc_change_notify+0xa>
1d3c: 2000039c .word 0x2000039c
00001d40 <usbdc_request_handler>:
/** 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)
{
1d40: b5f8 push {r3, r4, r5, r6, r7, lr}
1d42: 0005 movs r5, r0
1d44: 000e movs r6, r1
1d46: 0017 movs r7, r2
struct usbdc_req_handler *h = (struct usbdc_req_handler *)usbdc.handlers.req_list.head;
1d48: 4b0b ldr r3, [pc, #44] ; (1d78 <usbdc_request_handler+0x38>)
1d4a: 689c ldr r4, [r3, #8]
int32_t rc;
while (h != NULL) {
1d4c: 2c00 cmp r4, #0
1d4e: d101 bne.n 1d54 <usbdc_request_handler+0x14>
return -1;
}
}
h = h->next;
}
return false;
1d50: 0020 movs r0, r4
}
1d52: bdf8 pop {r3, r4, r5, r6, r7, pc}
if (NULL != h->cb) {
1d54: 6863 ldr r3, [r4, #4]
1d56: 2b00 cmp r3, #0
1d58: d101 bne.n 1d5e <usbdc_request_handler+0x1e>
h = h->next;
1d5a: 6824 ldr r4, [r4, #0]
1d5c: e7f6 b.n 1d4c <usbdc_request_handler+0xc>
rc = h->cb(ep, req, stage);
1d5e: 003a movs r2, r7
1d60: 0031 movs r1, r6
1d62: 0028 movs r0, r5
1d64: 4798 blx r3
if (0 == rc) {
1d66: 2800 cmp r0, #0
1d68: d004 beq.n 1d74 <usbdc_request_handler+0x34>
} else if (ERR_NOT_FOUND != rc) {
1d6a: 300a adds r0, #10
1d6c: d0f5 beq.n 1d5a <usbdc_request_handler+0x1a>
return -1;
1d6e: 2001 movs r0, #1
1d70: 4240 negs r0, r0
1d72: e7ee b.n 1d52 <usbdc_request_handler+0x12>
return true;
1d74: 2001 movs r0, #1
1d76: e7ec b.n 1d52 <usbdc_request_handler+0x12>
1d78: 2000039c .word 0x2000039c
00001d7c <usbd_sof_cb>:
struct usbdc_sof_handler *sof = (struct usbdc_sof_handler *)usbdc.handlers.sof_list.head;
1d7c: 4b05 ldr r3, [pc, #20] ; (1d94 <usbd_sof_cb+0x18>)
/**
* \brief Callback invoked on USB device SOF
*/
static void usbd_sof_cb(void)
{
1d7e: b510 push {r4, lr}
struct usbdc_sof_handler *sof = (struct usbdc_sof_handler *)usbdc.handlers.sof_list.head;
1d80: 685c ldr r4, [r3, #4]
while (sof != NULL) {
1d82: 2c00 cmp r4, #0
1d84: d100 bne.n 1d88 <usbd_sof_cb+0xc>
usbdc_sof_notify();
}
1d86: bd10 pop {r4, pc}
if (NULL != sof->cb) {
1d88: 6863 ldr r3, [r4, #4]
1d8a: 2b00 cmp r3, #0
1d8c: d000 beq.n 1d90 <usbd_sof_cb+0x14>
sof->cb();
1d8e: 4798 blx r3
sof = sof->next;
1d90: 6824 ldr r4, [r4, #0]
1d92: e7f6 b.n 1d82 <usbd_sof_cb+0x6>
1d94: 2000039c .word 0x2000039c
00001d98 <usbdc_cb_ctl_done>:
* \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)
{
1d98: b510 push {r4, lr}
1d9a: 0014 movs r4, r2
(void)ep;
switch (code) {
1d9c: 2900 cmp r1, #0
1d9e: d003 beq.n 1da8 <usbdc_cb_ctl_done+0x10>
1da0: 2901 cmp r1, #1
1da2: d023 beq.n 1dec <usbdc_cb_ctl_done+0x54>
return usbdc_ctrl_data_end(req);
default:
break;
}
return false;
}
1da4: 2000 movs r0, #0
1da6: bd10 pop {r4, pc}
if (req->bmRequestType != USB_REQT_TYPE_STANDARD) {
1da8: 7813 ldrb r3, [r2, #0]
1daa: 2b00 cmp r3, #0
1dac: d1fa bne.n 1da4 <usbdc_cb_ctl_done+0xc>
switch (req->bRequest) {
1dae: 7853 ldrb r3, [r2, #1]
1db0: 2b05 cmp r3, #5
1db2: d00f beq.n 1dd4 <usbdc_cb_ctl_done+0x3c>
1db4: 2b09 cmp r3, #9
1db6: d1f5 bne.n 1da4 <usbdc_cb_ctl_done+0xc>
usbdc.cfg_value = req->wValue;
1db8: 78e1 ldrb r1, [r4, #3]
1dba: 7892 ldrb r2, [r2, #2]
1dbc: 4b0e ldr r3, [pc, #56] ; (1df8 <usbdc_cb_ctl_done+0x60>)
1dbe: 0209 lsls r1, r1, #8
1dc0: 4311 orrs r1, r2
1dc2: 76d9 strb r1, [r3, #27]
usbdc.state = req->wValue ? USBD_S_CONFIG : USBD_S_ADDRESS;
1dc4: 1e4a subs r2, r1, #1
1dc6: 4191 sbcs r1, r2
1dc8: 3103 adds r1, #3
usbdc.state = req->wValue ? USBD_S_ADDRESS : USBD_S_DEFAULT;
1dca: 7699 strb r1, [r3, #26]
usbdc_change_notify(USBDC_C_STATE, usbdc.state);
1dcc: 2001 movs r0, #1
1dce: 4b0b ldr r3, [pc, #44] ; (1dfc <usbdc_cb_ctl_done+0x64>)
1dd0: 4798 blx r3
break;
1dd2: e7e7 b.n 1da4 <usbdc_cb_ctl_done+0xc>
usb_d_set_address(addr);
1dd4: 4b0a ldr r3, [pc, #40] ; (1e00 <usbdc_cb_ctl_done+0x68>)
1dd6: 7890 ldrb r0, [r2, #2]
1dd8: 4798 blx r3
usbdc.state = req->wValue ? USBD_S_ADDRESS : USBD_S_DEFAULT;
1dda: 78e1 ldrb r1, [r4, #3]
1ddc: 78a2 ldrb r2, [r4, #2]
1dde: 0209 lsls r1, r1, #8
1de0: 4311 orrs r1, r2
1de2: 1e4b subs r3, r1, #1
1de4: 4199 sbcs r1, r3
1de6: 4b04 ldr r3, [pc, #16] ; (1df8 <usbdc_cb_ctl_done+0x60>)
1de8: 3102 adds r1, #2
1dea: e7ee b.n 1dca <usbdc_cb_ctl_done+0x32>
usbdc_request_handler(0, req, USB_DATA_STAGE);
1dec: 000a movs r2, r1
1dee: 4b05 ldr r3, [pc, #20] ; (1e04 <usbdc_cb_ctl_done+0x6c>)
1df0: 0021 movs r1, r4
1df2: 2000 movs r0, #0
1df4: 4798 blx r3
return usbdc_ctrl_data_end(req);
1df6: e7d5 b.n 1da4 <usbdc_cb_ctl_done+0xc>
1df8: 2000039c .word 0x2000039c
1dfc: 00001d1d .word 0x00001d1d
1e00: 000017e5 .word 0x000017e5
1e04: 00001d41 .word 0x00001d41
00001e08 <usbdc_reset>:
/**
* \brief USB Device Core Reset
*/
void usbdc_reset(void)
{
1e08: b570 push {r4, r5, r6, lr}
usbdc_unconfig();
usbdc.state = USBD_S_DEFAULT;
usbdc.cfg_value = 0;
usbdc.ifc_alt_map = 0;
1e0a: 2400 movs r4, #0
usbdc.state = USBD_S_DEFAULT;
1e0c: 2602 movs r6, #2
usbdc_unconfig();
1e0e: 4b0c ldr r3, [pc, #48] ; (1e40 <usbdc_reset+0x38>)
1e10: 4798 blx r3
usbdc.state = USBD_S_DEFAULT;
1e12: 4d0c ldr r5, [pc, #48] ; (1e44 <usbdc_reset+0x3c>)
// Setup EP0
usb_d_ep_deinit(0);
1e14: 0020 movs r0, r4
usbdc.state = USBD_S_DEFAULT;
1e16: 836e strh r6, [r5, #26]
usb_d_ep_deinit(0);
1e18: 4b0b ldr r3, [pc, #44] ; (1e48 <usbdc_reset+0x40>)
usbdc.ifc_alt_map = 0;
1e1a: 776c strb r4, [r5, #29]
usb_d_ep_deinit(0);
1e1c: 4798 blx r3
usb_d_ep0_init(usbdc.ctrl_size);
1e1e: 4b0b ldr r3, [pc, #44] ; (1e4c <usbdc_reset+0x44>)
1e20: 7f28 ldrb r0, [r5, #28]
1e22: 4798 blx r3
usb_d_ep_register_callback(0, USB_D_EP_CB_SETUP, (FUNC_PTR)usbdc_cb_ctl_req);
1e24: 4d0a ldr r5, [pc, #40] ; (1e50 <usbdc_reset+0x48>)
1e26: 0021 movs r1, r4
1e28: 0020 movs r0, r4
1e2a: 4a0a ldr r2, [pc, #40] ; (1e54 <usbdc_reset+0x4c>)
1e2c: 47a8 blx r5
usb_d_ep_register_callback(0, USB_D_EP_CB_XFER, (FUNC_PTR)usbdc_cb_ctl_done);
1e2e: 0031 movs r1, r6
1e30: 0020 movs r0, r4
1e32: 4a09 ldr r2, [pc, #36] ; (1e58 <usbdc_reset+0x50>)
1e34: 47a8 blx r5
usb_d_ep_enable(0);
1e36: 0020 movs r0, r4
1e38: 4b08 ldr r3, [pc, #32] ; (1e5c <usbdc_reset+0x54>)
1e3a: 4798 blx r3
}
1e3c: bd70 pop {r4, r5, r6, pc}
1e3e: 46c0 nop ; (mov r8, r8)
1e40: 00001cfd .word 0x00001cfd
1e44: 2000039c .word 0x2000039c
1e48: 00001855 .word 0x00001855
1e4c: 00001841 .word 0x00001841
1e50: 00001a15 .word 0x00001a15
1e54: 00001e9d .word 0x00001e9d
1e58: 00001d99 .word 0x00001d99
1e5c: 00001881 .word 0x00001881
00001e60 <usbd_event_cb>:
* \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)
{
1e60: b510 push {r4, lr}
(void)param;
switch (ev) {
1e62: 2800 cmp r0, #0
1e64: d002 beq.n 1e6c <usbd_event_cb+0xc>
1e66: 2801 cmp r0, #1
1e68: d003 beq.n 1e72 <usbd_event_cb+0x12>
break;
default:
break;
}
}
1e6a: bd10 pop {r4, pc}
usbdc_change_notify(USBDC_C_CONN, param);
1e6c: 4b02 ldr r3, [pc, #8] ; (1e78 <usbd_event_cb+0x18>)
1e6e: 4798 blx r3
break;
1e70: e7fb b.n 1e6a <usbd_event_cb+0xa>
usbdc_reset();
1e72: 4b02 ldr r3, [pc, #8] ; (1e7c <usbd_event_cb+0x1c>)
1e74: 4798 blx r3
}
1e76: e7f8 b.n 1e6a <usbd_event_cb+0xa>
1e78: 00001d1d .word 0x00001d1d
1e7c: 00001e09 .word 0x00001e09
00001e80 <usbdc_xfer>:
/**
* \brief Issue USB device transfer
*/
int32_t usbdc_xfer(uint8_t ep, uint8_t *buf, uint32_t size, bool zlp)
{
1e80: b51f push {r0, r1, r2, r3, r4, lr}
struct usb_d_transfer xfer = {(uint8_t *)buf, size, ep, zlp};
1e82: 9202 str r2, [sp, #8]
1e84: 466a mov r2, sp
1e86: 7310 strb r0, [r2, #12]
1e88: 7353 strb r3, [r2, #13]
return usb_d_ep_transfer(&xfer);
1e8a: a801 add r0, sp, #4
1e8c: 4b02 ldr r3, [pc, #8] ; (1e98 <usbdc_xfer+0x18>)
struct usb_d_transfer xfer = {(uint8_t *)buf, size, ep, zlp};
1e8e: 9101 str r1, [sp, #4]
return usb_d_ep_transfer(&xfer);
1e90: 4798 blx r3
}
1e92: b005 add sp, #20
1e94: bd00 pop {pc}
1e96: 46c0 nop ; (mov r8, r8)
1e98: 000018c1 .word 0x000018c1
00001e9c <usbdc_cb_ctl_req>:
{
1e9c: b5f7 push {r0, r1, r2, r4, r5, r6, r7, lr}
switch (usbdc_request_handler(ep, req, USB_SETUP_STAGE)) {
1e9e: 4bb7 ldr r3, [pc, #732] ; (217c <STACK_SIZE+0x17c>)
1ea0: 2200 movs r2, #0
{
1ea2: 0004 movs r4, r0
1ea4: 000d movs r5, r1
switch (usbdc_request_handler(ep, req, USB_SETUP_STAGE)) {
1ea6: 4798 blx r3
1ea8: 0003 movs r3, r0
return false;
1eaa: 2000 movs r0, #0
switch (usbdc_request_handler(ep, req, USB_SETUP_STAGE)) {
1eac: 1c5a adds r2, r3, #1
1eae: d100 bne.n 1eb2 <usbdc_cb_ctl_req+0x16>
1eb0: e0c1 b.n 2036 <STACK_SIZE+0x36>
1eb2: 3001 adds r0, #1
1eb4: 4283 cmp r3, r0
1eb6: d100 bne.n 1eba <usbdc_cb_ctl_req+0x1e>
1eb8: e0bd b.n 2036 <STACK_SIZE+0x36>
switch (req->bmRequestType & (USB_REQT_TYPE_MASK | USB_REQT_DIR_IN)) {
1eba: 782b ldrb r3, [r5, #0]
1ebc: 221f movs r2, #31
1ebe: 0019 movs r1, r3
1ec0: 4391 bics r1, r2
1ec2: d004 beq.n 1ece <usbdc_cb_ctl_req+0x32>
1ec4: 2980 cmp r1, #128 ; 0x80
1ec6: d100 bne.n 1eca <usbdc_cb_ctl_req+0x2e>
1ec8: e0b6 b.n 2038 <STACK_SIZE+0x38>
switch (req->bRequest) {
1eca: 2000 movs r0, #0
1ecc: e0b3 b.n 2036 <STACK_SIZE+0x36>
switch (req->bRequest) {
1ece: 7868 ldrb r0, [r5, #1]
1ed0: 3801 subs r0, #1
1ed2: 280a cmp r0, #10
1ed4: d8f9 bhi.n 1eca <usbdc_cb_ctl_req+0x2e>
1ed6: f000 fa05 bl 22e4 <__gnu_thumb1_case_sqi>
1eda: f846 .short 0xf846
1edc: f80bf856 .word 0xf80bf856
1ee0: f806f8f8 .word 0xf806f8f8
1ee4: 60 .byte 0x60
1ee5: 00 .byte 0x00
if (!usbdc_set_config(req->wValue)) {
1ee6: 78aa ldrb r2, [r5, #2]
if (cfg_value == 0) {
1ee8: 2a00 cmp r2, #0
1eea: d10b bne.n 1f04 <usbdc_cb_ctl_req+0x68>
usbdc_unconfig();
1eec: 4ba4 ldr r3, [pc, #656] ; (2180 <STACK_SIZE+0x180>)
1eee: 4798 blx r3
return (ERR_NONE == usbdc_xfer(ep, NULL, 0, true));
1ef0: 2200 movs r2, #0
1ef2: 2301 movs r3, #1
1ef4: 0011 movs r1, r2
if (ERR_NONE != usbdc_xfer(ep, str_desc, length, need_zlp)) {
1ef6: 0020 movs r0, r4
1ef8: 4ca2 ldr r4, [pc, #648] ; (2184 <STACK_SIZE+0x184>)
1efa: 47a0 blx r4
1efc: 4243 negs r3, r0
1efe: 4158 adcs r0, r3
1f00: b2c0 uxtb r0, r0
1f02: e098 b.n 2036 <STACK_SIZE+0x36>
cfg_desc = usb_find_cfg_desc(usbdc.desces.ls_fs->sod, usbdc.desces.ls_fs->eod, cfg_value);
1f04: 4da0 ldr r5, [pc, #640] ; (2188 <STACK_SIZE+0x188>)
1f06: 682b ldr r3, [r5, #0]
1f08: cb03 ldmia r3!, {r0, r1}
1f0a: 4ba0 ldr r3, [pc, #640] ; (218c <STACK_SIZE+0x18c>)
1f0c: 4798 blx r3
if (NULL == cfg_desc) {
1f0e: 2800 cmp r0, #0
1f10: d100 bne.n 1f14 <usbdc_cb_ctl_req+0x78>
1f12: e090 b.n 2036 <STACK_SIZE+0x36>
return (ptr[0] + (ptr[1] << 8));
1f14: 78c3 ldrb r3, [r0, #3]
1f16: 7881 ldrb r1, [r0, #2]
1f18: 021b lsls r3, r3, #8
1f1a: 18c9 adds r1, r1, r3
desc.eod = cfg_desc + total_len;
1f1c: b289 uxth r1, r1
1f1e: 1841 adds r1, r0, r1
desc.sod = usb_find_desc(cfg_desc, desc.eod, USB_DT_INTERFACE);
1f20: 2204 movs r2, #4
1f22: 4b9b ldr r3, [pc, #620] ; (2190 <STACK_SIZE+0x190>)
desc.eod = cfg_desc + total_len;
1f24: 9101 str r1, [sp, #4]
desc.sod = usb_find_desc(cfg_desc, desc.eod, USB_DT_INTERFACE);
1f26: 4798 blx r3
uint8_t last_iface = 0xFF;
1f28: 22ff movs r2, #255 ; 0xff
desc.sod = usb_find_desc(cfg_desc, desc.eod, USB_DT_INTERFACE);
1f2a: 9000 str r0, [sp, #0]
while (NULL != desc.sod) {
1f2c: 9b00 ldr r3, [sp, #0]
1f2e: 2b00 cmp r3, #0
1f30: d0de beq.n 1ef0 <usbdc_cb_ctl_req+0x54>
if (last_iface != desc.sod[2] /* bInterfaceNumber */) {
1f32: 789e ldrb r6, [r3, #2]
1f34: 4296 cmp r6, r2
1f36: d002 beq.n 1f3e <usbdc_cb_ctl_req+0xa2>
func = (struct usbdf_driver *)usbdc.func_list.head;
1f38: 692f ldr r7, [r5, #16]
while (NULL != func) {
1f3a: 2f00 cmp r7, #0
1f3c: d10a bne.n 1f54 <usbdc_cb_ctl_req+0xb8>
desc.sod = usb_desc_next(desc.sod);
1f3e: 9800 ldr r0, [sp, #0]
desc.sod = usb_find_desc(desc.sod, desc.eod, USB_DT_INTERFACE);
1f40: 2204 movs r2, #4
return (desc + usb_desc_len(desc));
1f42: 7803 ldrb r3, [r0, #0]
1f44: 9901 ldr r1, [sp, #4]
1f46: 18c0 adds r0, r0, r3
desc.sod = usb_desc_next(desc.sod);
1f48: 9000 str r0, [sp, #0]
desc.sod = usb_find_desc(desc.sod, desc.eod, USB_DT_INTERFACE);
1f4a: 4b91 ldr r3, [pc, #580] ; (2190 <STACK_SIZE+0x190>)
1f4c: 4798 blx r3
1f4e: 0032 movs r2, r6
1f50: 9000 str r0, [sp, #0]
1f52: e7eb b.n 1f2c <usbdc_cb_ctl_req+0x90>
if (func->ctrl(func, USBDF_ENABLE, &desc)) {
1f54: 466a mov r2, sp
1f56: 2100 movs r1, #0
1f58: 0038 movs r0, r7
1f5a: 687b ldr r3, [r7, #4]
1f5c: 4798 blx r3
1f5e: 2800 cmp r0, #0
1f60: d0ed beq.n 1f3e <usbdc_cb_ctl_req+0xa2>
func = func->next;
1f62: 683f ldr r7, [r7, #0]
1f64: e7e9 b.n 1f3a <usbdc_cb_ctl_req+0x9e>
switch (req->bmRequestType & USB_REQT_RECIP_MASK) {
1f66: 2b02 cmp r3, #2
1f68: d1af bne.n 1eca <usbdc_cb_ctl_req+0x2e>
if (req->wLength != 0) {
1f6a: 79ee ldrb r6, [r5, #7]
1f6c: 79ab ldrb r3, [r5, #6]
1f6e: 0236 lsls r6, r6, #8
1f70: 431e orrs r6, r3
1f72: d1aa bne.n 1eca <usbdc_cb_ctl_req+0x2e>
usb_d_ep_halt(req->wIndex & 0xFF, USB_EP_HALT_CLR);
1f74: 0031 movs r1, r6
1f76: 7928 ldrb r0, [r5, #4]
usb_d_ep_halt(req->wIndex & 0xFF, USB_EP_HALT_SET);
1f78: 4b86 ldr r3, [pc, #536] ; (2194 <STACK_SIZE+0x194>)
1f7a: 4798 blx r3
usbdc_xfer(ep, NULL, 0, true);
1f7c: 2301 movs r3, #1
1f7e: 0032 movs r2, r6
1f80: 0031 movs r1, r6
usbdc_xfer(ep, usbdc.ctrl_buf, 1, false);
1f82: 0020 movs r0, r4
1f84: e054 b.n 2030 <STACK_SIZE+0x30>
switch (req->bmRequestType & USB_REQT_RECIP_MASK) {
1f86: 2b02 cmp r3, #2
1f88: d19f bne.n 1eca <usbdc_cb_ctl_req+0x2e>
if (req->wLength != 0) {
1f8a: 79eb ldrb r3, [r5, #7]
1f8c: 79ae ldrb r6, [r5, #6]
1f8e: 021b lsls r3, r3, #8
1f90: 431e orrs r6, r3
1f92: d19a bne.n 1eca <usbdc_cb_ctl_req+0x2e>
usb_d_ep_halt(req->wIndex & 0xFF, USB_EP_HALT_SET);
1f94: 2101 movs r1, #1
1f96: 7928 ldrb r0, [r5, #4]
1f98: e7ee b.n 1f78 <usbdc_cb_ctl_req+0xdc>
return usbdc_set_interface(req->wValue, req->wIndex);
1f9a: 78ec ldrb r4, [r5, #3]
1f9c: 78ab ldrb r3, [r5, #2]
1f9e: 0224 lsls r4, r4, #8
1fa0: 431c orrs r4, r3
1fa2: 792b ldrb r3, [r5, #4]
1fa4: 796d ldrb r5, [r5, #5]
ifc = usb_find_cfg_desc(usbdc.desces.ls_fs->sod, usbdc.desces.ls_fs->eod, usbdc.cfg_value);
1fa6: 4e78 ldr r6, [pc, #480] ; (2188 <STACK_SIZE+0x188>)
return usbdc_set_interface(req->wValue, req->wIndex);
1fa8: 022d lsls r5, r5, #8
1faa: 431d orrs r5, r3
ifc = usb_find_cfg_desc(usbdc.desces.ls_fs->sod, usbdc.desces.ls_fs->eod, usbdc.cfg_value);
1fac: 6833 ldr r3, [r6, #0]
1fae: 7ef2 ldrb r2, [r6, #27]
1fb0: cb03 ldmia r3!, {r0, r1}
1fb2: 4b76 ldr r3, [pc, #472] ; (218c <STACK_SIZE+0x18c>)
1fb4: 4798 blx r3
if (NULL == ifc) {
1fb6: 2800 cmp r0, #0
1fb8: d087 beq.n 1eca <usbdc_cb_ctl_req+0x2e>
if (NULL == (ifc = usb_find_desc(desc.sod, desc.eod, USB_DT_INTERFACE))) {
1fba: 2204 movs r2, #4
desc.sod = ifc;
1fbc: 9000 str r0, [sp, #0]
return (ptr[0] + (ptr[1] << 8));
1fbe: 78c3 ldrb r3, [r0, #3]
1fc0: 7881 ldrb r1, [r0, #2]
1fc2: 021b lsls r3, r3, #8
1fc4: 18c9 adds r1, r1, r3
desc.eod = ifc + usb_cfg_desc_total_len(ifc);
1fc6: b289 uxth r1, r1
1fc8: 1841 adds r1, r0, r1
if (NULL == (ifc = usb_find_desc(desc.sod, desc.eod, USB_DT_INTERFACE))) {
1fca: 4f71 ldr r7, [pc, #452] ; (2190 <STACK_SIZE+0x190>)
desc.eod = ifc + usb_cfg_desc_total_len(ifc);
1fcc: 9101 str r1, [sp, #4]
ifc = usb_find_desc(desc.sod, desc.eod, USB_DT_INTERFACE);
1fce: 47b8 blx r7
if (NULL == ifc) {
1fd0: 2800 cmp r0, #0
1fd2: d100 bne.n 1fd6 <usbdc_cb_ctl_req+0x13a>
1fd4: e779 b.n 1eca <usbdc_cb_ctl_req+0x2e>
while (ifc[2] != ifc_id || ifc[3] != alt_set) {
1fd6: 7883 ldrb r3, [r0, #2]
1fd8: 42ab cmp r3, r5
1fda: d110 bne.n 1ffe <usbdc_cb_ctl_req+0x162>
1fdc: 78c3 ldrb r3, [r0, #3]
1fde: 42a3 cmp r3, r4
1fe0: d10d bne.n 1ffe <usbdc_cb_ctl_req+0x162>
func = (struct usbdf_driver *)usbdc.func_list.head;
1fe2: 6937 ldr r7, [r6, #16]
desc.sod = ifc;
1fe4: 9000 str r0, [sp, #0]
while (NULL != func) {
1fe6: 2f00 cmp r7, #0
1fe8: d100 bne.n 1fec <usbdc_cb_ctl_req+0x150>
1fea: e76e b.n 1eca <usbdc_cb_ctl_req+0x2e>
if (func->ctrl(func, USBDF_DISABLE, &desc)) {
1fec: 2101 movs r1, #1
1fee: 466a mov r2, sp
1ff0: 0038 movs r0, r7
1ff2: 687b ldr r3, [r7, #4]
1ff4: 4798 blx r3
1ff6: 1e01 subs r1, r0, #0
1ff8: d008 beq.n 200c <STACK_SIZE+0xc>
func = func->next;
1ffa: 683f ldr r7, [r7, #0]
1ffc: e7f3 b.n 1fe6 <usbdc_cb_ctl_req+0x14a>
desc.sod = usb_desc_next(desc.sod);
1ffe: 9800 ldr r0, [sp, #0]
ifc = usb_find_desc(desc.sod, desc.eod, USB_DT_INTERFACE);
2000: 2204 movs r2, #4
return (desc + usb_desc_len(desc));
2002: 7803 ldrb r3, [r0, #0]
2004: 9901 ldr r1, [sp, #4]
2006: 18c0 adds r0, r0, r3
desc.sod = usb_desc_next(desc.sod);
2008: 9000 str r0, [sp, #0]
ifc = usb_find_desc(desc.sod, desc.eod, USB_DT_INTERFACE);
200a: e7e0 b.n 1fce <usbdc_cb_ctl_req+0x132>
} else if (ERR_NONE == func->ctrl(func, USBDF_ENABLE, &desc)) {
200c: 466a mov r2, sp
200e: 0038 movs r0, r7
2010: 687b ldr r3, [r7, #4]
2012: 4798 blx r3
2014: 2800 cmp r0, #0
2016: d000 beq.n 201a <STACK_SIZE+0x1a>
2018: e757 b.n 1eca <usbdc_cb_ctl_req+0x2e>
if (alt_set) {
201a: 2c00 cmp r4, #0
201c: d004 beq.n 2028 <STACK_SIZE+0x28>
usbdc.ifc_alt_map |= 1 << ifc_id;
201e: 2201 movs r2, #1
2020: 40aa lsls r2, r5
2022: 7f73 ldrb r3, [r6, #29]
2024: 4313 orrs r3, r2
2026: 7773 strb r3, [r6, #29]
usbdc_xfer(0, NULL, 0, 0);
2028: 2300 movs r3, #0
202a: 001a movs r2, r3
202c: 0019 movs r1, r3
202e: 0018 movs r0, r3
2030: 4c54 ldr r4, [pc, #336] ; (2184 <STACK_SIZE+0x184>)
2032: 47a0 blx r4
return true;
2034: 2001 movs r0, #1
}
2036: bdfe pop {r1, r2, r3, r4, r5, r6, r7, pc}
switch (req->bRequest) {
2038: 7868 ldrb r0, [r5, #1]
203a: 280a cmp r0, #10
203c: d900 bls.n 2040 <STACK_SIZE+0x40>
203e: e744 b.n 1eca <usbdc_cb_ctl_req+0x2e>
2040: f000 f95a bl 22f8 <__gnu_thumb1_case_shi>
2044: ff430062 .word 0xff430062
2048: ff43ff43 .word 0xff43ff43
204c: ff43ff43 .word 0xff43ff43
2050: ff43000b .word 0xff43000b
2054: ff43005a .word 0xff43005a
2058: 0083 .short 0x0083
uint8_t type = (uint8_t)(req->wValue >> 8);
205a: 78e9 ldrb r1, [r5, #3]
205c: 78ab ldrb r3, [r5, #2]
205e: 0209 lsls r1, r1, #8
2060: 430b orrs r3, r1
2062: 0a09 lsrs r1, r1, #8
2064: b2ca uxtb r2, r1
switch (type) {
2066: 2902 cmp r1, #2
2068: d017 beq.n 209a <STACK_SIZE+0x9a>
206a: 2a03 cmp r2, #3
206c: d034 beq.n 20d8 <STACK_SIZE+0xd8>
206e: 2000 movs r0, #0
2070: 2a01 cmp r2, #1
2072: d1e0 bne.n 2036 <STACK_SIZE+0x36>
uint16_t length = req->wLength;
2074: 79ab ldrb r3, [r5, #6]
2076: 79ed ldrb r5, [r5, #7]
2078: 022d lsls r5, r5, #8
207a: 431d orrs r5, r3
dev_desc = usb_find_desc(usbdc.desces.ls_fs->sod, usbdc.desces.ls_fs->eod, USB_DT_DEVICE);
207c: 4b42 ldr r3, [pc, #264] ; (2188 <STACK_SIZE+0x188>)
207e: 681b ldr r3, [r3, #0]
2080: cb03 ldmia r3!, {r0, r1}
2082: 4b43 ldr r3, [pc, #268] ; (2190 <STACK_SIZE+0x190>)
2084: 4798 blx r3
2086: 1e01 subs r1, r0, #0
if (!dev_desc) {
2088: d100 bne.n 208c <STACK_SIZE+0x8c>
208a: e71e b.n 1eca <usbdc_cb_ctl_req+0x2e>
if (ERR_NONE != usbdc_xfer(ep, dev_desc, length, false)) {
208c: 1c2a adds r2, r5, #0
208e: 2d12 cmp r5, #18
2090: d900 bls.n 2094 <STACK_SIZE+0x94>
2092: 2212 movs r2, #18
2094: 2300 movs r3, #0
2096: b292 uxth r2, r2
2098: e72d b.n 1ef6 <usbdc_cb_ctl_req+0x5a>
uint16_t length = req->wLength;
209a: 79aa ldrb r2, [r5, #6]
209c: 79ed ldrb r5, [r5, #7]
cfg_desc = usb_find_cfg_desc(usbdc.desces.ls_fs->sod, usbdc.desces.ls_fs->eod, index + 1);
209e: 3301 adds r3, #1
uint16_t length = req->wLength;
20a0: 022d lsls r5, r5, #8
20a2: 4315 orrs r5, r2
bool need_zlp = !(length & (usbdc.ctrl_size - 1));
20a4: 4a38 ldr r2, [pc, #224] ; (2188 <STACK_SIZE+0x188>)
cfg_desc = usb_find_cfg_desc(usbdc.desces.ls_fs->sod, usbdc.desces.ls_fs->eod, index + 1);
20a6: 6810 ldr r0, [r2, #0]
bool need_zlp = !(length & (usbdc.ctrl_size - 1));
20a8: 7f16 ldrb r6, [r2, #28]
cfg_desc = usb_find_cfg_desc(usbdc.desces.ls_fs->sod, usbdc.desces.ls_fs->eod, index + 1);
20aa: c803 ldmia r0, {r0, r1}
20ac: b2da uxtb r2, r3
20ae: 4b37 ldr r3, [pc, #220] ; (218c <STACK_SIZE+0x18c>)
20b0: 4798 blx r3
20b2: 1e01 subs r1, r0, #0
if (NULL == cfg_desc) {
20b4: d100 bne.n 20b8 <STACK_SIZE+0xb8>
20b6: e708 b.n 1eca <usbdc_cb_ctl_req+0x2e>
return (ptr[0] + (ptr[1] << 8));
20b8: 78c3 ldrb r3, [r0, #3]
20ba: 7882 ldrb r2, [r0, #2]
20bc: 021b lsls r3, r3, #8
20be: 18d2 adds r2, r2, r3
20c0: b292 uxth r2, r2
need_zlp = false;
20c2: 2300 movs r3, #0
if (length <= str_desc[0]) {
20c4: 4295 cmp r5, r2
20c6: d905 bls.n 20d4 <STACK_SIZE+0xd4>
bool need_zlp = !(length & (usbdc.ctrl_size - 1));
20c8: 3e01 subs r6, #1
20ca: 4035 ands r5, r6
20cc: 426b negs r3, r5
20ce: 415d adcs r5, r3
20d0: b2eb uxtb r3, r5
20d2: 0015 movs r5, r2
if (ERR_NONE != usbdc_xfer(ep, str_desc, length, need_zlp)) {
20d4: 002a movs r2, r5
20d6: e70e b.n 1ef6 <usbdc_cb_ctl_req+0x5a>
uint16_t length = req->wLength;
20d8: 79aa ldrb r2, [r5, #6]
20da: 79ed ldrb r5, [r5, #7]
20dc: 022d lsls r5, r5, #8
20de: 4315 orrs r5, r2
bool need_zlp = !(length & (usbdc.ctrl_size - 1));
20e0: 4a29 ldr r2, [pc, #164] ; (2188 <STACK_SIZE+0x188>)
str_desc = usb_find_str_desc(usbdc.desces.ls_fs->sod, usbdc.desces.ls_fs->eod, index);
20e2: 6810 ldr r0, [r2, #0]
bool need_zlp = !(length & (usbdc.ctrl_size - 1));
20e4: 7f16 ldrb r6, [r2, #28]
str_desc = usb_find_str_desc(usbdc.desces.ls_fs->sod, usbdc.desces.ls_fs->eod, index);
20e6: c803 ldmia r0, {r0, r1}
20e8: b2da uxtb r2, r3
20ea: 4b2b ldr r3, [pc, #172] ; (2198 <STACK_SIZE+0x198>)
20ec: 4798 blx r3
20ee: 1e01 subs r1, r0, #0
if (NULL == str_desc) {
20f0: d100 bne.n 20f4 <STACK_SIZE+0xf4>
20f2: e6ea b.n 1eca <usbdc_cb_ctl_req+0x2e>
if (length <= str_desc[0]) {
20f4: 7802 ldrb r2, [r0, #0]
20f6: e7e4 b.n 20c2 <STACK_SIZE+0xc2>
*(uint8_t *)usbdc.ctrl_buf = usbdc.cfg_value;
20f8: 4923 ldr r1, [pc, #140] ; (2188 <STACK_SIZE+0x188>)
20fa: 7ecb ldrb r3, [r1, #27]
20fc: 694a ldr r2, [r1, #20]
20fe: 7013 strb r3, [r2, #0]
usbdc_xfer(ep, usbdc.ctrl_buf, 1, false);
2100: 6949 ldr r1, [r1, #20]
2102: 2300 movs r3, #0
2104: 2201 movs r2, #1
2106: e73c b.n 1f82 <usbdc_cb_ctl_req+0xe6>
switch (req->bmRequestType & USB_REQT_RECIP_MASK) {
2108: 211f movs r1, #31
210a: 221e movs r2, #30
210c: 0018 movs r0, r3
210e: 4019 ands r1, r3
2110: 4010 ands r0, r2
2112: 4213 tst r3, r2
2114: d00e beq.n 2134 <STACK_SIZE+0x134>
2116: 2902 cmp r1, #2
2118: d000 beq.n 211c <STACK_SIZE+0x11c>
211a: e6d6 b.n 1eca <usbdc_cb_ctl_req+0x2e>
st = usb_d_ep_halt(req->wIndex & 0xFF, USB_EP_HALT_GET);
211c: 4b1d ldr r3, [pc, #116] ; (2194 <STACK_SIZE+0x194>)
211e: 7928 ldrb r0, [r5, #4]
2120: 4798 blx r3
2122: 0003 movs r3, r0
return false;
2124: 2000 movs r0, #0
if (st < 0) {
2126: 4283 cmp r3, r0
2128: da00 bge.n 212c <STACK_SIZE+0x12c>
212a: e784 b.n 2036 <STACK_SIZE+0x36>
st = st & 0x1;
212c: 3001 adds r0, #1
212e: 4003 ands r3, r0
2130: 9300 str r3, [sp, #0]
break;
2132: e000 b.n 2136 <STACK_SIZE+0x136>
st = 0;
2134: 9000 str r0, [sp, #0]
memcpy(usbdc.ctrl_buf, &st, 2);
2136: 4d14 ldr r5, [pc, #80] ; (2188 <STACK_SIZE+0x188>)
2138: 2202 movs r2, #2
213a: 4669 mov r1, sp
213c: 4b17 ldr r3, [pc, #92] ; (219c <STACK_SIZE+0x19c>)
213e: 6968 ldr r0, [r5, #20]
2140: 4798 blx r3
usbdc_xfer(ep, usbdc.ctrl_buf, 2, false);
2142: 2300 movs r3, #0
2144: 2202 movs r2, #2
2146: 6969 ldr r1, [r5, #20]
2148: e71b b.n 1f82 <usbdc_cb_ctl_req+0xe6>
if (!(usbdc.ifc_alt_map & (1 << req->wIndex))) {
214a: 4e0f ldr r6, [pc, #60] ; (2188 <STACK_SIZE+0x188>)
214c: 796b ldrb r3, [r5, #5]
214e: 7929 ldrb r1, [r5, #4]
2150: 7f72 ldrb r2, [r6, #29]
2152: 021b lsls r3, r3, #8
2154: 430b orrs r3, r1
2156: 411a asrs r2, r3
2158: 2401 movs r4, #1
215a: 0010 movs r0, r2
215c: 4020 ands r0, r4
215e: 4222 tst r2, r4
2160: d01e beq.n 21a0 <STACK_SIZE+0x1a0>
struct usbdf_driver *func = (struct usbdf_driver *)usbdc.func_list.head;
2162: 6934 ldr r4, [r6, #16]
while (NULL != func) {
2164: 2c00 cmp r4, #0
2166: d100 bne.n 216a <STACK_SIZE+0x16a>
2168: e6af b.n 1eca <usbdc_cb_ctl_req+0x2e>
if (0 > (rc = func->ctrl(func, USBDF_GET_IFACE, req))) {
216a: 002a movs r2, r5
216c: 2102 movs r1, #2
216e: 0020 movs r0, r4
2170: 6863 ldr r3, [r4, #4]
2172: 4798 blx r3
2174: 2800 cmp r0, #0
2176: da1b bge.n 21b0 <STACK_SIZE+0x1b0>
func = func->next;
2178: 6824 ldr r4, [r4, #0]
217a: e7f3 b.n 2164 <STACK_SIZE+0x164>
217c: 00001d41 .word 0x00001d41
2180: 00001cfd .word 0x00001cfd
2184: 00001e81 .word 0x00001e81
2188: 2000039c .word 0x2000039c
218c: 0000151d .word 0x0000151d
2190: 000014e5 .word 0x000014e5
2194: 000019b1 .word 0x000019b1
2198: 00001559 .word 0x00001559
219c: 00002355 .word 0x00002355
usbdc.ctrl_buf[0] = 0;
21a0: 6973 ldr r3, [r6, #20]
usbdc_xfer(0, usbdc.ctrl_buf, 1, false);
21a2: 0022 movs r2, r4
usbdc.ctrl_buf[0] = 0;
21a4: 7018 strb r0, [r3, #0]
usbdc_xfer(0, usbdc.ctrl_buf, 1, false);
21a6: 6971 ldr r1, [r6, #20]
21a8: 0003 movs r3, r0
21aa: 4d05 ldr r5, [pc, #20] ; (21c0 <STACK_SIZE+0x1c0>)
21ac: 47a8 blx r5
return true;
21ae: e741 b.n 2034 <STACK_SIZE+0x34>
usbdc.ctrl_buf[0] = (uint8_t)rc;
21b0: 6973 ldr r3, [r6, #20]
usbdc_xfer(0, usbdc.ctrl_buf, 1, false);
21b2: 2201 movs r2, #1
usbdc.ctrl_buf[0] = (uint8_t)rc;
21b4: 7018 strb r0, [r3, #0]
usbdc_xfer(0, usbdc.ctrl_buf, 1, false);
21b6: 2300 movs r3, #0
21b8: 6971 ldr r1, [r6, #20]
21ba: 0018 movs r0, r3
21bc: e738 b.n 2030 <STACK_SIZE+0x30>
21be: 46c0 nop ; (mov r8, r8)
21c0: 00001e81 .word 0x00001e81
000021c4 <usbdc_register_handler>:
/**
* \brief Register the handler
*/
void usbdc_register_handler(enum usbdc_handler_type type, const struct usbdc_handler *h)
{
21c4: b510 push {r4, lr}
switch (type) {
21c6: 2801 cmp r0, #1
21c8: d008 beq.n 21dc <usbdc_register_handler+0x18>
21ca: 2802 cmp r0, #2
21cc: d009 beq.n 21e2 <usbdc_register_handler+0x1e>
21ce: 2800 cmp r0, #0
21d0: d103 bne.n 21da <usbdc_register_handler+0x16>
case USBDC_HDL_SOF:
list_insert_at_end(&usbdc.handlers.sof_list, (void *)h);
21d2: 4805 ldr r0, [pc, #20] ; (21e8 <usbdc_register_handler+0x24>)
21d4: 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);
21d6: 4b05 ldr r3, [pc, #20] ; (21ec <usbdc_register_handler+0x28>)
21d8: 4798 blx r3
break;
default:
break;
}
}
21da: bd10 pop {r4, pc}
list_insert_at_end(&usbdc.handlers.req_list, (void *)h);
21dc: 4802 ldr r0, [pc, #8] ; (21e8 <usbdc_register_handler+0x24>)
21de: 3008 adds r0, #8
21e0: e7f9 b.n 21d6 <usbdc_register_handler+0x12>
list_insert_at_end(&usbdc.handlers.change_list, (void *)h);
21e2: 4801 ldr r0, [pc, #4] ; (21e8 <usbdc_register_handler+0x24>)
21e4: 300c adds r0, #12
21e6: e7f6 b.n 21d6 <usbdc_register_handler+0x12>
21e8: 2000039c .word 0x2000039c
21ec: 00001285 .word 0x00001285
000021f0 <usbdc_init>:
/**
* \brief Initialize the USB device core driver
*/
int32_t usbdc_init(uint8_t *ctrl_buf)
{
21f0: b570 push {r4, r5, r6, lr}
21f2: 0004 movs r4, r0
ASSERT(ctrl_buf);
21f4: 1e43 subs r3, r0, #1
21f6: 4198 sbcs r0, r3
21f8: 4a0c ldr r2, [pc, #48] ; (222c <usbdc_init+0x3c>)
21fa: 4b0d ldr r3, [pc, #52] ; (2230 <usbdc_init+0x40>)
21fc: 490d ldr r1, [pc, #52] ; (2234 <usbdc_init+0x44>)
21fe: b2c0 uxtb r0, r0
2200: 4798 blx r3
int32_t rc;
rc = usb_d_init();
2202: 4b0d ldr r3, [pc, #52] ; (2238 <usbdc_init+0x48>)
2204: 4798 blx r3
if (rc < 0) {
2206: 2800 cmp r0, #0
2208: db0e blt.n 2228 <usbdc_init+0x38>
return rc;
}
memset(&usbdc, 0, sizeof(usbdc));
220a: 4d0c ldr r5, [pc, #48] ; (223c <usbdc_init+0x4c>)
220c: 2220 movs r2, #32
220e: 4b0c ldr r3, [pc, #48] ; (2240 <usbdc_init+0x50>)
2210: 2100 movs r1, #0
2212: 0028 movs r0, r5
2214: 4798 blx r3
usbdc.ctrl_buf = ctrl_buf;
usb_d_register_callback(USB_D_CB_SOF, (FUNC_PTR)usbd_sof_cb);
2216: 2000 movs r0, #0
2218: 490a ldr r1, [pc, #40] ; (2244 <usbdc_init+0x54>)
usbdc.ctrl_buf = ctrl_buf;
221a: 616c str r4, [r5, #20]
usb_d_register_callback(USB_D_CB_SOF, (FUNC_PTR)usbd_sof_cb);
221c: 4c0a ldr r4, [pc, #40] ; (2248 <usbdc_init+0x58>)
221e: 47a0 blx r4
usb_d_register_callback(USB_D_CB_EVENT, (FUNC_PTR)usbd_event_cb);
2220: 2001 movs r0, #1
2222: 490a ldr r1, [pc, #40] ; (224c <usbdc_init+0x5c>)
2224: 47a0 blx r4
return 0;
2226: 2000 movs r0, #0
}
2228: bd70 pop {r4, r5, r6, pc}
222a: 46c0 nop ; (mov r8, r8)
222c: 00000355 .word 0x00000355
2230: 000012c5 .word 0x000012c5
2234: 000023ff .word 0x000023ff
2238: 00001759 .word 0x00001759
223c: 2000039c .word 0x2000039c
2240: 00002367 .word 0x00002367
2244: 00001d7d .word 0x00001d7d
2248: 000017c1 .word 0x000017c1
224c: 00001e61 .word 0x00001e61
00002250 <usbdc_register_function>:
* \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)
{
2250: b510 push {r4, lr}
2252: 0001 movs r1, r0
list_insert_at_end(&usbdc.func_list, func);
2254: 4802 ldr r0, [pc, #8] ; (2260 <usbdc_register_function+0x10>)
2256: 4b03 ldr r3, [pc, #12] ; (2264 <usbdc_register_function+0x14>)
2258: 3010 adds r0, #16
225a: 4798 blx r3
}
225c: bd10 pop {r4, pc}
225e: 46c0 nop ; (mov r8, r8)
2260: 2000039c .word 0x2000039c
2264: 00001285 .word 0x00001285
00002268 <usbdc_start>:
/**
* \brief Start the USB device driver with specific descriptors set
*/
int32_t usbdc_start(struct usbd_descriptors *desces)
{
2268: b510 push {r4, lr}
if (usbdc.state >= USBD_S_POWER) {
226a: 4b0a ldr r3, [pc, #40] ; (2294 <usbdc_start+0x2c>)
226c: 7e9c ldrb r4, [r3, #26]
226e: 2c00 cmp r4, #0
2270: d10b bne.n 228a <usbdc_start+0x22>
return ERR_BUSY;
}
if (desces) {
2272: 2800 cmp r0, #0
2274: d00c beq.n 2290 <usbdc_start+0x28>
#endif
} else {
return ERR_BAD_DATA;
}
usbdc.ctrl_size = desces->sod[7];
2276: 6802 ldr r2, [r0, #0]
usbdc.desces.ls_fs = desces;
2278: 6018 str r0, [r3, #0]
usbdc.ctrl_size = desces->sod[7];
227a: 79d2 ldrb r2, [r2, #7]
227c: 771a strb r2, [r3, #28]
usbdc.state = USBD_S_POWER;
227e: 2201 movs r2, #1
2280: 769a strb r2, [r3, #26]
usb_d_enable();
2282: 4b05 ldr r3, [pc, #20] ; (2298 <usbdc_start+0x30>)
2284: 4798 blx r3
return ERR_NONE;
2286: 0020 movs r0, r4
}
2288: bd10 pop {r4, pc}
return ERR_BUSY;
228a: 2004 movs r0, #4
return ERR_BAD_DATA;
228c: 4240 negs r0, r0
228e: e7fb b.n 2288 <usbdc_start+0x20>
2290: 2009 movs r0, #9
2292: e7fb b.n 228c <usbdc_start+0x24>
2294: 2000039c .word 0x2000039c
2298: 000017cd .word 0x000017cd
0000229c <usbdc_attach>:
/**
* \brief Attach the USB device to host
*/
void usbdc_attach(void)
{
229c: b510 push {r4, lr}
usb_d_attach();
229e: 4b01 ldr r3, [pc, #4] ; (22a4 <usbdc_attach+0x8>)
22a0: 4798 blx r3
}
22a2: bd10 pop {r4, pc}
22a4: 000017d9 .word 0x000017d9
000022a8 <usbdc_get_ctrl_buffer>:
/**
* \brief Return USB Device endpoint0 buffer
*/
uint8_t *usbdc_get_ctrl_buffer(void)
{
return usbdc.ctrl_buf;
22a8: 4b01 ldr r3, [pc, #4] ; (22b0 <usbdc_get_ctrl_buffer+0x8>)
22aa: 6958 ldr r0, [r3, #20]
}
22ac: 4770 bx lr
22ae: 46c0 nop ; (mov r8, r8)
22b0: 2000039c .word 0x2000039c
000022b4 <usbdc_get_state>:
/**
* \brief Return current USB state
*/
uint8_t usbdc_get_state(void)
{
if (usbdc.state & USBD_S_SUSPEND) {
22b4: 4b03 ldr r3, [pc, #12] ; (22c4 <usbdc_get_state+0x10>)
22b6: 7e98 ldrb r0, [r3, #26]
22b8: 2310 movs r3, #16
22ba: 4218 tst r0, r3
22bc: d000 beq.n 22c0 <usbdc_get_state+0xc>
return USBD_S_SUSPEND;
22be: 0018 movs r0, r3
}
return usbdc.state;
}
22c0: 4770 bx lr
22c2: 46c0 nop ; (mov r8, r8)
22c4: 2000039c .word 0x2000039c
000022c8 <atomic_enter_critical>:
*/
__STATIC_FORCEINLINE uint32_t __get_PRIMASK(void)
{
uint32_t result;
__ASM volatile ("MRS %0, primask" : "=r" (result) :: "memory");
22c8: f3ef 8310 mrs r3, PRIMASK
/**
* \brief Disable interrupts, enter critical section
*/
void atomic_enter_critical(hal_atomic_t volatile *atomic)
{
*atomic = __get_PRIMASK();
22cc: 6003 str r3, [r0, #0]
__ASM volatile ("cpsid i" : : : "memory");
22ce: 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");
22d0: f3bf 8f5f dmb sy
__disable_irq();
__DMB();
}
22d4: 4770 bx lr
000022d6 <atomic_leave_critical>:
22d6: f3bf 8f5f dmb sy
* \brief Exit atomic section
*/
void atomic_leave_critical(hal_atomic_t volatile *atomic)
{
__DMB();
__set_PRIMASK(*atomic);
22da: 6803 ldr r3, [r0, #0]
__ASM volatile ("MSR primask, %0" : : "r" (priMask) : "memory");
22dc: f383 8810 msr PRIMASK, r3
}
22e0: 4770 bx lr
...
000022e4 <__gnu_thumb1_case_sqi>:
22e4: b402 push {r1}
22e6: 4671 mov r1, lr
22e8: 0849 lsrs r1, r1, #1
22ea: 0049 lsls r1, r1, #1
22ec: 5609 ldrsb r1, [r1, r0]
22ee: 0049 lsls r1, r1, #1
22f0: 448e add lr, r1
22f2: bc02 pop {r1}
22f4: 4770 bx lr
22f6: 46c0 nop ; (mov r8, r8)
000022f8 <__gnu_thumb1_case_shi>:
22f8: b403 push {r0, r1}
22fa: 4671 mov r1, lr
22fc: 0849 lsrs r1, r1, #1
22fe: 0040 lsls r0, r0, #1
2300: 0049 lsls r1, r1, #1
2302: 5e09 ldrsh r1, [r1, r0]
2304: 0049 lsls r1, r1, #1
2306: 448e add lr, r1
2308: bc03 pop {r0, r1}
230a: 4770 bx lr
0000230c <__libc_init_array>:
230c: b570 push {r4, r5, r6, lr}
230e: 2600 movs r6, #0
2310: 4d0c ldr r5, [pc, #48] ; (2344 <__libc_init_array+0x38>)
2312: 4c0d ldr r4, [pc, #52] ; (2348 <__libc_init_array+0x3c>)
2314: 1b64 subs r4, r4, r5
2316: 10a4 asrs r4, r4, #2
2318: 42a6 cmp r6, r4
231a: d109 bne.n 2330 <__libc_init_array+0x24>
231c: 2600 movs r6, #0
231e: f000 f87b bl 2418 <_init>
2322: 4d0a ldr r5, [pc, #40] ; (234c <__libc_init_array+0x40>)
2324: 4c0a ldr r4, [pc, #40] ; (2350 <__libc_init_array+0x44>)
2326: 1b64 subs r4, r4, r5
2328: 10a4 asrs r4, r4, #2
232a: 42a6 cmp r6, r4
232c: d105 bne.n 233a <__libc_init_array+0x2e>
232e: bd70 pop {r4, r5, r6, pc}
2330: 00b3 lsls r3, r6, #2
2332: 58eb ldr r3, [r5, r3]
2334: 4798 blx r3
2336: 3601 adds r6, #1
2338: e7ee b.n 2318 <__libc_init_array+0xc>
233a: 00b3 lsls r3, r6, #2
233c: 58eb ldr r3, [r5, r3]
233e: 4798 blx r3
2340: 3601 adds r6, #1
2342: e7f2 b.n 232a <__libc_init_array+0x1e>
2344: 00002424 .word 0x00002424
2348: 00002424 .word 0x00002424
234c: 00002424 .word 0x00002424
2350: 00002428 .word 0x00002428
00002354 <memcpy>:
2354: 2300 movs r3, #0
2356: b510 push {r4, lr}
2358: 429a cmp r2, r3
235a: d100 bne.n 235e <memcpy+0xa>
235c: bd10 pop {r4, pc}
235e: 5ccc ldrb r4, [r1, r3]
2360: 54c4 strb r4, [r0, r3]
2362: 3301 adds r3, #1
2364: e7f8 b.n 2358 <memcpy+0x4>
00002366 <memset>:
2366: 0003 movs r3, r0
2368: 1882 adds r2, r0, r2
236a: 4293 cmp r3, r2
236c: d100 bne.n 2370 <memset+0xa>
236e: 4770 bx lr
2370: 7019 strb r1, [r3, #0]
2372: 3301 adds r3, #1
2374: e7f9 b.n 236a <memset+0x4>
...
00002378 <_usb_ep_cfgs>:
2378: 0250 2000 0000 0000 0040 0000 0210 2000 P.. ....@......
2388: 0000 0000 0040 0000 01d0 2000 0000 0000 ....@...... ....
2398: 0040 0000 2e2e 682f 6c61 752f 6974 736c @...../hal/utils
23a8: 732f 6372 752f 6974 736c 6c5f 7369 2e74 /src/utils_list.
23b8: 0063 2e2e 682f 6c61 732f 6372 682f 6c61 c.../hal/src/hal
23c8: 755f 6173 7472 735f 6e79 2e63 0063 _usart_sync.c.
000023d6 <CSWTCH.37>:
23d6: 01ed 0101 0201 .......
000023dd <CSWTCH.40>:
23dd: 00ed 0101 0201 2ef0 2f2e 7068 2f6c 6573 ........./hpl/se
23ed: 6372 6d6f 682f 6c70 735f 7265 6f63 2e6d rcom/hpl_sercom.
23fd: 0063 2e2e 752f 6273 642f 7665 6369 2f65 c.../usb/device/
240d: 7375 6462 2e63 0063 0000 usbdc.c....
00002418 <_init>:
2418: b5f8 push {r3, r4, r5, r6, r7, lr}
241a: 46c0 nop ; (mov r8, r8)
241c: bcf8 pop {r3, r4, r5, r6, r7}
241e: bc08 pop {r3}
2420: 469e mov lr, r3
2422: 4770 bx lr
00002424 <__frame_dummy_init_array_entry>:
2424: 00dd 0000 ....
00002428 <_fini>:
2428: b5f8 push {r3, r4, r5, r6, r7, lr}
242a: 46c0 nop ; (mov r8, r8)
242c: bcf8 pop {r3, r4, r5, r6, r7}
242e: bc08 pop {r3}
2430: 469e mov lr, r3
2432: 4770 bx lr
00002434 <__do_global_dtors_aux_fini_array_entry>:
2434: 00b5 0000 ....