-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathspec.c
37 lines (28 loc) · 949 Bytes
/
spec.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
#include "spec.h"
#define JTAG_DELAY_EBC 1000
#define JTAG_DELAY_RAM 1000000
#define JTAG_DELAY JTAG_DELAY_RAM
void POR_disable(void)
{
int i = 0;
for (i=0;i<JTAG_DELAY;i++) {}; // Pause to take control in alarm case
BKP->KEY = _KEY_; // Key to access batary domain control
BKP->REG_60_TMR0 |= 1<<28; // POR is disable
BKP->REG_60_TMR1 |= 1<<28; // POR is disable
BKP->REG_60_TMR2 |= 1<<28; // POR is disable
CLK_CNTR->KEY = _KEY_; // Key to access clock control
FT_CNTR->KEY = _KEY_; // Key to access fault control
FT_CNTR->RESET_EVENT0 = 0x0; // hide all errors
FT_CNTR->RESET_EVENT1 = 0x0; // hide all errors
FT_CNTR->RESET_EVENT2 = 0x0; // hide all errors
FT_CNTR->RESET_EVENT3 = 0x0; // hide all errors
FT_CNTR->RESET_EVENT4 = 0x0; // hide all errors
}
void KEY_reg_accs(void)
{
PORTA->KEY =_KEY_;
PORTB->KEY =_KEY_;
PORTC->KEY =_KEY_;
PORTD->KEY =_KEY_;
PORTE->KEY =_KEY_;
}