MotionLib
1.0.0
SamBuCa motion library
|
Public Member Functions | |
EdgeGrblDeviceBase (int lun, const std::string &driverPath=std::string()) | |
Construct a new EdgeGrblDevice. More... | |
void | read () override |
fill LineBuffer with incoming bytes | |
void | write (const std::string &data) override |
raw write some bytes More... | |
bool | wait (const std::chrono::milliseconds &timeout) override |
wait for input More... | |
void | wake () override |
wake thread waiting for input | |
void | read (struct edge_reg *reg, uint32_t &value) |
Get a register value. More... | |
void | read (struct edge_reg *reg, size_t offset, uint32_t &value) |
Get a register value at depth. More... | |
void | read (struct edge_reg *reg, std::vector< uint32_t > &values) |
Get all registers. More... | |
void | write (struct edge_reg *reg, uint32_t value) |
Write a value to register. More... | |
void | write (struct edge_reg *reg, size_t offset, uint32_t value) |
Write a value to register. More... | |
struct fmc_mfe_hdl * | getDrv () const |
get driver handler | |
![]() | |
void | fetch (const std::chrono::milliseconds &timeout) |
wait for data and process it More... | |
virtual grbl::ErrorCode | send (const std::string &cmd, std::function< bool(const std::string &)> msg={}, const std::chrono::milliseconds &timeout=defaultSendTimeout) |
send a command wait for reply More... | |
virtual grbl::ErrorCode | sendRealtime (const std::string &cmd, std::function< bool(const std::string &)> msg={}, const std::chrono::milliseconds &timeout=defaultSendTimeout) |
send a realtime-command wait for reply More... | |
virtual bool | takeLine (std::string &line) |
consume line from buffer More... | |
Protected Member Functions | |
void | init (int lun, const std::string &driverPath) |
void | irqLoop () |
Wait for irq using blocking API and set variables once available. | |
bool | waitIrq (const std::chrono::milliseconds &timeout, const struct edge_reg *const expectedReg, uint32_t expectedBit) |
Wait for irq from given source. More... | |
void | drvOpen (int lun, const std::string &simPath, bool isSim) |
Open FMC_MFE device with given driver. More... | |
void | drvClose () |
Close the driver. | |
Protected Attributes | |
int | m_wakeFd [2] |
struct fmc_mfe_hdl * | m_edgeDrvHdl |
std::vector< char > | m_fifoBytes |
![]() | |
ccut::LineBuffer | m_buffer |
Static Protected Attributes | |
static const std::string | loggerCat {"edge:edgegrbldevice"} |
Additional Inherited Members | |
![]() | |
ccut::Signal< std::string > | dataSignal |
![]() | |
static const std::chrono::milliseconds | defaultSendTimeout |
Definition at line 50 of file EdgeGrblDeviceBase.hpp.
|
explicit |
Construct a new EdgeGrblDevice.
lun | LUN to use |
driverPath | Path of the sim library (leave empty for non-sim) |
Definition at line 57 of file EdgeGrblDeviceBase.cpp.
|
protected |
Open FMC_MFE device with given driver.
lun | LUN of device to open |
simPath | Path with FMC_MFE sim driver location |
isSim | Set true if simulation driver should be opened |
Definition at line 328 of file EdgeGrblDeviceBase.cpp.
void edge::EdgeGrblDeviceBase::read | ( | struct edge_reg * | reg, |
size_t | offset, | ||
uint32_t & | value | ||
) |
Get a register value at depth.
[in] | reg | register to read |
[in] | offset | offset in the register (depth) |
[out] | value | register value |
smc::Exception | on error |
Definition at line 268 of file EdgeGrblDeviceBase.cpp.
void edge::EdgeGrblDeviceBase::read | ( | struct edge_reg * | reg, |
std::vector< uint32_t > & | values | ||
) |
Get all registers.
[in] | reg | register to read |
values | values to fill |
the values initial size is the register depth
Definition at line 288 of file EdgeGrblDeviceBase.cpp.
|
inline |
Get a register value.
[in] | reg | register to read |
[out] | value | register value |
smc::Exception | on error |
Definition at line 76 of file EdgeGrblDeviceBase.hpp.
|
overridevirtual |
wait for input
timeout | wait timeout |
Exception(IO) | on IO error |
Implements grbl::GrblDeviceBase.
Definition at line 175 of file EdgeGrblDeviceBase.cpp.
|
protected |
Wait for irq from given source.
timeout | Timeout for wait. |
expectedReg | Expected status register |
expectedBit | Expected status bit set |
Definition at line 186 of file EdgeGrblDeviceBase.cpp.
|
overridevirtual |
raw write some bytes
[in] | data | bytes to write |
Implements grbl::GrblDeviceBase.
Definition at line 129 of file EdgeGrblDeviceBase.cpp.
void edge::EdgeGrblDeviceBase::write | ( | struct edge_reg * | reg, |
size_t | offset, | ||
uint32_t | value | ||
) |
Write a value to register.
[in] | reg | register to write |
[in] | offset | offset in the register (depth) |
[in] | value | value to set |
smc::Exception | on error |
Definition at line 308 of file EdgeGrblDeviceBase.cpp.
|
inline |
Write a value to register.
[in] | reg | register to write |
[in] | value | value to set |
smc::Exception | on error |
Definition at line 107 of file EdgeGrblDeviceBase.hpp.