/* 
 * File:   UART.h
 * Author: hamilton
 *
 * Created on January 15, 2014, 3:54 PM
 */
#include "config.h"
#ifdef DEBUG

#ifndef UART_H
#define	UART_H
#define BRATE1 259    //38400 Baud (BRGH = 1)  w/39960375 HZ clock Actual, Baud rate is 38423
#define BRATE 86    //115200 Baud (BRGH = 1)   w/39960375 HZ clock, Actual Baud rate is 114829
#define U_ENABLE_H 0x8808  //enable the UART Peripheral with BRGH = 1
#define U_ENABLE_L 0x8008  //enable the UART Peripheral with BRGH = 1;
#define U_NOFLOWCONTROL 0x0000
#define U_TX  0x0400  //Enable transmission

#define CTS1 _RD14
#define RTS1 _LATD15
#define TRTS1 TRISDbits.TRISD15

#define CTS2 _RF12
#define RTS2 _LATF13
#define TRTS2 TRISFbits.TRISF13


void InitU1(void);
void InitU2(void);
int putU1( int c);
void putsU1(char *s);
char getU1(void);
int putU2( int c);
void putsU2(char *s);
char getU2(void);

#endif

#endif	/* UART_H */

