/* Get 32-bit endpoint bitmask from index. 
In the returned 32-bit word, the bit positions in the lower 16 bits indicate OUT endpoints, while the upper 16 bits indicate IN endpoints */
static uint32_t get_ep_bm_from_addr(uint8_t ep)
/* Get 32-bit endpoint bitmask from index. 
In the returned 32-bit word, the bit positions in the lower 16 bits indicate OUT endpoints, while the upper 16 bits indicate IN endpoints */
static uint32_t get_ep_bm_from_addr(uint8_t ep)
{
	uint32_t ep_bm = 0;
	uint8_t ep_idx;
	ep_idx = ep & (~USB_EP_DIR_IN);
	if (ep_idx > 15) {
		LOG_ERR("Endpoint 0x%02x is invalid", ep);
		goto done;
	}
	if (ep & USB_EP_DIR_IN) {
		ep_bm = BIT(ep_idx + 16);
	} else {
		ep_bm = BIT(ep_idx);
	}
done:
	return ep_bm;
}