54 :
Schedulable(scheduler), interf(interf_), clock(scheduler)
67 recvParityEnabled =
false;
77 writeCommand(0, time);
86 result = readTrans(time);
89 result = readStatus(time);
114 writeTrans(value, time);
142 writeCommand(value, time);
154 void I8251::setMode(
byte value)
222 charLength = (((2 * (1 + unsigned(dataBits) + (parityEnable ? 1 : 0))) +
223 unsigned(stopBits)) * baudrate) / 2;
228 byte oldCommand = command;
251 if ((command ^ oldCommand) &
CMD_RXE) {
268 byte result = status;
269 if (interf.
getDSR(time)) {
284 if (!(command & CMD_TXEN)) {
314 recvParityEnabled = enable;
315 recvParityBit = parity;
321 assert(recvReady && (command &
CMD_RXE));
342 return (command &
CMD_RXE) != 0;
364 assert(!(status &
STAT_TXEMPTY) && (command & CMD_TXEN));
371 send(sendBuffer, time);
388 static enum_string<SerialDataInterface::StopBits> stopBitsInfo[] = {
396 static enum_string<SerialDataInterface::ParityBit> parityBitInfo[] = {
402 static enum_string<I8251::CmdFaze> cmdFazeInfo[] = {
410 template<
typename Archive>
413 ar.template serializeBase<Schedulable>(*this);
414 ar.serialize(
"clock", clock);
415 ar.serialize(
"charLength", charLength);
416 ar.serialize(
"recvDataBits", recvDataBits);
417 ar.serialize(
"recvStopBits", recvStopBits);
418 ar.serialize(
"recvParityBit", recvParityBit);
419 ar.serialize(
"recvParityEnabled", recvParityEnabled);
420 ar.serialize(
"recvBuf", recvBuf);
421 ar.serialize(
"recvReady", recvReady);
422 ar.serialize(
"sendByte", sendByte);
423 ar.serialize(
"sendBuffer", sendBuffer);
424 ar.serialize(
"status", status);
425 ar.serialize(
"command", command);
426 ar.serialize(
"mode", mode);
427 ar.serialize(
"sync1", sync1);
428 ar.serialize(
"sync2", sync2);
429 ar.serialize(
"cmdFaze", cmdFaze);