Download CPAL v2 - STMicroelectronics
Transcript
CPAL architecture description Table 10. UM1566 wCPAL_DevError field values (for I2C peripherals) (continued) Field value Description CPAL_I2C_ERR_ARLO An arbitration loss is detected when a high level is sent on SDA, but a low level is sampled on the SCL rising edge. – In master mode, the arbitration loss is detected during address phase, data phase and data acknowledge phase. In that case, SDA and SCL lines are released, START control bit is cleared by hardware and the master switches automatically to slave mode. – In slave mode, arbitration loss is detected during data phase and data acknowledge phase. In that case, the transfer is stopped, and SCL and SDA lines are released. When an arbitration loss is detected, ARLO flag is set in I2C_ISR register, and an interrupt is generated if ERRIE is set in I2C_CR1 register. It is cleared by software by setting ARLOCF bit. CPAL_I2C_ERR_AF Not Acknowledge is detected as an error only in master mode when a NACK is received after sending slave address. NACKF flag is set in I2C_ISR register, and an interrupt is generated if NACKIE is set in I2C_CR1 register. It is cleared by software by setting NACKCF bit. CPAL_I2C_ERR_OVR An overrun or underrun error is detected in slave mode when NOSTRETCH=1 and: – In reception when a new byte is received and the RXDR register has not been read yet. New received byte is lost, and a NACK is automatically sent as a response to the new byte. – In transmission: – when STOPF=1 and the first data should be sent. The content of TXDATA is sent if TXE=0, 0xFF if not. – when a new byte should be sent and the TXDR register has not been written yet. 0xFF is sent. When an overrun or underrun error is detected, OVR flag is set in I2C_ISR register, and an interrupt is generated if ERRIE is set in I2C_CR1 register. It is cleared by software by setting OVRCF bit. The wCPAL_Options field in the CPAL device structure can be used to manage additional configuration options for peripheral initialization and communications. The options are bit-field values (each option is coded on 1 bit into the 32-bit word-field wCPAL_Options). Multiple options may be assigned to the wCPAL_Options field at the same time. 14/66 Doc ID 023577 Rev 1