Skip to content

Commit c55b921

Browse files
Added Raylase IO Cycles
1 parent fa8a76e commit c55b921

16 files changed

Lines changed: 939 additions & 117 deletions

Drivers/RayLase/ACT/LibMCDriver_RayLase.xml

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,10 @@
9595
<error name="COULDNOTRECEIVESPIPACKET" code="1044" description="Could not receive SPI Packet" />
9696
<error name="INVALIDLASERMODE" code="1045" description="Invalid laser mode" />
9797
<error name="NLIGHTLASERMODEHASNOPOWEROVERRIDE" code="1046" description="nLight laser mode has no power override" />
98-
99-
98+
<error name="INVALIDIOCYCLEID" code="1047" description="Invalid IO Cycle ID" />
99+
<error name="IOCYCLEALREADYEXISTS" code="1048" description="IO Cycle already exists" />
100+
<error name="IOCYCLENOTFOUND" code="1049" description="IO Cycle not found" />
101+
<error name="INVALIDIOPORT" code="1050" description="Invalid IO Port" />
100102

101103

102104

@@ -286,10 +288,10 @@ Custom implementation
286288
</class>
287289

288290

289-
<class name="RaylaseCycle" parent="Base" description="Object to control a raylase list cycle.">
291+
<class name="RaylaseIOCycle" parent="Base" description="Object to control a raylase list cycle.">
290292

291293
<method name="GetCycleID" description="Returns the cycle ID as Integer.">
292-
<param name="CycleID" type="uint32" pass="in" description="Cycle ID. MUST NOT be 0." />
294+
<param name="CycleID" type="uint32" pass="return" description="Cycle ID. Will not be 0." />
293295
</method>
294296

295297
<method name="AddSignalOut" description="Enables a GPIO Output signal during the list cycle.">
@@ -336,6 +338,25 @@ Custom implementation
336338
<param name="DriverBoard" type="class" class="NLightDriverBoard" pass="return" description="NLight Driver Board Instance" />
337339
</method>
338340

341+
<method name="CreateIOCycle" description="Creates a new IO cycle with a certain ID. Fails if cycle ID is already existing..">
342+
<param name="CycleID" type="uint32" pass="in" description="Cycle ID to use. MUST NOT be 0." />
343+
<param name="IOCycle" type="class" class="RaylaseIOCycle" pass="return" description="IO Cycle Instance" />
344+
</method>
345+
346+
<method name="IOCycleExists" description="Returns if a IO cycle exists.">
347+
<param name="CycleID" type="uint32" pass="in" description="Cycle ID to return." />
348+
<param name="IOCycleDoesExist" type="bool" pass="return" description="Returns true, if IO Cycle exists." />
349+
</method>
350+
351+
<method name="GetIOCycle" description="Returns a new cycle. Fails if cycle ID does not exist..">
352+
<param name="CycleID" type="uint32" pass="in" description="Cycle ID to return." />
353+
<param name="IOCycle" type="class" class="RaylaseIOCycle" pass="return" description="IO Cycle Instance" />
354+
</method>
355+
356+
<method name="RemoveIOCycle" description="Removes an IO Cycle of a certain ID. Does nothing if IO cycle does not exist..">
357+
<param name="CycleID" type="uint32" pass="in" description="Cycle ID to remove." />
358+
</method>
359+
339360
<method name="LaserOff" description="Turns the laser off.">
340361
</method>
341362

Drivers/RayLase/Headers/CppDynamic/libmcdriver_raylase_dynamic.h

