William Kane / Generic

Dependents:   LaserioLib

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers sync_obj.h Source File

sync_obj.h

00001 /*******************************************************************************
00002 ********************************************************************************
00003 **                                                                            **
00004 ** ABCC Starter Kit version 2.01.01 (2015-12-14)                              **
00005 **                                                                            **
00006 ** Delivered with:                                                            **
00007 **    ABCC Driver 4.01.01 (2015-12-14)                                        **
00008 **    ABP         7.16.01 (2015-10-14)                                        **
00009 **                                                                            */
00010 /*******************************************************************************
00011 ********************************************************************************
00012 ** COPYRIGHT NOTIFICATION (c) 2015 HMS Industrial Networks AB                 **
00013 **                                                                            **
00014 ** This code is the property of HMS Industrial Networks AB.                   **
00015 ** The source code may not be reproduced, distributed, or used without        **
00016 ** permission. When used together with a product from HMS, permission is      **
00017 ** granted to modify, reproduce and distribute the code in binary form        **
00018 ** without any restrictions.                                                  **
00019 **                                                                            **
00020 ** THE CODE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. HMS DOES NOT    **
00021 ** WARRANT THAT THE FUNCTIONS OF THE CODE WILL MEET YOUR REQUIREMENTS, OR     **
00022 ** THAT THE OPERATION OF THE CODE WILL BE UNINTERRUPTED OR ERROR-FREE, OR     **
00023 ** THAT DEFECTS IN IT CAN BE CORRECTED.                                       **
00024 ********************************************************************************
00025 ********************************************************************************
00026 ** Sync Object 0xEE - Public interfaces
00027 ********************************************************************************
00028 ********************************************************************************
00029 ** Services:
00030 **    SYNC_GetCycleTime()            - Returns the set cycle time
00031 **    SYNC_GetInputCaptureTime()     - Returns the set input capture time
00032 **    SYNC_GetMode()                 - Returns the set sync mode
00033 **    SYNC_GetOutputValidTime()      - Returns the set output valid time
00034 **    SYNC_ProcessCmdMsg()           - Processes a message addressed to this
00035 **                                     object
00036 **    SYNC_SetInputProcessingTime()  - Set the input processing time
00037 **    SYNC_SetMinCycleTime()         - Set the minimum allowed cycle time
00038 **    SYNC_SetOutputProcessingTime() - Set the output processing time
00039 ********************************************************************************
00040 ********************************************************************************
00041 */
00042 #ifndef SYNC_OBJ_H
00043 #define SYNC_OBJ_H
00044 
00045 #include "abcc_td.h"
00046 #include "abp.h"
00047 #include "abcc_ad_if.h"
00048 
00049 
00050 /*******************************************************************************
00051 ** Typedefs
00052 ********************************************************************************
00053 */
00054 
00055 /*------------------------------------------------------------------------------
00056 ** Structure describing the sync modes of attribute 7, 'Sync mode'.
00057 **------------------------------------------------------------------------------
00058 */
00059 typedef enum SYNC_SyncMode
00060 {
00061    SYNC_MODE_NONSYNCHRONOUS = 0,
00062    SYNC_MODE_SYNCHRONOUS = 1
00063 }
00064 SYNC_SyncModeType;
00065 
00066 /*******************************************************************************
00067 ** Public Services
00068 ********************************************************************************
00069 */
00070 
00071 /*------------------------------------------------------------------------------
00072 ** Get the currently configured cycle time
00073 **------------------------------------------------------------------------------
00074 ** Arguments:
00075 **    None
00076 **
00077 ** Returns:
00078 **    Cycle time in nanoseconds
00079 **------------------------------------------------------------------------------
00080 */
00081 EXTFUNC UINT32 SYNC_GetCycleTime( void );
00082 
00083 /*------------------------------------------------------------------------------
00084 ** Get the currently configured input capture time
00085 **------------------------------------------------------------------------------
00086 ** Arguments:
00087 **    None
00088 **
00089 ** Returns:
00090 **    Input capture time in nanoseconds
00091 **------------------------------------------------------------------------------
00092 */
00093 EXTFUNC UINT32 SYNC_GetInputCaptureTime( void );
00094 
00095 /*------------------------------------------------------------------------------
00096 ** Get the currently configured sync mode
00097 **------------------------------------------------------------------------------
00098 ** Arguments:
00099 **    None
00100 **
00101 ** Returns:
00102 **    Sync mode of type SYNC_SyncModeType.
00103 **------------------------------------------------------------------------------
00104 */
00105 EXTFUNC SYNC_SyncModeType SYNC_GetMode( void );
00106 
00107 /*------------------------------------------------------------------------------
00108 ** Get the currently configured output valid time
00109 **------------------------------------------------------------------------------
00110 ** Arguments:
00111 **    None
00112 **
00113 ** Returns:
00114 **    Output valid time in nanoseconds
00115 **------------------------------------------------------------------------------
00116 */
00117 EXTFUNC UINT32 SYNC_GetOutputValidTime( void );
00118 
00119 /*------------------------------------------------------------------------------
00120 ** Process an object request against the SYNC Object.
00121 **------------------------------------------------------------------------------
00122 ** Arguments:
00123 **    psMsgBuffer      - Pointer to ABCC command message.
00124 **
00125 ** Returns:
00126 **    None
00127 **------------------------------------------------------------------------------
00128 */
00129 EXTFUNC void SYNC_ProcessCmdMsg( ABP_MsgType* psNewMessage );
00130 
00131 /*------------------------------------------------------------------------------
00132 ** Updates the input processing time reported to the ABCC upon request.
00133 ** This value may be changed in runtime to reflect the timing required for the
00134 ** current process data map.
00135 **------------------------------------------------------------------------------
00136 ** Arguments:
00137 **    lInputProcTimeNs - Input processing time in nanoseconds
00138 **
00139 ** Returns:
00140 **    None
00141 **------------------------------------------------------------------------------
00142 */
00143 EXTFUNC void SYNC_SetInputProcessingTime( UINT32 lInputProcTimeNs );
00144 
00145 /*------------------------------------------------------------------------------
00146 ** Updates the minimum cycle time reported to the ABCC upon request.
00147 ** This value may be changed in runtime to reflect the timing required for the
00148 ** current process data map.
00149 **------------------------------------------------------------------------------
00150 ** Arguments:
00151 **    lMinCycleTimeNs - Minimum cycle time in nanoseconds
00152 **
00153 ** Returns:
00154 **    None
00155 **------------------------------------------------------------------------------
00156 */
00157 EXTFUNC void SYNC_SetMinCycleTime( UINT32 lMinCycleTimeNs );
00158 
00159 /*------------------------------------------------------------------------------
00160 ** Updates the output processing time reported to the ABCC upon request.
00161 ** This value may change in runtime to reflect the timing required for the
00162 ** current process data map.
00163 **------------------------------------------------------------------------------
00164 ** Arguments:
00165 **    lOutputProcTimeNs - Output processing time in nanoseconds
00166 **
00167 ** Returns:
00168 **    None
00169 **------------------------------------------------------------------------------
00170 */
00171 EXTFUNC void SYNC_SetOutputProcessingTime( UINT32 lOutputProcTimeNs );
00172 
00173 #endif