2013-08-07 13:37:27 +00:00
|
|
|
/*
|
2014-07-26 09:24:53 +00:00
|
|
|
ChibiOS/HAL - Copyright (C) 2006-2014 Giovanni Di Sirio
|
2013-08-07 13:37:27 +00:00
|
|
|
|
2013-08-07 14:33:33 +00:00
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
You may obtain a copy of the License at
|
2013-08-07 13:37:27 +00:00
|
|
|
|
2013-08-07 14:33:33 +00:00
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
2013-08-07 13:37:27 +00:00
|
|
|
|
2013-08-07 14:33:33 +00:00
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
2013-08-07 13:37:27 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @file common/ARMCMx/nvic.h
|
|
|
|
* @brief Cortex-Mx NVIC support macros and structures.
|
|
|
|
*
|
|
|
|
* @addtogroup COMMON_ARMCMx_NVIC
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _NVIC_H_
|
|
|
|
#define _NVIC_H_
|
|
|
|
|
2013-08-07 14:33:33 +00:00
|
|
|
/*===========================================================================*/
|
|
|
|
/* Driver constants. */
|
|
|
|
/*===========================================================================*/
|
|
|
|
|
2014-02-05 19:55:42 +00:00
|
|
|
/**
|
|
|
|
* @name System vectors numbers
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
#define HANDLER_MEM_MANAGE 0 /**< MEM MANAGE vector id. */
|
|
|
|
#define HANDLER_BUS_FAULT 1 /**< BUS FAULT vector id. */
|
|
|
|
#define HANDLER_USAGE_FAULT 2 /**< USAGE FAULT vector id. */
|
|
|
|
#define HANDLER_RESERVED_3 3
|
|
|
|
#define HANDLER_RESERVED_4 4
|
|
|
|
#define HANDLER_RESERVED_5 5
|
|
|
|
#define HANDLER_RESERVED_6 6
|
|
|
|
#define HANDLER_SVCALL 7 /**< SVCALL vector id. */
|
|
|
|
#define HANDLER_DEBUG_MONITOR 8 /**< DEBUG MONITOR vector id. */
|
|
|
|
#define HANDLER_RESERVED_9 9
|
|
|
|
#define HANDLER_PENDSV 10 /**< PENDSV vector id. */
|
|
|
|
#define HANDLER_SYSTICK 11 /**< SYS TCK vector id. */
|
|
|
|
/** @} */
|
|
|
|
|
2013-08-07 14:33:33 +00:00
|
|
|
/*===========================================================================*/
|
|
|
|
/* Driver pre-compile time settings. */
|
|
|
|
/*===========================================================================*/
|
|
|
|
|
|
|
|
/*===========================================================================*/
|
|
|
|
/* Derived constants and error checks. */
|
|
|
|
/*===========================================================================*/
|
|
|
|
|
|
|
|
/*===========================================================================*/
|
|
|
|
/* Driver data structures and types. */
|
|
|
|
/*===========================================================================*/
|
|
|
|
|
|
|
|
/*===========================================================================*/
|
|
|
|
/* Driver macros. */
|
|
|
|
/*===========================================================================*/
|
|
|
|
|
2013-08-07 14:07:06 +00:00
|
|
|
/**
|
|
|
|
* @brief Priority level to priority mask conversion macro.
|
|
|
|
*/
|
|
|
|
#define NVIC_PRIORITY_MASK(prio) ((prio) << (8 - __NVIC_PRIO_BITS))
|
|
|
|
|
2013-08-07 14:33:33 +00:00
|
|
|
/*===========================================================================*/
|
|
|
|
/* External declarations. */
|
|
|
|
/*===========================================================================*/
|
|
|
|
|
2013-08-07 13:37:27 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
2014-02-01 13:47:25 +00:00
|
|
|
void nvicEnableVector(uint32_t n, uint32_t prio);
|
|
|
|
void nvicDisableVector(uint32_t n);
|
2014-02-05 19:55:42 +00:00
|
|
|
void nvicSetSystemHandlerPriority(uint32_t handler, uint32_t prio);
|
2013-08-07 13:37:27 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* _NVIC_H_ */
|
|
|
|
|
|
|
|
/** @} */
|