Can the MAX3421E detect how it is attached—as a peripheral or host?
Yes. If the design includes both an A and B USB connector, put the MAX3421E into host mode (HOST bit equals 1), switch on the internal DP/DM pulldown resistors, and supply 5V to the A-connector VBUS pin. A MAX3421E interrupt signals that a device is attaching. On the B-connector, connect the VBUS pin to the MAX3421E VBCOMP (VBUS Comparator) input. Then, when the user connects to a PC, the MAX3421E detects VBUS and the MAX3421E configures as a peripheral.