libsting
Step Timing and INformation Gathering Library
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
API Types
Collaboration diagram for API Types:

Data Structures

struct  st_cb_operation_t
 

Typedefs

typedef void * STING_CTX
 Opaque handle to primary resources allocated for a libsting usage session. More...
 
typedef int32_t STING_ACT
 
typedef uint32_t stcb_opvalue_t
 
typedef STING_OPERATION_RESULT(* STING_CALLBACK )(st_cb_operation_t *p_op, void *data)
 Callback to provide arbitrary hardware operational capability to libsting. More...
 
typedef uint32_t st_pos_t
 
typedef int32_t st_relmv_t
 

Enumerations

enum  STING_CB_OP_TYPE {
  ST_OPTYPE_NONE = 0, ST_OPTYPE_MVABS = 1, ST_OPTYPE_MVUP = 2, ST_OPTYPE_MVDN = 3,
  ST_OPTYPE_GETPOS = 4, ST_OPTYPE_SETPOS = 5, ST_OPTYPE_FINDLIMIT = 6
}
 
enum  STING_FINDLIMIT_TYPE { STFLT_HOME = 0, STFLT_LOWER = 2, STFLT_UPPER = 3 }
 
enum  STING_OPERATION_RESULT {
  ST_OPRES_SUCCESS = 0, ST_OPRES_LIMIT = 1, ST_OPRES_ERROR = 2, ST_OPRES_ABORT = 3,
  ST_OPRES_TIMEOUT = 4
}
 Return type for user callbacks. More...
 
enum  STING_STATUS {
  STING_ST_SUCCESS = 0, STING_ST_ABORT = 1, STING_ST_ERR_BADCTX = -1, STING_ST_ERR_UNKNOWN = -2,
  STING_ST_ERR_CALLBACKFAIL = -3, STING_ST_ERR_BADPARAM = -4, STING_ST_ERR_INVALID_STATE = -5, STING_ST_ERR_OP_PENDING = -6
}
 

Detailed Description

Typedef Documentation

typedef uint32_t st_pos_t

Motor position value.

typedef int32_t st_relmv_t

Motor relative move distance. Negative values indicate a "downward" move.

typedef uint32_t stcb_opvalue_t

Value associated with an actuator operation, eg. a distance value for a move

typedef int32_t STING_ACT

Opaque handle to an actuator to be controlled by libsting.

typedef STING_OPERATION_RESULT(* STING_CALLBACK)(st_cb_operation_t *p_op, void *data)

Callback to provide arbitrary hardware operational capability to libsting.

Applications must implement this function to perform fundamental operations requested by libsting, and supply its pointer to sting_init(). A definition of the operation requested by libsting is provided, plus an opaque data pointer previously provided to libsting at the registration of the actuator. The application must return a STING_OPERATION_RESULT value indicating the result of the operation.

typedef void* STING_CTX

Opaque handle to primary resources allocated for a libsting usage session.

Applications must obtain this handle from sting_init(), and destroy it with sting_terminate().

Enumeration Type Documentation

Callback Operation Type. To be provided to a client application callback, to communicate the operation libsting requests for an actuator.

Enumerator
ST_OPTYPE_NONE 

No-op by default; require explicit setting of operation

ST_OPTYPE_MVABS 

Move to absolute position

ST_OPTYPE_MVUP 

Relative move UP

ST_OPTYPE_MVDN 

Relative move DOWN

ST_OPTYPE_GETPOS 

Get position from controller hardware

ST_OPTYPE_SETPOS 

Overwrite position in controller hardware

ST_OPTYPE_FINDLIMIT 

Command hardware to home or find limit

Type of limit-finding operation.

Enumerator
STFLT_HOME 

Find lower limit and then set location to zero.

STFLT_LOWER 

Find lower limit.

STFLT_UPPER 

Find upper limit.

Return type for user callbacks.

Applications must return a value of this type from their implementation of STING_CALLBACK, to inform libsting of the result of the requested operation.

Enumerator
ST_OPRES_SUCCESS 

Operation successfully completed

ST_OPRES_LIMIT 

Movement operation partially successful, movement occurred but limit encountered

ST_OPRES_ERROR 

Operation encountered a non-specified error

ST_OPRES_ABORT 

Operation aborted by user

ST_OPRES_TIMEOUT 

Operation timed out

Return value from a libsting API function.

Enumerator
STING_ST_SUCCESS 

Operation completed successfully, no error.

STING_ST_ABORT 

Operation aborted due to user intervention or shutdown.

STING_ST_ERR_BADCTX 

Invalid libsting session context provided.

STING_ST_ERR_UNKNOWN 

Unknown error.

STING_ST_ERR_CALLBACKFAIL 

Client-provided callback function failed to complete.

STING_ST_ERR_BADPARAM 

Bad/invalid parameter value provided.

STING_ST_ERR_INVALID_STATE 

Session in invalid state, could not complete operation.

STING_ST_ERR_OP_PENDING 

Operation pending.