Rajath Ravi / Mbed 2 deprecated ravi_blinkycode

Dependencies:   mbed

Committer:
rajathr
Date:
Sat Oct 23 05:49:09 2021 +0000
Revision:
0:34ee385f4d2d
At 23rd Oct 21 - All Code

Who changed what in which revision?

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