Functional Description
Register Protection
The module implements write protection on two critical configuration registers: clock divider LEDC_PRO_R_I2C_CLK_DIV and data length LEDC_PRO_R_I2C_DATA_NUM, preventing accidental writes from altering communication parameters during an ongoing transfer. Before modifying a protected register, software must write 0xa5a5a5a5 to LEDC_PRO_SEQUENCE_CHECK1 (register 0x10[31:0]) to disable protection. After configuration is complete, write 0x00000000 to re-enable protection.
Clock Divider Configuration
During module initialization, software must first perform a software reset on the module (disable and then re-enable the module clock), followed by setting the LEDC_PRO_BIT_R_PSEDO_I2C_EN bit (register 0x08[7]) in the LEDC_PRO_PSDO_I2C_CTL register to enable pseudo I2C mode.
Once enabled, software must disable register protection and set the clock divider factor via LEDC_PRO_R_I2C_CLK_DIV (register 0x08[5:0]). The actual division factor is twice the configured value, with a minimum effective value of 2. After configuration, re-enable register protection.
Timing Control
After software writes the trigger sequence, SDA is pulled low while SCL remains high. The divider counter starts and, after counting LEDC_PRO_R_I2C_CLK_DIV x 2 - 1 clock cycles, SCL is also pulled low. The start signal generation is then complete, and the hardware begins transmitting data bit by bit.
Once all data bytes specified by LEDC_PRO_R_I2C_DATA_NUM have been transferred, the hardware automatically enters the stop phase. SCL is driven high first, and the divider counter continues counting. After counting LEDC_PRO_R_I2C_CLK_DIV x 2 - 1 clock cycles, SDA is also driven high, generating the stop signal.
Transfer Control
Idle State Confirmation
Before initiating each data transfer, software must poll the LEDC_PRO_BIT_R_I2C_TX_STATUS bit (register 0x08[6]) in the LEDC_PRO_PSDO_I2C_CTL register until it reads 1, indicating that the pseudo I2C is in the idle state and subsequent operations may proceed. If this bit reads 0, the previous transfer has not yet completed and software should continue waiting.
Clear RAM Data
After confirming that the module is idle, software must write 1 to the LEDC_PRO_BIT_R_LED_BUF_CLEAR bit (register 0x00[17]) in the LEDC_PRO_LED_PALY_CTL0 register to generate a clear pulse that zeros out any residual data in the RAM, ensuring that the current write is not affected by previous content.
Write Data and Set Transfer Length
Software writes the data to be transmitted into the LEDC_PRO_LED_RAM register. After the data write is complete, software must disable register protection and set the total number of bytes for this transfer via the LEDC_PRO_R_I2C_DATA_NUM field (register 0x08[14:8]) in the LEDC_PRO_PSDO_I2C_CTL register, supporting a maximum of 127 bytes. After configuration, re-enable register protection.
Trigger Hardware Transfer
Once the data is ready, software sequentially writes 0x69696969 and 0x96969696 to the LEDC_PRO_SEQUENCE_CHECK0 register, triggering the hardware to read data from the shared buffer and execute the pseudo I2C transfer. Upon a successful trigger, the LEDC_PRO_BIT_R_SEQ_PASS_FLAG bit (register 0x00[20]) in the LEDC_PRO_LED_PALY_CTL0 register is set to 1. This bit is automatically cleared after software reads it, allowing software to determine that the current transfer has completed and prepare for the next data write.
After the transfer completes, the state machine returns to the idle state, and the LEDC_PRO_BIT_R_I2C_TX_STATUS bit in the LEDC_PRO_PSDO_I2C_CTL register automatically reverts to 1.
Reset Protection
During a software reset, watchdog reset, or system reset, the state of this module and its pad interface is not cleared, ensuring that the display output remains unaffected.
When software needs to actively reset the module, it can do so by disabling and then re-enabling the module clock. The reset operation clears all internal register states and RAM data, so pin mux configuration and module initialization must be performed again after the reset.