osObjects.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*----------------------------------------------------------------------------
  2. * osObjects.h: CMSIS-RTOS global object definitions for an application
  3. *----------------------------------------------------------------------------
  4. *
  5. * This header file defines global RTOS objects used throughout a project
  6. *
  7. * #define osObjectsPublic indicates that objects are defined; without that
  8. * definition the objects are defined as external symbols.
  9. *
  10. *--------------------------------------------------------------------------*/
  11. #ifndef __osObjects
  12. #define __osObjects
  13. #if (!defined (osObjectsPublic))
  14. #define osObjectsExternal // define RTOS objects with extern attribute
  15. #endif
  16. #include "cmsis_os.h" // CMSIS RTOS header file
  17. // global 'thread' functions ---------------------------------------------------
  18. /*
  19. Example:
  20. extern void sample_name (void const *argument); // thread function
  21. osThreadId tid_sample_name; // thread id
  22. osThreadDef (sample_name, osPriorityNormal, 1, 0); // thread object
  23. */
  24. // global 'semaphores' ----------------------------------------------------------
  25. /*
  26. Example:
  27. osSemaphoreId sid_sample_name; // semaphore id
  28. osSemaphoreDef (sample_name); // semaphore object
  29. */
  30. // global 'memory pools' --------------------------------------------------------
  31. /*
  32. Example:
  33. typedef struct sample_name type_sample_name; // object data type
  34. osPoolId mpid_sample_name; // memory pool id
  35. osPoolDef (sample_name, 16, type_sample_name); // memory pool object
  36. */
  37. // global 'message queues' -------------------------------------------------------
  38. /*
  39. Example:
  40. typedef struct sample_name type_sample_name; // object data type
  41. osMessageQId mid_sample_name; // message queue id
  42. osMessageQDef (sample_name, 16, type_sample_name); // message queue object
  43. */
  44. // global 'mail queues' ----------------------------------------------------------
  45. /*
  46. Example:
  47. typedef struct sample_name type_sample_name; // object data type
  48. osMailQId qid_sample_name; // mail queue id
  49. osMailQDef (sample_name, 16, type_sample_name); // mail queue object
  50. */
  51. #endif // __osObjects