USB1_ENDPTCTRL1 not usable?

CM207

Member
Hey, Im trying to use the USB1_ENDPTCTRL1 like the others USB1_ENDPTCTRL2, USB1_ENDPTCTRL3, etc.

C:
static void endpoint0_setup(uint64_t setupdata)
{
    setup_t setup;
    uint32_t endpoint, dir, ctrl;
    const usb_descriptor_list_t *list;

    setup.bothwords = setupdata;
    switch (setup.wRequestAndType) {
      case 0x0500: // SET_ADDRESS
        endpoint0_receive(NULL, 0, 0);
        USB1_DEVICEADDR = USB_DEVICEADDR_USBADR(setup.wValue) | USB_DEVICEADDR_USBADRA;
        return;
      case 0x0900: // SET_CONFIGURATION
        usb_configuration = setup.wValue;
        // configure all other endpoints
        #if defined(ENDPOINT1_CONFIG)
        USB1_ENDPTCTRL1 = ENDPOINT1_CONFIG;
        #endif
        #if defined(ENDPOINT2_CONFIG)
        USB1_ENDPTCTRL2 = ENDPOINT2_CONFIG;
        #endif
        #if defined(ENDPOINT3_CONFIG)
        USB1_ENDPTCTRL3 = ENDPOINT3_CONFIG;
        #endif
        #if defined(ENDPOINT4_CONFIG)
        USB1_ENDPTCTRL4 = ENDPOINT4_CONFIG;
        #endif
....

C:
#if defined(USB_HID)
  #define VENDOR_ID        0x16C0
  #define PRODUCT_ID        0x0482
  #define MANUFACTURER_NAME    {'T','e','e','n','s','y','d','u','i','n','o'}
  #define MANUFACTURER_NAME_LEN    11
  #define PRODUCT_NAME        {'K','e','y','b','o','a','r','d','/','M','o','u','s','e','/','J','o','y','s','t','i','c','k'}
  #define PRODUCT_NAME_LEN    23
  #define EP0_SIZE        64
  #define NUM_ENDPOINTS         5
  #define NUM_USB_BUFFERS    24
  #define NUM_INTERFACE        4
  #define MOUSE_INTERFACE       0
  #define MOUSE_ENDPOINT        1
  #define MOUSE_SIZE            64
  #define MOUSE_INTERVAL        1
  #define KEYBOARD_INTERFACE    1
  #define KEYBOARD_ENDPOINT     2
  #define KEYBOARD_SIZE         64
  #define KEYBOARD_INTERVAL     1
  #define VENDOR_INTERFACE    2
  #define VENDOR_ENDPOINT     3
  #define VENDOR_SIZE         64
  #define VENDOR_INTERVAL     1
  #define SEREMU_INTERFACE      3
  #define SEREMU_TX_ENDPOINT    4
  #define SEREMU_TX_SIZE        64
  #define SEREMU_TX_INTERVAL    1
  #define SEREMU_RX_ENDPOINT    4
  #define SEREMU_RX_SIZE        32
  #define SEREMU_RX_INTERVAL    2
  #define ENDPOINT1_CONFIG    ENDPOINT_RECEIVE_UNUSED + ENDPOINT_TRANSMIT_INTERRUPT
  #define ENDPOINT2_CONFIG    ENDPOINT_RECEIVE_UNUSED + ENDPOINT_TRANSMIT_INTERRUPT
  #define ENDPOINT3_CONFIG    ENDPOINT_RECEIVE_UNUSED + ENDPOINT_TRANSMIT_INTERRUPT
  #define ENDPOINT4_CONFIG    ENDPOINT_RECEIVE_INTERRUPT + ENDPOINT_TRANSMIT_INTERRUPT
#endif

I'm almost positive that this is dumb question, but does anyone know why its not possible like that?
Everything works fine if I use endpoint 2-5.
 
Thanks for the quick response.

May someone knows how to make use of endpoint 1, even if clearly documented as reserved? If something breaks in the future, its ok.

This probably needs to be answered by Paul :/
 
Last edited:
Back
Top