Subversion Repositories Code-Repo

Rev

Rev 129 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 129 Rev 130
Line 2... Line 2...
2
#include "uart.h"
2
#include "uart.h"
3
#include "xbee.h"
3
#include "xbee.h"
4
#include <string.h>
4
#include <string.h>
5
#include <stdio.h>
5
#include <stdio.h>
6
 
6
 
-
 
7
#pragma udata UART1_BUFFER
7
static UART_DATA uart_1_data;
8
static UART_DATA uart_1_data;
-
 
9
#pragma udata
8
static UART_DATA *uart_1_data_p = &uart_1_data;
10
static UART_DATA *uart_1_data_p = &uart_1_data;
9
 
11
 
10
void UART1_Init() {
12
void UART1_Init() {
11
    // Configure the hardware USART device
13
    // Configure the hardware USART device
12
    // UART1 TX RC6
14
    // UART1 TX RC6
Line 43... Line 45...
43
 
45
 
44
//void uart_2_init() {
46
//void uart_2_init() {
45
//    // Configure the PPS USART ports
47
//    // Configure the PPS USART ports
46
//
48
//
47
//    // UART2 RX Pin RP5
49
//    // UART2 RX Pin RP5
48
//    RPINR16 = 5;    // 5 is PPS RP5
50
//    RPINR16 = PPS_UART2_RX;    // 5 is PPS RP5
49
//    // UART2 TX Pin RP6
51
//    // UART2 TX Pin RP6
50
//    RPOR6 = 6;  // 6 is TX2/CK2 (EUSART2 Asynchronous Transmit/Asynchronous Clock Output)
52
//    PPS_UART2_TX = 6;  // 6 is TX2/CK2 (EUSART2 Asynchronous Transmit/Asynchronous Clock Output)
51
//
53
//
52
//    Open2USART(USART_TX_INT_OFF &   // Interrupt on TX off
54
//    Open2USART(USART_TX_INT_OFF &   // Interrupt on TX off
53
//            USART_RX_INT_ON &      // Interrupt on RX on
55
//            USART_RX_INT_ON &      // Interrupt on RX on
54
//            USART_ASYNCH_MODE &     // Operate in async mode
56
//            USART_ASYNCH_MODE &     // Operate in async mode
55
//            USART_EIGHT_BIT &       // Operate in 8-bit mode
57
//            USART_EIGHT_BIT &       // Operate in 8-bit mode