nmsis_version.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /*
  2. * Copyright (c) 2019 Nuclei Limited. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Licensed under the Apache License, Version 2.0 (the License); you may
  7. * not use this file except in compliance with the License.
  8. * You may obtain a copy of the License at
  9. *
  10. * www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing, software
  13. * distributed under the License is distributed on an AS IS BASIS, WITHOUT
  14. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. * See the License for the specific language governing permissions and
  16. * limitations under the License.
  17. */
  18. #ifndef __NMSIS_VERSION_H
  19. #define __NMSIS_VERSION_H
  20. /**
  21. * \defgroup NMSIS_Core_VersionControl Version Control
  22. * \ingroup NMSIS_Core
  23. * \brief Version \#define symbols for NMSIS release specific C/C++ source code
  24. * \details
  25. *
  26. * We followed the [semantic versioning 2.0.0](https://semver.org/) to control NMSIS version.
  27. * The version format is **MAJOR.MINOR.PATCH**, increment the:
  28. * 1. MAJOR version when you make incompatible API changes,
  29. * 2. MINOR version when you add functionality in a backwards compatible manner, and
  30. * 3. PATCH version when you make backwards compatible bug fixes.
  31. *
  32. * The header file `nmsis_version.h` is included by each core header so that these definitions are available.
  33. *
  34. * **Example Usage for NMSIS Version Check**:
  35. * \code
  36. * #if defined(__NMSIS_VERSION) && (__NMSIS_VERSION >= 0x00010105)
  37. * #warning "Yes, we have NMSIS 1.1.5 or later"
  38. * #else
  39. * #error "We need NMSIS 1.1.5 or later!"
  40. * #endif
  41. * \endcode
  42. *
  43. * @{
  44. */
  45. /*!
  46. * \file nmsis_version.h
  47. * \brief NMSIS Version definitions
  48. **/
  49. /**
  50. * \brief Represent the NMSIS major version
  51. * \details
  52. * The NMSIS major version can be used to
  53. * differentiate between NMSIS major releases.
  54. * */
  55. #define __NMSIS_VERSION_MAJOR (1U)
  56. /**
  57. * \brief Represent the NMSIS minor version
  58. * \details
  59. * The NMSIS minor version can be used to
  60. * query a NMSIS release update including new features.
  61. *
  62. **/
  63. #define __NMSIS_VERSION_MINOR (3U)
  64. /**
  65. * \brief Represent the NMSIS patch version
  66. * \details
  67. * The NMSIS patch version can be used to
  68. * show bug fixes in this package.
  69. **/
  70. #define __NMSIS_VERSION_PATCH (1U)
  71. /**
  72. * \brief Represent the NMSIS Version
  73. * \details
  74. * NMSIS Version format: **MAJOR.MINOR.PATCH**
  75. * * MAJOR: \ref __NMSIS_VERSION_MAJOR, stored in `bits [31:16]` of \ref __NMSIS_VERSION
  76. * * MINOR: \ref __NMSIS_VERSION_MINOR, stored in `bits [15:8]` of \ref __NMSIS_VERSION
  77. * * PATCH: \ref __NMSIS_VERSION_PATCH, stored in `bits [7:0]` of \ref __NMSIS_VERSION
  78. **/
  79. #define __NMSIS_VERSION ((__NMSIS_VERSION_MAJOR << 16U) | (__NMSIS_VERSION_MINOR << 8) | __NMSIS_VERSION_PATCH)
  80. /** @} */ /* End of Doxygen Group NMSIS_Core_VersionControl */
  81. #endif