intc.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. /*
  2. ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
  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. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. */
  13. /**
  14. * @file SPC560Bxx/intc.h
  15. * @brief SPC560Bxx INTC module header.
  16. *
  17. * @addtogroup INTC
  18. * @{
  19. */
  20. #ifndef INTC_H
  21. #define INTC_H
  22. /*===========================================================================*/
  23. /* Module constants. */
  24. /*===========================================================================*/
  25. /**
  26. * @name INTC addresses
  27. * @{
  28. */
  29. #define INTC_BASE 0xFFF48000
  30. #define INTC_IACKR_ADDR (INTC_BASE + 0x10)
  31. #define INTC_EOIR_ADDR (INTC_BASE + 0x18)
  32. /** @} */
  33. /**
  34. * @brief INTC priority levels.
  35. */
  36. #define INTC_PRIORITY_LEVELS 16U
  37. /*===========================================================================*/
  38. /* Module pre-compile time settings. */
  39. /*===========================================================================*/
  40. /*===========================================================================*/
  41. /* Derived constants and error checks. */
  42. /*===========================================================================*/
  43. /*===========================================================================*/
  44. /* Module data structures and types. */
  45. /*===========================================================================*/
  46. /*===========================================================================*/
  47. /* Module macros. */
  48. /*===========================================================================*/
  49. /**
  50. * @name INTC-related macros
  51. * @{
  52. */
  53. #define INTC_BCR (*((volatile uint32_t *)(INTC_BASE + 0)))
  54. #define INTC_CPR(n) (*((volatile uint32_t *)(INTC_BASE + 8 + ((n) * sizeof (uint32_t)))))
  55. #define INTC_IACKR(n) (*((volatile uint32_t *)(INTC_BASE + 0x10 + ((n) * sizeof (uint32_t)))))
  56. #define INTC_EOIR(n) (*((volatile uint32_t *)(INTC_BASE + 0x18 + ((n) * sizeof (uint32_t)))))
  57. #define INTC_PSR(n) (*((volatile uint8_t *)(INTC_BASE + 0x40 + ((n) * sizeof (uint8_t)))))
  58. /** @} */
  59. /**
  60. * @brief Core selection macros for PSR register.
  61. */
  62. #define INTC_PSR_CORE0 0x00
  63. /**
  64. * @brief PSR register content helper
  65. */
  66. #define INTC_PSR_ENABLE(cores, prio) ((uint32_t)(cores) | (uint32_t)(prio))
  67. /*===========================================================================*/
  68. /* External declarations. */
  69. /*===========================================================================*/
  70. /*===========================================================================*/
  71. /* Module inline functions. */
  72. /*===========================================================================*/
  73. #endif /* INTC_H */
  74. /** @} */