using Microsoft.SPOT;

namespace HWModules
{
    public delegate void UartDataReceivedEventHandler(object sender, EventArgs e);

    interface IUart
    {
        int BytesToRead { get; }
        int BytesToWrite { get; }

        void Write(byte[] buffer, int offset, int count);
        void WriteByte(byte value);
        int Read(byte[] buffer, int offset, int count);
        byte ReadByte();

        bool Open();
        void Close();

        event UartDataReceivedEventHandler DataReceived;
        event UartDataReceivedEventHandler ErrorReceived;

    }
}
