/* Read a sequence of DPORT registers to the buffer, SMP-safe version. 
This implementation uses a method of the pre-reading of the APB register before reading the register of the DPORT, without stall other CPU. There is disable/enable interrupt. */
void IRAM_ATTR esp_dport_access_read_buffer(uint32_t *buff_out, uint32_t address, uint32_t num_words)
/* Read a sequence of DPORT registers to the buffer, SMP-safe version. 
This implementation uses a method of the pre-reading of the APB register before reading the register of the DPORT, without stall other CPU. There is disable/enable interrupt. */
void IRAM_ATTR esp_dport_access_read_buffer(uint32_t *buff_out, uint32_t address, uint32_t num_words)
{
    DPORT_INTERRUPT_DISABLE();
    for (uint32_t i = 0;  i < num_words; ++i) {
        buff_out[i] = DPORT_SEQUENCE_REG_READ(address + i * 4);
    }
    DPORT_INTERRUPT_RESTORE();
}