-
Notifications
You must be signed in to change notification settings - Fork 1
/
SysCtrl.c
68 lines (47 loc) · 1.33 KB
/
SysCtrl.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#include "SysCtrl.h"
/* Grant coprocessor access*/
void SystemInit(void){
/* This is required since TM4C123G has a floating point coprocessor */
SCB_CPAC |= 0x00F00000;
}
// Enable clock of the demanded port and offline others to save power.
//GPIO CLOCK
void clock_Enable_PORT(U8_t port){
// make a delay to manipulate instruction well.
U32_t delay=0;
//Access clock register.
GPIO_RCGC_PORT|=port;
delay=GPIO_RCGC_PORT;
}//End of clock function
//UART CLOCK
void Clock_Enable_UART(U8_t uart_n){
// make a delay to manipulate instruction well.
U32_t delay=0;
//Access clock register.
UART_RCGC|=uart_n;
delay=UART_RCGC;
}//End of clock function
//Timer clock
void Clock_Enable_Timer(U8_t timer_n){
// make a delay to manipulate instruction well.
U32_t delay=0;
//Access clock register.
Timer_clock|=timer_n;
delay=Timer_clock;
}//End of clock function
//ADC clock
void Clock_Enable_ADC(U8_t ADC_n){
// make a delay to manipulate instruction well.
U32_t delay=0;
//Access clock register.
ADC_clock|=ADC_n;
delay=ADC_clock;
}//End of clock function
//SPI clock
void Clock_Enable_SPI(U8_t SPI_n){
// make a delay to manipulate instruction well.
U32_t delay=0;
//Access clock register.
SPI_clock|=SPI_n;
delay=SPI_clock;
}//End of clock function