1 """UART Class for NXP LPC4330"""
2 from greatfet import GreatFET
3 from greatfet.interfaces.uart import UART as _UART
7 """Custom UART Class for NXP LPC4330"""
12 PARITY_STUCK_AT_ONE = 3
13 PARITY_STUCK_AT_ZERO = 4
15 # pylint: disable=too-many-arguments,unused-argument
37 if flow is not None: # default None
38 raise NotImplementedError(
39 "Parameter '{}' unsupported on GreatFET One".format("flow")
42 # pylint: enable=too-many-arguments,unused-argument
46 self._uart.initialized = False
48 def read(self, nbytes=None):
49 """Read data from UART and return it"""
52 return self._uart.read(nbytes)
54 def readinto(self, buf, nbytes=None):
55 """Read data from UART and into the buffer"""
58 result = self.read(nbytes)
59 for _ in range(nbytes):
64 """Read a single line of data from UART"""
65 out = self.read(nbytes=1)
68 out = self.read(nbytes=1)
73 """Write data from the buffer to UART"""
74 return self._uart.write(buf)