esp_dport_access.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. // Copyright 2010-2017 Espressif Systems (Shanghai) PTE LTD
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. // http://www.apache.org/licenses/LICENSE-2.0
  7. //
  8. // Unless required by applicable law or agreed to in writing, software
  9. // distributed under the License is distributed on an "AS IS" BASIS,
  10. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. // See the License for the specific language governing permissions and
  12. // limitations under the License.
  13. #include <sdkconfig.h>
  14. #ifndef _ESP_DPORT_ACCESS_H_
  15. #define _ESP_DPORT_ACCESS_H_
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19. void esp_dport_access_stall_other_cpu_start(void);
  20. void esp_dport_access_stall_other_cpu_end(void);
  21. void esp_dport_access_int_init(void);
  22. void esp_dport_access_int_pause(void);
  23. void esp_dport_access_int_resume(void);
  24. void esp_dport_access_read_buffer(uint32_t *buff_out, uint32_t address, uint32_t num_words);
  25. uint32_t esp_dport_access_reg_read(uint32_t reg);
  26. uint32_t esp_dport_access_sequence_reg_read(uint32_t reg);
  27. //This routine does not stop the dport routines in any way that is recoverable. Please
  28. //only call in case of panic().
  29. void esp_dport_access_int_abort(void);
  30. #if defined(BOOTLOADER_BUILD) || !defined(CONFIG_ESP32_DPORT_WORKAROUND) || !defined(ESP_PLATFORM)
  31. #define DPORT_STALL_OTHER_CPU_START()
  32. #define DPORT_STALL_OTHER_CPU_END()
  33. #define DPORT_INTERRUPT_DISABLE()
  34. #define DPORT_INTERRUPT_RESTORE()
  35. #else
  36. #define DPORT_STALL_OTHER_CPU_START() esp_dport_access_stall_other_cpu_start()
  37. #define DPORT_STALL_OTHER_CPU_END() esp_dport_access_stall_other_cpu_end()
  38. #define DPORT_INTERRUPT_DISABLE() unsigned int intLvl = XTOS_SET_INTLEVEL(CONFIG_ESP32_DPORT_DIS_INTERRUPT_LVL)
  39. #define DPORT_INTERRUPT_RESTORE() XTOS_RESTORE_JUST_INTLEVEL(intLvl)
  40. #endif
  41. #ifdef __cplusplus
  42. }
  43. #endif
  44. #endif /* _ESP_DPORT_ACCESS_H_ */