wm_osal.h 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731
  1. /**
  2. * @file wm_osal.h
  3. *
  4. * @brief WM OS adapter layer
  5. *
  6. * @author winnermicro
  7. *
  8. * Copyright (c) 2015 Winner Microelectronics Co., Ltd.
  9. */
  10. #ifndef WM_OSAL_H
  11. #define WM_OSAL_H
  12. #include <stdio.h>
  13. #include <stdlib.h>
  14. #include "wm_config.h"
  15. #include <core_804.h>
  16. #include "wm_type_def.h"
  17. /** OS TICK Frequency ,this value needs to keep the same as OS self-defined tick value*/
  18. extern const unsigned int HZ;
  19. /** Type definition of os_time_t */
  20. typedef long os_time_t;
  21. /** Structure definition of os_time */
  22. struct os_time {
  23. os_time_t sec;
  24. os_time_t usec;
  25. };
  26. /** ENUMERATION of OS */
  27. enum TLS_OS_TYPE{
  28. OS_UCOSII = 0,
  29. OS_FREERTOS = 1,
  30. OS_MAX_NUM
  31. };
  32. /** TYPE definition of OS_STK */
  33. #ifdef OS_STK
  34. #undef OS_STK
  35. #endif
  36. typedef unsigned int OS_STK;
  37. /** TYPE definition of OS_CPU_SR */
  38. #ifdef OS_CPU_SR
  39. #undef OS_CPU_SR
  40. #endif
  41. typedef unsigned int OS_CPU_SR;
  42. /** TYPE definition of tls_os_task_t */
  43. typedef void * tls_os_task_t;
  44. /** TYPE definition of tls_os_timer_t */
  45. typedef void tls_os_timer_t;
  46. /** TYPE definition of tls_os_sem_t */
  47. typedef void tls_os_sem_t;
  48. /** TYPE definition of tls_os_queue_t */
  49. typedef void tls_os_queue_t;
  50. /** TYPE definition of tls_os_mailbox_t */
  51. typedef void tls_os_mailbox_t;
  52. /** TYPE definition of tls_os_mutex_t */
  53. typedef void tls_os_mutex_t;
  54. /** TYPE definition of TLS_OS_TIMER_CALLBACK */
  55. typedef void (*TLS_OS_TIMER_CALLBACK)(void *ptmr, void *parg);
  56. /** MACRO definition of TIMER ONE times */
  57. #define TLS_OS_TIMER_OPT_ONE_SHORT 1u
  58. /** MACRO definition of TIMER PERIOD */
  59. #define TLS_OS_TIMER_OPT_PERIOD 2u
  60. /** ENUMERATION definition of OS STATUS */
  61. typedef enum tls_os_status {
  62. TLS_OS_SUCCESS = 0,
  63. TLS_OS_ERROR,
  64. TLS_OS_ERR_TIMEOUT,
  65. } tls_os_status_t;
  66. /**
  67. * @defgroup System_APIs System APIs
  68. * @brief System APIs
  69. */
  70. /**
  71. * @addtogroup System_APIs
  72. * @{
  73. */
  74. /**
  75. * @defgroup OS_APIs OS APIs
  76. * @brief Operate system APIs
  77. */
  78. /**
  79. * @addtogroup OS_APIs
  80. * @{
  81. */
  82. /**
  83. * @brief This function is used to register OS tick timer irq
  84. *
  85. * @param[in] None
  86. *
  87. * @return None
  88. *
  89. * @note None
  90. */
  91. void tls_os_timer_init(void);
  92. /**
  93. * @brief This function is used to tick handler
  94. *
  95. * @param[in] *p argument
  96. *
  97. * @return None
  98. *
  99. * @note None
  100. */
  101. void tls_os_time_tick(void *p);
  102. /**
  103. * @brief This function is used to initialize OS common resource
  104. *
  105. * @param[in] *arg
  106. *
  107. * @return None
  108. *
  109. * @note None
  110. */
  111. void tls_os_init(void *arg);
  112. /**
  113. * @brief This function is used to start task scheduler
  114. *
  115. * @param[in] None
  116. *
  117. * @return None
  118. *
  119. * @note None
  120. */
  121. void tls_os_start_scheduler(void);
  122. /**
  123. * @brief This function is used to get OS type
  124. *
  125. * @param[in] None
  126. *
  127. * @retval 0 OS_UCOSII
  128. * @retval 1 OS_FREERTOS
  129. *
  130. * @note May not be used by now.
  131. */
  132. int tls_os_get_type(void);
  133. /**
  134. * @brief This function is used to create a task. Tasks can either be created prior to
  135. the start of multitasking or by a running task.
  136. A task cannot be created in an ISR.
  137. *
  138. * @param[in] *task pointer to the task
  139. * @param[in] name the task's name
  140. * @param[in] entry the task's entry function
  141. * @param[in] param pointer to an optional data area which can be
  142. used to pass parameters to the task when the
  143. task first executes. Where the task is
  144. concerned it thinks it was invoked and passed
  145. the argument 'param' as follows:
  146. void Task (void *param)
  147. {
  148. for (;;) {
  149. Task code;
  150. }
  151. }
  152. * @param[in] *stk_start pointer to the task's bottom of stack. Address must be between 0x20000000 and 0x20028000
  153. * @param[in] stk_size the size of the stack in number of elements.
  154. If OS_STK is set to INT8U,
  155. 'stk_size' corresponds to the number of bytes
  156. available.
  157. If OS_STK is set to INT16U, 'stk_size' contains
  158. the number of 16-bit entries available.
  159. Finally, if OS_STK is set to INT32U,
  160. 'stk_size' contains the number of 32-bit entries
  161. available on the stack.
  162. * @param[in] prio the task's priority. A unique priority MUST be
  163. assigned to each task and the lower the number,
  164. the higher the priority.
  165. * @param[in] flag contains additional information about the behavior of the task
  166. *
  167. * @retval TLS_OS_SUCCESS the call was successful.
  168. * @retval TLS_OS_ERROR failed
  169. *
  170. * @note 1) Stack Range: [stk_start, stk_start + stk_size) must be between 0x20000000 and 0x20028000
  171. * 2) task stack: Using static memory like array, not using dynamic memory.
  172. * 3) And if you use static memory like array (large size) as data storage in your application,
  173. * we suggest you change it to dynamic memory by tls_mem_alloc.
  174. */
  175. tls_os_status_t tls_os_task_create(tls_os_task_t *task,
  176. const char* name,
  177. void (*entry)(void* param),
  178. void* param,
  179. u8 *stk_start,
  180. u32 stk_size,
  181. u32 prio,
  182. u32 flag);
  183. /**
  184. * @brief This function allows you to delete a task. The calling
  185. task can delete itself by its own priority number.
  186. The deleted task is returned to the dormant state
  187. and can be re-activated by creating the deleted task
  188. again.
  189. *
  190. * @param[in] prio task priority to delete
  191. * @param[in] (*freefun)(void) function to free resource
  192. *
  193. * @retval TLS_OS_SUCCESS the call is successful
  194. * @retval TLS_OS_ERROR failed
  195. *
  196. * @note Generally, you do not need to call this function in your application.
  197. */
  198. tls_os_status_t tls_os_task_del(u8 prio, void (*freefun)(void));
  199. /**
  200. * @brief This function allows you to delete a task. The calling
  201. task can delete itself by taks's handler.
  202. The deleted task is returned to the dormant state
  203. and can be re-activated by creating the deleted task
  204. again.
  205. *
  206. * @param[in] prio task handler to delete
  207. * @param[in] (*freefun)(void) function to free resource
  208. *
  209. * @retval TLS_OS_SUCCESS the call is successful
  210. * @retval TLS_OS_ERROR failed
  211. *
  212. */
  213. tls_os_status_t tls_os_task_del_by_task_handle(void *handle, void (*freefun)(void));
  214. /**
  215. * @brief This function creates a mutual exclusion semaphore
  216. *
  217. * @param[in] prio the priority to use when accessing the mutual
  218. exclusion semaphore. In other words, when the
  219. semaphore is acquired and a higher priority task
  220. attempts to obtain the semaphore then the
  221. priority of the task owning the semaphore is
  222. raised to this priority. It is assumed that
  223. you will specify a priority that is LOWER in
  224. value than ANY of the tasks competing for the
  225. mutex.
  226. * @param[in] **mutex pointer to the event control clock (OS_EVENT)
  227. associated with the created mutex.
  228. *
  229. * @retval TLS_OS_SUCCESS the call was successful
  230. * @retval TLS_OS_ERROR failed
  231. *
  232. * @note 1) The LEAST significant 8 bits of '.OSEventCnt' are used
  233. to hold the priority number of the task owning the mutex
  234. or 0xFF if no task owns the mutex.
  235. 2) The MOST significant 8 bits of '.OSEventCnt' are used to
  236. hold the priority number to use to reduce priority
  237. inversion.
  238. */
  239. tls_os_status_t tls_os_mutex_create(u8 prio, tls_os_mutex_t **mutex);
  240. /**
  241. * @brief This function deletes a mutual exclusion semaphore and
  242. readies all tasks pending on the it
  243. *
  244. * @param[in] *mutex pointer to the event control block associated
  245. with the desired mutex
  246. *
  247. * @retval TLS_OS_SUCCESS The call was successful and the mutex
  248. was deleted
  249. * @retval TLS_OS_ERROR failed
  250. *
  251. * @note 1) This function must be used with care. Tasks that would
  252. normally expect the presence of the mutex MUST check the
  253. return code of OSMutexPend().
  254. 2) This call can potentially disable interrupts for a long
  255. time. The interrupt disable time is directly
  256. proportional to the number of tasks waiting on the mutex.
  257. 3) Because ALL tasks pending on the mutex will be readied,
  258. you MUST be careful because the resource(s) will no
  259. longer be guarded by the mutex.
  260. 4) IMPORTANT: In the 'OS_DEL_ALWAYS' case, we assume that
  261. the owner of the Mutex (if there is one) is ready-to-run
  262. and is thus NOT pending on another kernel object or has
  263. delayed itself.In other words, if a task owns the mutex
  264. being deleted,that task will be made ready-to-run at
  265. its original priority.
  266. */
  267. tls_os_status_t tls_os_mutex_delete(tls_os_mutex_t *mutex);
  268. /**
  269. * @brief This function waits for a mutual exclusion semaphore
  270. *
  271. * @param[in] *mutex pointer to the event control block
  272. associated with the desired mutex
  273. * @param[in] wait_time an optional timeout period (in clock ticks).
  274. If non-zero, your task will wait for the resource
  275. up to the amount of time specified by
  276. this argument.
  277. If you specify 0, however, your task will wait
  278. forever at the specified mutex or,
  279. until the resource becomes available.
  280. *
  281. * @retval TLS_OS_SUCCESS The call was successful and your task
  282. owns the mutex
  283. * @retval TLS_OS_ERROR failed
  284. *
  285. * @note 1) The task that owns the Mutex MUST NOT pend on
  286. any other event while it owns the mutex.
  287. 2) You MUST NOT change the priority of the task
  288. that owns the mutex
  289. */
  290. tls_os_status_t tls_os_mutex_acquire(tls_os_mutex_t *mutex,
  291. u32 wait_time);
  292. /**
  293. * @brief This function releases a mutual exclusion semaphore
  294. *
  295. * @param[in] *mutex pointer to the event control block
  296. associated with the desired mutex
  297. *
  298. * @retval TLS_OS_SUCCESS The call was successful and the mutex was signaled.
  299. * @retval TLS_OS_ERROR failed
  300. *
  301. * @note None
  302. */
  303. tls_os_status_t tls_os_mutex_release(tls_os_mutex_t *mutex);
  304. /**
  305. * @brief This function creates a semaphore
  306. *
  307. * @param[in] **sem pointer to the event control block (OS_EVENT)
  308. associated with the created semaphore
  309. * @param[in] cnt the initial value for the semaphore.
  310. If the value is 0, no resource is available
  311. (or no event has occurred).
  312. You initialize the semaphore to a non-zero value
  313. to specify how many resources are available
  314. (e.g. if you have 10 resources, you would
  315. initialize the semaphore to 10).
  316. *
  317. * @retval TLS_OS_SUCCESS success,The call was successful
  318. * @retval TLS_OS_ERROR failed
  319. *
  320. * @note None
  321. */
  322. tls_os_status_t tls_os_sem_create(tls_os_sem_t **sem, u32 cnt);
  323. /**
  324. * @brief This function deletes a semaphore and readies all tasks
  325. pending on this semaphore.
  326. *
  327. * @param[in] *sem pointer to the event control block associated
  328. with the desired semaphore
  329. *
  330. * @retval TLS_OS_SUCCESS success
  331. * @retval TLS_OS_ERROR failed
  332. *
  333. * @note None
  334. */
  335. tls_os_status_t tls_os_sem_delete(tls_os_sem_t *sem);
  336. /**
  337. * @brief This function waits for a semaphore
  338. *
  339. * @param[in] *sem pointer to the event control block
  340. associated with the desired semaphore
  341. * @param[in] wait_time an optional timeout period (in clock ticks).
  342. If non-zero, your task will wait for the
  343. resource up to the amount of time specified
  344. by this argument.If you specify 0, however,
  345. your task will wait forever at the specified
  346. semaphore or, until the resource becomes
  347. available (or the event occurs).
  348. *
  349. * @retval TLS_OS_SUCCESS success
  350. * @retval TLS_OS_ERROR failed
  351. *
  352. * @note None
  353. */
  354. tls_os_status_t tls_os_sem_acquire(tls_os_sem_t *sem,
  355. u32 wait_time);
  356. /**
  357. * @brief This function signals a semaphore
  358. *
  359. * @param[in] *sem pointer to the event control block associated
  360. with the desired semaphore
  361. *
  362. * @retval TLS_OS_SUCCESS success
  363. * @retval TLS_OS_ERROR failed
  364. *
  365. * @note None
  366. */
  367. tls_os_status_t tls_os_sem_release(tls_os_sem_t *sem);
  368. /**
  369. * @brief This function sets the semaphore count to the value specified
  370. as an argument.Typically,this value would be 0.You
  371. would typically use this function when a semaphore is
  372. used as a signaling mechanism and, you want to reset
  373. the count value.
  374. *
  375. * @param[in] *sem pointer to the event control block
  376. * @param[in] cnt the new value for the semaphore count. You would
  377. pass 0 to reset the semaphore count.
  378. *
  379. * @retval TLS_OS_SUCCESS success
  380. * @retval TLS_OS_ERROR failed
  381. *
  382. * @note None
  383. */
  384. tls_os_status_t tls_os_sem_set(tls_os_sem_t *sem, u16 cnt);
  385. /**
  386. * @brief This function creates a message queue if free event cont
  387. rol blocks are available
  388. *
  389. * @param[in] **queue pointer to the event control clock (OS_EVENT)
  390. associated with the created queue
  391. * @param[in] queue_size the number of elements in the storage area
  392. *
  393. * @retval TLS_OS_SUCCESS success
  394. * @retval TLS_OS_ERROR failed
  395. *
  396. * @note None
  397. */
  398. tls_os_status_t tls_os_queue_create(tls_os_queue_t **queue, u32 queue_size);
  399. /**
  400. * @brief This function deletes a message queue and readies all
  401. tasks pending on the queue
  402. *
  403. * @param[in] *queue pointer to the event control block associated
  404. with the desired queue
  405. *
  406. * @retval TLS_OS_SUCCESS success
  407. * @retval TLS_OS_ERROR failed
  408. *
  409. * @note None
  410. */
  411. tls_os_status_t tls_os_queue_delete(tls_os_queue_t *queue);
  412. /**
  413. * @brief This function sends a message to a queue
  414. *
  415. * @param[in] *queue pointer to the event control block
  416. associated with the desired queue
  417. * @param[in] *msg pointer to the message to send.
  418. * @param[in] msg_size message size
  419. *
  420. * @retval 0 success
  421. * @retval other failed
  422. *
  423. * @note None
  424. */
  425. tls_os_status_t tls_os_queue_send(tls_os_queue_t *queue,
  426. void *msg,
  427. u32 msg_size);
  428. /**
  429. * @brief This function is used to flush the contents of the message
  430. queue.
  431. *
  432. * @param[in] *queue
  433. *
  434. * @retval TLS_OS_SUCCESS success
  435. * @retval TLS_OS_ERROR failed
  436. *
  437. * @note None
  438. */
  439. tls_os_status_t tls_os_queue_flush(tls_os_queue_t *queue);
  440. /**
  441. * @brief This function waits for a message to be sent to a queue
  442. *
  443. * @param[in] *queue pointer to the event control block associated
  444. with the desired queue
  445. * @param[in] **msg pointer to the message received
  446. * @param[in] msg_size message size
  447. * @param[in] wait_time an optional timeout period (in clock ticks).
  448. If non-zero, your task will wait for a message
  449. to arrive at the queue up to the amount of time
  450. specified by this argument. If you specify 0,
  451. however, your task will wait forever at the
  452. specified queue or, until a message arrives.
  453. *
  454. * @retval TLS_OS_SUCCESS success
  455. * @retval TLS_OS_ERROR failed
  456. *
  457. * @note None
  458. */
  459. tls_os_status_t tls_os_queue_receive(tls_os_queue_t *queue,void **msg,
  460. u32 msg_size,
  461. u32 wait_time);
  462. /**
  463. * @brief This function creates a message mailbox if free event
  464. control blocks are available.
  465. *
  466. * @param[in] **mailbox pointer to the event control clock (OS_EVENT)
  467. associated with the created mailbox
  468. * @param[in] mailbox_size size
  469. *
  470. * @retval TLS_OS_SUCCESS success
  471. * @retval TLS_OS_ERROR failed
  472. *
  473. * @note None
  474. */
  475. tls_os_status_t tls_os_mailbox_create(tls_os_mailbox_t **mailbox, u32 mailbox_size);
  476. /**
  477. * @brief This function deletes a mailbox and readies all of the tasks
  478. pending on the this mailbox.
  479. *
  480. * @param[in] *mailbox pointer to the event control block
  481. associated with the desired mailbox.
  482. *
  483. * @retval TLS_OS_SUCCESS success
  484. * @retval TLS_OS_ERROR failed
  485. *
  486. * @note None
  487. */
  488. tls_os_status_t tls_os_mailbox_delete(tls_os_mailbox_t *mailbox);
  489. /**
  490. * @brief This function sends a message to a mailbox
  491. *
  492. * @param[in] *mailbox pointer to the event control block associated
  493. with the desired mailbox
  494. * @param[in] *msg pointer to the message to send.
  495. You MUST NOT send a NULL pointer
  496. *
  497. * @retval TLS_OS_SUCCESS success
  498. * @retval TLS_OS_ERROR failed
  499. *
  500. * @note None
  501. */
  502. tls_os_status_t tls_os_mailbox_send(tls_os_mailbox_t *mailbox,void *msg);
  503. /**
  504. * @brief This function waits for a message to be sent to a mailbox
  505. *
  506. * @param[in] *mailbox pointer to the event control block associated
  507. with the desired mailbox
  508. * @param[in] **msg pointer to the message received
  509. * @param[in] wait_time an optional timeout period (in clock ticks).
  510. If non-zero, your task will wait for a message
  511. to arrive at the mailbox up to the amount of
  512. time specified by this argument.
  513. If you specify 0, however, your task will wait
  514. forever at the specified mailbox or,
  515. until a message arrives.
  516. *
  517. *
  518. * @retval TLS_OS_SUCCESS success
  519. * @retval TLS_OS_ERROR failed
  520. *
  521. * @note None
  522. */
  523. tls_os_status_t tls_os_mailbox_receive(tls_os_mailbox_t *mailbox,
  524. void **msg,
  525. u32 wait_time);
  526. /**
  527. * @brief This function is used by your application to obtain the
  528. current value of the 32-bit counter which keeps track
  529. of the number of clock ticks since the system starts.
  530. *
  531. * @param[in] None
  532. *
  533. * @retval current value of OSTime
  534. *
  535. * @note None
  536. */
  537. u32 tls_os_get_time(void);
  538. /**
  539. * @brief This function is used to disable interrupts by preserving
  540. the state of interrupts
  541. *
  542. * @param[in] None
  543. *
  544. * @retval cpu_sr
  545. *
  546. * @note None
  547. */
  548. u32 tls_os_set_critical(void);
  549. /**
  550. * @brief This function is used to enable interrupts by preserving
  551. the state of interrupts
  552. *
  553. * @param[in] cpu_sr
  554. *
  555. * @return None
  556. *
  557. * @note None
  558. */
  559. void tls_os_release_critical(u32 cpu_sr);
  560. /**
  561. * @brief This function is called by your application code to create
  562. a timer
  563. *
  564. * @param[in] **timer pointer to an OS_TMR data structure.
  565. This is the 'handle' that your application will
  566. use to reference the timer created
  567. * @param[in] callback pointer to a callback function that will
  568. be called when the timer expires. The callback
  569. function must be declared as follows
  570. void MyCallback (OS_TMR *ptmr, void *p_arg);
  571. * @param[in] *callback_arg argument (a pointer) that is passed to
  572. the callback function when it is called
  573. * @param[in] period The 'period' being repeated for the timer.
  574. If you specified 'OS_TMR_OPT_PERIODIC' as
  575. an option, when the timer expires, it will
  576. automatically restart with the same period.
  577. * @param[in] repeat if repeat
  578. * @param[in] *name pointer to an ASCII string that is used to
  579. name the timer. Names are useful for
  580. debugging.
  581. *
  582. * @retval TLS_OS_SUCCESS success
  583. * @retval TLS_OS_ERROR failed
  584. *
  585. * @note None
  586. */
  587. tls_os_status_t tls_os_timer_create(tls_os_timer_t **timer,
  588. TLS_OS_TIMER_CALLBACK callback,
  589. void *callback_arg,
  590. u32 period,
  591. bool repeat,
  592. u8 *name);
  593. /**
  594. * @brief This function is called by your application code to start
  595. a timer.
  596. *
  597. * @param[in] *timer pointer to an OS_TMR
  598. *
  599. * @return None
  600. *
  601. * @note None
  602. */
  603. void tls_os_timer_start(tls_os_timer_t *timer);
  604. /*
  605. ************************************************************************************************************************
  606. * CHANGE A TIMER WAIT TIME
  607. *
  608. * Description: This function is called by your application code to change a timer wait time.
  609. *
  610. * Arguments : timer Is a pointer to an OS_TMR
  611. *
  612. * ticks is the wait time
  613. ************************************************************************************************************************
  614. */
  615. void tls_os_timer_change(tls_os_timer_t *timer, u32 ticks);
  616. /**
  617. * @brief This function is called by your application code to stop
  618. a timer
  619. *
  620. * @param[in] *timer pointer to the timer to stop.
  621. *
  622. * @return None
  623. *
  624. * @note None
  625. */
  626. void tls_os_timer_stop(tls_os_timer_t *timer);
  627. /**
  628. * @brief This function is called by your application code to delete
  629. a timer
  630. *
  631. * @param[in] *timer pointer to the timer to delete
  632. *
  633. * @retval TLS_OS_SUCCESS success
  634. * @retval TLS_OS_ERROR failed
  635. *
  636. * @note None
  637. */
  638. tls_os_status_t tls_os_timer_delete(tls_os_timer_t *timer);
  639. /**
  640. * @brief This function is called to delay execution of the currently
  641. running task until the specified number of system
  642. ticks expires. This, of course, directly equates to
  643. delaying the current task for some time to expire.
  644. There will be no delay if the specified delay is 0.
  645. If the specified delay is greater than 0 then,
  646. a context switch will executed.
  647. *
  648. * @param[in] ticks the time delay that the task will be suspended
  649. in number of clock 'ticks'.Note that by specifying 0,
  650. the task will not be delayed.
  651. *
  652. * @return None
  653. *
  654. * @note None
  655. */
  656. void tls_os_time_delay(u32 ticks);
  657. /**
  658. * @brief This function is used to display all the tasks' detail status.
  659. *
  660. * @param[in] None
  661. *
  662. * @return None
  663. *
  664. * @note None
  665. */
  666. void tls_os_disp_task_stat_info(void);
  667. /**
  668. * @}
  669. */
  670. /**
  671. * @}
  672. */
  673. #endif /* end of WM_OSAL_H */