mirror of
https://github.com/polhenarejos/pico-keys-sdk
synced 2026-06-22 01:40:52 +02:00
Added support for Interrupt endpoint.
It is only used to inform the host changes on card status (insert or removal). Actually it only notifies the insertion of the virtual card on connect. Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
@@ -74,7 +74,7 @@ tusb_desc_configuration_t const desc_config = {
|
||||
.wTotalLength = (sizeof(tusb_desc_configuration_t)
|
||||
#ifdef USB_ITF_CCID
|
||||
+ sizeof(tusb_desc_interface_t) + sizeof(struct ccid_class_descriptor) +
|
||||
2 * sizeof(tusb_desc_endpoint_t)
|
||||
3 * sizeof(tusb_desc_endpoint_t)
|
||||
#endif
|
||||
#ifdef USB_ITF_HID
|
||||
+ TUD_HID_INOUT_DESC_LEN + TUD_HID_DESC_LEN
|
||||
@@ -120,7 +120,7 @@ tusb_desc_interface_t const desc_interface = {
|
||||
.bDescriptorType = TUSB_DESC_INTERFACE,
|
||||
.bInterfaceNumber = ITF_CCID,
|
||||
.bAlternateSetting = 0,
|
||||
.bNumEndpoints = 2,
|
||||
.bNumEndpoints = 3,
|
||||
.bInterfaceClass = TUSB_CLASS_SMART_CARD,
|
||||
.bInterfaceSubClass = 0,
|
||||
.bInterfaceProtocol = 0,
|
||||
@@ -139,17 +139,26 @@ tusb_desc_endpoint_t const desc_ep1 = {
|
||||
tusb_desc_endpoint_t const desc_ep2 = {
|
||||
.bLength = sizeof(tusb_desc_endpoint_t),
|
||||
.bDescriptorType = TUSB_DESC_ENDPOINT,
|
||||
.bEndpointAddress = 2,
|
||||
.bEndpointAddress = 1,
|
||||
.bmAttributes.xfer = TUSB_XFER_BULK,
|
||||
.wMaxPacketSize = (64),
|
||||
.bInterval = 0
|
||||
};
|
||||
|
||||
tusb_desc_endpoint_t const desc_ep3 = {
|
||||
.bLength = sizeof(tusb_desc_endpoint_t),
|
||||
.bDescriptorType = TUSB_DESC_ENDPOINT,
|
||||
.bEndpointAddress = TUSB_DIR_IN_MASK | 2,
|
||||
.bmAttributes.xfer = TUSB_XFER_INTERRUPT,
|
||||
.wMaxPacketSize = (64),
|
||||
.bInterval = 0
|
||||
};
|
||||
#endif
|
||||
|
||||
static uint8_t desc_config_extended[sizeof(tusb_desc_configuration_t)
|
||||
#ifdef USB_ITF_CCID
|
||||
+ sizeof(tusb_desc_interface_t) +
|
||||
sizeof(struct ccid_class_descriptor) + 2 *
|
||||
sizeof(struct ccid_class_descriptor) + 3 *
|
||||
sizeof(tusb_desc_endpoint_t)
|
||||
#endif
|
||||
#ifdef USB_ITF_HID
|
||||
@@ -213,6 +222,7 @@ uint8_t const *tud_descriptor_configuration_cb(uint8_t index) {
|
||||
p += sizeof(struct ccid_class_descriptor);
|
||||
memcpy(p, &desc_ep1, sizeof(tusb_desc_endpoint_t)); p += sizeof(tusb_desc_endpoint_t);
|
||||
memcpy(p, &desc_ep2, sizeof(tusb_desc_endpoint_t)); p += sizeof(tusb_desc_endpoint_t);
|
||||
memcpy(p, &desc_ep3, sizeof(tusb_desc_endpoint_t)); p += sizeof(tusb_desc_endpoint_t);
|
||||
#endif
|
||||
initd = 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user