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