18 You should have received a copy of the GNU Lesser General Public |
18 You should have received a copy of the GNU Lesser General Public |
19 License along with this library; if not, write to the Free Software |
19 License along with this library; if not, write to the Free Software |
20 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
20 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
21 */ |
21 */ |
22 |
22 |
|
23 /** @defgroup timer Timer Management |
|
24 * @ingroup userapi |
|
25 */ |
|
26 |
23 #ifndef __timer_driver_h__ |
27 #ifndef __timer_driver_h__ |
24 #define __timer_driver_h__ |
28 #define __timer_driver_h__ |
25 |
29 |
26 #include "timerscfg.h" |
30 #include "timerscfg.h" |
27 #include "timer.h" |
31 #include "timer.h" |
28 /*void initTimer();*/ |
|
29 |
32 |
30 // For use from CAN driver |
33 // For use from CAN driver |
|
34 /** |
|
35 * @ingroup timer |
|
36 * @brief Acquire mutex |
|
37 */ |
31 void EnterMutex(void); |
38 void EnterMutex(void); |
|
39 |
|
40 /** |
|
41 * @ingroup timer |
|
42 * @brief Release mutex |
|
43 */ |
32 void LeaveMutex(void); |
44 void LeaveMutex(void); |
33 void WaitReceiveTaskEnd(TASK_HANDLE*); |
45 void WaitReceiveTaskEnd(TASK_HANDLE*); |
34 |
46 |
35 // For use from application |
47 /** |
|
48 * @ingroup timer |
|
49 * @brief Initialize Timer |
|
50 * |
|
51 */ |
36 void TimerInit(void); |
52 void TimerInit(void); |
|
53 |
|
54 /** |
|
55 * @ingroup timer |
|
56 * @brief Cleanup Timer |
|
57 */ |
37 void TimerCleanup(void); |
58 void TimerCleanup(void); |
38 void StartTimerLoop(TimerCallback_t); |
59 |
39 void StopTimerLoop(TimerCallback_t); |
60 /** |
40 void CreateReceiveTask(CAN_PORT , TASK_HANDLE* , void* ); |
61 * @ingroup timer |
|
62 * @brief Start the timer task |
|
63 * @param Callback A callback function |
|
64 */ |
|
65 void StartTimerLoop(TimerCallback_t Callback); |
|
66 |
|
67 /** |
|
68 * @ingroup timer |
|
69 * @brief Stop the timer task |
|
70 * @param Callback A callback function |
|
71 */ |
|
72 void StopTimerLoop(TimerCallback_t Callback); |
|
73 /** @} */ |
|
74 |
|
75 /** |
|
76 * @brief Stop the timer task |
|
77 * @param port CanFestival file descriptor |
|
78 * @param *handle handle of receive loop thread |
|
79 * @param *ReceiveLoopPtr Pointer on the receive loop function |
|
80 */ |
|
81 void CreateReceiveTask(CAN_PORT port, TASK_HANDLE* handle, void* ReceiveLoopPtr); |
41 |
82 |
42 #endif |
83 #endif |