cmparams.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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 STM32L4xx/cmparams.h
  15. * @brief ARM Cortex-M4 parameters for the STM32L4xx.
  16. *
  17. * @defgroup ARMCMx_STM32L4xx STM32L4xx Specific Parameters
  18. * @ingroup ARMCMx_SPECIFIC
  19. * @details This file contains the Cortex-M4 specific parameters for the
  20. * STM32L4xx platform.
  21. * @{
  22. */
  23. #ifndef CMPARAMS_H
  24. #define CMPARAMS_H
  25. /**
  26. * @brief Cortex core model.
  27. */
  28. #define CORTEX_MODEL 4
  29. /**
  30. * @brief Floating Point unit presence.
  31. */
  32. #define CORTEX_HAS_FPU 1
  33. /**
  34. * @brief Number of bits in priority masks.
  35. */
  36. #define CORTEX_PRIORITY_BITS 4
  37. /* If the device type is not externally defined, for example from the Makefile,
  38. then a file named board.h is included. This file must contain a device
  39. definition compatible with the vendor include file.*/
  40. #if !defined(STM32L431xx) && !defined(STM32L432xx) && \
  41. !defined(STM32L433xx) && !defined(STM32L442xx) && \
  42. !defined(STM32L443xx) && !defined(STM32L451xx) && \
  43. !defined(STM32L452xx) && !defined(STM32L462xx) && \
  44. !defined(STM32L471xx) && !defined(STM32L475xx) && \
  45. !defined(STM32L476xx) && !defined(STM32L485xx) && \
  46. !defined(STM32L486xx) && !defined(STM32L496xx) && \
  47. !defined(STM32L4A6xx) && \
  48. !defined(STM32L4R5xx) && !defined(STM32L4R7xx) && \
  49. !defined(STM32L4R9xx) && !defined(STM32L4S5xx) && \
  50. !defined(STM32L4S7xx) && !defined(STM32L4S9xx)
  51. #include "board.h"
  52. #endif
  53. /**
  54. * @brief Number of interrupt vectors.
  55. * @note This number does not include the 16 system vectors and must be
  56. * rounded to a multiple of 8.
  57. */
  58. #if defined(STM32L496xx) || defined(STM32L4A6xx) || defined(STM32L4R5xx) || \
  59. defined(STM32L4R7xx) || defined(STM32L4R9xx) || defined(STM32L4S5xx) || \
  60. defined(STM32L4S7xx) || defined(STM32L4S9xx)
  61. #define CORTEX_NUM_VECTORS 96
  62. #else
  63. #define CORTEX_NUM_VECTORS 88
  64. #endif
  65. /* The following code is not processed when the file is included from an
  66. asm module.*/
  67. #if !defined(_FROM_ASM_)
  68. /* Including the device CMSIS header. Note, we are not using the definitions
  69. from this header because we need this file to be usable also from
  70. assembler source files. We verify that the info matches instead.*/
  71. #include "stm32l4xx.h"
  72. /*lint -save -e9029 [10.4] Signedness comes from external files, it is
  73. unpredictable but gives no problems.*/
  74. #if CORTEX_MODEL != __CORTEX_M
  75. #error "CMSIS __CORTEX_M mismatch"
  76. #endif
  77. #if CORTEX_HAS_FPU != __FPU_PRESENT
  78. #error "CMSIS __FPU_PRESENT mismatch"
  79. #endif
  80. #if CORTEX_PRIORITY_BITS != __NVIC_PRIO_BITS
  81. #error "CMSIS __NVIC_PRIO_BITS mismatch"
  82. #endif
  83. /*lint -restore*/
  84. #endif /* !defined(_FROM_ASM_) */
  85. #endif /* CMPARAMS_H */
  86. /** @} */