Rev 134 | Rev 139 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 134 | Rev 136 | ||
---|---|---|---|
Line 54... | Line 54... | ||
54 | // + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
54 | // + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
55 | // + POSSIBILITY OF SUCH DAMAGE. |
55 | // + POSSIBILITY OF SUCH DAMAGE. |
56 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
56 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
57 | //#include <stdio.h> |
57 | //#include <stdio.h> |
58 | #include "91x_lib.h" |
58 | #include "91x_lib.h" |
- | 59 | #include "config.h" |
|
59 | #include "uart1.h" |
60 | #include "uart1.h" |
Line 60... | Line -... | ||
60 | - | ||
61 | #define UART2_BAUD_RATE 57600 //Baud Rate for the serial interfaces |
- | |
62 | - | ||
63 | 61 | ||
64 | /********************************************************/ |
62 | /********************************************************/ |
65 | /* Initialize UART2 */ |
63 | /* Initialize UART2 */ |
66 | /********************************************************/ |
64 | /********************************************************/ |
67 | void UART2_Init(void) |
65 | void UART2_Init(void) |
Line 109... | Line 107... | ||
109 | UART_InitStructure.UART_BaudRate = UART2_BAUD_RATE; |
107 | UART_InitStructure.UART_BaudRate = UART2_BAUD_RATE; |
110 | UART_InitStructure.UART_HardwareFlowControl = UART_HardwareFlowControl_None; |
108 | UART_InitStructure.UART_HardwareFlowControl = UART_HardwareFlowControl_None; |
111 | UART_InitStructure.UART_Mode = UART_Mode_Tx_Rx; |
109 | UART_InitStructure.UART_Mode = UART_Mode_Tx_Rx; |
112 | UART_InitStructure.UART_FIFO = UART_FIFO_Enable; |
110 | UART_InitStructure.UART_FIFO = UART_FIFO_Enable; |
113 | UART_InitStructure.UART_TxFIFOLevel = UART_FIFOLevel_1_2; |
111 | UART_InitStructure.UART_TxFIFOLevel = UART_FIFOLevel_1_2; |
114 | UART_InitStructure.UART_RxFIFOLevel = UART_FIFOLevel_1_2; |
112 | UART_InitStructure.UART_RxFIFOLevel = UART_FIFOLevel_1_8; |
Line 115... | Line 113... | ||
115 | 113 | ||
116 | UART_DeInit(UART2); // reset uart 2 to default |
114 | UART_DeInit(UART2); // reset uart 2 to default |
Line 117... | Line 115... | ||
117 | UART_Init(UART2, &UART_InitStructure); // initialize uart 2 |
115 | UART_Init(UART2, &UART_InitStructure); // initialize uart 2 |
118 | 116 | ||
119 | // enable uart 2 interrupts selective |
117 | // enable uart 2 interrupts selective |
120 | UART_ITConfig(UART2, UART_IT_Receive | UART_IT_ReceiveTimeOut, ENABLE); |
118 | UART_ITConfig(UART2, UART_IT_Receive | UART_IT_ReceiveTimeOut, ENABLE); |
121 | UART_Cmd(UART2, ENABLE); // enable uart 2 |
119 | UART_Cmd(UART2, ENABLE); // enable uart 2 |
122 | // configure the uart 2 interupt line as an IRQ with priority 5(0 is highest) |
120 | // configure the uart 2 interupt line |
123 | VIC_Config(UART2_ITLine, VIC_IRQ, 5); |
121 | VIC_Config(UART2_ITLine, VIC_IRQ, PRIORITY_UART2); |
Line 124... | Line 122... | ||
124 | // enable the uart 2 IRQ |
122 | // enable the uart 2 IRQ |
125 | VIC_ITCmd(UART2_ITLine, ENABLE); |
123 | VIC_ITCmd(UART2_ITLine, ENABLE); |