{"id":319837,"date":"2021-03-18T15:03:32","date_gmt":"2021-03-18T15:03:32","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=319837"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=319837","title":{"rendered":"Stm32 + USB \u043d\u0430 \u0448\u0430\u0431\u043b\u043e\u043d\u0430\u0445 C++"},"content":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<p>*\u0417\u0430 \u043f\u0440\u0438\u043a\u043e\u043b\u044c\u043d\u0443\u044e \u0438\u0434\u0435\u044e \u0441 \u0438\u0437\u043e\u043b\u0435\u043d\u0442\u043e\u0439 \u0441\u043f\u0430\u0441\u0438\u0431\u043e @<a href=\"https:\/\/habr.com\/ru\/users\/grafalex\/\" rel=\"noopener noreferrer nofollow\">grafalex<\/a><\/p>\n<h2>\u041d\u0438\u043a\u0442\u043e \u043d\u0435 \u043b\u044e\u0431\u0438\u0442 USB.<\/h2>\n<p>    \u041f\u0440\u043e\u0434\u0432\u0438\u0433\u0430\u044f\u0441\u044c \u0432 \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432, \u044f \u043e\u0441\u043e\u0437\u043d\u0430\u043b \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u043e\u0441\u0432\u043e\u0438\u0442\u044c USB, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u044d\u0442\u043e, \u0431\u0435\u0441\u0441\u043f\u043e\u0440\u043d\u043e, \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u041d\u0415-\u0432\u043d\u0443\u0442\u0440\u0438\u0441\u0445\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432. \u041e\u0434\u043d\u0430\u043a\u043e \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u043e\u0432 \u0432 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u043c \u043c\u0438\u0440\u0435 \u043d\u0435\u043c\u043d\u043e\u0433\u043e. \u041f\u0440\u043e\u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0432 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0444\u043e\u0440\u0443\u043c\u044b, \u0441\u0444\u043e\u0440\u043c\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u043b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0440\u0438\u0447\u0438\u043d\u044b \u043d\u0435\u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0441\u0442\u0438 USB \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445:<\/p>\n<ul>\n<li>\n<p><a class=\"mention\" href=\"\/users\/jaiprakash\">@jaiprakash<\/a>\u043d\u0430\u043f\u043e\u043c\u043d\u0438\u043b, \u0447\u0442\u043e \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0434\u043b\u044f USB-\u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 VID \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043a\u0443\u043f\u0430\u0442\u044c \u0437\u0430 \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0434\u0435\u043d\u044c\u0433\u0438.<\/p>\n<\/li>\n<li>\n<p>\u041e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0432\u044b\u0441\u043e\u043a\u043e\u0441\u043a\u043e\u0440\u043e\u0441\u0442\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<\/li>\n<li>\n<p>\u0412\u044b\u0441\u043e\u043a\u0430\u044f \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u0430\u043c\u043e\u0433\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0430 \u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u044b\u043c \u043c\u043d\u043e\u0433\u0438\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u043c UART. \u0414\u0435\u0448\u0435\u0432\u043b\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u0433\u043e\u0442\u043e\u0432\u044b\u0439 USB&lt;-&gt;UART \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u043d\u0438\u043a.<\/p>\n<\/li>\n<li>\n<p>\u041e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u043d\u0430\u0432\u044b\u043a\u043e\u0432 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u043e\u0432 \u0434\u043b\u044f \u041e\u0421 Windows\/Linux.<\/p>\n<\/li>\n<\/ul>\n<p>   \u0412 \u0438\u0442\u043e\u0433\u0435, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438, \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c, \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0438\u0442\u0430\u044e\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c UART (\u0447\u0435\u0440\u0435\u0437 \u0430\u043f\u043f\u0430\u0440\u0430\u0442\u043d\u044b\u0439 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0435\u0440 \u0438\u043b\u0438, \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c, \u043f\u0443\u0442\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f VCP-\u0434\u0435\u0432\u0430\u0439\u0441\u0430, \u043a\u043e\u0434 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 CubeMX). \u042f \u0440\u0435\u0448\u0438\u043b \u043f\u043e\u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0441 USB \u0445\u043e\u0442\u044f \u0431\u044b \u043d\u0430 \u0431\u0430\u0437\u043e\u0432\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435, \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0432 \u043b\u0438\u043d\u0438\u044e \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 \u044f\u0437\u044b\u043a\u0430 C++. \u0412 \u044d\u0442\u043e\u043c \u043f\u043e\u0441\u0442\u0435 \u043e\u043f\u0438\u0441\u0430\u043d \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 (\u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u0431\u0443\u0444\u0435\u0440\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u0438 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u043e\u0432) \u043c\u0435\u0436\u0434\u0443 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u043c\u0438 \u0442\u043e\u0447\u043a\u0430\u043c\u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430.<\/p>\n<h2>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f<\/h2>\n<p>    \u041e\u0441\u043d\u043e\u0432\u043d\u044b\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b, \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0449\u0435\u0439 USB-\u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <em>\u041a\u043e\u043d\u0435\u0447\u043d\u0430\u044f \u0442\u043e\u0447\u043a\u0430 <\/em>(Endpoint). \u0425\u043e\u0441\u0442 \u043e\u0431\u043c\u0435\u043d\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0441 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u043e\u0439. \u0423\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u043e\u0431\u044f\u0437\u0430\u043d\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043a\u043e\u043d\u0435\u0447\u043d\u0443\u044e \u0442\u043e\u0447\u043a\u0443 \u0441 \u043d\u043e\u043c\u0435\u0440\u043e\u043c 0, \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435, \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u043e\u0432 \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u044d\u043d\u0443\u043c\u0435\u0440\u0430\u0446\u0438\u0438, \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0430\u0434\u0440\u0435\u0441\u0430, \u0432\u044b\u0431\u043e\u0440\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0438 \u0432\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435. \u0411\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0441 \u043f\u043e\u043d\u044f\u0442\u0438\u0435\u043c \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0445 \u0442\u043e\u0447\u0435\u043a \u0438 \u0432 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435 \u0431\u0430\u0437\u043e\u0432\u044b\u043c\u0438 \u0437\u043d\u0430\u043d\u0438\u044f\u043c\u0438 USB \u043c\u043e\u0436\u043d\u043e \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0432 <a href=\"http:\/\/microsin.net\/programming\/arm-working-with-usb\/usb-in-a-nutshell-part1.html\" rel=\"noopener noreferrer nofollow\">\u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0435 <\/a>&#171;USB in NutShell&#187; \u043d\u0430 \u0440\u0435\u0441\u0443\u0440\u0441\u0435 microsin (\u0440\u0435\u0431\u044f\u0442\u0430\u043c \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0435 \u0441\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u043f\u0440\u043e\u0434\u0435\u043b\u0430\u043d\u043d\u044b\u0439 \u0442\u0440\u0443\u0434, \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0435 \u0434\u0435\u043b\u043e \u0441\u0434\u0435\u043b\u0430\u043b\u0438).<\/p>\n<p>    \u041a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u044b Stm32F0\/F1 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u0443\u044e \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u0438 &#8212; <em>Packet Memory Area (PMA)<\/em>, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u043e\u0432 \u0431\u0443\u0444\u0435\u0440\u043e\u0432 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0445 \u0442\u043e\u0447\u0435\u043a \u0438 \u0441\u0430\u043c\u0438 \u0431\u0443\u0444\u0435\u0440\u044b \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0445 \u0442\u043e\u0447\u0435\u043a. \u0412\u0441\u0435 \u0432\u0441\u0435\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445 \u043d\u0438\u0437\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 USB-\u0441\u0442\u0435\u043a\u0430 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u044c, \u0447\u0442\u043e \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u043e, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u0440\u0438\u0441\u043a\u0438 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0443. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440 \u0431\u0443\u0444\u0435\u0440\u0430 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 <em>K, <\/em>\u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e &#171;\u043f\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u044c&#187; \u0432\u0441\u0435 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0445 \u0442\u043e\u0447\u0435\u043a <em>K+1, &#8230; , N. <\/em>(\u0433\u0434\u0435 <em>N<\/em> &#8212; \u043e\u0431\u0449\u0435\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0445 \u0442\u043e\u0447\u0435\u043a). \u041b\u0438\u0447\u043d\u043e \u0432 \u0441\u0435\u0431\u0435 \u044f \u0443\u0432\u0435\u0440\u0435\u043d: 100% \u0440\u0430\u043d\u043e \u0438\u043b\u0438 \u043f\u043e\u0437\u0434\u043d\u043e \u043e\u0448\u0438\u0431\u0443\u0441\u044c.<\/p>\n<p>    \u0421\u0442\u043e\u0438\u0442 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c, \u0447\u0442\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0445 \u0442\u043e\u0447\u0435\u043a (\u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0440\u0430\u0437\u043c\u0435\u0440 \u0431\u0443\u0444\u0435\u0440\u0430) \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0442\u0438 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043f\u0430\u043c\u044f\u0442\u0438 \u0438\u0437 runtime \u0432 compile-time, \u044d\u0442\u043e \u0434\u0430\u0435\u0442 \u0434\u0432\u0430 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430:<\/p>\n<ul>\n<li>\n<p>\u0418\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u0423\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u0432 \u0431\u0443\u0444\u0435\u0440\u043e\u0432 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043b\u044f \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0439. \u0422\u0430\u043a\u0436\u0435 \u043e\u0442\u043f\u0430\u0434\u0430\u0435\u0442 \u0432 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0440\u0443\u0447\u043d\u043e\u0439 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u043e\u0432 \u0431\u0443\u0444\u0435\u0440\u043e\u0432 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 (<em>ADDRn_TX, COUNTn_TX, ADDRn_RX, COUNTn_RX<\/em>), \u0442\u0430\u043a \u043a\u0430\u043a \u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438, \u0430 \u0432 runtime \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u043f\u0430\u043c\u044f\u0442\u044c.<\/p>\n<\/li>\n<li>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u043d\u043d\u0435\u0433\u043e \u0434\u0435\u0442\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043e\u0448\u0438\u0431\u043e\u043a, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0431\u0443\u0444\u0435\u0440\u0430 \u0438\u043b\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0430 \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0439 \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0445 \u0442\u043e\u0447\u0435\u043a \u043a \u043e\u0434\u043d\u043e\u043c\u0443 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0443 <em>EPnR <\/em>(\u044d\u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442 \u0442\u043e\u0436\u0435 \u043f\u043e\u0434\u0432\u0435\u0440\u0436\u0435\u043d \u043e\u0448\u0438\u0431\u043a\u0430\u043c, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0435\u0433\u0438\u0441\u0442\u0440 \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d \u0434\u043b\u044f \u0434\u0432\u0443\u0445 \u0440\u0430\u0437\u043d\u043e\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0445 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0445 \u0442\u043e\u0447\u0435\u043a, \u0438\u043b\u0438 \u043e\u0434\u043d\u043e\u0439 \u0441 \u0434\u0432\u043e\u0439\u043d\u043e\u0439 \u0431\u0443\u0444\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u0435\u0439).<\/p>\n<\/li>\n<\/ul>\n<h2>\u041a\u043e\u043d\u0435\u0447\u043d\u044b\u0435 \u0442\u043e\u0447\u043a\u0438 \u0438 \u0438\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b<\/h2>\n<p>\u041a\u0430\u0436\u0434\u0430\u044f \u043a\u043e\u043d\u0435\u0447\u043d\u0430\u044f \u0442\u043e\u0447\u043a\u0430 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0437\u0443\u0435\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438:<\/p>\n<ol>\n<li>\n<p>\u041d\u043e\u043c\u0435\u0440 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 (0..16).<\/p>\n<\/li>\n<li>\n<p>\u0422\u0438\u043f \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 (Control, Interrupt, Bulk, Isochronous).<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 (In, Out).<\/p>\n<\/li>\n<li>\n<p>\u041c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 \u043f\u0430\u043a\u0435\u0442\u0430 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438.<\/p>\n<\/li>\n<\/ol>\n<p>\u0412\u0441\u0435 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0432\u0445\u043e\u0434\u044f\u0442 \u0432 \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u0445\u043e\u0441\u0442 \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u044d\u043d\u0443\u043c\u0435\u0440\u0430\u0446\u0438\u0438.<\/p>\n<p>\u0412 \u0440\u0430\u043c\u043a\u0430\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0434\u043b\u044f \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u044b:<\/p>\n<ol>\n<li>\n<p>\u0420\u0435\u0433\u0438\u0441\u0442\u0440 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 (EPnR).<\/p>\n<\/li>\n<li>\n<p>\u0410\u0434\u0440\u0435\u0441 \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u0430 \u0431\u0443\u0444\u0435\u0440\u0430 \u043f\u0430\u043a\u0435\u0442\u043e\u0432.<\/p>\n<\/li>\n<li>\n<p>\u0410\u0434\u0440\u0435\u0441 \u0431\u0443\u0444\u0435\u0440\u0430 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 (\u0438\u043b\u0438 \u0434\u0432\u0443\u0445 \u0431\u0443\u0444\u0435\u0440\u043e\u0432 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0434\u0432\u0443\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0439 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u0438\u043b\u0438 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u0441 \u0434\u0432\u043e\u0439\u043d\u043e\u0439 \u0431\u0443\u0444\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u0435\u0439).<\/p>\n<\/li>\n<\/ol>\n<p>\u0418 \u0432\u043e\u0442 \u0437\u0434\u0435\u0441\u044c \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u0430\u044f \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c: \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0435 \u0432\u044b\u0448\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 <em>N <\/em>\u0437\u0430\u0432\u0438\u0441\u044f\u0442 \u043e\u0442 \u0432\u0441\u0435\u0445 \u0434\u0440\u0443\u0433\u0438\u0445 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0445 \u0442\u043e\u0447\u0435\u043a. \u0418\u0437 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u0448\u043b\u0438 \u0432 \u0433\u043e\u043b\u043e\u0432\u0443, \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0441\u044f \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043c\u0435\u0442\u043e\u0434\u0438\u043a\u0435:<\/p>\n<ol>\n<li>\n<p>\u041e\u0431\u044a\u044f\u0432\u0438\u0442\u044c \u0432\u0441\u0435 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0435 \u0442\u043e\u0447\u043a\u0438 \u0441 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435\u043c \u043d\u043e\u043c\u0435\u0440\u0430, \u0442\u0438\u043f\u0430, \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0438 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u043f\u0430\u043a\u0435\u0442\u0430.<\/p>\n<\/li>\n<li>\n<p>\u041e\u0431\u044a\u044f\u0432\u0438\u0442\u044c \u043a\u043b\u0430\u0441\u0441 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u0430 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0445 \u0442\u043e\u0447\u0435\u043a, \u043f\u0435\u0440\u0435\u0434\u0430\u0432 \u0432\u0441\u0435 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0435 \u0442\u043e\u0447\u043a\u0438.<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043e\u0442 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u0430 &#171;\u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u044b\u0435&#187; \u0432\u0435\u0440\u0441\u0438\u0438 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0445 \u0442\u043e\u0447\u0435\u043a.<\/p>\n<\/li>\n<\/ol>\n<h2>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u0430 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0445 \u0442\u043e\u0447\u0435\u043a<\/h2>\n<p>\u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043b\u0430\u0441\u0441:<\/p>\n<pre><code class=\"cpp\">template&lt;typename... AllEndpoints,   typename... BidirectionalAndBulkDoubleBufferedEndpoints,   typename... RxEndpoints,   typename... BulkDoubleBufferedTxEndpoints&gt; class EndpointsManagerBase&lt;TypeList&lt;AllEndpoints...&gt;,   TypeList&lt;BidirectionalAndBulkDoubleBufferedEndpoints...&gt;,   TypeList&lt;RxEndpoints...&gt;,   TypeList&lt;BulkDoubleBufferedTxEndpoints...&gt;&gt; {   \/\/ \u0412\u0441\u0435 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0435 \u0442\u043e\u0447\u043a\u0438   using AllEndpointsList = TypeList&lt;AllEndpoints...&gt;;   \/\/\/ \u0420\u0430\u0437\u043c\u0435\u0440 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u043e\u0432 \u0431\u0443\u0444\u0435\u0440\u043e\u0432 \u043f\u0430\u043a\u0435\u0442\u043e\u0432    static const auto BdtSize = 8 * (EndpointEPRn&lt;GetType_t&lt;sizeof...(AllEndpoints) - 1, AllEndpointsList&gt;, AllEndpointsList&gt;::RegisterNumber + 1);   \/\/\/ \u0421\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0431\u0443\u0444\u0435\u0440\u0430 \u0434\u043b\u044f \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0439 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438   template&lt;typename Endpoint&gt;   static constexpr uint32_t BufferOffset = BdtSize + OffsetOfBuffer&lt;TypeIndex&lt;Endpoint, AllEndpointsList&gt;::value, AllEndpointsList&gt;::value;   \/\/\/ \u0421\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u0430 \u0434\u043b\u044f \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0439 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438   template&lt;typename Endpoint&gt;   static constexpr uint32_t BdtCellOffset =     EndpointEPRn&lt;Endpoint, AllEndpointsList&gt;::RegisterNumber * 8       + (Endpoint::Type == EndpointType::Control       || Endpoint::Type == EndpointType::ControlStatusOut       || Endpoint::Type == EndpointType::BulkDoubleBuffered       || Endpoint::Direction == EndpointDirection::Out       || Endpoint::Direction == EndpointDirection::Bidirectional         ? 0         : 4);   \/\/\/ \u0411\u0430\u0437\u043e\u0432\u044b\u0439 \u0430\u0434\u0440\u0435\u0441 \u0431\u0443\u0444\u0435\u0440\u0430 USB   static const uint32_t BdtBase = PmaBufferBase; public:   \/\/\/ \"\u0420\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u0442\" \u043a\u043e\u043d\u0435\u0447\u043d\u0443\u044e \u0442\u043e\u0447\u043a\u0443   template&lt;typename Endpoint&gt;   using ExtendEndpoint =      typename Select&lt;Endpoint::Type == EndpointType::Control || Endpoint::Type == EndpointType::ControlStatusOut,     ControlEndpoint&lt;Endpoint,       typename EndpointEPRn&lt;Endpoint, TypeList&lt;AllEndpoints...&gt;&gt;::type,       PmaBufferBase + BufferOffset&lt;Endpoint&gt;, \/\/ TxBuffer       PmaBufferBase + BdtCellOffset&lt;Endpoint&gt; + 2, \/\/ TxCount       PmaBufferBase + BufferOffset&lt;Endpoint&gt; + Endpoint::MaxPacketSize, \/\/ RxBuffer       PmaBufferBase + BdtCellOffset&lt;Endpoint&gt; + 6&gt;, \/\/RxCount     typename Select&lt;Endpoint::Direction == EndpointDirection::Bidirectional,     BidirectionalEndpoint&lt;Endpoint,       typename EndpointEPRn&lt;Endpoint, TypeList&lt;AllEndpoints...&gt;&gt;::type,       PmaBufferBase + BufferOffset&lt;Endpoint&gt;, \/\/ TxBuffer       PmaBufferBase + BdtCellOffset&lt;Endpoint&gt; + 2, \/\/ TxCount       PmaBufferBase + BufferOffset&lt;Endpoint&gt; + Endpoint::MaxPacketSize, \/\/ RxBuffer       PmaBufferBase + BdtCellOffset&lt;Endpoint&gt; + 6&gt;, \/\/RxCount     ... \/\/ \u041a\u0430\u0436\u0434\u044b\u0439 \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u0442\u0438\u043f \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u0442\u0441\u044f \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u044b\u0439     void&gt;::value&gt;::value;    static void Init()   {     memset(reinterpret_cast&lt;void*&gt;(BdtBase), 0x00, BdtSize);     \/\/ \u0411\u0430\u0437\u043e\u0432\u0430\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0432\u0441\u0435\u0445 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0445 \u0442\u043e\u0447\u0435\u043a     ((*(reinterpret_cast&lt;uint16_t*&gt;(BdtBase + BdtCellOffset&lt;AllEndpoints&gt;)) = BufferOffset&lt;AllEndpoints&gt;), ...);     \/\/ \u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u0431\u0443\u0444\u0435\u0440\u0430 \u0434\u043b\u044f \u0434\u0432\u0443\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u0442\u043e\u0447\u0435\u043a \u0438 \u0442\u043e\u0447\u0435\u043a \u0441 \u0434\u0432\u043e\u0439\u043d\u043e\u0439 \u0431\u0443\u0444\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u0435\u0439     ((*(reinterpret_cast&lt;uint16_t*&gt;(BdtBase + BdtCellOffset&lt;BidirectionalAndBulkDoubleBufferedEndpoints&gt; + 4)) = (BufferOffset&lt;BidirectionalAndBulkDoubleBufferedEndpoints&gt; + BidirectionalAndBulkDoubleBufferedEndpoints::MaxPacketSize)), ...);     \/\/ \u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f COUNTn_RX \u0434\u043b\u044f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0449\u0438\u0445 (Rx, Out) \u0442\u043e\u0447\u0435\u043a     ((*(reinterpret_cast&lt;uint16_t*&gt;(BdtBase + BdtCellOffset&lt;RxEndpoints&gt; + 2)) = (RxEndpoints::MaxPacketSize &lt;= 62       ? (RxEndpoints::MaxPacketSize \/ 2) &lt;&lt; 10       : 0x8000 | (RxEndpoints::MaxPacketSize \/ 32) &lt;&lt; 10)), ...);     \/\/ \u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f COUNTn_RX \u0434\u043b\u044f \u0434\u0432\u0443\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u0442\u043e\u0447\u0435\u043a \u0438 \u0442\u043e\u0447\u0435\u043a \u0441 \u0434\u0432\u043e\u0439\u043d\u043e\u0439 \u0431\u0443\u0444\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u0435\u0439     ((*(reinterpret_cast&lt;uint16_t*&gt;(BdtBase + BdtCellOffset&lt;BidirectionalAndBulkDoubleBufferedEndpoints&gt; + 6)) = (BidirectionalAndBulkDoubleBufferedEndpoints::MaxPacketSize &lt;= 62       ? (BidirectionalAndBulkDoubleBufferedEndpoints::MaxPacketSize \/ 2) &lt;&lt; 10       : 0x8000 | (BidirectionalAndBulkDoubleBufferedEndpoints::MaxPacketSize \/ 32) &lt;&lt; 10)), ...);      \/\/ \u0421\u0431\u0440\u043e\u0441 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430 COUNTn_RX \u0434\u043b\u044f Tx \u0442\u043e\u0447\u0435\u043a \u0441 \u0434\u0432\u043e\u0439\u043d\u043e\u0439 \u0431\u0443\u0444\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u0435\u0439 (\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u044d\u0442\u043e \u0438 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e, \u043f\u043e\u043a\u0430 \u043d\u0430 \u0432\u0441\u044f\u043a\u0438\u0439 \u0441\u043b\u0443\u0447\u0430\u0439 \u043e\u0431\u043d\u0443\u043b\u044f\u0435\u0442\u0441\u044f)     ((*(reinterpret_cast&lt;uint16_t*&gt;(BdtBase + BdtCellOffset&lt;BulkDoubleBufferedTxEndpoints&gt; + 2)) = 0), ...);     ((*(reinterpret_cast&lt;uint16_t*&gt;(BdtBase + BdtCellOffset&lt;BulkDoubleBufferedTxEndpoints&gt; + 6)) = 0), ...);   } };  template&lt;typename Endpoints&gt; using EndpointsManager = EndpointsManagerBase&lt;SortedUniqueEndpoints&lt;Endpoints&gt;,   typename Sample&lt;IsBidirectionalOrBulkDoubleBufferedEndpoint, SortedUniqueEndpoints&lt;Endpoints&gt;&gt;::type,   typename Sample&lt;IsOutEndpoint, SortedUniqueEndpoints&lt;Endpoints&gt;&gt;::type,   typename Sample&lt;IsBulkDoubleBufferedTxEndpoint, SortedUniqueEndpoints&lt;Endpoints&gt;&gt;::type&gt;;  template&lt;typename... Endpoints&gt; using EndpointsInitializer = EndpointsManagerBase&lt;SortedUniqueEndpoints&lt;TypeList&lt;Endpoints...&gt;&gt;,   TypeList&lt;&gt;,   TypeList&lt;&gt;,   TypeList&lt;&gt;&gt;;<\/code><\/pre>\n<p>\u041d\u0435 \u0431\u0443\u0434\u0443 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u044c \u043a\u043e\u0434 \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432, \u0434\u0430\u043c \u043a\u0440\u0430\u0442\u043a\u043e\u0435 \u0438\u0445 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435:<\/p>\n<ol>\n<li>\n<p><strong><em>EndpointEPRn <\/em><\/strong>&#8212; \u043a\u043b\u0430\u0441\u0441, \u043d\u0430\u0437\u043d\u0430\u0447\u0430\u044e\u0449\u0438\u0439 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430 EPnR \u0434\u043b\u044f \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438. \u0420\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e: \u0432\u0441\u0435\u043c \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u043c \u0442\u043e\u0447\u043a\u0430\u043c \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u044b \u043d\u0430\u0437\u043d\u0447\u0430\u044e\u0442\u0441\u044f \u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443. \u0415\u0441\u043b\u0438 \u0434\u0432\u0435 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0435 \u0442\u043e\u0447\u043a\u0438 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u0434\u0435\u043b\u044f\u0442 \u043e\u0434\u0438\u043d \u043d\u043e\u043c\u0435\u0440, \u0442\u043e \u043e\u0431\u0435\u0438\u043c \u043d\u0430\u0437\u043d\u0430\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0434\u0438\u043d \u0440\u0435\u0433\u0438\u0441\u0442\u0440.<\/p>\n<\/li>\n<li>\n<p><strong><em>BufferOffset <\/em><\/strong>&#8212; \u043a\u043b\u0430\u0441\u0441, \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u044e\u0449\u0438\u0439 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0431\u0443\u0444\u0435\u0440\u0430 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0434\u043b\u044f \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438. \u041a\u043b\u0430\u0441\u0441 \u0442\u043e\u0436\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0439, \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0431\u0443\u0444\u0435\u0440\u0430 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 <em>N <\/em>\u0435\u0441\u0442\u044c \u0441\u0443\u043c\u043c\u0430 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u0432 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0445 \u0442\u043e\u0447\u0435\u043a <em>0, &#8230;, N-1<\/em>.<\/p>\n<\/li>\n<li>\n<p><strong><em>SortedUniqueEndpoints <\/em><\/strong>&#8212; \u043a\u043b\u0430\u0441\u0441, \u0441\u043e\u0440\u0442\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u0432\u0441\u0435  \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0435 \u0442\u043e\u0447\u043a\u0438 \u043f\u043e \u043d\u043e\u043c\u0435\u0440\u0430\u043c \u0438 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f\u043c + \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0434\u0443\u0431\u043b\u0438\u043a\u0430\u0442\u043e\u0432. \u0422\u0435\u043a\u0443\u0449\u0435\u0435 \u043c\u043e\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435 USB \u0434\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0434\u043d\u043e\u0439 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430\u0445\/\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f\u0445, \u0447\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u0442 \u043a \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e \u0432 \u043a\u043b\u0430\u0441\u0441\u0435 <em>Device.<\/em><\/p>\n<\/li>\n<li>\n<p><strong><em>IsBidirectionalOrBulkDoubleBufferedEndpoint, IsOutEndpoint, IsBulkDoubleBufferedTxEndpoint <\/em><\/strong>&#8212; \u043f\u0440\u0435\u0434\u0438\u043a\u0430\u0442\u044b \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0445 \u0442\u043e\u0447\u0435\u043a \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u0432 \u043e\u0431\u0449\u0435\u043c \u0441\u043f\u0438\u0441\u043a\u0435. <\/p>\n<\/li>\n<\/ol>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u0430 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0445 \u0442\u043e\u0447\u0435\u043a \u043d\u0443\u0436\u043d\u043e \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"cpp\">using DefaultEp0 = ZeroEndpointBase&lt;64&gt;; using LedsControlEpBase = OutEndpointBase&lt;1, EndpointType::Interrupt, 64, 32&gt;; \/\/ \u041e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u0430 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0445 \u0442\u043e\u0447\u0435\u043a \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0438\u0445 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 using EpInitializer = EndpointsInitializer&lt;DefaultEp0, LedsControlEpBase&gt;;  \/\/ EpInitializer \u0432\u0435\u0440\u043d\u0435\u0442 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u044b\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 \u0442\u043e\u0447\u0435\u043a. \/\/ \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u043d\u0435 \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u043b \u043d\u0438\u0447\u0435\u0433\u043e, \u0447\u0442\u043e \u0431\u044b \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u043b\u043e \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0434 using Ep0 = EpInitializer::ExtendEndpoint&lt;DefaultEp0&gt;; using LedsControlEp = EpInitializer::ExtendEndpoint&lt;LedsControlEpBase&gt;; \/\/ \u041e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430, \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430. using Hid = HidInterface&lt;0, 0, 0, 0, HidDesc, LedsControlEp&gt;; using Config = HidConfiguration&lt;0, 250, false, false, Report, Hid&gt;; using MyDevice = Device&lt;0x0200, DeviceClass::InterfaceSpecified, 0, 0, 0x0483, 0x5711, 0, Ep0, Config&gt;;<\/code><\/pre>\n<p>\u0412\u043d\u0443\u0442\u0440\u0438 \u043a\u043b\u0430\u0441\u0441\u0430 <em>Device <\/em>\u0441\u043d\u043e\u0432\u0430 \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0445 \u0442\u043e\u0447\u0435\u043a, \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0443\u0436\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u044b\u0445 \u0438\u0445 \u0432\u0435\u0440\u0441\u0438\u0438:<\/p>\n<pre><code class=\"cpp\">template&lt;   ...   typename _Ep0,   typename... _Configurations&gt;   class DeviceBase : public _Ep0 {   using This = DeviceBase&lt;_Regs, _IRQNumber, _ClockCtrl, _UsbVersion, _Class, _SubClass, _Protocol, _VendorId, _ProductId, _DeviceReleaseNumber, _Ep0, _Configurations...&gt;;   using Endpoints = Append_t&lt;typename _Configurations::Endpoints...&gt;;   using Configurations = TypeList&lt;_Configurations...&gt;;    using EpBufferManager = EndpointsManager&lt;Append_t&lt;_Ep0, Endpoints&gt;&gt;;   \/\/ \u041a\u043b\u0430\u0441\u0441 Device \u0432\u044b\u0441\u0442\u0443\u043f\u0430\u0435\u0442 \u0432 \u0440\u043e\u043b\u0438 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438   using EpHandlers = EndpointHandlers&lt;Append_t&lt;This, Endpoints&gt;&gt;; public:   static void Enable()   {     _ClockCtrl::Enable();     \/\/ \u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u043e\u0432 \u0431\u0443\u0444\u0435\u0440\u043e\u0432 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0445 \u0442\u043e\u0447\u0435\u043a     EpBufferManager::Init();<\/code><\/pre>\n<p>\u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 C++ \u0434\u043e\u0441\u0442\u0438\u0433\u043d\u0443\u0442\u044b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b:<\/p>\n<ol>\n<li>\n<p>\u0427\u0430\u0441\u0442\u044c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0435\u043d\u0430 \u043d\u0430 \u044d\u0442\u0430\u043f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u043b\u043e, \u043f\u0443\u0441\u0442\u044c \u0438 \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0441\u043d\u0438\u0437\u0438\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440 \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0438 (\u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0430 HID-\u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0435\u0433\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043e\u0434\u043d\u0438\u043c \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u043e\u043c, \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 2400 \u0431\u0430\u0439\u0442\u043e\u0432).<\/p>\n<\/li>\n<li>\n<p>\u0421\u043d\u0438\u0436\u0435\u043d \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0433\u043e \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u0434\u0430, \u0445\u043e\u0442\u044f \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0435\u0433\u043e \u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c.<\/p>\n<\/li>\n<li>\n<p>\u041a\u0430\u043a \u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e \u043f\u0443\u043d\u043a\u0442\u0430, \u0441\u043d\u0438\u0436\u0435\u043d \u043e\u0431\u044a\u0435\u043c \u043e\u0448\u0438\u0431\u043e\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442 \u043c\u043e\u0436\u0435\u0442 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c. \u0422\u0430\u043a\u0436\u0435 &#171;\u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e&#187; \u043f\u043e\u043b\u0443\u0447\u0435\u043d \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u043d\u0430\u0434 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u043c \u0432\u044b\u0445\u043e\u0434\u043e\u043c \u0437\u0430 \u043f\u0440\u0435\u0434\u0435\u043b\u044b \u0431\u0443\u0444\u0435\u0440\u0430 USB.<\/p>\n<\/li>\n<li>\n<p><strong>*<\/strong>\u043b\u0438\u0447\u043d\u043e \u043c\u043e\u0439 \u043f\u0440\u043e\u0444\u0438\u0442. \u0423\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u044b \u0437\u043d\u0430\u043d\u0438\u044f \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 C++, \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0441\u044f \u0432 \u043a\u043e\u043d\u0446\u0435\u043f\u0442\u0430\u0445, \u0445\u043e\u0442\u044f \u0432 \u0438\u0442\u043e\u0433\u0435 \u043d\u0438\u0433\u0434\u0435 \u043d\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043b.<\/p>\n<\/li>\n<\/ol>\n<p>   USB \u0434\u043b\u044f \u043c\u0435\u043d\u044f \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u043e\u0447\u0435\u043d\u044c \u0441\u043b\u043e\u0436\u043d\u044b\u043c. \u0423\u0432\u0435\u0440\u0435\u043d, \u0447\u0442\u043e \u043a\u043e\u0435-\u0447\u0442\u043e \u0434\u043e \u0441\u0438\u0445 \u043f\u043e\u0440 \u043f\u043e\u043d\u0438\u043c\u0430\u044e \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0438 \u043d\u0430\u0434\u0435\u044e\u0441\u044c \u0432\u0441\u0435-\u0442\u0430\u043a\u0438 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e USB, \u043f\u043e \u043c\u043e\u0435\u043c\u0443 \u043c\u043d\u0435\u043d\u0438\u044e, \u0434\u0435-\u0444\u0430\u043a\u0442\u043e \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0430\u0434\u0435\u043a\u0432\u0430\u0442\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u043a \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0443. \u041e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u0432\u044b\u0448\u0435 \u043f\u043e\u0434\u0445\u043e\u0434 \u0432\u043d\u0435\u0434\u0440\u0435\u043d \u0432 \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c\u0443\u044e \u043c\u043d\u043e\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443, \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0438\u043c \u0443\u0434\u043e\u0431\u043d\u043e. \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u043f\u043e \u0444\u0430\u043a\u0442\u0443 \u043f\u043e\u0445\u0432\u0430\u0441\u0442\u0430\u0442\u044c\u0441\u044f \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 \u043f\u043e\u043a\u0430 USB \u043d\u0435 \u043c\u043e\u0433\u0443, \u043e\u0434\u043d\u0430\u043a\u043e \u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0434\u043e\u0441\u0442\u0438\u0433 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440 &#171;\u0432\u0438\u0434\u0438\u0442&#187; \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u043e\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0435\u0433\u043e \u043a\u043b\u0430\u0441\u0441.<\/p>\n<p>    \u0414\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u0441\u0442 \u0431\u044b\u043b \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d \u043d\u0435 \u0447\u0430\u0441\u0442\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u043a\u0430\u0441\u0430\u044e\u0449\u0435\u0439\u0441\u044f USB \u0432 \u0446\u0435\u043b\u043e\u043c, \u0430 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u043c, \u043d\u043e \u0432\u0430\u0436\u043d\u043e\u043c \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u043c\u0435\u0436\u0434\u0443 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u043c\u0438 \u0442\u043e\u0447\u043a\u0430\u043c\u0438. \u0411\u0443\u0434\u0443 \u0440\u0430\u0434 \u0432\u043e\u043f\u0440\u043e\u0441\u0430\u043c \u0438 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u043c.<\/p>\n<p>   \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043a\u043e\u0434 \u0446\u0435\u043b\u0438\u043a\u043e\u043c (USB \u043f\u043e\u043a\u0430 \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u044e \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 F072RBT6, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0435\u0441\u0442\u044c disco \u0441 \u0440\u0430\u0441\u043f\u0430\u044f\u043d\u043d\u044b\u043c miniusb) \u043c\u043e\u0436\u043d\u043e <a href=\"https:\/\/github.com\/azhel12\/Zhele\" rel=\"noopener noreferrer nofollow\">\u0442\u0443\u0442<\/a>. \u041d\u0430\u0434\u0435\u044e\u0441\u044c \u043a \u043b\u0435\u0442\u0443 \u043f\u043e\u0431\u0435\u0434\u0438\u0442\u044c USB \u0445\u043e\u0442\u044f \u0431\u044b \u0434\u043b\u044f \u041c\u041a \u0441\u0435\u0440\u0438\u0438 F0 \u0438 F1. \u0421\u043c\u043e\u0442\u0440\u0435\u043b \u043d\u0430 F4 &#8212; \u0442\u0430\u043c \u0432\u0441\u0435 \u0431\u043e\u043b\u0435\u0435 \u043a\u0440\u0443\u0442\u043e (\u0435\u0441\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 OTG) \u0438 \u0441\u043b\u043e\u0436\u043d\u043e.<\/p>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/547732\/\"> https:\/\/habr.com\/ru\/post\/547732\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<p>*\u0417\u0430 \u043f\u0440\u0438\u043a\u043e\u043b\u044c\u043d\u0443\u044e \u0438\u0434\u0435\u044e \u0441 \u0438\u0437\u043e\u043b\u0435\u043d\u0442\u043e\u0439 \u0441\u043f\u0430\u0441\u0438\u0431\u043e @<a href=\"https:\/\/habr.com\/ru\/users\/grafalex\/\" rel=\"noopener noreferrer nofollow\">grafalex<\/a><\/p>\n<h2>\u041d\u0438\u043a\u0442\u043e \u043d\u0435 \u043b\u044e\u0431\u0438\u0442 USB.<\/h2>\n<p>    \u041f\u0440\u043e\u0434\u0432\u0438\u0433\u0430\u044f\u0441\u044c \u0432 \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432, \u044f \u043e\u0441\u043e\u0437\u043d\u0430\u043b \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u043e\u0441\u0432\u043e\u0438\u0442\u044c USB, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u044d\u0442\u043e, \u0431\u0435\u0441\u0441\u043f\u043e\u0440\u043d\u043e, \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u041d\u0415-\u0432\u043d\u0443\u0442\u0440\u0438\u0441\u0445\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432. \u041e\u0434\u043d\u0430\u043a\u043e \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u043e\u0432 \u0432 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u043c \u043c\u0438\u0440\u0435 \u043d\u0435\u043c\u043d\u043e\u0433\u043e. \u041f\u0440\u043e\u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0432 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0444\u043e\u0440\u0443\u043c\u044b, \u0441\u0444\u043e\u0440\u043c\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u043b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0440\u0438\u0447\u0438\u043d\u044b \u043d\u0435\u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0441\u0442\u0438 USB \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445:<\/p>\n<ul>\n<li>\n<p><a class=\"mention\" href=\"\/users\/jaiprakash\">@jaiprakash<\/a>\u043d\u0430\u043f\u043e\u043c\u043d\u0438\u043b, \u0447\u0442\u043e \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0434\u043b\u044f USB-\u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 VID \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043a\u0443\u043f\u0430\u0442\u044c \u0437\u0430 \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0434\u0435\u043d\u044c\u0433\u0438.<\/p>\n<\/li>\n<li>\n<p>\u041e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0432\u044b\u0441\u043e\u043a\u043e\u0441\u043a\u043e\u0440\u043e\u0441\u0442\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<\/li>\n<li>\n<p>\u0412\u044b\u0441\u043e\u043a\u0430\u044f \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u0430\u043c\u043e\u0433\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0430 \u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u044b\u043c \u043c\u043d\u043e\u0433\u0438\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u043c UART. \u0414\u0435\u0448\u0435\u0432\u043b\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u0433\u043e\u0442\u043e\u0432\u044b\u0439 USB&lt;-&gt;UART \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u043d\u0438\u043a.<\/p>\n<\/li>\n<li>\n<p>\u041e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u043d\u0430\u0432\u044b\u043a\u043e\u0432 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u043e\u0432 \u0434\u043b\u044f \u041e\u0421 Windows\/Linux.<\/p>\n<\/li>\n<\/ul>\n<p>   \u0412 \u0438\u0442\u043e\u0433\u0435, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438, \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c, \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0438\u0442\u0430\u044e\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c UART (\u0447\u0435\u0440\u0435\u0437 \u0430\u043f\u043f\u0430\u0440\u0430\u0442\u043d\u044b\u0439 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0435\u0440 \u0438\u043b\u0438, \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c, \u043f\u0443\u0442\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f VCP-\u0434\u0435\u0432\u0430\u0439\u0441\u0430, \u043a\u043e\u0434 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 CubeMX). \u042f \u0440\u0435\u0448\u0438\u043b \u043f\u043e\u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0441 USB \u0445\u043e\u0442\u044f \u0431\u044b \u043d\u0430 \u0431\u0430\u0437\u043e\u0432\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435, \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0432 \u043b\u0438\u043d\u0438\u044e \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 \u044f\u0437\u044b\u043a\u0430 C++. \u0412 \u044d\u0442\u043e\u043c \u043f\u043e\u0441\u0442\u0435 \u043e\u043f\u0438\u0441\u0430\u043d \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 (\u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u0431\u0443\u0444\u0435\u0440\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u0438 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u043e\u0432) \u043c\u0435\u0436\u0434\u0443 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u043c\u0438 \u0442\u043e\u0447\u043a\u0430\u043c\u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430.<\/p>\n<h2>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f<\/h2>\n<p>    \u041e\u0441\u043d\u043e\u0432\u043d\u044b\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b, \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0449\u0435\u0439 USB-\u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <em>\u041a\u043e\u043d\u0435\u0447\u043d\u0430\u044f \u0442\u043e\u0447\u043a\u0430 <\/em>(Endpoint). \u0425\u043e\u0441\u0442 \u043e\u0431\u043c\u0435\u043d\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0441 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u043e\u0439. \u0423\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u043e\u0431\u044f\u0437\u0430\u043d\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043a\u043e\u043d\u0435\u0447\u043d\u0443\u044e \u0442\u043e\u0447\u043a\u0443 \u0441 \u043d\u043e\u043c\u0435\u0440\u043e\u043c 0, \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435, \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u043e\u0432 \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u044d\u043d\u0443\u043c\u0435\u0440\u0430\u0446\u0438\u0438, \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0430\u0434\u0440\u0435\u0441\u0430, \u0432\u044b\u0431\u043e\u0440\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0438 \u0432\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435. \u0411\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0441 \u043f\u043e\u043d\u044f\u0442\u0438\u0435\u043c \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0445 \u0442\u043e\u0447\u0435\u043a \u0438 \u0432 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435 \u0431\u0430\u0437\u043e\u0432\u044b\u043c\u0438 \u0437\u043d\u0430\u043d\u0438\u044f\u043c\u0438 USB \u043c\u043e\u0436\u043d\u043e \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0432 <a href=\"http:\/\/microsin.net\/programming\/arm-working-with-usb\/usb-in-a-nutshell-part1.html\" rel=\"noopener noreferrer nofollow\">\u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0435 <\/a>&#171;USB in NutShell&#187; \u043d\u0430 \u0440\u0435\u0441\u0443\u0440\u0441\u0435 microsin (\u0440\u0435\u0431\u044f\u0442\u0430\u043c \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0435 \u0441\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u043f\u0440\u043e\u0434\u0435\u043b\u0430\u043d\u043d\u044b\u0439 \u0442\u0440\u0443\u0434, \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0435 \u0434\u0435\u043b\u043e \u0441\u0434\u0435\u043b\u0430\u043b\u0438).<\/p>\n<p>    \u041a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u044b Stm32F0\/F1 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u0443\u044e \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u0438 &#8212; <em>Packet Memory Area (PMA)<\/em>, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u043e\u0432 \u0431\u0443\u0444\u0435\u0440\u043e\u0432 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0445 \u0442\u043e\u0447\u0435\u043a \u0438 \u0441\u0430\u043c\u0438 \u0431\u0443\u0444\u0435\u0440\u044b \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0445 \u0442\u043e\u0447\u0435\u043a. \u0412\u0441\u0435 \u0432\u0441\u0435\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445 \u043d\u0438\u0437\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 USB-\u0441\u0442\u0435\u043a\u0430 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u044c, \u0447\u0442\u043e \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u043e, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u0440\u0438\u0441\u043a\u0438 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0443. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440 \u0431\u0443\u0444\u0435\u0440\u0430 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 <em>K, <\/em>\u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e &#171;\u043f\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u044c&#187; \u0432\u0441\u0435 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0445 \u0442\u043e\u0447\u0435\u043a <em>K+1, &#8230; , N. <\/em>(\u0433\u0434\u0435 <em>N<\/em> &#8212; \u043e\u0431\u0449\u0435\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0445 \u0442\u043e\u0447\u0435\u043a). \u041b\u0438\u0447\u043d\u043e \u0432 \u0441\u0435\u0431\u0435 \u044f \u0443\u0432\u0435\u0440\u0435\u043d: 100% \u0440\u0430\u043d\u043e \u0438\u043b\u0438 \u043f\u043e\u0437\u0434\u043d\u043e \u043e\u0448\u0438\u0431\u0443\u0441\u044c.<\/p>\n<p>    \u0421\u0442\u043e\u0438\u0442 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c, \u0447\u0442\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0445 \u0442\u043e\u0447\u0435\u043a (\u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0440\u0430\u0437\u043c\u0435\u0440 \u0431\u0443\u0444\u0435\u0440\u0430) \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0442\u0438 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043f\u0430\u043c\u044f\u0442\u0438 \u0438\u0437 runtime \u0432 compile-time, \u044d\u0442\u043e \u0434\u0430\u0435\u0442 \u0434\u0432\u0430 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430:<\/p>\n<ul>\n<li>\n<p>\u0418\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u0423\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u0432 \u0431\u0443\u0444\u0435\u0440\u043e\u0432 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043b\u044f \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0439. \u0422\u0430\u043a\u0436\u0435 \u043e\u0442\u043f\u0430\u0434\u0430\u0435\u0442 \u0432 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0440\u0443\u0447\u043d\u043e\u0439 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u043e\u0432 \u0431\u0443\u0444\u0435\u0440\u043e\u0432 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 (<em>ADDRn_TX, COUNTn_TX, ADDRn_RX, COUNTn_RX<\/em>), \u0442\u0430\u043a \u043a\u0430\u043a \u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438, \u0430 \u0432 runtime \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u043f\u0430\u043c\u044f\u0442\u044c.<\/p>\n<\/li>\n<li>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u043d\u043d\u0435\u0433\u043e \u0434\u0435\u0442\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043e\u0448\u0438\u0431\u043e\u043a, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0431\u0443\u0444\u0435\u0440\u0430 \u0438\u043b\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0430 \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0439 \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0445 \u0442\u043e\u0447\u0435\u043a \u043a \u043e\u0434\u043d\u043e\u043c\u0443 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0443 <em>EPnR <\/em>(\u044d\u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442 \u0442\u043e\u0436\u0435 \u043f\u043e\u0434\u0432\u0435\u0440\u0436\u0435\u043d \u043e\u0448\u0438\u0431\u043a\u0430\u043c, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0435\u0433\u0438\u0441\u0442\u0440 \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d \u0434\u043b\u044f \u0434\u0432\u0443\u0445 \u0440\u0430\u0437\u043d\u043e\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0445 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0445 \u0442\u043e\u0447\u0435\u043a, \u0438\u043b\u0438 \u043e\u0434\u043d\u043e\u0439 \u0441 \u0434\u0432\u043e\u0439\u043d\u043e\u0439 \u0431\u0443\u0444\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u0435\u0439).<\/p>\n<\/li>\n<\/ul>\n<h2>\u041a\u043e\u043d\u0435\u0447\u043d\u044b\u0435 \u0442\u043e\u0447\u043a\u0438 \u0438 \u0438\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b<\/h2>\n<p>\u041a\u0430\u0436\u0434\u0430\u044f \u043a\u043e\u043d\u0435\u0447\u043d\u0430\u044f \u0442\u043e\u0447\u043a\u0430 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0437\u0443\u0435\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438:<\/p>\n<ol>\n<li>\n<p>\u041d\u043e\u043c\u0435\u0440 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 (0..16).<\/p>\n<\/li>\n<li>\n<p>\u0422\u0438\u043f \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 (Control, Interrupt, Bulk, Isochronous).<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 (In, Out).<\/p>\n<\/li>\n<li>\n<p>\u041c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 \u043f\u0430\u043a\u0435\u0442\u0430 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438.<\/p>\n<\/li>\n<\/ol>\n<p>\u0412\u0441\u0435 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0432\u0445\u043e\u0434\u044f\u0442 \u0432 \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u0445\u043e\u0441\u0442 \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u044d\u043d\u0443\u043c\u0435\u0440\u0430\u0446\u0438\u0438.<\/p>\n<p>\u0412 \u0440\u0430\u043c\u043a\u0430\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0434\u043b\u044f \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u044b:<\/p>\n<ol>\n<li>\n<p>\u0420\u0435\u0433\u0438\u0441\u0442\u0440 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 (EPnR).<\/p>\n<\/li>\n<li>\n<p>\u0410\u0434\u0440\u0435\u0441 \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u0430 \u0431\u0443\u0444\u0435\u0440\u0430 \u043f\u0430\u043a\u0435\u0442\u043e\u0432.<\/p>\n<\/li>\n<li>\n<p>\u0410\u0434\u0440\u0435\u0441 \u0431\u0443\u0444\u0435\u0440\u0430 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 (\u0438\u043b\u0438 \u0434\u0432\u0443\u0445 \u0431\u0443\u0444\u0435\u0440\u043e\u0432 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0434\u0432\u0443\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0439 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u0438\u043b\u0438 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u0441 \u0434\u0432\u043e\u0439\u043d\u043e\u0439 \u0431\u0443\u0444\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u0435\u0439).<\/p>\n<\/li>\n<\/ol>\n<p>\u0418 \u0432\u043e\u0442 \u0437\u0434\u0435\u0441\u044c \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u0430\u044f \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c: \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0435 \u0432\u044b\u0448\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 <em>N <\/em>\u0437\u0430\u0432\u0438\u0441\u044f\u0442 \u043e\u0442 \u0432\u0441\u0435\u0445 \u0434\u0440\u0443\u0433\u0438\u0445 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0445 \u0442\u043e\u0447\u0435\u043a. \u0418\u0437 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u0448\u043b\u0438 \u0432 \u0433\u043e\u043b\u043e\u0432\u0443, \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0441\u044f \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043c\u0435\u0442\u043e\u0434\u0438\u043a\u0435:<\/p>\n<ol>\n<li>\n<p>\u041e\u0431\u044a\u044f\u0432\u0438\u0442\u044c \u0432\u0441\u0435 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0435 \u0442\u043e\u0447\u043a\u0438 \u0441 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435\u043c \u043d\u043e\u043c\u0435\u0440\u0430, \u0442\u0438\u043f\u0430, \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0438 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u043f\u0430\u043a\u0435\u0442\u0430.<\/p>\n<\/li>\n<li>\n<p>\u041e\u0431\u044a\u044f\u0432\u0438\u0442\u044c \u043a\u043b\u0430\u0441\u0441 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u0430 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0445 \u0442\u043e\u0447\u0435\u043a, \u043f\u0435\u0440\u0435\u0434\u0430\u0432 \u0432\u0441\u0435 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0435 \u0442\u043e\u0447\u043a\u0438.<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043e\u0442 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u0430 &#171;\u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u044b\u0435&#187; \u0432\u0435\u0440\u0441\u0438\u0438 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0445 \u0442\u043e\u0447\u0435\u043a.<\/p>\n<\/li>\n<\/ol>\n<h2>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u0430 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0445 \u0442\u043e\u0447\u0435\u043a<\/h2>\n<p>\u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043b\u0430\u0441\u0441:<\/p>\n<pre><code class=\"cpp\">template&lt;typename... AllEndpoints,   typename... BidirectionalAndBulkDoubleBufferedEndpoints,   typename... RxEndpoints,   typename... BulkDoubleBufferedTxEndpoints&gt; class EndpointsManagerBase&lt;TypeList&lt;AllEndpoints...&gt;,   TypeList&lt;BidirectionalAndBulkDoubleBufferedEndpoints...&gt;,   TypeList&lt;RxEndpoints...&gt;,   TypeList&lt;BulkDoubleBufferedTxEndpoints...&gt;&gt; {   \/\/ \u0412\u0441\u0435 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0435 \u0442\u043e\u0447\u043a\u0438   using AllEndpointsList = TypeList&lt;AllEndpoints...&gt;;   \/\/\/ \u0420\u0430\u0437\u043c\u0435\u0440 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u043e\u0432 \u0431\u0443\u0444\u0435\u0440\u043e\u0432 \u043f\u0430\u043a\u0435\u0442\u043e\u0432    static const auto BdtSize = 8 * (EndpointEPRn&lt;GetType_t&lt;sizeof...(AllEndpoints) - 1, AllEndpointsList&gt;, AllEndpointsList&gt;::RegisterNumber + 1);   \/\/\/ \u0421\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0431\u0443\u0444\u0435\u0440\u0430 \u0434\u043b\u044f \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0439 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438   template&lt;typename Endpoint&gt;   static constexpr uint32_t BufferOffset = BdtSize + OffsetOfBuffer&lt;TypeIndex&lt;Endpoint, AllEndpointsList&gt;::value, AllEndpointsList&gt;::value;   \/\/\/ \u0421\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u0430 \u0434\u043b\u044f \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0439 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438   template&lt;typename Endpoint&gt;   static constexpr uint32_t BdtCellOffset =     EndpointEPRn&lt;Endpoint, AllEndpointsList&gt;::RegisterNumber * 8       + (Endpoint::Type == EndpointType::Control       || Endpoint::Type == EndpointType::ControlStatusOut       || Endpoint::Type == EndpointType::BulkDoubleBuffered       || Endpoint::Direction == EndpointDirection::Out       || Endpoint::Direction == EndpointDirection::Bidirectional         ? 0         : 4);   \/\/\/ \u0411\u0430\u0437\u043e\u0432\u044b\u0439 \u0430\u0434\u0440\u0435\u0441 \u0431\u0443\u0444\u0435\u0440\u0430 USB   static const uint32_t BdtBase = PmaBufferBase; public:   \/\/\/ \"\u0420\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u0442\" \u043a\u043e\u043d\u0435\u0447\u043d\u0443\u044e \u0442\u043e\u0447\u043a\u0443   template&lt;typename Endpoint&gt;   using ExtendEndpoint =      typename Select&lt;Endpoint::Type == EndpointType::Control || Endpoint::Type == EndpointType::ControlStatusOut,     ControlEndpoint&lt;Endpoint,       typename EndpointEPRn&lt;Endpoint, TypeList&lt;AllEndpoints...&gt;&gt;::type,       PmaBufferBase + BufferOffset&lt;Endpoint&gt;, \/\/ TxBuffer       PmaBufferBase + BdtCellOffset&lt;Endpoint&gt; + 2, \/\/ TxCount       PmaBufferBase + BufferOffset&lt;Endpoint&gt; + Endpoint::MaxPacketSize, \/\/ RxBuffer       PmaBufferBase + BdtCellOffset&lt;Endpoint&gt; + 6&gt;, \/\/RxCount     typename Select&lt;Endpoint::Direction == EndpointDirection::Bidirectional,     BidirectionalEndpoint&lt;Endpoint,       typename EndpointEPRn&lt;Endpoint, TypeList&lt;AllEndpoints...&gt;&gt;::type,       PmaBufferBase + BufferOffset&lt;Endpoint&gt;, \/\/ TxBuffer       PmaBufferBase + BdtCellOffset&lt;Endpoint&gt; + 2, \/\/ TxCount       PmaBufferBase + BufferOffset&lt;Endpoint&gt; + Endpoint::MaxPacketSize, \/\/ RxBuffer       PmaBufferBase + BdtCellOffset&lt;Endpoint&gt; + 6&gt;, \/\/RxCount     ... \/\/ \u041a\u0430\u0436\u0434\u044b\u0439 \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u0442\u0438\u043f \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u0442\u0441\u044f \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u044b\u0439     void&gt;::value&gt;::value;    static void Init()   {     memset(reinterpret_cast&lt;void*&gt;(BdtBase), 0x00, BdtSize);     \/\/ \u0411\u0430\u0437\u043e\u0432\u0430\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0432\u0441\u0435\u0445 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0445 \u0442\u043e\u0447\u0435\u043a     ((*(reinterpret_cast&lt;uint16_t*&gt;(BdtBase + BdtCellOffset&lt;AllEndpoints&gt;)) = BufferOffset&lt;AllEndpoints&gt;), ...);     \/\/ \u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u0431\u0443\u0444\u0435\u0440\u0430 \u0434\u043b\u044f \u0434\u0432\u0443\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u0442\u043e\u0447\u0435\u043a \u0438 \u0442\u043e\u0447\u0435\u043a \u0441 \u0434\u0432\u043e\u0439\u043d\u043e\u0439 \u0431\u0443\u0444\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u0435\u0439     ((*(reinterpret_cast&lt;uint16_t*&gt;(BdtBase + BdtCellOffset&lt;BidirectionalAndBulkDoubleBufferedEndpoints&gt; + 4)) = (BufferOffset&lt;BidirectionalAndBulkDoubleBufferedEndpoints&gt; + BidirectionalAndBulkDoubleBufferedEndpoints::MaxPacketSize)), ...);     \/\/ \u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f COUNTn_RX \u0434\u043b\u044f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0449\u0438\u0445 (Rx, Out) \u0442\u043e\u0447\u0435\u043a     ((*(reinterpret_cast&lt;uint16_t*&gt;(BdtBase + BdtCellOffset&lt;RxEndpoints&gt; + 2)) = (RxEndpoints::MaxPacketSize &lt;= 62       ? (RxEndpoints::MaxPacketSize \/ 2) &lt;&lt; 10       : 0x8000 | (RxEndpoints::MaxPacketSize \/ 32) &lt;&lt; 10)), ...);     \/\/ \u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f COUNTn_RX \u0434\u043b\u044f \u0434\u0432\u0443\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u0442\u043e\u0447\u0435\u043a \u0438 \u0442\u043e\u0447\u0435\u043a \u0441 \u0434\u0432\u043e\u0439\u043d\u043e\u0439 \u0431\u0443\u0444\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u0435\u0439     ((*(reinterpret_cast&lt;uint16_t*&gt;(BdtBase + BdtCellOffset&lt;BidirectionalAndBulkDoubleBufferedEndpoints&gt; + 6)) = (BidirectionalAndBulkDoubleBufferedEndpoints::MaxPacketSize &lt;= 62       ? (BidirectionalAndBulkDoubleBufferedEndpoints::MaxPacketSize \/ 2) &lt;&lt; 10       : 0x8000 | (BidirectionalAndBulkDoubleBufferedEndpoints::MaxPacketSize \/ 32) &lt;&lt; 10)), ...);      \/\/ \u0421\u0431\u0440\u043e\u0441 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430 COUNTn_RX \u0434\u043b\u044f Tx \u0442\u043e\u0447\u0435\u043a \u0441 \u0434\u0432\u043e\u0439\u043d\u043e\u0439 \u0431\u0443\u0444\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u0435\u0439 (\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u044d\u0442\u043e \u0438 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e, \u043f\u043e\u043a\u0430 \u043d\u0430 \u0432\u0441\u044f\u043a\u0438\u0439 \u0441\u043b\u0443\u0447\u0430\u0439 \u043e\u0431\u043d\u0443\u043b\u044f\u0435\u0442\u0441\u044f)     ((*(reinterpret_cast&lt;uint16_t*&gt;(BdtBase + BdtCellOffset&lt;BulkDoubleBufferedTxEndpoints&gt; + 2)) = 0), ...);     ((*(reinterpret_cast&lt;uint16_t*&gt;(BdtBase + BdtCellOffset&lt;BulkDoubleBufferedTxEndpoints&gt; + 6)) = 0), ...);   } };  template&lt;typename Endpoints&gt; using EndpointsManager = EndpointsManagerBase&lt;SortedUniqueEndpoints&lt;Endpoints&gt;,   typename Sample&lt;IsBidirectionalOrBulkDoubleBufferedEndpoint, SortedUniqueEndpoints&lt;Endpoints&gt;&gt;::type,   typename Sample&lt;IsOutEndpoint, SortedUniqueEndpoints&lt;Endpoints&gt;&gt;::type,   typename Sample&lt;IsBulkDoubleBufferedTxEndpoint, SortedUniqueEndpoints&lt;Endpoints&gt;&gt;::type&gt;;  template&lt;typename... Endpoints&gt; using EndpointsInitializer = EndpointsManagerBase&lt;SortedUniqueEndpoints&lt;TypeList&lt;Endpoints...&gt;&gt;,   TypeList&lt;&gt;,   TypeList&lt;&gt;,   TypeList&lt;&gt;&gt;;<\/code><\/pre>\n<p>\u041d\u0435 \u0431\u0443\u0434\u0443 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u044c \u043a\u043e\u0434 \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432, \u0434\u0430\u043c \u043a\u0440\u0430\u0442\u043a\u043e\u0435 \u0438\u0445 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435:<\/p>\n<ol>\n<li>\n<p><strong><em>EndpointEPRn <\/em><\/strong>&#8212; \u043a\u043b\u0430\u0441\u0441, \u043d\u0430\u0437\u043d\u0430\u0447\u0430\u044e\u0449\u0438\u0439 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430 EPnR \u0434\u043b\u044f \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438. \u0420\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e: \u0432\u0441\u0435\u043c \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u043c \u0442\u043e\u0447\u043a\u0430\u043c \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u044b \u043d\u0430\u0437\u043d\u0447\u0430\u044e\u0442\u0441\u044f \u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443. \u0415\u0441\u043b\u0438 \u0434\u0432\u0435 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0435 \u0442\u043e\u0447\u043a\u0438 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u0434\u0435\u043b\u044f\u0442 \u043e\u0434\u0438\u043d \u043d\u043e\u043c\u0435\u0440, \u0442\u043e \u043e\u0431\u0435\u0438\u043c \u043d\u0430\u0437\u043d\u0430\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0434\u0438\u043d \u0440\u0435\u0433\u0438\u0441\u0442\u0440.<\/p>\n<\/li>\n<li>\n<p><strong><em>BufferOffset <\/em><\/strong>&#8212; \u043a\u043b\u0430\u0441\u0441, \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u044e\u0449\u0438\u0439 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0431\u0443\u0444\u0435\u0440\u0430 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0434\u043b\u044f \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438. \u041a\u043b\u0430\u0441\u0441 \u0442\u043e\u0436\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0439, \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0431\u0443\u0444\u0435\u0440\u0430 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 <em>N <\/em>\u0435\u0441\u0442\u044c \u0441\u0443\u043c\u043c\u0430 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u0432 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0445 \u0442\u043e\u0447\u0435\u043a <em>0, &#8230;, N-1<\/em>.<\/p>\n<\/li>\n<li>\n<p><strong><em>SortedUniqueEndpoints <\/em><\/strong>&#8212; \u043a\u043b\u0430\u0441\u0441, \u0441\u043e\u0440\u0442\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u0432\u0441\u0435  \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0435 \u0442\u043e\u0447\u043a\u0438 \u043f\u043e \u043d\u043e\u043c\u0435\u0440\u0430\u043c \u0438 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f\u043c + \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0434\u0443\u0431\u043b\u0438\u043a\u0430\u0442\u043e\u0432. \u0422\u0435\u043a\u0443\u0449\u0435\u0435 \u043c\u043e\u0435 <\/p>\n<\/li>\n<\/ol>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-319837","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/319837","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=319837"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/319837\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=319837"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=319837"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=319837"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}