<p>With the move to usbdev devices as part of periph, I have to think a bit on how to rework the device setup itself. suggestions are welcome of course (<a class="user-mention" data-hovercard-type="user" data-hovercard-url="/hovercards?user_id=22391368" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/dylad">@dylad</a> <a class="user-mention" data-hovercard-type="user" data-hovercard-url="/hovercards?user_id=4679640" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/kaspar030">@kaspar030</a>).<br>
Main requirement from <code>usbus</code> is that it needs the <code>usbdev</code> context on initialization.</p>
<p>One option is to move the <code>$usbdev_setup()</code> to the <code>periph_init()</code> of the cpu and add a getter to retrieve the context, something like <code>usbdev_get_context(unsigned num)</code> where <code>num</code> selects the usb peripheral number (many mid and high end STM32's and Kinetis MCU's have 2 USB interfaces).</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/RIOT-OS/RIOT/pull/11075#issuecomment-474119744">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AEn7YDabKVkgiyd2Rk2R-2pMdP1wEPpwks5vYA2pgaJpZM4bVfZZ">mute the thread</a>.<img src="https://github.com/notifications/beacon/AEn7YHxgc9psM2djpGMOKbHO_-KgraO0ks5vYA2pgaJpZM4bVfZZ.gif" height="1" width="1" alt="" /></p>
<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/RIOT-OS/RIOT","title":"RIOT-OS/RIOT","subtitle":"GitHub repository","main_image_url":"https://github.githubassets.com/images/email/message_cards/header.png","avatar_image_url":"https://github.githubassets.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/RIOT-OS/RIOT"}},"updates":{"snippets":[{"icon":"PERSON","message":"@bergzand in #11075: With the move to usbdev devices as part of periph, I have to think a bit on how to rework the device setup itself. suggestions are welcome of course (@dylad @kaspar030).\r\nMain requirement from `usbus` is that it needs the `usbdev` context on initialization.\r\n\r\nOne option is to move the `$usbdev_setup()` to the `periph_init()` of the cpu and add a getter to retrieve the context, something like `usbdev_get_context(unsigned num)` where `num` selects the usb peripheral number (many mid and high end STM32's and Kinetis MCU's have 2 USB interfaces)."}],"action":{"name":"View Pull Request","url":"https://github.com/RIOT-OS/RIOT/pull/11075#issuecomment-474119744"}}}</script>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/RIOT-OS/RIOT/pull/11075#issuecomment-474119744",
"url": "https://github.com/RIOT-OS/RIOT/pull/11075#issuecomment-474119744",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>