tmp68301: Add parity tx support

This commit is contained in:
Olivier Galibert 2024-02-24 23:51:03 +01:00
parent 1b7b4e5f11
commit 3d21b4d249

View file

@ -1099,8 +1099,15 @@ void tmp68301_device::serial_tx_update(int ch)
nstate = m_smr[ch] & SMR_PEN ? SR_PARITY : SR_STOP;
break;
case SR_PARITY:
abort();
case SR_PARITY: {
u32 parity = m_smr[ch] & SMR_PEO ? 0 : 1;
for(u32 i = 0; i != 5 + ((m_smr[ch] >> SMR_CL_SFT) & 3); i++)
if((m_serial_tx[ch] >> i) & 1)
parity = parity ^ 1;
m_tx_cb[ch](parity);
nstate = SR_STOP;
break;
}
case SR_STOP:
m_tx_cb[ch](1);