This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# since screen doesn't know how to set custom baud rates, this does it for FTDI devices. | |
# it works by using setserial to set the custom speed (spd_cust) mode for baud rate 38400 | |
# it calculates the proper clock divider by dividing the device's base clock by the desired rate | |
# then, it starts screen at 38400 - which is not longer 38400 but your new clock rate. | |
# tested on FT232H, FT2232H, FT-X, and FT232RL | |
# does not work on CH341 or PL2303 | |
# todo: confirm FTDI before running setserial and report error | |
# todo: validate uart range |