nmsis_version.h 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. // This is modified NMSIS for Nuclei 100 Series CPU
  21. /**
  22. * \defgroup NMSIS_Core_VersionControl Version Control
  23. * \ingroup NMSIS_Core
  24. * \brief Version \#define symbols for NMSIS release specific C/C++ source code
  25. * \details
  26. *
  27. * We followed the [semantic versioning 2.0.0](https://semver.org/) to control NMSIS version.
  28. * The version format is **MAJOR.MINOR.PATCH**, increment the:
  29. * 1. MAJOR version when you make incompatible API changes,
  30. * 2. MINOR version when you add functionality in a backwards compatible manner, and
  31. * 3. PATCH version when you make backwards compatible bug fixes.
  32. *
  33. * The header file `nmsis_version.h` is included by each core header so that these definitions are available.
  34. *
  35. * **Example Usage for NMSIS Version Check**:
  36. * \code
  37. * #if defined(__NMSIS_VERSION) && (__NMSIS_VERSION >= 0x00010105)
  38. * #warning "Yes, we have NMSIS 1.1.5 or later"
  39. * #else
  40. * #error "We need NMSIS 1.1.5 or later!"
  41. * #endif
  42. * \endcode
  43. *
  44. * @{
  45. */
  46. /*!
  47. * \file nmsis_version.h
  48. * \brief NMSIS Version definitions
  49. **/
  50. /**
  51. * \brief Represent the NMSIS major version
  52. * \details
  53. * The NMSIS major version can be used to
  54. * differentiate between NMSIS major releases.
  55. * */
  56. #define __NMSIS_VERSION_MAJOR (1U)
  57. /**
  58. * \brief Represent the NMSIS minor version
  59. * \details
  60. * The NMSIS minor version can be used to
  61. * query a NMSIS release update including new features.
  62. *
  63. **/
  64. #define __NMSIS_VERSION_MINOR (1U)
  65. /**
  66. * \brief Represent the NMSIS patch version
  67. * \details
  68. * The NMSIS patch version can be used to
  69. * show bug fixes in this package.
  70. **/
  71. #define __NMSIS_VERSION_PATCH (0U)
  72. /**
  73. * \brief Represent the NMSIS Version
  74. * \details
  75. * NMSIS Version format: **MAJOR.MINOR.PATCH**
  76. * * MAJOR: \ref __NMSIS_VERSION_MAJOR, stored in `bits [31:16]` of \ref __NMSIS_VERSION
  77. * * MINOR: \ref __NMSIS_VERSION_MINOR, stored in `bits [15:8]` of \ref __NMSIS_VERSION
  78. * * PATCH: \ref __NMSIS_VERSION_PATCH, stored in `bits [7:0]` of \ref __NMSIS_VERSION
  79. **/
  80. #define __NMSIS_VERSION ((__NMSIS_VERSION_MAJOR << 16U) | (__NMSIS_VERSION_MINOR << 8) | __NMSIS_VERSION_PATCH)
  81. /** @} */ /* End of Doxygen Group NMSIS_Core_VersionControl */
  82. #endif