-
Notifications
You must be signed in to change notification settings - Fork 0
/
NVIC.c
40 lines (34 loc) · 1.17 KB
/
NVIC.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include "naglowki_include.h"
#include "NVIC.h"
void inicjalizacja_NVIC()
{
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_4);
NVIC_InitTypeDef nvic_timer;
nvic_timer.NVIC_IRQChannel = TIM3_IRQn;
nvic_timer.NVIC_IRQChannelPreemptionPriority = 2;
nvic_timer.NVIC_IRQChannelSubPriority = 0;
nvic_timer.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&nvic_timer);
nvic_timer.NVIC_IRQChannel = TIM4_IRQn;
nvic_timer.NVIC_IRQChannelPreemptionPriority = 2;
nvic_timer.NVIC_IRQChannelSubPriority = 0;
nvic_timer.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&nvic_timer);
nvic_timer.NVIC_IRQChannel = TIM2_IRQn;
nvic_timer.NVIC_IRQChannelPreemptionPriority = 2;
nvic_timer.NVIC_IRQChannelSubPriority = 0;
nvic_timer.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&nvic_timer);
NVIC_InitTypeDef nvic_usart;
nvic_usart.NVIC_IRQChannel = USART1_IRQn;
nvic_usart.NVIC_IRQChannelPreemptionPriority = 1;
nvic_usart.NVIC_IRQChannelSubPriority = 0;
nvic_usart.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&nvic_usart);
NVIC_InitTypeDef adc;
adc.NVIC_IRQChannel = ADC1_IRQn;
adc.NVIC_IRQChannelPreemptionPriority = 3;
adc.NVIC_IRQChannelSubPriority = 0;
adc.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&adc);
}