f

Dependencies:   ST_INTERFACES X_NUCLEO_COMMON

Fork of X_NUCLEO_IHM01A1 by ST

Files at this revision

API Documentation at this revision

Comitter:
Davidroid
Date:
Thu Sep 08 12:38:35 2016 +0000
Parent:
26:fd83fecf1ef5
Child:
28:f6093f7cdc09
Commit message:
Initialization function updated.

Changed in this revision

Components/l6474/l6474.h Show annotated file Show diff for this revision Revisions of this file
Components/l6474/l6474_class.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/Components/l6474/l6474.h	Fri Apr 08 12:47:39 2016 +0000
+++ b/Components/l6474/l6474.h	Thu Sep 08 12:38:35 2016 +0000
@@ -450,17 +450,17 @@
  *----------------------------------------------------------------------------*/
 typedef struct
 {
-  /* Acceleration rate in step/s2. Range: (0..+inf). */
-  int acceleration_step_s2;
+  /* Acceleration rate in pps^2. Range: (0..+inf). */
+  int acceleration_pps_2;
 
-  /* Deceleration rate in step/s2. Range: (0..+inf). */
-  int deceleration_step_s2;
+  /* Deceleration rate in pps^2. Range: (0..+inf). */
+  int deceleration_pps_2;
 
-  /* Maximum speed in step/s. Range: (30..10000]. */
-  int maximum_speed_step_s;
+  /* Maximum speed in pps. Range: (30..10000]. */
+  int maximum_speed_pps;
 
-  /* Minimum speed in step/s. Range: [30..10000). */
-  int minimum_speed_step_s;
+  /* Minimum speed in pps. Range: [30..10000). */
+  int minimum_speed_pps;
 
   /* Torque regulation current in mA. Range: 31.25mA to 4000mA. */
   float torque_regulation_current_mA;
--- a/Components/l6474/l6474_class.cpp	Fri Apr 08 12:47:39 2016 +0000
+++ b/Components/l6474/l6474_class.cpp	Thu Sep 08 12:38:35 2016 +0000
@@ -1149,6 +1149,10 @@
                     (uint16_t) init->slew_rate |
                     (uint16_t) init->target_swicthing_period
                     );
+  L6474_SetAcceleration((uint16_t) init->acceleration_pps_2);
+  L6474_SetDeceleration((uint16_t) init->deceleration_pps_2);
+  L6474_SetMaxSpeed((uint16_t) init->maximum_speed_pps);
+  L6474_SetMinSpeed((uint16_t) init->minimum_speed_pps);
 }
 
 /**********************************************************