osapi-os-timer.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /*
  2. ** File: osapi-os-timer.h
  3. **
  4. ** Copyright (c) 2004-2006, United States government as represented by the
  5. ** administrator of the National Aeronautics Space Administration.
  6. ** All rights reserved. This software was created at NASAs Goddard
  7. ** Space Flight Center pursuant to government contracts.
  8. **
  9. ** This is governed by the NASA Open Source Agreement and may be used,
  10. ** distributed and modified only pursuant to the terms of that agreement.
  11. **
  12. ** Author: Alan Cudmore - Code 582
  13. **
  14. ** Purpose: Contains functions prototype definitions and variable declarations
  15. ** for the OS Abstraction Layer, Timer API
  16. **
  17. ** $Revision: 1.5 $
  18. **
  19. ** $Date: 2013/07/25 10:02:20GMT-05:00 $
  20. **
  21. ** $Log: osapi-os-timer.h $
  22. ** Revision 1.5 2013/07/25 10:02:20GMT-05:00 acudmore
  23. ** removed circular include "osapi.h"
  24. ** Revision 1.4 2010/11/12 12:00:19GMT-05:00 acudmore
  25. ** replaced copyright character with (c) and added open source notice where needed.
  26. ** Revision 1.3 2010/02/01 12:38:34EST acudmore
  27. ** Added return code to OS_TimerAPIInit
  28. ** Revision 1.2 2008/08/26 13:52:52EDT apcudmore
  29. ** removed linux specific define
  30. ** Revision 1.1 2008/08/20 16:12:07EDT apcudmore
  31. ** Initial revision
  32. ** Member added to project c:/MKSDATA/MKS-REPOSITORY/MKS-OSAL-REPOSITORY/src/os/inc/project.pj
  33. **
  34. **
  35. */
  36. #ifndef _osapi_timer_
  37. #define _osapi_timer_
  38. /*
  39. ** Typedefs
  40. */
  41. typedef void (*OS_TimerCallback_t)(uint32 timer_id);
  42. typedef struct
  43. {
  44. char name[OS_MAX_API_NAME];
  45. uint32 creator;
  46. uint32 start_time;
  47. uint32 interval_time;
  48. uint32 accuracy;
  49. } OS_timer_prop_t;
  50. /*
  51. ** Timer API
  52. */
  53. int32 OS_TimerAPIInit (void);
  54. int32 OS_TimerCreate (uint32 *timer_id, const char *timer_name, uint32 *clock_accuracy, OS_TimerCallback_t callback_ptr);
  55. int32 OS_TimerSet (uint32 timer_id, uint32 start_msec, uint32 interval_msec);
  56. int32 OS_TimerDelete (uint32 timer_id);
  57. int32 OS_TimerGetIdByName (uint32 *timer_id, const char *timer_name);
  58. int32 OS_TimerGetInfo (uint32 timer_id, OS_timer_prop_t *timer_prop);
  59. #endif