Проект перенесен в папку MDK-ARM
This commit is contained in:
412
MDK-ARM/Core/App/vk035_it.c
Normal file
412
MDK-ARM/Core/App/vk035_it.c
Normal file
@@ -0,0 +1,412 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file vk035_it.c
|
||||
* @author Разваляев Алексей
|
||||
* @brief Обработчики прерываний для микроконтроллера 1921ВК035.
|
||||
* Этот файл содержит:
|
||||
* + Обработчики прерываний периферии (UART, TMR, ADC, DMA и др.)
|
||||
* + Обработчики исключений Cortex-M4 (HardFault, SysTick и др.)
|
||||
* + Интеграцию с драйверами периферии через вызовы обработчиков
|
||||
* + Управление системным временем через SysTick
|
||||
*
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Использование этого файла предполагает наличие корректных настроек:
|
||||
* - Определены USE_xxx макросы в periph_config.h для включения периферии
|
||||
* - Инициализированы соответствующие драйверы периферии
|
||||
* - Включены прерывания в NVIC через функции драйверов
|
||||
*
|
||||
******************************************************************************
|
||||
* @verbatim
|
||||
==============================================================================
|
||||
##### Как использовать этот файл #####
|
||||
==============================================================================
|
||||
|
||||
1. Настройка периферии (periph_config.h):
|
||||
(+) Определить USE_TMRx для используемых таймеров (0-3)
|
||||
(+) Определить USE_UARTx для используемых UART (0-1)
|
||||
(+) Определить USE_ADC_SEQx для используемых секвенсоров ADC (0-1)
|
||||
|
||||
2. Инициализация драйверов:
|
||||
(+) Вызвать функции инициализации драйверов (uart_init_first, tmr_init_first и т.д.)
|
||||
- Драйверы автоматически включат соответствующие прерывания в NVIC
|
||||
|
||||
3. Обработка прерываний:
|
||||
(+) Прерывания периферии автоматически перенаправляются в драйверы
|
||||
(+) Системные прерывания (SysTick) управляют временем millis/micros
|
||||
(+) Обработчики исключений обрабатывают критические ошибки
|
||||
|
||||
4. Интеграция с драйверами:
|
||||
(+) UART прерывания -> uart_irq_handler(&huartx)
|
||||
(+) TMR прерывания -> tmr_irq_handler(&htmrx)
|
||||
(+) ADC SEQ прерывания -> adc_seq_irq_handler(&hadc, SEQ_Num)
|
||||
|
||||
5. Системное время:
|
||||
(+) SysTick_Handler() автоматически обновляет millis() и micros()
|
||||
(+) Период SysTick настраивается в sysclk_init()
|
||||
|
||||
6. Особенности работы:
|
||||
(+) Неиспользуемые обработчики оставлены пустыми для будущего расширения
|
||||
(+) Критические ошибки (HardFault и др.) уходят в бесконечный цикл
|
||||
(+) Прерывания обрабатываются неблокирующе с минимальными задержками
|
||||
|
||||
@endverbatim
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
//-- Includes ------------------------------------------------------------------
|
||||
#include "main.h"
|
||||
|
||||
|
||||
/******************************************************************************/
|
||||
/* 1921VK035 Peripheral Interrupt Handlers */
|
||||
/* Add here the Interrupt Handlers for the used peripherals. */
|
||||
/******************************************************************************/
|
||||
#if USE_WDT==1
|
||||
void WDT_IRQHandler(void)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
void GPIOA_IRQHandler(void)
|
||||
{
|
||||
}
|
||||
void GPIOB_IRQHandler(void)
|
||||
{
|
||||
}
|
||||
#if USE_TMR0==1
|
||||
void TMR0_IRQHandler(void)
|
||||
{
|
||||
tmr_irq_handler(&htmr0);
|
||||
}
|
||||
#endif
|
||||
#if USE_TMR1==1
|
||||
void TMR1_IRQHandler(void)
|
||||
{
|
||||
tmr_irq_handler(&htmr1);
|
||||
}
|
||||
#endif
|
||||
#if USE_TMR2==1
|
||||
void TMR2_IRQHandler(void)
|
||||
{
|
||||
tmr_irq_handler(&htmr2);
|
||||
}
|
||||
#endif
|
||||
#if USE_TMR3==1
|
||||
void TMR3_IRQHandler(void)
|
||||
{
|
||||
tmr_irq_handler(&htmr3);
|
||||
}
|
||||
#endif
|
||||
#if USE_UART0==1
|
||||
void UART0_TD_IRQHandler(void)
|
||||
{
|
||||
uart_irq_handler(&huart0);
|
||||
}
|
||||
void UART0_RX_IRQHandler(void)
|
||||
{
|
||||
uart_irq_handler(&huart0);
|
||||
}
|
||||
void UART0_TX_IRQHandler(void)
|
||||
{
|
||||
uart_irq_handler(&huart0);
|
||||
}
|
||||
void UART0_E_RT_IRQHandler(void)
|
||||
{
|
||||
uart_irq_handler(&huart0);
|
||||
}
|
||||
#endif
|
||||
#if USE_UART1==1
|
||||
void UART1_TD_IRQHandler(void)
|
||||
{
|
||||
uart_irq_handler(&huart1);
|
||||
}
|
||||
void UART1_RX_IRQHandler(void)
|
||||
{
|
||||
uart_irq_handler(&huart1);
|
||||
}
|
||||
void UART1_TX_IRQHandler(void)
|
||||
{
|
||||
uart_irq_handler(&huart1);
|
||||
}
|
||||
void UART1_E_RT_IRQHandler(void)
|
||||
{
|
||||
uart_irq_handler(&huart1);
|
||||
}
|
||||
#endif
|
||||
#if USE_SPI==1
|
||||
void SPI_RO_RT_IRQHandler(void)
|
||||
{
|
||||
}
|
||||
void SPI_RX_IRQHandler(void)
|
||||
{
|
||||
}
|
||||
void SPI_TX_IRQHandler(void)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
#if USE_I2C==1
|
||||
void I2C_IRQHandler(void)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
#if USE_ECAP0==1
|
||||
void ECAP0_IRQHandler(void)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
#if USE_ECAP1==1
|
||||
void ECAP1_IRQHandler(void)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
#if USE_ECAP2==1
|
||||
void ECAP2_IRQHandler(void)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
#if USE_PWM0==1
|
||||
void PWM0_IRQHandler(void)
|
||||
{
|
||||
}
|
||||
void PWM0_HD_IRQHandler(void)
|
||||
{
|
||||
}
|
||||
void PWM0_TZ_IRQHandler(void)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
#if USE_PWM1==1
|
||||
void PWM1_IRQHandler(void)
|
||||
{
|
||||
}
|
||||
void PWM1_HD_IRQHandler(void)
|
||||
{
|
||||
}
|
||||
void PWM1_TZ_IRQHandler(void)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
#if USE_PWM2==1
|
||||
void PWM2_IRQHandler(void)
|
||||
{
|
||||
}
|
||||
void PWM2_HD_IRQHandler(void)
|
||||
{
|
||||
}
|
||||
void PWM2_TZ_IRQHandler(void)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
#if USE_QEP==1
|
||||
void QEP_IRQHandler(void)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
#if USE_ADC_SEQ0==1
|
||||
void ADC_SEQ0_IRQHandler(void)
|
||||
{
|
||||
adc_seq_irq_handler(&hadc, ADC_SEQ_Num_0);
|
||||
}
|
||||
#endif
|
||||
#if USE_ADC_SEQ1==1
|
||||
void ADC_SEQ1_IRQHandler(void)
|
||||
{
|
||||
adc_seq_irq_handler(&hadc, ADC_SEQ_Num_1);
|
||||
}
|
||||
#endif
|
||||
#if (USE_ADC_DC0==1) || (USE_ADC_DC1==1) || (USE_ADC_DC2==1) || (USE_ADC_DC3==1)
|
||||
void ADC_DC_IRQHandler(void)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
#if USE_ADC_CAN==1
|
||||
void CAN0_IRQHandler(void)
|
||||
{
|
||||
}
|
||||
void CAN1_IRQHandler(void)
|
||||
{
|
||||
}
|
||||
void CAN2_IRQHandler(void)
|
||||
{
|
||||
}
|
||||
void CAN3_IRQHandler(void)
|
||||
{
|
||||
}
|
||||
void CAN4_IRQHandler(void)
|
||||
{
|
||||
}
|
||||
void CAN5_IRQHandler(void)
|
||||
{
|
||||
}
|
||||
void CAN6_IRQHandler(void)
|
||||
{
|
||||
}
|
||||
void CAN7_IRQHandler(void)
|
||||
{
|
||||
}
|
||||
void CAN8_IRQHandler(void)
|
||||
{
|
||||
}
|
||||
void CAN9_IRQHandler(void)
|
||||
{
|
||||
}
|
||||
void CAN10_IRQHandler(void)
|
||||
{
|
||||
}
|
||||
void CAN11_IRQHandler(void)
|
||||
{
|
||||
}
|
||||
void CAN12_IRQHandler(void)
|
||||
{
|
||||
}
|
||||
void CAN13_IRQHandler(void)
|
||||
{
|
||||
}
|
||||
void CAN14_IRQHandler(void)
|
||||
{
|
||||
}
|
||||
void CAN15_IRQHandler(void)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
void DMA_CH0_IRQHandler(void)
|
||||
{
|
||||
}
|
||||
void DMA_CH1_IRQHandler(void)
|
||||
{
|
||||
}
|
||||
void DMA_CH2_IRQHandler(void)
|
||||
{
|
||||
}
|
||||
void DMA_CH3_IRQHandler(void)
|
||||
{
|
||||
}
|
||||
void DMA_CH4_IRQHandler(void)
|
||||
{
|
||||
}
|
||||
void DMA_CH5_IRQHandler(void)
|
||||
{
|
||||
}
|
||||
void DMA_CH6_IRQHandler(void)
|
||||
{
|
||||
}
|
||||
void DMA_CH7_IRQHandler(void)
|
||||
{
|
||||
}
|
||||
void DMA_CH8_IRQHandler(void)
|
||||
{
|
||||
}
|
||||
void DMA_CH9_IRQHandler(void)
|
||||
{
|
||||
}
|
||||
void DMA_CH10_IRQHandler(void)
|
||||
{
|
||||
}
|
||||
void DMA_CH11_IRQHandler(void)
|
||||
{
|
||||
}
|
||||
void DMA_CH12_IRQHandler(void)
|
||||
{
|
||||
}
|
||||
void DMA_CH13_IRQHandler(void)
|
||||
{
|
||||
}
|
||||
void DMA_CH14_IRQHandler(void)
|
||||
{
|
||||
}
|
||||
void DMA_CH15_IRQHandler(void)
|
||||
{
|
||||
}
|
||||
void FPU_IRQHandler(void)
|
||||
{
|
||||
}
|
||||
void RCU_IRQHandler(void)
|
||||
{
|
||||
}
|
||||
void MFLASH_IRQHandler(void)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************/
|
||||
/* Cortex-M4 Processor Interruption and Exception Handlers */
|
||||
/******************************************************************************/
|
||||
/**
|
||||
* @brief This function handles Non maskable interrupt.
|
||||
*/
|
||||
void NMI_Handler(void)
|
||||
{
|
||||
while (1)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles Hard fault interrupt.
|
||||
*/
|
||||
void HardFault_Handler(void)
|
||||
{
|
||||
while (1)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles Memory management fault.
|
||||
*/
|
||||
void MemManage_Handler(void)
|
||||
{
|
||||
while (1)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles Prefetch fault, memory access fault.
|
||||
*/
|
||||
void BusFault_Handler(void)
|
||||
{
|
||||
while (1)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles Undefined instruction or illegal state.
|
||||
*/
|
||||
void UsageFault_Handler(void)
|
||||
{
|
||||
while (1)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles System service call via SWI instruction.
|
||||
*/
|
||||
void SVC_Handler(void)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles Debug monitor.
|
||||
*/
|
||||
void DebugMon_Handler(void)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles Pendable request for system service.
|
||||
*/
|
||||
void PendSV_Handler(void)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles System tick timer.
|
||||
*/
|
||||
void SysTick_Handler(void)
|
||||
{
|
||||
sysclk_irq_handler();
|
||||
}
|
||||
Reference in New Issue
Block a user