Lines changed: 57 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -313,47 +313,47 @@ typedef LibMCDriver_RaylaseResult (*PLibMCDriver_RaylaseNLightDriverBoard_SetMod
313313
typedef LibMCDriver_RaylaseResult (*PLibMCDriver_RaylaseNLightDriverBoard_GetModeChangeDelaysPtr) (LibMCDriver_Raylase_NLightDriverBoard pNLightDriverBoard, LibMCDriver_Raylase_uint32 * pModeChangeSignalDelayInMicroseconds, LibMCDriver_Raylase_uint32 * pModeChangeApplyDelayInMicroseconds);
314314

315315
/*************************************************************************************************************************
316-
Class definition for RaylaseCycle
316+
Class definition for RaylaseIOCycle
317317
**************************************************************************************************************************/
318318

319319
/**
320320
* Returns the cycle ID as Integer.
321321
*
322-
* @param[in] pRaylaseCycle - RaylaseCycle instance.
323-
* @param[in] nCycleID - Cycle ID. MUST NOT be 0.
322+
* @param[in] pRaylaseIOCycle - RaylaseIOCycle instance.
323+
* @param[out] pCycleID - Cycle ID. Will not be 0.
324324
* @return error code or 0 (success)
325325
*/
326-
typedef LibMCDriver_RaylaseResult (*PLibMCDriver_RaylaseRaylaseCycle_GetCycleIDPtr) (LibMCDriver_Raylase_RaylaseCycle pRaylaseCycle, LibMCDriver_Raylase_uint32 nCycleID);
326+
typedef LibMCDriver_RaylaseResult (*PLibMCDriver_RaylaseRaylaseIOCycle_GetCycleIDPtr) (LibMCDriver_Raylase_RaylaseIOCycle pRaylaseIOCycle, LibMCDriver_Raylase_uint32 * pCycleID);
327327

328328
/**
329329
* Enables a GPIO Output signal during the list cycle.
330330
*
331-
* @param[in] pRaylaseCycle - RaylaseCycle instance.
331+
* @param[in] pRaylaseIOCycle - RaylaseIOCycle instance.
332332
* @param[in] eIOPort - IO Port to write out to. MUST be configured as output pin.
333333
* @param[in] nIOPin - IO Pin to write out to. MUST be configured as output pin.
334334
* @return error code or 0 (success)
335335
*/
336-
typedef LibMCDriver_RaylaseResult (*PLibMCDriver_RaylaseRaylaseCycle_AddSignalOutPtr) (LibMCDriver_Raylase_RaylaseCycle pRaylaseCycle, LibMCDriver_Raylase::eIOPort eIOPort, LibMCDriver_Raylase_uint32 nIOPin);
336+
typedef LibMCDriver_RaylaseResult (*PLibMCDriver_RaylaseRaylaseIOCycle_AddSignalOutPtr) (LibMCDriver_Raylase_RaylaseIOCycle pRaylaseIOCycle, LibMCDriver_Raylase::eIOPort eIOPort, LibMCDriver_Raylase_uint32 nIOPin);
337337

338338
/**
339339
* Enables to wait for an Input signal during the list cycle.
340340
*
341-
* @param[in] pRaylaseCycle - RaylaseCycle instance.
341+
* @param[in] pRaylaseIOCycle - RaylaseIOCycle instance.
342342
* @param[in] eIOPort - IO Port to read from. MUST be configured as input pin.
343343
* @param[in] nIOPin - IO Pin to read from. MUST be configured as input pin.
344344
* @param[in] nTimeoutInMicroseconds - Timeout in Microseconds.
345345
* @return error code or 0 (success)
346346
*/
347-
typedef LibMCDriver_RaylaseResult (*PLibMCDriver_RaylaseRaylaseCycle_AddWaitForSignalPtr) (LibMCDriver_Raylase_RaylaseCycle pRaylaseCycle, LibMCDriver_Raylase::eIOPort eIOPort, LibMCDriver_Raylase_uint32 nIOPin, LibMCDriver_Raylase_uint32 nTimeoutInMicroseconds);
347+
typedef LibMCDriver_RaylaseResult (*PLibMCDriver_RaylaseRaylaseIOCycle_AddWaitForSignalPtr) (LibMCDriver_Raylase_RaylaseIOCycle pRaylaseIOCycle, LibMCDriver_Raylase::eIOPort eIOPort, LibMCDriver_Raylase_uint32 nIOPin, LibMCDriver_Raylase_uint32 nTimeoutInMicroseconds);
348348

349349
/**
350350
* Adds a delay to the list cycle.
351351
*
352-
* @param[in] pRaylaseCycle - RaylaseCycle instance.
352+
* @param[in] pRaylaseIOCycle - RaylaseIOCycle instance.
353353
* @param[in] nDelayInMicroseconds - Delay in Microseconds.
354354
* @return error code or 0 (success)
355355
*/
356-
typedef LibMCDriver_RaylaseResult (*PLibMCDriver_RaylaseRaylaseCycle_AddDelayPtr) (LibMCDriver_Raylase_RaylaseCycle pRaylaseCycle, LibMCDriver_Raylase_uint32 nDelayInMicroseconds);
356+
typedef LibMCDriver_RaylaseResult (*PLibMCDriver_RaylaseRaylaseIOCycle_AddDelayPtr) (LibMCDriver_Raylase_RaylaseIOCycle pRaylaseIOCycle, LibMCDriver_Raylase_uint32 nDelayInMicroseconds);
357357

358358
/*************************************************************************************************************************
359359
Class definition for RaylaseCard
@@ -418,6 +418,45 @@ typedef LibMCDriver_RaylaseResult (*PLibMCDriver_RaylaseRaylaseCard_LaserOnPtr)
418418
*/
419419
typedef LibMCDriver_RaylaseResult (*PLibMCDriver_RaylaseRaylaseCard_GetNLightDriverBoardPtr) (LibMCDriver_Raylase_RaylaseCard pRaylaseCard, LibMCDriver_Raylase_NLightDriverBoard * pDriverBoard);
420420

421+
/**
422+
* Creates a new IO cycle with a certain ID. Fails if cycle ID is already existing..
423+
*
424+
* @param[in] pRaylaseCard - RaylaseCard instance.
425+
* @param[in] nCycleID - Cycle ID to use. MUST NOT be 0.
426+
* @param[out] pIOCycle - IO Cycle Instance
427+
* @return error code or 0 (success)
428+
*/
429+
typedef LibMCDriver_RaylaseResult (*PLibMCDriver_RaylaseRaylaseCard_CreateIOCyclePtr) (LibMCDriver_Raylase_RaylaseCard pRaylaseCard, LibMCDriver_Raylase_uint32 nCycleID, LibMCDriver_Raylase_RaylaseIOCycle * pIOCycle);
430+
431+
/**
432+
* Returns if a IO cycle exists.
433+
*
434+
* @param[in] pRaylaseCard - RaylaseCard instance.
435+
* @param[in] nCycleID - Cycle ID to return.
436+
* @param[out] pIOCycleDoesExist - Returns true, if IO Cycle exists.
437+
* @return error code or 0 (success)
438+
*/
439+
typedef LibMCDriver_RaylaseResult (*PLibMCDriver_RaylaseRaylaseCard_IOCycleExistsPtr) (LibMCDriver_Raylase_RaylaseCard pRaylaseCard, LibMCDriver_Raylase_uint32 nCycleID, bool * pIOCycleDoesExist);
440+
441+
/**
442+
* Returns a new cycle. Fails if cycle ID does not exist..
443+
*
444+
* @param[in] pRaylaseCard - RaylaseCard instance.
445+
* @param[in] nCycleID - Cycle ID to return.
446+
* @param[out] pIOCycle - IO Cycle Instance
447+
* @return error code or 0 (success)
448+
*/
449+
typedef LibMCDriver_RaylaseResult (*PLibMCDriver_RaylaseRaylaseCard_GetIOCyclePtr) (LibMCDriver_Raylase_RaylaseCard pRaylaseCard, LibMCDriver_Raylase_uint32 nCycleID, LibMCDriver_Raylase_RaylaseIOCycle * pIOCycle);
450+
451+
/**
452+
* Removes an IO Cycle of a certain ID. Does nothing if IO cycle does not exist..
453+
*
454+
* @param[in] pRaylaseCard - RaylaseCard instance.
455+
* @param[in] nCycleID - Cycle ID to remove.
456+
* @return error code or 0 (success)
457+
*/
458+
typedef LibMCDriver_RaylaseResult (*PLibMCDriver_RaylaseRaylaseCard_RemoveIOCyclePtr) (LibMCDriver_Raylase_RaylaseCard pRaylaseCard, LibMCDriver_Raylase_uint32 nCycleID);
459+
421460
/**
422461
* Turns the laser off.
423462
*
@@ -803,17 +842,21 @@ typedef struct {
803842
PLibMCDriver_RaylaseNLightDriverBoard_IsWaterFlowPtr m_NLightDriverBoard_IsWaterFlow;
804843
PLibMCDriver_RaylaseNLightDriverBoard_SetModeChangeDelaysPtr m_NLightDriverBoard_SetModeChangeDelays;
805844
PLibMCDriver_RaylaseNLightDriverBoard_GetModeChangeDelaysPtr m_NLightDriverBoard_GetModeChangeDelays;
806-
PLibMCDriver_RaylaseRaylaseCycle_GetCycleIDPtr m_RaylaseCycle_GetCycleID;
807-
PLibMCDriver_RaylaseRaylaseCycle_AddSignalOutPtr m_RaylaseCycle_AddSignalOut;
808-
PLibMCDriver_RaylaseRaylaseCycle_AddWaitForSignalPtr m_RaylaseCycle_AddWaitForSignal;
809-
PLibMCDriver_RaylaseRaylaseCycle_AddDelayPtr m_RaylaseCycle_AddDelay;
845+
PLibMCDriver_RaylaseRaylaseIOCycle_GetCycleIDPtr m_RaylaseIOCycle_GetCycleID;
846+
PLibMCDriver_RaylaseRaylaseIOCycle_AddSignalOutPtr m_RaylaseIOCycle_AddSignalOut;
847+
PLibMCDriver_RaylaseRaylaseIOCycle_AddWaitForSignalPtr m_RaylaseIOCycle_AddWaitForSignal;
848+
PLibMCDriver_RaylaseRaylaseIOCycle_AddDelayPtr m_RaylaseIOCycle_AddDelay;
810849
PLibMCDriver_RaylaseRaylaseCard_IsConnectedPtr m_RaylaseCard_IsConnected;
811850
PLibMCDriver_RaylaseRaylaseCard_ResetToSystemDefaultsPtr m_RaylaseCard_ResetToSystemDefaults;
812851
PLibMCDriver_RaylaseRaylaseCard_EnableCommandLoggingPtr m_RaylaseCard_EnableCommandLogging;
813852
PLibMCDriver_RaylaseRaylaseCard_DisableCommandLoggingPtr m_RaylaseCard_DisableCommandLogging;
814853
PLibMCDriver_RaylaseRaylaseCard_RetrieveLatestLogPtr m_RaylaseCard_RetrieveLatestLog;
815854
PLibMCDriver_RaylaseRaylaseCard_LaserOnPtr m_RaylaseCard_LaserOn;
816855
PLibMCDriver_RaylaseRaylaseCard_GetNLightDriverBoardPtr m_RaylaseCard_GetNLightDriverBoard;
856+
PLibMCDriver_RaylaseRaylaseCard_CreateIOCyclePtr m_RaylaseCard_CreateIOCycle;
857+
PLibMCDriver_RaylaseRaylaseCard_IOCycleExistsPtr m_RaylaseCard_IOCycleExists;
858+
PLibMCDriver_RaylaseRaylaseCard_GetIOCyclePtr m_RaylaseCard_GetIOCycle;
859+
PLibMCDriver_RaylaseRaylaseCard_RemoveIOCyclePtr m_RaylaseCard_RemoveIOCycle;
817860
PLibMCDriver_RaylaseRaylaseCard_LaserOffPtr m_RaylaseCard_LaserOff;
818861
PLibMCDriver_RaylaseRaylaseCard_ArmLaserPtr m_RaylaseCard_ArmLaser;
819862
PLibMCDriver_RaylaseRaylaseCard_IsLaserArmedPtr m_RaylaseCard_IsLaserArmed;

0 commit comments

Comments
 (0)