-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUSART_CONFIG.h
More file actions
112 lines (95 loc) · 2.42 KB
/
USART_CONFIG.h
File metadata and controls
112 lines (95 loc) · 2.42 KB
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
/***************************************************************/
/***************************************************************/
/************ Author: A. S. Eldesouky ************/
/************ Layer: MCAL ************/
/************ SWC: USART ************/
/************ Date: 6-10-2020 ************/
/************ Version: 1.00 ************/
/***************************************************************/
/***************************************************************/
/*File Gard*/
#ifndef USART_CONFIG_H_
#define USART_CONFIG_H_
/*Set System Frequency*/
#define SYSTEM_FREQUENCY 8000000UL
/*Set Baud Rate*/
#define USART_BAUD_RATE 9600UL
/*Set System Speed
* choose between
* 1. USART_X1
* 2. USART_X2
*/
#define USART_SYSTEM_SPEED USART_X1
/*Set Timeout for Your functions*/
#define USART_uint32TIMEOUT 10000UL
/*Set Multi-Processor Communication mode
* choose between
* 1. DISABLE
* 2. ENABLE
*/
#define USART_MPCM DISABLE
/*Set RX Complete Interrupt Enable
* choose between
* 1. DISABLE
* 2. ENABLE
*/
#define USART_RX_COMPLETE_INTERRUPT DISABLE
/*Set TX Complete Interrupt Enable
* choose between
* 1. DISABLE
* 2. ENABLE
*/
#define USART_TX_COMPLETE_INTERRUPT DISABLE
/*Set UDR Empty Interrupt Enable
* choose between
* 1. DISABLE
* 2. ENABLE
*/
#define USART_UDR_EMPTY_INTERRUPT DISABLE
/*Set Receiver Enable
* choose between
* 1. DISABLE
* 2. ENABLE
*/
#define USART_RECEIVER_ENABLE ENABLE
/*Set Transmitter Enable
* choose between
* 1. DISABLE
* 2. ENABLE
*/
#define USART_TRANSMITTER_ENABLE ENABLE
/*Set USART Mode Select
* choose between
* 1. ASYNCHRONOUS
* 2. SYNCHRONOUS
*/
#define USART_MODE ASYNCHRONOUS
/*Set Parity Mode
* choose between
* 1. DISABLE
* 2. EVEN_PARITY
* 3. ODD_PARITY
*/
#define USART_PARITY_MODE DISABLE
/*Set Stop bit
* choose between
* 1. STOP_BIT_1
* 2. STOP_BIT_2
*/
#define USART_STOP_BIT STOP_BIT_1
/*Set Data Size
* choose between
* 1. DATA_SIZE_5_BIT
* 2. DATA_SIZE_6_BIT
* 3. DATA_SIZE_7_BIT
* 4. DATA_SIZE_8_BIT
* 5. DATA_SIZE_9_BIT
*/
#define USART_DATA_SIZE DATA_SIZE_8_BIT
/*Set Clock Polarity (for SYNCHRONOUS mode only)
* choose between
* 1. XCK_RISING_TX_XCH_FALLING_RX
* 2. XCK_RISING_RX_XCH_FALLING_TX
*/
#define USART_CLOCK_POLARITY XCK_RISING_TX_XCH_FALLING_RX
#endif