cmparams.h 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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 STM32L1xx/cmparams.h
  15. * @brief ARM Cortex-M3 parameters for the STM32L1xx.
  16. *
  17. * @defgroup ARMCMx_STM32L1xx STM32L1xx Specific Parameters
  18. * @ingroup ARMCMx_SPECIFIC
  19. * @details This file contains the Cortex-M3 specific parameters for the
  20. * STM32L1xx platform.
  21. * @{
  22. */
  23. #ifndef CMPARAMS_H
  24. #define CMPARAMS_H
  25. /**
  26. * @brief Cortex core model.
  27. */
  28. #define CORTEX_MODEL 3
  29. /**
  30. * @brief Floating Point unit presence.
  31. */
  32. #define CORTEX_HAS_FPU 0
  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(STM32L100xB) && !defined(STM32L100xBA) && \
  41. !defined(STM32L100xC) && !defined(STM32L151xB) && \
  42. !defined(STM32L151xBA) && !defined(STM32L151xC) && \
  43. !defined(STM32L151xCA) && !defined(STM32L151xD) && \
  44. !defined(STM32L151xDX) && !defined(STM32L151xE) && \
  45. !defined(STM32L152xB) && !defined(STM32L152xBA) && \
  46. !defined(STM32L152xC) && !defined(STM32L152xCA) && \
  47. !defined(STM32L152xD) && !defined(STM32L152xDX) && \
  48. !defined(STM32L152xE) && !defined(STM32L162xC) && \
  49. !defined(STM32L162xCA) && !defined(STM32L162xD) && \
  50. !defined(STM32L162xDX) && !defined(STM32L162xE)
  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. #define CORTEX_NUM_VECTORS 64
  59. /* The following code is not processed when the file is included from an
  60. asm module.*/
  61. #if !defined(_FROM_ASM_)
  62. /* Including the device CMSIS header. Note, we are not using the definitions
  63. from this header because we need this file to be usable also from
  64. assembler source files. We verify that the info matches instead.*/
  65. #include "stm32l1xx.h"
  66. /*lint -save -e9029 [10.4] Signedness comes from external files, it is
  67. unpredictable but gives no problems.*/
  68. #if CORTEX_MODEL != __CORTEX_M
  69. #error "CMSIS __CORTEX_M mismatch"
  70. #endif
  71. #if CORTEX_PRIORITY_BITS != __NVIC_PRIO_BITS
  72. #error "CMSIS __NVIC_PRIO_BITS mismatch"
  73. #endif
  74. /*lint -restore*/
  75. /* Fix for yet another consistency error in ST headers.*/
  76. #define SVCall_IRQn SVC_IRQn
  77. #endif /* !defined(_FROM_ASM_) */
  78. #endif /* CMPARAMS_H */
  79. /** @} */