![]() |
LibL6474-C-Library 1.0
Library Code documentation
|
The following code documentation is a set of tips and diagrams as well as function and structure descriptions which help when using the library. It is used to increase the implementation speed. Some examples are attached in this documentation as well
LIBL6474_STEP_ASYNC: This DEFINE is used to switch from blocking synchronous mode to asynchronous non-blocking step mode. This changes the API behavior
LIBL6474_HAS_LOCKING: This DEFINE is used to enable the lock guard and thread synchronization guard abstraction, which requires additional abstraction functions
LIBL6474_DISABLE_OCD: Should only be used for debugging purposes and not for productive code! This DEFINE is used to disable the overcurrent detection feature in the library and the stepper driver
LIBL6474_HAS_FLAG: enables the support of the flag pin This DEFINE is used to enable the FLAG pin support, which requires additional abstraction functions
The following state diagram shows the internal state machine handling which follows or represents the state of the stepper driver chip. The fault conditions are not depicted in the diagram but in all regular cases the error handling is done by resetting and reinitialization of the stepper driver by the library.
The following example shows a part of the abstraction functions which are required for the usage of the Stepper library. It also shows how to create a instance of the stepper library.
The following example shows a really simple instantiation and usage of the library with a simple default and straight forward configuration and no calculation of any step widths or resolutions
The following example shows how to change the phase current (max torque) of the stepper. This can be achieved by reinitializing the library or by changing the parameter by calling L6474_SetProperty;