interrupt_controller_hal.c 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. const int_desc_t *int_desc = interrupt_controller_hal_desc_table();
  17. return(int_desc[interrupt_number].type);
  18. }
  19. int interrupt_controller_hal_desc_level(int interrupt_number)
  20. {
  21. const int_desc_t *int_desc = interrupt_controller_hal_desc_table();
  22. return(int_desc[interrupt_number].level);
  23. }
  24. int_desc_flag_t interrupt_controller_hal_desc_flags(int interrupt_number, int cpu_number)
  25. {
  26. const int_desc_t *int_desc = interrupt_controller_hal_desc_table();
  27. return(int_desc[interrupt_number].cpuflags[cpu_number]);
  28. }
  29. #if SOC_INTERRUPT_LEVEL_CAN_SET
  30. void interrupt_controller_hal_set_level(int interrupt_number, int level) {
  31. intr_cntrl_ll_set_level(interrupt_number, level);
  32. }
  33. #endif
  34. #if SOC_INTERRUPT_TYPE_CAN_SET
  35. void interrupt_controller_hal_set_type(int interrupt_number, int_type_t type) {
  36. intr_cntrl_ll_set_type(interrupt_number, type);
  37. }
  38. #endif