libsting
Step Timing and INformation Gathering Library
|
Functions | |
STING_CTX | sting_init (STING_CALLBACK cb_op, st_relmv_t step_buffer, st_relmv_t minimum_move, unsigned steps_per_sec) |
Initialize libsting session and start working threads. More... | |
STING_STATUS | sting_terminate (STING_CTX ctx) |
Terminate libsting session. Terminate any running threads and deallocate all resources. More... | |
STING_ACT | sting_act_register (STING_CTX ctx, void *data) |
Allocate a new actuator resource, and associate with client-supplied data. More... | |
STING_ACT | sting_act_find (STING_CTX ctx, void *data) |
Find an actuator resource based on the application data pointer provided to sting_act_register. More... | |
STING_ACT | sting_act_get (STING_CTX ctx, void *data) |
Find an actuator resource based on the application data pointer provided to sting_act_register, allocating it with minimal/default details if necessary. More... | |
STING_STATUS | sting_act_move_relative (STING_CTX ctx, STING_ACT actuator, st_relmv_t distance) |
Move an actuator a given distance from its current location. More... | |
const char * | sting_get_status_uilabel (STING_STATUS stat) |
Find the descriptive string associated with a libsting status code. More... | |
Find an actuator resource based on the application data pointer provided to sting_act_register.
Note that the client data pointer is optional when calling sting_act_register(). If not provided, then sting_act_find() will not be usable.
ctx | libsting context handle |
data | Pointer to client data associated with actuator |
Find an actuator resource based on the application data pointer provided to sting_act_register, allocating it with minimal/default details if necessary.
Note that the client data pointer is optional when calling sting_act_register(). If not provided, then sting_act_get() will not be usable.
ctx | libsting context handle |
data | Pointer to client data associated with actuator |
STING_STATUS sting_act_move_relative | ( | STING_CTX | ctx, |
STING_ACT | actuator, | ||
st_relmv_t | distance | ||
) |
Move an actuator a given distance from its current location.
ctx | libsting context handle. |
actuator | Actuator to move. |
distance | Distance to move. |
Allocate a new actuator resource, and associate with client-supplied data.
sting_act_register() creates a definition of an actuator within libsting, and provides the application data (opaque to libsting) that will be necessary to operate the motor. This application data is provided back to the application during operation callbacks.
ctx | libsting context handle. |
data | Opaque pointer to data structure for libsting to associate with actuator. |
const char* sting_get_status_uilabel | ( | STING_STATUS | stat | ) |
Find the descriptive string associated with a libsting status code.
Use sting_get_status_uilabel() to provide status messages in an application user interface, or for logging errors in a human-readable representation.
stat | Status code from a libsting API function. |
STING_CTX sting_init | ( | STING_CALLBACK | cb_op, |
st_relmv_t | step_buffer, | ||
st_relmv_t | minimum_move, | ||
unsigned | steps_per_sec | ||
) |
Initialize libsting session and start working threads.
Applications should call sting_init() once to initialize the library and obtain a context handle for all subsequent API calls. Generally this should only be done once; multiple concurrent sessions are not required (and not well tested).
cb_op | Pointer to user-supplied callback for executing hardware-dependent operations. |
step_buffer | Number of actuator steps to "buffer" before thermal rate limits begin. |
minimum_move | Minimum number of steps for a single move request, unless number of remaining steps in a requested movement is less. |
steps_per_sec | Overall maximum average rate of travel to maintain thermal equilibrium. |
STING_STATUS sting_terminate | ( | STING_CTX | ctx | ) |
Terminate libsting session. Terminate any running threads and deallocate all resources.
Applications must call sting_terminate() prior to exit.
ctx | libsting context handle, invalid after sting_terminate() returns |