para el ventilador

Dependencies:   QEI FastPWM

Revision:
1:aa5df1878126
Parent:
0:9d0b9785d3d6
Child:
2:6f618b905d4f
--- a/project_defines.h	Sat Apr 11 22:53:05 2020 +0000
+++ b/project_defines.h	Thu Apr 16 13:02:36 2020 +0000
@@ -29,7 +29,7 @@
 #define STEPPER_PULSE_PIN                       PC_8
 #define STEPPER_ENABLE_PIN                      PC_6
 #define STEPPER_DIRECTION_PIN                   PC_5
-
+#define STEPPER_PULSE_FEEDBACK_PIN              PA_12
 
 
 /* Constants and macros */
@@ -76,9 +76,33 @@
 #define AIR_INPUT                               0
 #define OXYGEN_INPUT                            1
 
-/* System default state */
-#define SYSTEM_DEFAULT_STATE                    Main_Screen_Cursor_Disable
+
+#define MAIN_SCREEN_DEFAULT_STATE                       Main_Screen_Cursor_Disable
+
+/* Defines for the stepper motor control */ 
+
 
+#define TO_HOME                                         0
+#define TO_AIRBAG                                       1
+#define STEPPER_ENABLED                                 0
+#define STEPPER_DISABLED                                1                                 
+                
+#define STEPPER_DRIVER_PULSE_MIN_PERIOD_US              100     
+#define STEPPER_DRIVER_PULSE_HOME_PERIOD_US             1000  
+#define STEPPER_DRIVER_DEFAULT_PULSE_PERIOD_US          1000  
+ 
+#define STEPPER_DRIVER_MAX_PULSES                       6000 // Limite de pasos cuando no encuentra el sensor    
+#define STEPPER_DRIVER_MIN_PULSES                       (2*RAMP_STEPS + 2)
+#define STEPPER_DRIVER_INSPIRATION_PULSES_DEFAULT       2000
+   
+#define STEPPER_DRIVER_DEFAULT_STATE                    Stepper_Driver_Home_Ramp
+
+#define STEPPER_CALIBRATION_FREQUENCY_HZ                200
+#define STEPPER_START_BRAKE_FREQUENCY_HZ                100 
+
+// Number of steps used for the speed ramp, can be either 50 or 100  
+#define RAMP_STEPS                                      50
+#define STEPPER_START_BRAKE_PERIOD_US                   (1000000.0/STEPPER_START_BRAKE_FREQUENCY_HZ)
 
 
 #endif
\ No newline at end of file