Davide Aliprandi / X-NUCLEO-IHM05A1

Dependencies:   ST_INTERFACES

Fork of X-NUCLEO-IHM05A1 by ST

Revision:
2:2af31245e67e
Parent:
1:5cc2691ccfff
Child:
3:d566edd8cd34
--- a/Components/l6208/l6208_class.h	Wed Apr 27 16:30:55 2016 +0000
+++ b/Components/l6208/l6208_class.h	Fri Apr 29 14:58:30 2016 +0000
@@ -96,8 +96,8 @@
                                                                                                                                                          vrefB_pwm(vrefB_pwm_pin)
     {
         /* Checking stackability. */
-        if (!(numberOfDevices < MAX_NUMBER_OF_DEVICES))
-            error("Instantiation of the L6208 component failed: it can be stacked up to %d times.\r\n", MAX_NUMBER_OF_DEVICES);
+        if (numberOfDevices!=0)
+            error("Instantiation of the L6208 component failed: it can't be stacked on itself.\r\n");
 
         /* ACTION 4 ----------------------------------------------------------*
          * Initialize here the component's member variables, one variable per *
@@ -663,15 +663,6 @@
     {
         L6208_SetStopMode(stopMode);
     }
-    
-    /**
-     * @brief Public static functions
-     */    
-
-    static uint8_t GetNbDevices(void)
-    {
-        return numberOfDevices;
-    }
    
     /*** Public Interrupt Related Methods ***/
 
@@ -791,6 +782,34 @@
     void L6208_VrefPwmSetFreq(uint32_t newFreq);
     void L6208_WaitWhileActive(void);
     
+    /*** Functions intended to be used only internally ***/
+    
+    void L6208_ClearSysFlag(uint32_t mask);
+    uint32_t L6208_ComputeNbAccOrDecSteps(uint16_t accOrDecRate);
+    uint16_t L6208_ConvertAcceDecelRateValue(uint16_t newAccOrDecRate);
+    void L6208_DoAccel(void);
+    void L6208_DoDecel(void);
+    void L6208_DoRun(void);
+    uint8_t L6208_GetMicrostepSample2Scale(void);
+    void L6208_Indexmodeinit(void);
+    bool L6208_IsSysFlag(uint32_t mask);
+    void L6208_ResetSteps(void);
+    uint32_t L6208_ScaleWaveformSample(uint8_t sampleIndex);
+    void L6208_ScaleWaveformTable(void);
+    void L6208_SetDeviceParamsToGivenValues(l6208_Init_t* pInitDevicePrm);
+    void L6208_SetDeviceParamsToPredefinedValues(void);
+    void L6208_SetMicrostepSample2Scale(uint8_t value);
+    void L6208_SetMicrostepSample2Update(uint8_t value);
+    void L6208_SetMotionState(motorState_t newMotionState);
+    bool L6208_SetSpeed(uint16_t newSpeed, uint32_t volatile *pSpeed);
+    void L6208_SetSysFlag(uint32_t mask);
+    bool L6208_StartMovement(void);
+    void L6208_UpdateScanWaveformTable(void);
+    void L6208_UstepWaveformHandling(void);
+    bool L6208_VectorCalc(uint8_t newTorque);
+    bool L6208_VrefPwmComputePulseWidth(uint8_t bridgeId, uint16_t value, bool valueIsPwmDutyCycle);
+    void L6208_VrefPwmUpdatePulseWidth(void);
+    
     /*** Component's I/O Methods ***/
 
     /* ACTION 8 --------------------------------------------------------------*
@@ -1065,36 +1084,6 @@
         else return false;
         return true;
     }
-    
-private:
-
-    /*** Private Component Related Methods ***/
-
-    void L6208_ClearSysFlag(uint32_t mask);
-    uint32_t L6208_ComputeNbAccOrDecSteps(uint16_t accOrDecRate);
-    uint16_t L6208_ConvertAcceDecelRateValue(uint16_t newAccOrDecRate);
-    void L6208_DoAccel(void);
-    void L6208_DoDecel(void);
-    void L6208_DoRun(void);
-    uint8_t L6208_GetMicrostepSample2Scale(void);
-    void L6208_Indexmodeinit(void);
-    bool L6208_IsSysFlag(uint32_t mask);
-    void L6208_ResetSteps(void);
-    uint32_t L6208_ScaleWaveformSample(uint8_t sampleIndex);
-    void L6208_ScaleWaveformTable(void);
-    void L6208_SetDeviceParamsToGivenValues(l6208_Init_t* pInitDevicePrm);
-    void L6208_SetDeviceParamsToPredefinedValues(void);
-    void L6208_SetMicrostepSample2Scale(uint8_t value);
-    void L6208_SetMicrostepSample2Update(uint8_t value);
-    void L6208_SetMotionState(motorState_t newMotionState);
-    bool L6208_SetSpeed(uint16_t newSpeed, uint32_t volatile *pSpeed);
-    void L6208_SetSysFlag(uint32_t mask);
-    bool L6208_StartMovement(void);
-    void L6208_UpdateScanWaveformTable(void);
-    void L6208_UstepWaveformHandling(void);
-    bool L6208_VectorCalc(uint8_t newTorque);
-    bool L6208_VrefPwmComputePulseWidth(uint8_t bridgeId, uint16_t value, bool valueIsPwmDutyCycle);
-    void L6208_VrefPwmUpdatePulseWidth(void);
 
 protected: