nrf5x: USBD implementation and examples#965
Conversation
|
@kotokrad This is a great looking patch. Please ignore failing macos related actions, it seems that it's too new for Zig 0.15.2. It looks like you have some unused imports. Once those are fixed this is ready for a merge. |
|
@mattnite fixed 👌 |
|
I have the MDK. Give me a few days to test it. |
| // Bus reset | ||
| if (peripherals.USBD.EVENTS_USBRESET.raw != 0) { | ||
| peripherals.USBD.EVENTS_USBRESET.write_raw(0); | ||
| _ = peripherals.USBD.EVENTS_USBRESET.read(); |
There was a problem hiding this comment.
Is this the same spurious interrupt WAR? Can you please comment so
| }; | ||
| } | ||
|
|
||
| pub fn poll(self: *@This(), controller: anytype) void { |
There was a problem hiding this comment.
Can you please do const Self = @This(); in the class and use that?
| } | ||
| } | ||
|
|
||
| // Suspend (not implemented) |
There was a problem hiding this comment.
Let's add greppable TODOs for these.
| peripherals.USBD.SHORTS.write(.{ .EP0DATADONE_EP0STATUS = .Disabled }); | ||
| } | ||
|
|
||
| // Here, nrf-usbd does this: |
There was a problem hiding this comment.
Are we not doing this?
There was a problem hiding this comment.
Let me research it more
|
Tested on my MDK. Works without issue. Please address my comments and figure out why CI if failing and we can merge this. |
Working USBD, both CDC and HID examples work on nrf52840 (tested on nice!nano and a clone). For PR I adapted them for
nrf52840_mdkfor consistency but haven't tested as I don't have this board.HAL structure and examples are based on usb for rp2xxx port.