- Bit banging using Cypress USB serial bridge is not recommended. You may have to look for PSoC products for the same.
- For improving the toggling speed, what you can try is to use the CySetGpioValue/CyGetGpioValue APIs in a separate thread in your command line application. BUT NOTE that the performance of the main features of USB-Serial bridge(as mentioned in the datasheet) may be affected by this approach (which is creating a dedicated thread for bit banging a GPIO)
I further investigated this issue.
I captured USB traffic using protocol analyzer. Because it's a USB1.1 device, it's operating at 1ms resolution. There are USB SETUP transactions used to set/clear GPIOs. Each SETUP transaction has a couple of request-response phases, and each one takes about 1.9ms.
So toggle speed is limited by the fact that it's a USB1.1 device. It's a fundamental limitation of the chip and the speed cannot be improved.
I tried similar FTDI chip, which is USB2.0 device. Did the same GPIO bit-banging, and got 50-70us latencies.