No such thing as a small change | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Of course it does not. It becomes obvious when you read the POD of Device::SerialPort:
To use the parity bit for non-parity purposes, you would need other values, e.g. "mark" and "space" or simply "0" and "1". Also, parity() is one of the configuration parameter methods, not an operating method. It is not clear if changing the parity at operation time is supported: Some individual parameters (eg. baudrate) can be changed after the initialization is completed. These will be validated and will update the serial driver as required. Just to see an alternative implementation of a non-PC USART, here is a part of the documentation for the SERCOM peripheral of the Atmel/Microchip SAM D21 in USART Mode. It is also available in other SAMs, like the L21 and the D5x/E5x:
Note that neither mark or space are supported for parity, but you can transfer 9 data bits. The data register is 16 bits wide to support using 9 data bits. If you want to drive people really mad, you use 9 bit mode with parity enabled and two stop bits. This ends with a line format of 13 bits (1 start + 9 data + 1 parity + 2 stop bits), and only a few other U(S)ARTs will be able to send or receive that format. Alexander
-- Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-) In reply to Re^6: How to read serial port with WIN32:SerialPort?
by afoken
|
|