stepper_avr.h

Go to the documentation of this file.
00001 
00041 #ifndef DRV_STEPPER_AVR_H
00042 #define DRV_STEPPER_AVR_H
00043 
00044 
00045 #include <cfg/compiler.h>
00046 #include <cfg/macros.h>
00047 
00048 #include <drv/stepper.h>
00049 
00050 #warning TODO:This is an example, you must implement it!
00051 
00055 typedef void (*irq_t)(void);
00056 
00060 typedef struct TimerCounter
00061 {
00062     int timer_id;                  
00063     irq_t isr;                     
00064     stepper_isr_t callback;        
00065     struct Stepper *motor;         
00066 
00067 } TimerCounter;
00068 
00072 INLINE void stepper_tc_irq_enable(struct TimerCounter *timer)
00073 {
00074         /* put here code to enable timer irq */
00075 
00076         //Only for test remove when implement this function
00077         (void)timer;
00078 }
00079 
00080 
00084 INLINE void  stepper_tc_irq_disable(struct TimerCounter *timer)
00085 {
00086         /* put here code to disable timer irq */
00087 
00088         //Only for test remove when implement this function
00089         (void)timer;
00090 }
00091 
00095 INLINE void  stepper_tc_setDelay(struct TimerCounter *timer, stepper_time_t delay)
00096 {
00097         /* put here code to set the delay for next irq */
00098 
00099         //Only for test remove when implement this function
00100         (void)timer;
00101         (void)delay;
00102 }
00103 
00104 
00108 INLINE void  stepper_tc_resetTimer(struct TimerCounter *timer)
00109 {
00110         /* put here code to reset the timer */
00111 
00112         //Only for test remove when implement this function
00113         (void)timer;
00114 }
00115 
00119 INLINE void FAST_FUNC stepper_tc_doPulse(struct TimerCounter *timer)
00120 {
00121         /* put here code to generate a pulse */
00122 
00123         //Only for test remove when implement this function
00124         (void)timer;
00125 }
00126 
00130 INLINE void FAST_FUNC stepper_tc_skipPulse(struct TimerCounter *timer)
00131 {
00132         /* put here code to skip a pulse */
00133 
00134         //Only for test remove when implement this function
00135         (void)timer;
00136 }
00137 
00138 void stepper_tc_setup(int index, stepper_isr_t callback, struct Stepper *motor);
00139 void stepper_tc_init(void);
00140 
00141 #endif /*DRV_STEPPER_AVR_H */