SLAU723A October 2017 – October 2018 MSP432E401Y , MSP432E411Y
To start communication in host or device mode, the endpoint registers must first be configured. In host mode, this configuration establishes a connection between an endpoint register and an endpoint on a device. In device mode, a n endpoint must be configured before enumerating to the host controller.
In both cases,the endpoint 0 configuration is limited because it is a fixed-function, fixed-FIFO-size endpoint. In device and host modes,the endpoint requires little setup but does require a software-based state machine to progress through the setup, data, and status phases of a standard control transaction. In device mode,the configuration of the remaining endpoints is done once before enumerating and then only changed if an alternate configuration is selected by the host controller. In host mode, the endpoints must be configured to operate as control, bulk, interrupt or isochronous mode. Once the type of endpoint is configured, a FIFO area must be assigned to each endpoint. In the case of bulk, control and interrupt endpoints, each has a maximum of 64 bytes per transaction. Isochronous endpoints can have packets with up to 1023 bytes per packet. In either mode, the maximum packet size for the given endpoint must be set prior to sending or receiving data.
Configuring the FIFO of each endpoint involves reserving a portion of the overall USB FIFO RAM to each endpoint. The total FIFO RAM available is Kbytes with the first 64 bytes reserved for endpoint 0. The endpoint's FIFO must be at least as large as the maximum packet size. The FIFO can also be configured as a double-buffered FIFO so that interrupts occur at the end of each packet and allow filling the other half of the FIFO.
If operating as a device, the soft connect of the USB device controller must be enabled when the device is ready to start communications, indicating to the host controller that the device is ready to start the enumeration process. If operating as a host controller, the device soft connect must be disabled and power must be provided to VBUS through the USB0EPEN signal.