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 /** 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 /*! 48 * \file nmsis_version.h 49 * \brief NMSIS Version definitions 50 **/ 51 52 /** 53 * \brief Represent the NMSIS major version 54 * \details 55 * The NMSIS major version can be used to 56 * differentiate between NMSIS major releases. 57 * */ 58 #define __NMSIS_VERSION_MAJOR (1U) 59 60 /** 61 * \brief Represent the NMSIS minor version 62 * \details 63 * The NMSIS minor version can be used to 64 * query a NMSIS release update including new features. 65 * 66 **/ 67 #define __NMSIS_VERSION_MINOR (0U) 68 69 /** 70 * \brief Represent the NMSIS patch version 71 * \details 72 * The NMSIS patch version can be used to 73 * show bug fixes in this package. 74 **/ 75 #define __NMSIS_VERSION_PATCH (1U) 76 /** 77 * \brief Represent the NMSIS Version 78 * \details 79 * NMSIS Version format: **MAJOR.MINOR.PATCH** 80 * * MAJOR: \ref __NMSIS_VERSION_MAJOR, stored in `bits [31:16]` of \ref __NMSIS_VERSION 81 * * MINOR: \ref __NMSIS_VERSION_MINOR, stored in `bits [15:8]` of \ref __NMSIS_VERSION 82 * * PATCH: \ref __NMSIS_VERSION_PATCH, stored in `bits [7:0]` of \ref __NMSIS_VERSION 83 **/ 84 #define __NMSIS_VERSION ((__NMSIS_VERSION_MAJOR << 16U) | (__NMSIS_VERSION_MINOR << 8) | __NMSIS_VERSION_PATCH) 85 86 /** @} */ /* End of Doxygen Group NMSIS_Core_VersionControl */ 87 #endif 88