Personal fork of the library for direct control instead of library control

Dependencies:   X_NUCLEO_COMMON

Dependents:   Thesis_Rotating_Platform

Fork of X_NUCLEO_IHM01A1 by Arkadi Rafalovich

Revision:
18:2d6ab2b93685
Parent:
8:42e0b00b1e4d
Child:
22:ed3a6990a6eb
--- a/Components/l6474/l6474.h	Mon Jan 04 15:54:07 2016 +0000
+++ b/Components/l6474/l6474.h	Wed Jan 13 14:35:59 2016 +0000
@@ -435,6 +435,70 @@
   * @}
   */
 
+/** @defgroup Motor_Driver_Initialization_Structure
+  * @{
+  */
+/// Motor driver initialization structure definition  
+typedef struct
+{
+    /* Acceleration rate in step/s2. Range: (0..+inf). */
+    int acceleration_step_s2;
+
+    /* Deceleration rate in step/s2. Range: (0..+inf). */
+    int deceleration_step_s2;
+
+    /* Maximum speed in step/s. Range: (30..10000]. */
+    int maximum_speed_step_s;
+
+    /* Minimum speed in step/s. Range: [30..10000). */
+    int minimum_speed_step_s;
+
+    /* Torque regulation current in mA. Range: 31.25mA to 4000mA. */
+    float torque_regulation_current_mA;
+
+    /* Overcurrent threshold (OCD_TH register). */
+    L6474_OCD_TH_t overcurrent_threshold;
+
+    /* Overcurrent shutwdown (OC_SD field of CONFIG register). */
+    L6474_CONFIG_OC_SD_t overcurrent_shutwdown;
+
+    /* Torque regulation method (EN_TQREG field of CONFIG register). */
+    L6474_CONFIG_EN_TQREG_t torque_regulation_method;
+    
+    /* Step selection (STEP_SEL field of STEP_MODE register). */
+    L6474_STEP_SEL_t step_selection;
+
+    /* Sync selection (SYNC_SEL field of STEP_MODE register). */
+    L6474_SYNC_SEL_t sync_selection;
+
+    /* Fall time value (T_FAST field of T_FAST register). Range: 2us to 32us. */
+    L6474_FAST_STEP_t fall_time;
+
+    /* Maximum fast decay time (T_OFF field of T_FAST register). Range: 2us to 32us. */
+    L6474_TOFF_FAST_t maximum_fast_decay_time;
+
+    /* Minimum ON time in us (TON_MIN register). Range: 0.5us to 64us. */
+    float minimum_ON_time_us;
+
+    /* Minimum OFF time in us (TOFF_MIN register). Range: 0.5us to 64us. */
+    float minimum_OFF_time_us;
+
+    /* Target Swicthing Period (field TOFF of CONFIG register). */
+    L6474_CONFIG_TOFF_t target_swicthing_period;
+
+    /* Slew rate (POW_SR field of CONFIG register). */
+    L6474_CONFIG_POW_SR_t slew_rate;
+
+    /* Clock setting (OSC_CLK_SEL field of CONFIG register). */
+    L6474_CONFIG_OSC_MGMT_t clock;
+
+    /* Alarm (ALARM_EN register). */
+    int alarm;
+} L6474_InitTypeDef;
+/**
+  * @}
+  */
+
 /** 
   * @brief  L6474 driver data structure definition
   */ 
@@ -448,11 +512,14 @@
   bool isrFlag; // = FALSE;
   /// L6474 Device Paramaters structure
   deviceParams_t devicePrm; //[MAX_NUMBER_OF_DEVICES];
-  uint8_t numberOfDevices;
-  uint8_t deviceInstance;
+  uint8_t number_of_devices;
+  uint8_t device_instance;
   uint8_t spiTxBursts[L6474_CMD_ARG_MAX_NB_BYTES][MAX_NUMBER_OF_DEVICES];
   uint8_t spiRxBursts[L6474_CMD_ARG_MAX_NB_BYTES][MAX_NUMBER_OF_DEVICES];
 } L6474_DrvDataTypeDef;
+/**
+  * @}
+  */
 
 
 /* Exported functions --------------------------------------------------------*/