interrupt_controller_hal.c 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // Copyright 2020 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 "hal/interrupt_controller_hal.h"
  14. int_type_t interrupt_controller_hal_desc_type(int interrupt_number)
  15. {
  16. #ifndef SOC_CPU_HAS_FLEXIBLE_INTC
  17. const int_desc_t *int_desc = interrupt_controller_hal_desc_table();
  18. return(int_desc[interrupt_number].type);
  19. #else
  20. return (INTTP_NA);
  21. #endif
  22. }
  23. int interrupt_controller_hal_desc_level(int interrupt_number)
  24. {
  25. #ifndef SOC_CPU_HAS_FLEXIBLE_INTC
  26. const int_desc_t *int_desc = interrupt_controller_hal_desc_table();
  27. return(int_desc[interrupt_number].level);
  28. #else
  29. return 1;
  30. #endif
  31. }
  32. int_desc_flag_t interrupt_controller_hal_desc_flags(int interrupt_number, int cpu_number)
  33. {
  34. #ifndef SOC_CPU_HAS_FLEXIBLE_INTC
  35. const int_desc_t *int_desc = interrupt_controller_hal_desc_table();
  36. return(int_desc[interrupt_number].cpuflags[cpu_number]);
  37. #else
  38. return INTDESC_NORMAL;
  39. #endif
  40. }