Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
misc_mort.h@0:716b93ab9a58, 2021-10-29 (annotated)
- Committer:
- rajathr
- Date:
- Fri Oct 29 20:56:20 2021 +0000
- Revision:
- 0:716b93ab9a58
AS ON 29TH OCT AT 5PM
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
rajathr | 0:716b93ab9a58 | 1 | /** |
rajathr | 0:716b93ab9a58 | 2 | ****************************************************************************** |
rajathr | 0:716b93ab9a58 | 3 | * @file misc.h |
rajathr | 0:716b93ab9a58 | 4 | * @author MCD Application Team |
rajathr | 0:716b93ab9a58 | 5 | * @version V1.8.0 |
rajathr | 0:716b93ab9a58 | 6 | * @date 04-November-2016 |
rajathr | 0:716b93ab9a58 | 7 | * @brief This file contains all the functions prototypes for the miscellaneous |
rajathr | 0:716b93ab9a58 | 8 | * firmware library functions (add-on to CMSIS functions). |
rajathr | 0:716b93ab9a58 | 9 | ****************************************************************************** |
rajathr | 0:716b93ab9a58 | 10 | * @attention |
rajathr | 0:716b93ab9a58 | 11 | * |
rajathr | 0:716b93ab9a58 | 12 | * <h2><center>© COPYRIGHT 2016 STMicroelectronics</center></h2> |
rajathr | 0:716b93ab9a58 | 13 | * |
rajathr | 0:716b93ab9a58 | 14 | * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); |
rajathr | 0:716b93ab9a58 | 15 | * You may not use this file except in compliance with the License. |
rajathr | 0:716b93ab9a58 | 16 | * You may obtain a copy of the License at: |
rajathr | 0:716b93ab9a58 | 17 | * |
rajathr | 0:716b93ab9a58 | 18 | * http://www.st.com/software_license_agreement_liberty_v2 |
rajathr | 0:716b93ab9a58 | 19 | * |
rajathr | 0:716b93ab9a58 | 20 | * Unless required by applicable law or agreed to in writing, software |
rajathr | 0:716b93ab9a58 | 21 | * distributed under the License is distributed on an "AS IS" BASIS, |
rajathr | 0:716b93ab9a58 | 22 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
rajathr | 0:716b93ab9a58 | 23 | * See the License for the specific language governing permissions and |
rajathr | 0:716b93ab9a58 | 24 | * limitations under the License. |
rajathr | 0:716b93ab9a58 | 25 | * |
rajathr | 0:716b93ab9a58 | 26 | ****************************************************************************** |
rajathr | 0:716b93ab9a58 | 27 | */ |
rajathr | 0:716b93ab9a58 | 28 | |
rajathr | 0:716b93ab9a58 | 29 | /* Define to prevent recursive inclusion -------------------------------------*/ |
rajathr | 0:716b93ab9a58 | 30 | #ifndef __MISC_MORT_H |
rajathr | 0:716b93ab9a58 | 31 | #define __MISC_MORT_H |
rajathr | 0:716b93ab9a58 | 32 | |
rajathr | 0:716b93ab9a58 | 33 | #ifdef __cplusplus |
rajathr | 0:716b93ab9a58 | 34 | extern "C" { |
rajathr | 0:716b93ab9a58 | 35 | #endif |
rajathr | 0:716b93ab9a58 | 36 | |
rajathr | 0:716b93ab9a58 | 37 | /* Includes ------------------------------------------------------------------*/ |
rajathr | 0:716b93ab9a58 | 38 | #include "stm32f4xx_mort2.h" |
rajathr | 0:716b93ab9a58 | 39 | |
rajathr | 0:716b93ab9a58 | 40 | /** @addtogroup STM32F4xx_StdPeriph_Driver |
rajathr | 0:716b93ab9a58 | 41 | * @{ |
rajathr | 0:716b93ab9a58 | 42 | */ |
rajathr | 0:716b93ab9a58 | 43 | |
rajathr | 0:716b93ab9a58 | 44 | /** @addtogroup MISC |
rajathr | 0:716b93ab9a58 | 45 | * @{ |
rajathr | 0:716b93ab9a58 | 46 | */ |
rajathr | 0:716b93ab9a58 | 47 | |
rajathr | 0:716b93ab9a58 | 48 | /* Exported types ------------------------------------------------------------*/ |
rajathr | 0:716b93ab9a58 | 49 | |
rajathr | 0:716b93ab9a58 | 50 | /** |
rajathr | 0:716b93ab9a58 | 51 | * @brief NVIC Init Structure definition |
rajathr | 0:716b93ab9a58 | 52 | */ |
rajathr | 0:716b93ab9a58 | 53 | |
rajathr | 0:716b93ab9a58 | 54 | typedef struct |
rajathr | 0:716b93ab9a58 | 55 | { |
rajathr | 0:716b93ab9a58 | 56 | uint8_t NVIC_IRQChannel; /*!< Specifies the IRQ channel to be enabled or disabled. |
rajathr | 0:716b93ab9a58 | 57 | This parameter can be an enumerator of @ref IRQn_Type_MORT |
rajathr | 0:716b93ab9a58 | 58 | enumeration (For the complete STM32 Devices IRQ Channels |
rajathr | 0:716b93ab9a58 | 59 | list, please refer to stm32f4xx.h file) */ |
rajathr | 0:716b93ab9a58 | 60 | |
rajathr | 0:716b93ab9a58 | 61 | uint8_t NVIC_IRQChannelPreemptionPriority; /*!< Specifies the pre-emption priority for the IRQ channel |
rajathr | 0:716b93ab9a58 | 62 | specified in NVIC_IRQChannel. This parameter can be a value |
rajathr | 0:716b93ab9a58 | 63 | between 0 and 15 as described in the table @ref MISC_NVIC_Priority_Table |
rajathr | 0:716b93ab9a58 | 64 | A lower priority value indicates a higher priority */ |
rajathr | 0:716b93ab9a58 | 65 | |
rajathr | 0:716b93ab9a58 | 66 | uint8_t NVIC_IRQChannelSubPriority; /*!< Specifies the subpriority level for the IRQ channel specified |
rajathr | 0:716b93ab9a58 | 67 | in NVIC_IRQChannel. This parameter can be a value |
rajathr | 0:716b93ab9a58 | 68 | between 0 and 15 as described in the table @ref MISC_NVIC_Priority_Table |
rajathr | 0:716b93ab9a58 | 69 | A lower priority value indicates a higher priority */ |
rajathr | 0:716b93ab9a58 | 70 | |
rajathr | 0:716b93ab9a58 | 71 | FunctionalState NVIC_IRQChannelCmd; /*!< Specifies whether the IRQ channel defined in NVIC_IRQChannel |
rajathr | 0:716b93ab9a58 | 72 | will be enabled or disabled. |
rajathr | 0:716b93ab9a58 | 73 | This parameter can be set either to ENABLE or DISABLE */ |
rajathr | 0:716b93ab9a58 | 74 | } NVIC_InitTypeDef_mort; |
rajathr | 0:716b93ab9a58 | 75 | |
rajathr | 0:716b93ab9a58 | 76 | /* Exported constants --------------------------------------------------------*/ |
rajathr | 0:716b93ab9a58 | 77 | |
rajathr | 0:716b93ab9a58 | 78 | /** @defgroup MISC_Exported_Constants |
rajathr | 0:716b93ab9a58 | 79 | * @{ |
rajathr | 0:716b93ab9a58 | 80 | */ |
rajathr | 0:716b93ab9a58 | 81 | |
rajathr | 0:716b93ab9a58 | 82 | /** @defgroup MISC_Vector_Table_Base |
rajathr | 0:716b93ab9a58 | 83 | * @{ |
rajathr | 0:716b93ab9a58 | 84 | */ |
rajathr | 0:716b93ab9a58 | 85 | |
rajathr | 0:716b93ab9a58 | 86 | #define NVIC_VectTab_RAM_MORT ((uint32_t)0x20000000) |
rajathr | 0:716b93ab9a58 | 87 | #define NVIC_VectTab_FLASH_MORT ((uint32_t)0x08000000) |
rajathr | 0:716b93ab9a58 | 88 | #define IS_NVIC_VECTTAB_MORT(VECTTAB) (((VECTTAB) == NVIC_VectTab_RAM_MORT) || \ |
rajathr | 0:716b93ab9a58 | 89 | ((VECTTAB) == NVIC_VectTab_FLASH_MORT)) |
rajathr | 0:716b93ab9a58 | 90 | /** |
rajathr | 0:716b93ab9a58 | 91 | * @} |
rajathr | 0:716b93ab9a58 | 92 | */ |
rajathr | 0:716b93ab9a58 | 93 | |
rajathr | 0:716b93ab9a58 | 94 | /** @defgroup MISC_System_Low_Power |
rajathr | 0:716b93ab9a58 | 95 | * @{ |
rajathr | 0:716b93ab9a58 | 96 | */ |
rajathr | 0:716b93ab9a58 | 97 | |
rajathr | 0:716b93ab9a58 | 98 | #define NVIC_LP_SEVONPEND_MORT ((uint8_t)0x10) |
rajathr | 0:716b93ab9a58 | 99 | #define NVIC_LP_SLEEPDEEP_MORT ((uint8_t)0x04) |
rajathr | 0:716b93ab9a58 | 100 | #define NVIC_LP_SLEEPONEXIT_MORT ((uint8_t)0x02) |
rajathr | 0:716b93ab9a58 | 101 | #define IS_NVIC_LP_MORT(LP) (((LP) == NVIC_LP_SEVONPEND_MORT) || \ |
rajathr | 0:716b93ab9a58 | 102 | ((LP) == NVIC_LP_SLEEPDEEP_MORT) || \ |
rajathr | 0:716b93ab9a58 | 103 | ((LP) == NVIC_LP_SLEEPONEXIT_MORT)) |
rajathr | 0:716b93ab9a58 | 104 | /** |
rajathr | 0:716b93ab9a58 | 105 | * @} |
rajathr | 0:716b93ab9a58 | 106 | */ |
rajathr | 0:716b93ab9a58 | 107 | |
rajathr | 0:716b93ab9a58 | 108 | /** @defgroup MISC_Preemption_Priority_Group |
rajathr | 0:716b93ab9a58 | 109 | * @{ |
rajathr | 0:716b93ab9a58 | 110 | */ |
rajathr | 0:716b93ab9a58 | 111 | |
rajathr | 0:716b93ab9a58 | 112 | #define NVIC_PriorityGroup_0_MORT ((uint32_t)0x700) /*!< 0 bits for pre-emption priority |
rajathr | 0:716b93ab9a58 | 113 | 4 bits for subpriority */ |
rajathr | 0:716b93ab9a58 | 114 | #define NVIC_PriorityGroup_1_MORT ((uint32_t)0x600) /*!< 1 bits for pre-emption priority |
rajathr | 0:716b93ab9a58 | 115 | 3 bits for subpriority */ |
rajathr | 0:716b93ab9a58 | 116 | #define NVIC_PriorityGroup_2_MORT ((uint32_t)0x500) /*!< 2 bits for pre-emption priority |
rajathr | 0:716b93ab9a58 | 117 | 2 bits for subpriority */ |
rajathr | 0:716b93ab9a58 | 118 | #define NVIC_PriorityGroup_3_MORT ((uint32_t)0x400) /*!< 3 bits for pre-emption priority |
rajathr | 0:716b93ab9a58 | 119 | 1 bits for subpriority */ |
rajathr | 0:716b93ab9a58 | 120 | #define NVIC_PriorityGroup_4_MORT ((uint32_t)0x300) /*!< 4 bits for pre-emption priority |
rajathr | 0:716b93ab9a58 | 121 | 0 bits for subpriority */ |
rajathr | 0:716b93ab9a58 | 122 | |
rajathr | 0:716b93ab9a58 | 123 | #define IS_NVIC_PRIORITY_GROUP_MORT(GROUP) (((GROUP) == NVIC_PriorityGroup_0_MORT) || \ |
rajathr | 0:716b93ab9a58 | 124 | ((GROUP) == NVIC_PriorityGroup_1_MORT) || \ |
rajathr | 0:716b93ab9a58 | 125 | ((GROUP) == NVIC_PriorityGroup_2_MORT) || \ |
rajathr | 0:716b93ab9a58 | 126 | ((GROUP) == NVIC_PriorityGroup_3_MORT) || \ |
rajathr | 0:716b93ab9a58 | 127 | ((GROUP) == NVIC_PriorityGroup_4_MORT)) |
rajathr | 0:716b93ab9a58 | 128 | |
rajathr | 0:716b93ab9a58 | 129 | #define IS_NVIC_PREEMPTION_PRIORITY_MORT(PRIORITY) ((PRIORITY) < 0x10) |
rajathr | 0:716b93ab9a58 | 130 | |
rajathr | 0:716b93ab9a58 | 131 | #define IS_NVIC_SUB_PRIORITY_MORT(PRIORITY) ((PRIORITY) < 0x10) |
rajathr | 0:716b93ab9a58 | 132 | |
rajathr | 0:716b93ab9a58 | 133 | #define IS_NVIC_OFFSET_MORT(OFFSET) ((OFFSET) < 0x000FFFFF) |
rajathr | 0:716b93ab9a58 | 134 | |
rajathr | 0:716b93ab9a58 | 135 | /** |
rajathr | 0:716b93ab9a58 | 136 | * @} |
rajathr | 0:716b93ab9a58 | 137 | */ |
rajathr | 0:716b93ab9a58 | 138 | |
rajathr | 0:716b93ab9a58 | 139 | /** @defgroup MISC_SysTick_clock_source |
rajathr | 0:716b93ab9a58 | 140 | * @{ |
rajathr | 0:716b93ab9a58 | 141 | */ |
rajathr | 0:716b93ab9a58 | 142 | |
rajathr | 0:716b93ab9a58 | 143 | #define SysTick_CLKSource_HCLK_Div8_MORT ((uint32_t)0xFFFFFFFB) |
rajathr | 0:716b93ab9a58 | 144 | #define SysTick_CLKSource_HCLK_MORT ((uint32_t)0x00000004) |
rajathr | 0:716b93ab9a58 | 145 | #define IS_SYSTICK_CLK_SOURCE_MORT(SOURCE) (((SOURCE) == SysTick_CLKSource_HCLK_MORT) || \ |
rajathr | 0:716b93ab9a58 | 146 | ((SOURCE) == SysTick_CLKSource_HCLK_Div8_MORT)) |
rajathr | 0:716b93ab9a58 | 147 | /** |
rajathr | 0:716b93ab9a58 | 148 | * @} |
rajathr | 0:716b93ab9a58 | 149 | */ |
rajathr | 0:716b93ab9a58 | 150 | |
rajathr | 0:716b93ab9a58 | 151 | /** |
rajathr | 0:716b93ab9a58 | 152 | * @} |
rajathr | 0:716b93ab9a58 | 153 | */ |
rajathr | 0:716b93ab9a58 | 154 | |
rajathr | 0:716b93ab9a58 | 155 | /* Exported macro ------------------------------------------------------------*/ |
rajathr | 0:716b93ab9a58 | 156 | /* Exported functions --------------------------------------------------------*/ |
rajathr | 0:716b93ab9a58 | 157 | |
rajathr | 0:716b93ab9a58 | 158 | void NVIC_PriorityGroupConfig_mort(uint32_t NVIC_PriorityGroup); |
rajathr | 0:716b93ab9a58 | 159 | void NVIC_Init_mort(NVIC_InitTypeDef_mort* NVIC_InitStruct); |
rajathr | 0:716b93ab9a58 | 160 | void NVIC_SetVectorTable_mort(uint32_t NVIC_VectTab, uint32_t Offset); |
rajathr | 0:716b93ab9a58 | 161 | void NVIC_SystemLPConfig_mort(uint8_t LowPowerMode, FunctionalState NewState); |
rajathr | 0:716b93ab9a58 | 162 | void SysTick_CLKSourceConfig_mort(uint32_t SysTick_CLKSource); |
rajathr | 0:716b93ab9a58 | 163 | |
rajathr | 0:716b93ab9a58 | 164 | #ifdef __cplusplus |
rajathr | 0:716b93ab9a58 | 165 | } |
rajathr | 0:716b93ab9a58 | 166 | #endif |
rajathr | 0:716b93ab9a58 | 167 | |
rajathr | 0:716b93ab9a58 | 168 | #endif /* __MISC_H */ |
rajathr | 0:716b93ab9a58 | 169 | |
rajathr | 0:716b93ab9a58 | 170 | /** |
rajathr | 0:716b93ab9a58 | 171 | * @} |
rajathr | 0:716b93ab9a58 | 172 | */ |
rajathr | 0:716b93ab9a58 | 173 | |
rajathr | 0:716b93ab9a58 | 174 | /** |
rajathr | 0:716b93ab9a58 | 175 | * @} |
rajathr | 0:716b93ab9a58 | 176 | */ |
rajathr | 0:716b93ab9a58 | 177 | |
rajathr | 0:716b93ab9a58 | 178 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |
rajathr | 0:716b93ab9a58 | 179 | |
rajathr | 0:716b93ab9a58 | 180 | |
rajathr | 0:716b93ab9a58 | 181 | |
rajathr | 0:716b93ab9a58 | 182 | |
rajathr | 0:716b93ab9a58 | 183 |