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