EHS/include/ehs/io/COM.h
Karutoh bcd71cf2b5
All checks were successful
Build & Release / Windows-AMD64-Build (push) Successful in 1m8s
Build & Release / Linux-AMD64-Build (push) Successful in 1m30s
Build & Release / Linux-AARCH64-Build (push) Successful in 3m21s
Adjusted workflow.
2024-02-05 22:25:30 -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();
};
}