cmsis_rtthread.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /*
  2. * Copyright (c) 2006-2021, RT-Thread Development Team
  3. * Copyright (c) 2023 HPMicro
  4. *
  5. * SPDX-License-Identifier: Apache-2.0
  6. *
  7. * Change Logs:
  8. * Date Author Notes
  9. * 2018-04-12 misonyo the first version
  10. * 2023-12-18 zhihongchen change flags type from uint8_t to uint32_t
  11. */
  12. #ifndef __RTTHREAD_OS2_H__
  13. #define __RTTHREAD_OS2_H__
  14. #include <rtthread.h>
  15. #include <cmsis_os2.h>
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19. typedef struct
  20. {
  21. rt_uint32_t flags;
  22. struct rt_thread thread;
  23. rt_sem_t joinable_sem; ///< semaphore for joinable thread
  24. rt_uint32_t flag_set; ///< thread flag set
  25. rt_uint32_t prio;
  26. }thread_cb_t;
  27. typedef struct
  28. {
  29. rt_uint32_t flags;
  30. struct rt_timer timer;
  31. }timer_cb_t;
  32. #ifdef RT_USING_EVENT
  33. typedef struct
  34. {
  35. rt_uint32_t flags;
  36. struct rt_event event;
  37. }event_cb_t;
  38. #endif
  39. #ifdef RT_USING_MUTEX
  40. typedef struct
  41. {
  42. rt_uint32_t flags;
  43. struct rt_mutex mutex;
  44. }mutex_cb_t;
  45. #endif
  46. #ifdef RT_USING_SEMAPHORE
  47. typedef struct
  48. {
  49. rt_uint32_t flags;
  50. struct rt_semaphore sem;
  51. }sem_cb_t;
  52. #endif
  53. #ifdef RT_USING_MEMPOOL
  54. typedef struct
  55. {
  56. rt_uint32_t flags;
  57. struct rt_mempool mp;
  58. }mempool_cb_t;
  59. #endif
  60. #ifdef RT_USING_MESSAGEQUEUE
  61. typedef struct
  62. {
  63. rt_uint32_t init_msg_size;
  64. rt_uint32_t flags;
  65. struct rt_messagequeue mq;
  66. }mq_cb_t;
  67. #endif
  68. #ifdef __cplusplus
  69. }
  70. #endif
  71. #endif