You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

80 line
2.4 KiB

  1. /*******************************************************************************
  2. * *
  3. * Copyright 2010 Rheinmetall Canada Inc. *
  4. * *
  5. * No part of this document may be reproduced, stored in *
  6. * a retrieval system, or transmitted, in any form or by any means, *
  7. * electronic, mechanical, photocopying, recording, or otherwise, *
  8. * without the prior written permission of Rheinmetall Canada Inc. *
  9. * *
  10. *******************************************************************************/
  11. /*
  12. Description:
  13. This is a template file for standard C header file.
  14. */
  15. /* ************************************************************************** */
  16. /* Revision:
  17. 000 20100616 HCAM
  18. Original version.
  19. ### YYYYMMDD Initial, Bug Identification
  20. Change description.
  21. */
  22. #ifndef TIMER_H
  23. #define TIMER_H
  24. /* ************************************************************************** */
  25. /* Includes */
  26. #include "define.h"
  27. /* ************************************************************************** */
  28. /* Defines */
  29. /* ************************************************************************** */
  30. /* Type definitions */
  31. typedef enum
  32. {
  33. HEARTBEAT_LED_TMR = 0,
  34. SLEEP_FCN_TIMER,
  35. WIFI_RECONNECT_TIMER,
  36. WIFI_TICK_TIMER,
  37. SYSLOG_TX_TIMER,
  38. BOOTLOADER_FLASH_POLL_TIMER,
  39. BUREAU_VOLUME_TRANSDUCER_TIMER,
  40. CUISINE_VOLUME_TRANSDUCER_TIMER,
  41. TIMER_MAX_ID
  42. }eTimerID;
  43. typedef struct
  44. {
  45. unsigned int uiStart;
  46. unsigned int uiMillisecCounter;
  47. unsigned int uiSecondCounter;
  48. unsigned int uiPeriodMillisec;
  49. unsigned int uiPeriodSecond;
  50. bool bRunning;
  51. } stTimer;
  52. /* ************************************************************************** */
  53. /* Prototypes */
  54. void TimerInit(void);
  55. int IsMilliSecTimerExpired(eTimerID p_eTimerID);
  56. int IsSecTimerExpired(eTimerID p_eTimerID);
  57. int IsTimerExpired(eTimerID p_eTimerID);
  58. void TimerStart(eTimerID p_eTimerID, unsigned int p_uiPeriod);
  59. void TimerStartSeconds(eTimerID p_eTimerID, unsigned int p_uiPeriod);
  60. void TimerStop(eTimerID p_eTimerID);
  61. void TimerReset(eTimerID p_eTimerID);
  62. bool IsTimerRunning(eTimerID p_eTimerID);
  63. void Sleep(unsigned int millisecs);
  64. #endif
  65. //EOF