TLazSerial
TLazSerial copied to clipboard
Add user-configurable initial states for DTR and RTS control lines
Motivation Currently, DTR and RTS are always set to HIGH when opening a serial port. This causes issues with hardware that is sensitive to these control lines (e.g., devices that reset on DTR change, or RS-485 transceivers).
Changes
- Added
InitialDTRandInitialRTSboolean properties toTLazSerial - Modified
DeviceOpen()to apply user-specified pin states after configuration - Changed
Config()to use disable flags, preventing automatic pin changes - Defaults to
Truefor backward compatibility
Testing
- Tested on Windows with COM ports
- Verified no DTR/RTS glitches when
InitialDTR/RTS = False - Confirmed backward compatibility with existing code
Breaking Changes None - defaults preserve original behavior.