OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [freertos-6.1.1/] [Demo/] [Common/] [drivers/] [ST/] [STM32F10xFWLib/] [inc/] [misc.h] - Blame information for rev 867

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 608 jeremybenn
/**
2
  ******************************************************************************
3
  * @file  misc.h
4
  * @author  MCD Application Team
5
  * @version  V3.0.0
6
  * @date  04/06/2009
7
  * @brief  This file contains all the functions prototypes for the
8
  *         miscellaneous firmware library functions.
9
  ******************************************************************************
10
  * @copy
11
  *
12
  * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
13
  * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
14
  * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
15
  * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
16
  * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
17
  * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
18
  *
19
  * <h2><center>&copy; COPYRIGHT 2009 STMicroelectronics</center></h2>
20
  */
21
 
22
/* Define to prevent recursive inclusion -------------------------------------*/
23
#ifndef __MISC_H
24
#define __MISC_H
25
 
26
/* Includes ------------------------------------------------------------------*/
27
#include "stm32f10x.h"
28
 
29
/** @addtogroup StdPeriph_Driver
30
  * @{
31
  */
32
 
33
/** @addtogroup MISC
34
  * @{
35
  */
36
 
37
/** @defgroup MISC_Exported_Types
38
  * @{
39
  */
40
 
41
/**
42
  * @brief  NVIC Init Structure definition
43
  */
44
 
45
typedef struct
46
{
47
  uint8_t NVIC_IRQChannel;
48
  uint8_t NVIC_IRQChannelPreemptionPriority;
49
  uint8_t NVIC_IRQChannelSubPriority;
50
  FunctionalState NVIC_IRQChannelCmd;
51
} NVIC_InitTypeDef;
52
 
53
/**
54
  * @}
55
  */
56
 
57
/** @defgroup MISC_Exported_Constants
58
  * @{
59
  */
60
 
61
/** @defgroup Vector_Table_Base
62
  * @{
63
  */
64
 
65
#define NVIC_VectTab_RAM             ((uint32_t)0x20000000)
66
#define NVIC_VectTab_FLASH           ((uint32_t)0x08000000)
67
#define IS_NVIC_VECTTAB(VECTTAB) (((VECTTAB) == NVIC_VectTab_RAM) || \
68
                                  ((VECTTAB) == NVIC_VectTab_FLASH))
69
/**
70
  * @}
71
  */
72
 
73
/** @defgroup System_Low_Power
74
  * @{
75
  */
76
 
77
#define NVIC_LP_SEVONPEND            ((uint8_t)0x10)
78
#define NVIC_LP_SLEEPDEEP            ((uint8_t)0x04)
79
#define NVIC_LP_SLEEPONEXIT          ((uint8_t)0x02)
80
#define IS_NVIC_LP(LP) (((LP) == NVIC_LP_SEVONPEND) || \
81
                        ((LP) == NVIC_LP_SLEEPDEEP) || \
82
                        ((LP) == NVIC_LP_SLEEPONEXIT))
83
/**
84
  * @}
85
  */
86
 
87
/** @defgroup Preemption_Priority_Group
88
  * @{
89
  */
90
 
91
#define NVIC_PriorityGroup_0         ((uint32_t)0x700) /* 0 bits for pre-emption priority
92
                                                          4 bits for subpriority */
93
#define NVIC_PriorityGroup_1         ((uint32_t)0x600) /* 1 bits for pre-emption priority
94
                                                          3 bits for subpriority */
95
#define NVIC_PriorityGroup_2         ((uint32_t)0x500) /* 2 bits for pre-emption priority
96
                                                          2 bits for subpriority */
97
#define NVIC_PriorityGroup_3         ((uint32_t)0x400) /* 3 bits for pre-emption priority
98
                                                          1 bits for subpriority */
99
#define NVIC_PriorityGroup_4         ((uint32_t)0x300) /* 4 bits for pre-emption priority
100
 
101
 
102
#define IS_NVIC_PRIORITY_GROUP(GROUP) (((GROUP) == NVIC_PriorityGroup_0) || \
103
                                       ((GROUP) == NVIC_PriorityGroup_1) || \
104
                                       ((GROUP) == NVIC_PriorityGroup_2) || \
105
                                       ((GROUP) == NVIC_PriorityGroup_3) || \
106
                                       ((GROUP) == NVIC_PriorityGroup_4))
107
 
108
#define IS_NVIC_PREEMPTION_PRIORITY(PRIORITY)  ((PRIORITY) < 0x10)
109
 
110
#define IS_NVIC_SUB_PRIORITY(PRIORITY)  ((PRIORITY) < 0x10)
111
 
112
#define IS_NVIC_OFFSET(OFFSET)  ((OFFSET) < 0x0007FFFF)
113
 
114
/**
115
  * @}
116
  */
117
 
118
/** @defgroup SysTick_clock_source
119
  * @{
120
  */
121
 
122
#define SysTick_CLKSource_HCLK_Div8    ((uint32_t)0xFFFFFFFB)
123
#define SysTick_CLKSource_HCLK         ((uint32_t)0x00000004)
124
#define IS_SYSTICK_CLK_SOURCE(SOURCE) (((SOURCE) == SysTick_CLKSource_HCLK) || \
125
                                       ((SOURCE) == SysTick_CLKSource_HCLK_Div8))
126
/**
127
  * @}
128
  */
129
 
130
/**
131
  * @}
132
  */
133
 
134
/** @defgroup MISC_Exported_Macros
135
  * @{
136
  */
137
 
138
/**
139
  * @}
140
  */
141
 
142
/** @defgroup MISC_Exported_Functions
143
  * @{
144
  */
145
 
146
void NVIC_PriorityGroupConfig(uint32_t NVIC_PriorityGroup);
147
void NVIC_Init(NVIC_InitTypeDef* NVIC_InitStruct);
148
void NVIC_SetVectorTable(uint32_t NVIC_VectTab, uint32_t Offset);
149
void NVIC_SystemLPConfig(uint8_t LowPowerMode, FunctionalState NewState);
150
void SysTick_CLKSourceConfig(uint32_t SysTick_CLKSource);
151
 
152
#endif /* __MISC_H */
153
 
154
/**
155
  * @}
156
  */
157
 
158
/**
159
  * @}
160
  */
161
 
162
/**
163
  * @}
164
  */
165
 
166
/******************* (C) COPYRIGHT 2009 STMicroelectronics *****END OF FILE****/

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.