EHS/include/ehs/io/COM.h
karutoh 1a4a1ecd9c
Some checks failed
Build & Release / Linux-x86_64-Build (push) Successful in 40s
Build & Release / Linux-AARCH64-Build (push) Has been cancelled
First commit.
2024-01-31 22:28:19 -08:00

55 lines
942 B
C++

#pragma once
#include "ehs/EHS.h"
namespace ehs
{
enum class Parity : UInt_8
{
NONE,
ODD,
EVEN,
MARK,
SPACE
};
enum class StopBits : UInt_8
{
ONE,
ONE_POINT_FIVE,
TWO
};
class COM
{
private:
UInt_8 port;
UInt_32 baudRate;
UInt_8 byteSize;
Parity parity;
StopBits stopBits;
void* hdl;
bool initialized;
public:
COM();
COM(const UInt_8 port, const UInt_32 baudRate, const UInt_8 byteSize, const Parity parity, const StopBits stopBits);
COM(const COM& com) = default;
void Initialize();
void UnInitialize();
UInt_32 Wait();
void Transmit(const Char_8 data);
UInt_32 Send(const Char_8* data, const UInt_32 size);
UInt_32 Receive(const Char_8* data, const UInt_32 size);
void Flush();
};
}