/*◄■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ EUSARTs.h ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■►*/

/* 
 * File        : EUSARTs.h
 * Author      : JWDarsow
 * For         : LCCnode1.c
 * µChip       : PIC18F26K80
 * See drawing : LCCnode1.dwg
 * Created on  : Tuesday, December 6, 2016
 * Tuesday, May 16, 2017 Combined with EUSART2
 * EUSART1 Driver API Header File
 */

#ifndef _EUSARTS_H
#define _EUSARTS_H

/*═════════════════════════════════ INCLUDEs ═════════════════════════════════*/
/**  Section: Included Standard API Files  */
#include <xc.h>
#include <stdio.h>
#include "JWD-NHR_Common.h"

/*═══════════════════════════ FUNCTION DECLARATIONS ══════════════════════════*/

/*──────────────────────────── INITILIZE EUSART1 ─────────────────────────────*/
/**
  @Summary
    Initialization routine that takes inputs from the EUSART1 GUI.
  @Description
    This routine initializes the EUSART1 driver.
    This routine must be called before any other EUSART1 routine is called.
  @Preconditions
    None
  @Param
    None
  @Returns
    None
  @Comment
*/
void EUSART1_Initialize(void);

/*──────────────────────────── INITILIZE EUSART2 ─────────────────────────────*/
/**
  @Summary
    Initialization routine that takes inputs from the EUSART2 GUI.
  @Description
    This routine initializes the EUSART2 driver.
    This routine must be called before any other EUSART2 routine is called.
  @Preconditions
    None
  @Param
    None
  @Returns
    None
  @Comment
*/
void EUSART2_Initialize(void);

/*────────────────────── EUSART1 Write for NCE Cab Bus ───────────────────────*/
/**
  @Summary
    Writes a byte of data to the EUSART1.

  @Description
    This routine writes a byte of data to the EUSART1.

  @Preconditions
    EUSART1_Initialize() function should have been called
    before calling this function. The transfer status should be checked to see
    if transmitter is not busy before calling this function.

  @Param
    txData  - Data byte to write to the EUSART1

  @Returns
    None
*/
void EUSART1_Write(Byte txData);

/*────────────────────── EUSART1 putch for NCE Cab Bus ───────────────────────*/
void putch1(char txData);

/*─────────────────────── EUART2 Send JMRI CAN String ────────────────────────*/
void print2(const Char * data);

#endif  // _EUSARTS_H
