## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
##
-# UART protocol decoder
-
import sigrokdecode as srd
'''
# TODO: Options to invert the signal(s).
}
annotations = [
- ['RX data', 'UART RX data'],
- ['TX data', 'UART TX data'],
- ['Start bits', 'UART start bits'],
- ['Parity bits', 'UART parity bits'],
- ['Stop bits', 'UART stop bits'],
- ['Warnings', 'Warnings'],
+ ['rx-data', 'UART RX data'],
+ ['tx-data', 'UART TX data'],
+ ['start-bits', 'UART start bits'],
+ ['parity-bits', 'UART parity bits'],
+ ['stop-bits', 'UART stop bits'],
+ ['warnings', 'Warnings'],
]
binary = (
('rx', 'RX dump'),
b, f = self.databyte[rxtx], self.options['format']
if f == 'ascii':
- c = chr(b) if chr(b).isprintable() else '[%02X]' % b
+ c = chr(b) if b in range(30, 126 + 1) else '[%02X]' % b
self.putx(rxtx, [rxtx, [c]])
elif f == 'dec':
self.putx(rxtx, [rxtx, [str(b)]])