dport_access_common.c 503 B

123456789101112131415161718
  1. /*
  2. * SPDX-FileCopyrightText: 2010-2022 Espressif Systems (Shanghai) CO LTD
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. #include <stdint.h>
  7. #include "soc/dport_access.h"
  8. // Read a sequence of DPORT registers to the buffer.
  9. void esp_dport_access_read_buffer(uint32_t *buff_out, uint32_t address, uint32_t num_words)
  10. {
  11. DPORT_INTERRUPT_DISABLE();
  12. for (uint32_t i = 0; i < num_words; ++i) {
  13. buff_out[i] = DPORT_SEQUENCE_REG_READ(address + i * 4);
  14. }
  15. DPORT_INTERRUPT_RESTORE();
  16. }