/**
 * \file   osdrv_uart.h
 *
 *
 * \brief  UART APIs implementation
 *
*/
/*
 * Copyright (c) 2012 Texas Instruments Incorporated ALL RIGHTS RESERVED
 */

#ifndef _OSDRV_UART_H
#define _OSDRV_UART_H
/* ========================================================================== */
/*                             Include Files                                  */
/* ========================================================================== */
#include <xdc/std.h>
#include <xdc/runtime/System.h>
#include <ti/sysbios/BIOS.h>
#include <ti/sysbios/family/arm/a8/intcps/Hwi.h>
#include <xdc/runtime/Error.h>

/* ========================================================================== */
/*                           Macros & Typedefs                                */
/* ========================================================================== */
/** \brief UART ISR prototyoe */
typedef Void (*UART_ISR_FUNC)(UArg);
/* ========================================================================== */
/*                         Structures and Enums                               */
/* ========================================================================== */

/* ========================================================================== */
/*                            Global Variables Declarations                   */
/* ========================================================================== */

/* ========================================================================== */
/*                          Function Declarations                             */
/* ========================================================================== */
/**
 * \brief   Routine to configura and initialise UART api
 *
 * \param   instance        instance number
 * \param   isrFunc         Interrupt service routine to be called when there 
 *                          is an interrupt on this uart
 *
 *
 * \return  TRUE on success and FALSE on failure.
 *
 **/
Bool UartOpen(UInt instance,UART_ISR_FUNC isrFunc);
/**
 * \brief   Routine to send a character over uart
 *
 * \param   instance    instance number
 * \param   txChar      data to be send
 *
 *
 * \return  None.
 *
 **/
Bool UARTPutChar(UInt instance,Char txChar);
/**
 * \brief   Routine to 
 *
 * \param   instance    UART instance number
 * \param   rxChar      buffer to store the data read from uart
 *
 *
 * \return  TRUE on success and FALSE on failure.
 *
 **/
Bool UARTGetChar(UInt instance,Char *rxChar);
/**
 * \brief   Routine to 
 *
 * \param   instance  UART instance number  
 * \param   buffer    String to be send over UART
 *
 * \return  TRUE on success and FALSE on failure.
 *
 **/
Bool UARTPutString(UInt instance,Char* buffer);
/**
 * \brief   Routine to 
 *
 * \param   instance    
 *
 *
 * \return  None.
 *
 **/
Void UartClose(UInt instance);

/**
 * \brief   Routine to get UART interrupt number
 *
 * \param   none
 *
 *
 * \return  Interrupt number
 *
 **/
unsigned int UartGetIntNum();
#endif



