/****************************************************************************/
/* Copyright 2016 MBARI.                                                    */
/* MBARI Proprietary Information. All rights reserved.                      */
/****************************************************************************/

#ifndef _UART1_H
#define _UART1_H

#include "typedefs.h"

/* Speed of the UART1 module */
#define BAUD_RATE_UART1	19200L

/* Speed of the UART2 module */
#define BAUD_RATE_UART2	19200L

/*---------------------------------------------------------------------------
  MACRO: True if the serial ports input buffer contains received data
---------------------------------------------------------------------------*/
#define mIsU1RXDataAvailable() (U1STAbits.URXDA)

//function declaration
void vInitU1 ( void );
void vInitU2 ( void );
void vPutCharU ( unsigned short cChar , int chan);
void vPutStrU ( char* pcStr, int chan );
CHAR cGetCharU( int chan );
int RxStr(int maxchar,char *buf,int ms_to1,int ms_bet); //read RxD1 to LF
int RxStr2(int maxchar,char *buf,int ms_to1,int ms_bet); //read RxD2 to LF
#endif
