From 76177aa280494bb36d7a0bcbda1078d4db717020 Mon Sep 17 00:00:00 2001 From: Ali Labbene Date: Mon, 9 Dec 2019 11:25:19 +0100 Subject: Official ARM version: v4.5 --- Documentation/RTOS/html/API_Structure.png | Bin 0 -> 9200 bytes Documentation/RTOS/html/CMSIS_Logo_Final.png | Bin 0 -> 12402 bytes Documentation/RTOS/html/CMSIS_RTOS_Files.png | Bin 0 -> 15706 bytes Documentation/RTOS/html/MailQueue.png | Bin 0 -> 14737 bytes Documentation/RTOS/html/MessageQueue.png | Bin 0 -> 11898 bytes Documentation/RTOS/html/Mutex.png | Bin 0 -> 8034 bytes Documentation/RTOS/html/Semaphore.png | Bin 0 -> 16954 bytes Documentation/RTOS/html/ThreadStatus.png | Bin 0 -> 20521 bytes Documentation/RTOS/html/Timer.png | Bin 0 -> 13428 bytes Documentation/RTOS/html/TimerValues.png | Bin 0 -> 4226 bytes Documentation/RTOS/html/_function_overview.html | 204 ++++ Documentation/RTOS/html/_rtos_validation.html | 132 ++ Documentation/RTOS/html/_using_o_s.html | 134 +++ Documentation/RTOS/html/annotated.html | 110 ++ Documentation/RTOS/html/annotated.js | 10 + Documentation/RTOS/html/bc_s.png | Bin 0 -> 676 bytes Documentation/RTOS/html/bdwn.png | Bin 0 -> 147 bytes Documentation/RTOS/html/classes.html | 106 ++ Documentation/RTOS/html/closed.png | Bin 0 -> 132 bytes Documentation/RTOS/html/cmsis.css | 1269 ++++++++++++++++++++ Documentation/RTOS/html/cmsis__os_8h.html | 689 +++++++++++ Documentation/RTOS/html/cmsis__os_8txt.html | 156 +++ Documentation/RTOS/html/cmsis_os_h.html | 826 +++++++++++++ .../html/dir_67baed4ff719a838d401a6dc7774cf41.html | 97 ++ .../html/dir_9afdeffb8e409a4e0df5c5bf9ab1a7d2.html | 97 ++ Documentation/RTOS/html/doxygen.css | 1172 ++++++++++++++++++ Documentation/RTOS/html/doxygen.png | Bin 0 -> 3779 bytes Documentation/RTOS/html/dynsections.js | 78 ++ Documentation/RTOS/html/files.html | 95 ++ Documentation/RTOS/html/ftv2blank.png | Bin 0 -> 86 bytes Documentation/RTOS/html/ftv2cl.png | Bin 0 -> 453 bytes Documentation/RTOS/html/ftv2doc.png | Bin 0 -> 746 bytes Documentation/RTOS/html/ftv2folderclosed.png | Bin 0 -> 616 bytes Documentation/RTOS/html/ftv2folderopen.png | Bin 0 -> 597 bytes Documentation/RTOS/html/ftv2lastnode.png | Bin 0 -> 86 bytes Documentation/RTOS/html/ftv2link.png | Bin 0 -> 746 bytes Documentation/RTOS/html/ftv2mlastnode.png | Bin 0 -> 246 bytes Documentation/RTOS/html/ftv2mnode.png | Bin 0 -> 246 bytes Documentation/RTOS/html/ftv2mo.png | Bin 0 -> 403 bytes Documentation/RTOS/html/ftv2node.png | Bin 0 -> 86 bytes Documentation/RTOS/html/ftv2ns.png | Bin 0 -> 388 bytes Documentation/RTOS/html/ftv2plastnode.png | Bin 0 -> 229 bytes Documentation/RTOS/html/ftv2pnode.png | Bin 0 -> 229 bytes Documentation/RTOS/html/ftv2splitbar.png | Bin 0 -> 314 bytes Documentation/RTOS/html/ftv2vertline.png | Bin 0 -> 86 bytes Documentation/RTOS/html/functions.html | 161 +++ Documentation/RTOS/html/functions_vars.html | 161 +++ Documentation/RTOS/html/globals.html | 423 +++++++ Documentation/RTOS/html/globals_defs.html | 182 +++ Documentation/RTOS/html/globals_enum.html | 110 ++ Documentation/RTOS/html/globals_eval.html | 173 +++ Documentation/RTOS/html/globals_func.html | 225 ++++ Documentation/RTOS/html/globals_type.html | 125 ++ .../RTOS/html/group___c_m_s_i_s___r_t_o_s.html | 122 ++ .../RTOS/html/group___c_m_s_i_s___r_t_o_s.js | 10 + .../group___c_m_s_i_s___r_t_o_s___definitions.html | 260 ++++ .../group___c_m_s_i_s___r_t_o_s___definitions.js | 14 + ...group___c_m_s_i_s___r_t_o_s___inter_thread.html | 133 ++ .../group___c_m_s_i_s___r_t_o_s___inter_thread.js | 9 + .../group___c_m_s_i_s___r_t_o_s___kernel_ctrl.html | 429 +++++++ .../group___c_m_s_i_s___r_t_o_s___kernel_ctrl.js | 14 + .../html/group___c_m_s_i_s___r_t_o_s___mail.html | 594 +++++++++ .../html/group___c_m_s_i_s___r_t_o_s___mail.js | 12 + .../group___c_m_s_i_s___r_t_o_s___message.html | 451 +++++++ .../html/group___c_m_s_i_s___r_t_o_s___message.js | 9 + .../group___c_m_s_i_s___r_t_o_s___mutex_mgmt.html | 405 +++++++ .../group___c_m_s_i_s___r_t_o_s___mutex_mgmt.js | 9 + .../group___c_m_s_i_s___r_t_o_s___pool_mgmt.html | 456 +++++++ .../group___c_m_s_i_s___r_t_o_s___pool_mgmt.js | 10 + ...oup___c_m_s_i_s___r_t_o_s___semaphore_mgmt.html | 424 +++++++ ...group___c_m_s_i_s___r_t_o_s___semaphore_mgmt.js | 10 + .../group___c_m_s_i_s___r_t_o_s___signal_mgmt.html | 337 ++++++ .../group___c_m_s_i_s___r_t_o_s___signal_mgmt.js | 7 + .../html/group___c_m_s_i_s___r_t_o_s___status.html | 198 +++ .../html/group___c_m_s_i_s___r_t_o_s___status.js | 20 + .../group___c_m_s_i_s___r_t_o_s___thread_mgmt.html | 580 +++++++++ .../group___c_m_s_i_s___r_t_o_s___thread_mgmt.js | 21 + .../group___c_m_s_i_s___r_t_o_s___timer_mgmt.html | 498 ++++++++ .../group___c_m_s_i_s___r_t_o_s___timer_mgmt.js | 13 + .../html/group___c_m_s_i_s___r_t_o_s___wait.html | 254 ++++ .../html/group___c_m_s_i_s___r_t_o_s___wait.js | 6 + Documentation/RTOS/html/index.html | 148 +++ Documentation/RTOS/html/jquery.js | 77 ++ Documentation/RTOS/html/modules.html | 108 ++ Documentation/RTOS/html/modules.js | 4 + Documentation/RTOS/html/nav_f.png | Bin 0 -> 153 bytes Documentation/RTOS/html/nav_g.png | Bin 0 -> 95 bytes Documentation/RTOS/html/nav_h.png | Bin 0 -> 98 bytes Documentation/RTOS/html/navtree.css | 143 +++ Documentation/RTOS/html/navtree.js | 527 ++++++++ Documentation/RTOS/html/navtreeindex0.js | 161 +++ Documentation/RTOS/html/open.png | Bin 0 -> 123 bytes Documentation/RTOS/html/pages.html | 99 ++ Documentation/RTOS/html/printComponentTabs.js | 36 + Documentation/RTOS/html/resize.js | 93 ++ Documentation/RTOS/html/rtos_revision_history.html | 114 ++ Documentation/RTOS/html/simple_signal.png | Bin 0 -> 10667 bytes .../RTOS/html/structos_mail_q_def__t.html | 155 +++ Documentation/RTOS/html/structos_mail_q_def__t.js | 6 + .../RTOS/html/structos_message_q_def__t.html | 155 +++ .../RTOS/html/structos_message_q_def__t.js | 6 + Documentation/RTOS/html/structos_mutex_def__t.html | 125 ++ Documentation/RTOS/html/structos_mutex_def__t.js | 4 + Documentation/RTOS/html/structos_pool_def__t.html | 155 +++ Documentation/RTOS/html/structos_pool_def__t.js | 6 + .../RTOS/html/structos_semaphore_def__t.html | 125 ++ .../RTOS/html/structos_semaphore_def__t.js | 4 + .../RTOS/html/structos_thread_def__t.html | 170 +++ Documentation/RTOS/html/structos_thread_def__t.js | 7 + Documentation/RTOS/html/structos_timer_def__t.html | 125 ++ Documentation/RTOS/html/structos_timer_def__t.js | 4 + Documentation/RTOS/html/sync_off.png | Bin 0 -> 853 bytes Documentation/RTOS/html/sync_on.png | Bin 0 -> 845 bytes Documentation/RTOS/html/tab_a.png | Bin 0 -> 142 bytes Documentation/RTOS/html/tab_b.png | Bin 0 -> 170 bytes Documentation/RTOS/html/tab_h.png | Bin 0 -> 177 bytes Documentation/RTOS/html/tab_s.png | Bin 0 -> 184 bytes Documentation/RTOS/html/tab_topnav.png | Bin 0 -> 232 bytes Documentation/RTOS/html/tabs.css | 71 ++ 119 files changed, 14668 insertions(+) create mode 100644 Documentation/RTOS/html/API_Structure.png create mode 100644 Documentation/RTOS/html/CMSIS_Logo_Final.png create mode 100644 Documentation/RTOS/html/CMSIS_RTOS_Files.png create mode 100644 Documentation/RTOS/html/MailQueue.png create mode 100644 Documentation/RTOS/html/MessageQueue.png create mode 100644 Documentation/RTOS/html/Mutex.png create mode 100644 Documentation/RTOS/html/Semaphore.png create mode 100644 Documentation/RTOS/html/ThreadStatus.png create mode 100644 Documentation/RTOS/html/Timer.png create mode 100644 Documentation/RTOS/html/TimerValues.png create mode 100644 Documentation/RTOS/html/_function_overview.html create mode 100644 Documentation/RTOS/html/_rtos_validation.html create mode 100644 Documentation/RTOS/html/_using_o_s.html create mode 100644 Documentation/RTOS/html/annotated.html create mode 100644 Documentation/RTOS/html/annotated.js create mode 100644 Documentation/RTOS/html/bc_s.png create mode 100644 Documentation/RTOS/html/bdwn.png create mode 100644 Documentation/RTOS/html/classes.html create mode 100644 Documentation/RTOS/html/closed.png create mode 100644 Documentation/RTOS/html/cmsis.css create mode 100644 Documentation/RTOS/html/cmsis__os_8h.html create mode 100644 Documentation/RTOS/html/cmsis__os_8txt.html create mode 100644 Documentation/RTOS/html/cmsis_os_h.html create mode 100644 Documentation/RTOS/html/dir_67baed4ff719a838d401a6dc7774cf41.html create mode 100644 Documentation/RTOS/html/dir_9afdeffb8e409a4e0df5c5bf9ab1a7d2.html create mode 100644 Documentation/RTOS/html/doxygen.css create mode 100644 Documentation/RTOS/html/doxygen.png create mode 100644 Documentation/RTOS/html/dynsections.js create mode 100644 Documentation/RTOS/html/files.html create mode 100644 Documentation/RTOS/html/ftv2blank.png create mode 100644 Documentation/RTOS/html/ftv2cl.png create mode 100644 Documentation/RTOS/html/ftv2doc.png create mode 100644 Documentation/RTOS/html/ftv2folderclosed.png create mode 100644 Documentation/RTOS/html/ftv2folderopen.png create mode 100644 Documentation/RTOS/html/ftv2lastnode.png create mode 100644 Documentation/RTOS/html/ftv2link.png create mode 100644 Documentation/RTOS/html/ftv2mlastnode.png create mode 100644 Documentation/RTOS/html/ftv2mnode.png create mode 100644 Documentation/RTOS/html/ftv2mo.png create mode 100644 Documentation/RTOS/html/ftv2node.png create mode 100644 Documentation/RTOS/html/ftv2ns.png create mode 100644 Documentation/RTOS/html/ftv2plastnode.png create mode 100644 Documentation/RTOS/html/ftv2pnode.png create mode 100644 Documentation/RTOS/html/ftv2splitbar.png create mode 100644 Documentation/RTOS/html/ftv2vertline.png create mode 100644 Documentation/RTOS/html/functions.html create mode 100644 Documentation/RTOS/html/functions_vars.html create mode 100644 Documentation/RTOS/html/globals.html create mode 100644 Documentation/RTOS/html/globals_defs.html create mode 100644 Documentation/RTOS/html/globals_enum.html create mode 100644 Documentation/RTOS/html/globals_eval.html create mode 100644 Documentation/RTOS/html/globals_func.html create mode 100644 Documentation/RTOS/html/globals_type.html create mode 100644 Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s.html create mode 100644 Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s.js create mode 100644 Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___definitions.html create mode 100644 Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___definitions.js create mode 100644 Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___inter_thread.html create mode 100644 Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___inter_thread.js create mode 100644 Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___kernel_ctrl.html create mode 100644 Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___kernel_ctrl.js create mode 100644 Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___mail.html create mode 100644 Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___mail.js create mode 100644 Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___message.html create mode 100644 Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___message.js create mode 100644 Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___mutex_mgmt.html create mode 100644 Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___mutex_mgmt.js create mode 100644 Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___pool_mgmt.html create mode 100644 Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___pool_mgmt.js create mode 100644 Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___semaphore_mgmt.html create mode 100644 Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___semaphore_mgmt.js create mode 100644 Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___signal_mgmt.html create mode 100644 Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___signal_mgmt.js create mode 100644 Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___status.html create mode 100644 Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___status.js create mode 100644 Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___thread_mgmt.html create mode 100644 Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___thread_mgmt.js create mode 100644 Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___timer_mgmt.html create mode 100644 Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___timer_mgmt.js create mode 100644 Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___wait.html create mode 100644 Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___wait.js create mode 100644 Documentation/RTOS/html/index.html create mode 100644 Documentation/RTOS/html/jquery.js create mode 100644 Documentation/RTOS/html/modules.html create mode 100644 Documentation/RTOS/html/modules.js create mode 100644 Documentation/RTOS/html/nav_f.png create mode 100644 Documentation/RTOS/html/nav_g.png create mode 100644 Documentation/RTOS/html/nav_h.png create mode 100644 Documentation/RTOS/html/navtree.css create mode 100644 Documentation/RTOS/html/navtree.js create mode 100644 Documentation/RTOS/html/navtreeindex0.js create mode 100644 Documentation/RTOS/html/open.png create mode 100644 Documentation/RTOS/html/pages.html create mode 100644 Documentation/RTOS/html/printComponentTabs.js create mode 100644 Documentation/RTOS/html/resize.js create mode 100644 Documentation/RTOS/html/rtos_revision_history.html create mode 100644 Documentation/RTOS/html/simple_signal.png create mode 100644 Documentation/RTOS/html/structos_mail_q_def__t.html create mode 100644 Documentation/RTOS/html/structos_mail_q_def__t.js create mode 100644 Documentation/RTOS/html/structos_message_q_def__t.html create mode 100644 Documentation/RTOS/html/structos_message_q_def__t.js create mode 100644 Documentation/RTOS/html/structos_mutex_def__t.html create mode 100644 Documentation/RTOS/html/structos_mutex_def__t.js create mode 100644 Documentation/RTOS/html/structos_pool_def__t.html create mode 100644 Documentation/RTOS/html/structos_pool_def__t.js create mode 100644 Documentation/RTOS/html/structos_semaphore_def__t.html create mode 100644 Documentation/RTOS/html/structos_semaphore_def__t.js create mode 100644 Documentation/RTOS/html/structos_thread_def__t.html create mode 100644 Documentation/RTOS/html/structos_thread_def__t.js create mode 100644 Documentation/RTOS/html/structos_timer_def__t.html create mode 100644 Documentation/RTOS/html/structos_timer_def__t.js create mode 100644 Documentation/RTOS/html/sync_off.png create mode 100644 Documentation/RTOS/html/sync_on.png create mode 100644 Documentation/RTOS/html/tab_a.png create mode 100644 Documentation/RTOS/html/tab_b.png create mode 100644 Documentation/RTOS/html/tab_h.png create mode 100644 Documentation/RTOS/html/tab_s.png create mode 100644 Documentation/RTOS/html/tab_topnav.png create mode 100644 Documentation/RTOS/html/tabs.css (limited to 'Documentation/RTOS') diff --git a/Documentation/RTOS/html/API_Structure.png b/Documentation/RTOS/html/API_Structure.png new file mode 100644 index 0000000..832753b Binary files /dev/null and b/Documentation/RTOS/html/API_Structure.png differ diff --git a/Documentation/RTOS/html/CMSIS_Logo_Final.png b/Documentation/RTOS/html/CMSIS_Logo_Final.png new file mode 100644 index 0000000..2056b7e Binary files /dev/null and b/Documentation/RTOS/html/CMSIS_Logo_Final.png differ diff --git a/Documentation/RTOS/html/CMSIS_RTOS_Files.png b/Documentation/RTOS/html/CMSIS_RTOS_Files.png new file mode 100644 index 0000000..136bc6d Binary files /dev/null and b/Documentation/RTOS/html/CMSIS_RTOS_Files.png differ diff --git a/Documentation/RTOS/html/MailQueue.png b/Documentation/RTOS/html/MailQueue.png new file mode 100644 index 0000000..9e75ff4 Binary files /dev/null and b/Documentation/RTOS/html/MailQueue.png differ diff --git a/Documentation/RTOS/html/MessageQueue.png b/Documentation/RTOS/html/MessageQueue.png new file mode 100644 index 0000000..712eeac Binary files /dev/null and b/Documentation/RTOS/html/MessageQueue.png differ diff --git a/Documentation/RTOS/html/Mutex.png b/Documentation/RTOS/html/Mutex.png new file mode 100644 index 0000000..7eec93b Binary files /dev/null and b/Documentation/RTOS/html/Mutex.png differ diff --git a/Documentation/RTOS/html/Semaphore.png b/Documentation/RTOS/html/Semaphore.png new file mode 100644 index 0000000..f1939c0 Binary files /dev/null and b/Documentation/RTOS/html/Semaphore.png differ diff --git a/Documentation/RTOS/html/ThreadStatus.png b/Documentation/RTOS/html/ThreadStatus.png new file mode 100644 index 0000000..45a0564 Binary files /dev/null and b/Documentation/RTOS/html/ThreadStatus.png differ diff --git a/Documentation/RTOS/html/Timer.png b/Documentation/RTOS/html/Timer.png new file mode 100644 index 0000000..63c666b Binary files /dev/null and b/Documentation/RTOS/html/Timer.png differ diff --git a/Documentation/RTOS/html/TimerValues.png b/Documentation/RTOS/html/TimerValues.png new file mode 100644 index 0000000..08add5d Binary files /dev/null and b/Documentation/RTOS/html/TimerValues.png differ diff --git a/Documentation/RTOS/html/_function_overview.html b/Documentation/RTOS/html/_function_overview.html new file mode 100644 index 0000000..9f6759e --- /dev/null +++ b/Documentation/RTOS/html/_function_overview.html @@ -0,0 +1,204 @@ + + + + + +Function Overview +CMSIS-RTOS: Function Overview + + + + + + + + + + + + +
+
+ + + + + + + +
+
CMSIS-RTOS +  Version 1.02 +
+
CMSIS-RTOS API: Generic RTOS interface for Cortex-M processor-based devices.
+
+
+ +
+
    + +
+
+ + +
+
+ +
+
+
+ +
+
+
+
Function Overview
+
+
+

The following list provides a brief overview of all CMSIS-RTOS functions. Functions marked with $ are optional. A specific CMSIS-RTOS implementation may not provide all functions, but this is clearly indicated with osFeatureXXXX defines.

+ + + + + + + + + +
    +
  • Mail Queue
      +
    • osMailCreate : Define and initialize a mail queue with fix-size memory blocks.
    • +
    • osMailAlloc : Allocate a memory block.
    • +
    • osMailCAlloc : Allocate a memory block and zero-set this block.
    • +
    • osMailPut : Put a memory block into a mail queue.
    • +
    • osMailGet : Get a mail or suspend thread execution until mail arrives.
    • +
    • osMailFree : Return a memory block to the mail queue.
    • +
    +
  • +
+

+Timout Value

+

The timeout value specifies the number of timer ticks until a timeout or time delay elapses. The value is an upper bound and depends on the actual time elapsed since the last timer tick.

+

For a value of 1 the system waits until the next timer tick occurs. That means that the actual timeout value can be one timer tick less than the specified timeout value.

+
+TimerValues.png +
+Timer Values
+

+Calls from Interrupt Service Routines

+

The following CMSIS-RTOS functions can be called from threads and Interrupt Service Routines (ISR):

+ +

Functions that cannot be called from an ISR are verifying the interrupt status and return, in case they are called from an ISR context, the status code osErrorISR. In some implementations, this condition might be caught using the HARD FAULT vector.

+

Some CMSIS-RTOS implementations support CMSIS-RTOS function calls from multiple ISRs at the same time. If this is impossible, the CMSIS-RTOS rejects calls by nested ISR functions with the status code osErrorISRRecursive.

+
+
+ + + + diff --git a/Documentation/RTOS/html/_rtos_validation.html b/Documentation/RTOS/html/_rtos_validation.html new file mode 100644 index 0000000..a4b6238 --- /dev/null +++ b/Documentation/RTOS/html/_rtos_validation.html @@ -0,0 +1,132 @@ + + + + + +RTOS Validation +CMSIS-RTOS: RTOS Validation + + + + + + + + + + + + +
+
+ + + + + + + +
+
CMSIS-RTOS +  Version 1.02 +
+
CMSIS-RTOS API: Generic RTOS interface for Cortex-M processor-based devices.
+
+
+ +
+
    + +
+
+ + +
+
+ +
+
+
+ +
+
+
+
RTOS Validation
+
+
+

ARM offers a Software Pack for the CMSIS-RTOS Validation. The ARM::CMSIS-RTOS_Validation Pack contains the following:

+
    +
  • Source code of a CMSIS-RTOS Validation Suite along with configuration file.
  • +
  • Documentation of the CMSIS-RTOS Validation Suite.
  • +
  • Example that shows the usage of the CMSIS-RTOS Validation Suite using simulation.
  • +
+

The CMSIS-RTOS Validation Suite is currently available in beta release and performs generic validation of various RTOS features. The test cases verify the functional behaviour, test invalid parameters and call management functions from ISR.

+

The following CMSIS-RTOS features can be tested with the current release:

+
    +
  • Thread : Create multiple threads, terminate, restart, yield, change priority
  • +
  • Timer : Create periodic and one-shot timers
  • +
  • GenWait : Call generic wait functions (osDelay and osWait)
  • +
  • WaitFunc : Measure wait ticks (delay, mail, message, mutex, semaphore, signal)
  • +
+

Moreover the following inter-thread communication functions can be tested:

+
    +
  • Signal : Verify signal events
  • +
  • Memory Pool : Verify memory allocation
  • +
  • Message Queue : Exchange messages between threads
  • +
  • Mail Queue : Exchange data between threads
  • +
  • Mutex : Synchronize resource access
  • +
  • Semaphore : Access shared resources
  • +
+

The RTOS Validation output can be printed to a console, output via ITM printf, or output to a memory buffer.

+

+Sample Test Output

+
CMSIS-RTOS Test Suite   Oct 21 2015   16:39:16 
+
+TEST 01: TC_ThreadCreate                  PASSED
+TEST 02: TC_ThreadMultiInstance           PASSED
+TEST 03: TC_ThreadTerminate               PASSED
+  :
+  :
+TEST 08: TC_ThreadChainedCreate           PASSED
+TEST 09: TC_ThreadYield                   NOT EXECUTED
+TEST 10: TC_ThreadParam                   PASSED
+  :
+  :
+TEST 60: TC_MailFromISRToThread           PASSED
+
+Test Summary: 60 Tests, 59 Executed, 59 Passed, 0 Failed, 0 Warnings.
+Test Result: PASSED
+
+
+ + + + diff --git a/Documentation/RTOS/html/_using_o_s.html b/Documentation/RTOS/html/_using_o_s.html new file mode 100644 index 0000000..7f85ccd --- /dev/null +++ b/Documentation/RTOS/html/_using_o_s.html @@ -0,0 +1,134 @@ + + + + + +Using a CMSIS-RTOS Implementation +CMSIS-RTOS: Using a CMSIS-RTOS Implementation + + + + + + + + + + + + +
+
+ + + + + + + +
+
CMSIS-RTOS +  Version 1.02 +
+
CMSIS-RTOS API: Generic RTOS interface for Cortex-M processor-based devices.
+
+
+ +
+
    + +
+
+ + +
+
+ +
+
+
+ +
+
+
+
Using a CMSIS-RTOS Implementation
+
+
+

A CMSIS-RTOS implementation is typically provided as a library. To add the RTOS functionality to an existing CMSIS-based application, the RTOS library (and typically a configuration file) needs to be added. The available functionality of the RTOS library is defined in the header file cmsis_os.h that is specific for each CMSIS-RTOS implementation.

+
+CMSIS_RTOS_Files.png +
+CMSIS-RTOS File Structure
+

Depending on the CMSIS-RTOS implementation, execution may start with the main function as the first thread. This has the benefit that an application programmer may use other middleware libraries that create threads internally, but the remaining part of the user application just uses the main thread. Therefore, the usage of the RTOS can be invisible to the application programmer, but libraries can use CMSIS-RTOS features.

+

Once the files are added to a project, the user can start working with the CMSIS-RTOS functions. A code example is provided below:

+

Code Example

+
#include "cmsis_os.h" // CMSIS-RTOS header file
+
+
void job1 (void const *argument) { // thread function 'job1'
+
while (1) {
+
: // execute some code
+
osDelay (10); // delay execution for 10 milliseconds
+
}
+
}
+
+
osThreadDef(job1, osPriorityAboveNormal, 1, 0); // define job1 as thread function
+
+
void job2 (void const *argument) { // thread function 'job2'
+
osThreadCreate(osThread(job1),NULL); // create job1 thread
+
while (1) {
+
: // execute some code
+
}
+
}
+
+
osThreadDef(job2, osPriorityNormal, 1, 0); // define job2 as thread function
+
+
void job3 (void const *argument) { // thread function 'job3'
+
while (1) {
+
: // execute some code
+
osDelay (20); // delay execution for 20 milliseconds
+
}
+
}
+
+
osThreadDef(job3, osPriorityNormal, 1, 0); // define job3 as thread function
+
+
int main (void) { // program execution starts here
+
osKernelInitialize (); // initialize RTOS kernel
+
: // setup and initialize peripherals
+ + +
osKernelStart (); // start kernel with job2 execution
+
}
+
+
+ + + + diff --git a/Documentation/RTOS/html/annotated.html b/Documentation/RTOS/html/annotated.html new file mode 100644 index 0000000..bb651f6 --- /dev/null +++ b/Documentation/RTOS/html/annotated.html @@ -0,0 +1,110 @@ + + + + + +Data Structures +CMSIS-RTOS: Data Structures + + + + + + + + + + + + +
+
+ + + + + + + +
+
CMSIS-RTOS +  Version 1.02 +
+
CMSIS-RTOS API: Generic RTOS interface for Cortex-M processor-based devices.
+
+
+ +
+
    + +
+
+ + + +
+
+ +
+
+
+ +
+
+
+
Data Structures
+
+
+
Here are the data structures with brief descriptions:
+ + + + + + + + + + +
oCos_mailQ
oCosEventEvent structure contains detailed information about an event
oCosMailQDef_tDefinition structure for mail queue
oCosMessageQDef_tDefinition structure for message queue
oCosMutexDef_tMutex Definition structure contains setup information for a mutex
oCosPoolDef_tDefinition structure for memory block allocation
oCosSemaphoreDef_tSemaphore Definition structure contains setup information for a semaphore
oCosThreadDef_tThread Definition structure contains startup information of a thread
\CosTimerDef_tTimer Definition structure contains timer parameters
+
+
+
+ + + + diff --git a/Documentation/RTOS/html/annotated.js b/Documentation/RTOS/html/annotated.js new file mode 100644 index 0000000..c324e28 --- /dev/null +++ b/Documentation/RTOS/html/annotated.js @@ -0,0 +1,10 @@ +var annotated = +[ + [ "osMailQDef_t", "structos_mail_q_def__t.html", "structos_mail_q_def__t" ], + [ "osMessageQDef_t", "structos_message_q_def__t.html", "structos_message_q_def__t" ], + [ "osMutexDef_t", "structos_mutex_def__t.html", "structos_mutex_def__t" ], + [ "osPoolDef_t", "structos_pool_def__t.html", "structos_pool_def__t" ], + [ "osSemaphoreDef_t", "structos_semaphore_def__t.html", "structos_semaphore_def__t" ], + [ "osThreadDef_t", "structos_thread_def__t.html", "structos_thread_def__t" ], + [ "osTimerDef_t", "structos_timer_def__t.html", "structos_timer_def__t" ] +]; \ No newline at end of file diff --git a/Documentation/RTOS/html/bc_s.png b/Documentation/RTOS/html/bc_s.png new file mode 100644 index 0000000..224b29a Binary files /dev/null and b/Documentation/RTOS/html/bc_s.png differ diff --git a/Documentation/RTOS/html/bdwn.png b/Documentation/RTOS/html/bdwn.png new file mode 100644 index 0000000..940a0b9 Binary files /dev/null and b/Documentation/RTOS/html/bdwn.png differ diff --git a/Documentation/RTOS/html/classes.html b/Documentation/RTOS/html/classes.html new file mode 100644 index 0000000..276e4dd --- /dev/null +++ b/Documentation/RTOS/html/classes.html @@ -0,0 +1,106 @@ + + + + + +Data Structure Index +CMSIS-RTOS: Data Structure Index + + + + + + + + + + + + +
+
+ + + + + + + +
+
CMSIS-RTOS +  Version 1.02 +
+
CMSIS-RTOS API: Generic RTOS interface for Cortex-M processor-based devices.
+
+
+ +
+
    + +
+
+ + + +
+
+ +
+
+
+ +
+
+
+
Data Structure Index
+
+
+ + + + + + +
  O  
+
osEvent   osMutexDef_t   osThreadDef_t   
osMailQDef_t   osPoolDef_t   osTimerDef_t   
os_mailQ   osMessageQDef_t   osSemaphoreDef_t   
+ +
+
+ + + + diff --git a/Documentation/RTOS/html/closed.png b/Documentation/RTOS/html/closed.png new file mode 100644 index 0000000..98cc2c9 Binary files /dev/null and b/Documentation/RTOS/html/closed.png differ diff --git a/Documentation/RTOS/html/cmsis.css b/Documentation/RTOS/html/cmsis.css new file mode 100644 index 0000000..293d0d0 --- /dev/null +++ b/Documentation/RTOS/html/cmsis.css @@ -0,0 +1,1269 @@ +/* The standard CSS for doxygen */ + +body, table, div, p, dl { + font-family: Lucida Grande, Verdana, Geneva, Arial, sans-serif; + font-size: 13px; + line-height: 1.3; +} + +/* CMSIS styles */ + +.style1 { + text-align: center; +} +.style2 { + color: #0000FF; + font-weight: normal; +} +.style3 { + text-align: left; +} +.style4 { + color: #008000; +} +.style5 { + color: #0000FF; +} +.style6 { + color: #000000; + font-style:italic; +} +.mand { + color: #0000FF; +} +.opt { + color: #008000; +} +.cond { + color: #990000; +} + +.choice +{ + background-color:#F7F9D0; +} +.seq +{ + background-color:#C9DECB; +} +.group1 +{ + background-color:#F8F1F1; +} +.group2 +{ + background-color:#DCEDEA; +} + + +ul ul { + list-style-type: disc; +} + +ul ul ul { + list-style-type: disc; +} + +ul.hierarchy { + color: green; +} + +em { + color: #000000; + font-style:italic; +} + + + +/* CMSIS Tables */ +table.cmtab1 { + padding: 4px; + border-collapse: collapse; + border: 1px solid #A3B4D7; + text-align: justify; + width:70%; +} + +th.cmtab1 { + background: #EBEFF6; + font-weight: bold; + height: 28px; +} + +td.cmtab1 { + padding:1px; + text-align: left; +} + +table.cmtable { + border-collapse:collapse; + text-align: justify; +} + +table.cmtable td, table.cmtable th { + border: 1px solid #2D4068; + padding: 3px 7px 2px; +} + +table.cmtable th { + background-color: #EBEFF6; + font-size: 110%; + padding-bottom: 4px; + padding-top: 5px; + text-align:left; +} + +td.MonoTxt { + font-family:"Arial monospaced for SAP"; +} + +td.XML-Token +{ + azimuth: 180; + font-style:italic; + color:Maroon; + z-index:20; + +} + +span.XML-Token +{ + azimuth: 180; + font-style:italic; + color:Maroon; + z-index:20; + +} + +span.h2 +{ + font-size: 120%; + font-weight: bold; +} + + + +/* @group Heading Levels */ + +h1 { + font-size: 150%; +} + +.title { + font-size: 150%; + font-weight: bold; + margin: 10px 2px; +} + +h2 { + font-size: 120%; +} + +h3 { + font-size: 100%; +} + +h1, h2, h3, h4, h5, h6 { + -webkit-transition: text-shadow 0.5s linear; + -moz-transition: text-shadow 0.5s linear; + -ms-transition: text-shadow 0.5s linear; + -o-transition: text-shadow 0.5s linear; + transition: text-shadow 0.5s linear; + margin-right: 15px; +} + +h1.glow, h2.glow, h3.glow, h4.glow, h5.glow, h6.glow { + text-shadow: 0 0 15px cyan; +} + +dt { + font-weight: bold; +} + +div.multicol { + -moz-column-gap: 1em; + -webkit-column-gap: 1em; + -moz-column-count: 3; + -webkit-column-count: 3; +} + +p.startli, p.startdd, p.starttd { + margin-top: 2px; +} + +p.endli { + margin-bottom: 0px; +} + +p.enddd { + margin-bottom: 4px; +} + +p.endtd { + margin-bottom: 2px; +} + +/* @end */ + +caption { + font-weight: bold; +} + +span.legend { + font-size: 70%; + text-align: center; +} + +h3.version { + font-size: 90%; + text-align: center; +} + +div.qindex, div.navtab{ + background-color: #EBEFF6; + border: 1px solid #A2B4D8; + text-align: center; +} + +div.qindex, div.navpath { + width: 100%; + line-height: 140%; +} + +div.navtab { + margin-right: 15px; +} + +/* @group Link Styling */ + +a { + color: #3A568E; + font-weight: normal; + text-decoration: none; +} + +.contents a:visited { + color: #4464A5; +} + +a:hover { + text-decoration: underline; +} + +a.qindex { + font-weight: bold; +} + +a.qindexHL { + font-weight: bold; + background-color: #9AAED5; + color: #ffffff; + border: 1px double #849CCC; +} + +.contents a.qindexHL:visited { + color: #ffffff; +} + +a.el { + font-weight: bold; +} + +a.elRef { +} + +a.code, a.code:visited { + color: #4665A2; +} + +a.codeRef, a.codeRef:visited { + color: #4665A2; +} + +/* @end */ + +dl.el { + margin-left: -1cm; +} + +pre.fragment { + border: 1px solid #C4CFE5; + background-color: #FBFCFD; + padding: 4px 6px; + margin: 4px 8px 4px 2px; + overflow: auto; + word-wrap: break-word; + font-size: 9pt; + line-height: 125%; + font-family: monospace, fixed; + font-size: 105%; +} + +div.fragment { + padding: 4px; + margin: 4px; + background-color: #FBFCFD; + border: 1px solid #C3CFE6; +} + +div.line { + font-family: monospace, fixed; + font-size: 13px; + line-height: 1.0; + text-wrap: unrestricted; + white-space: -moz-pre-wrap; /* Moz */ + white-space: -pre-wrap; /* Opera 4-6 */ + white-space: -o-pre-wrap; /* Opera 7 */ + white-space: pre-wrap; /* CSS3 */ + word-wrap: break-word; /* IE 5.5+ */ + text-indent: -53px; + padding-left: 53px; + padding-bottom: 0px; + margin: 0px; +} + +span.lineno { + padding-right: 4px; + text-align: right; + border-right: 2px solid #0F0; + background-color: #E8E8E8; + white-space: pre; +} +span.lineno a { + background-color: #D8D8D8; +} + +span.lineno a:hover { + background-color: #C8C8C8; +} + +div.ah { + background-color: black; + font-weight: bold; + color: #ffffff; + margin-bottom: 3px; + margin-top: 3px; + padding: 0.2em; + border: solid thin #333; + border-radius: 0.5em; + -webkit-border-radius: .5em; + -moz-border-radius: .5em; + box-shadow: 2px 2px 3px #999; + -webkit-box-shadow: 2px 2px 3px #999; + -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px; + background-image: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#000),color-stop(0.3, #444)); + background-image: -moz-linear-gradient(center top, #eee 0%, #444 40%, #000); +} + +div.groupHeader { + margin-left: 16px; + margin-top: 12px; + font-weight: bold; +} + +div.groupText { + margin-left: 16px; + font-style: italic; +} + +body { + background-color: white; + color: black; + margin: 0; +} + +div.contents { + margin-top: 10px; + margin-left: 12px; + margin-right: 8px; +} + +td.indexkey { + background-color: #EBEFF6; + font-weight: bold; + border: 1px solid #C3CFE6; + margin: 2px 0px 2px 0; + padding: 2px 10px; + white-space: nowrap; + vertical-align: top; +} + +td.indexvalue { + background-color: #EBEFF6; + border: 1px solid #C3CFE6; + padding: 2px 10px; + margin: 2px 0px; +} + +tr.memlist { + background-color: #EDF1F7; +} + +p.formulaDsp { + text-align: center; +} + +img.formulaDsp { + +} + +img.formulaInl { + vertical-align: middle; +} + +div.center { + text-align: center; + margin-top: 0px; + margin-bottom: 0px; + padding: 0px; +} + +div.center img { + border: 0px; +} + +address.footer { + text-align: right; + padding-right: 12px; +} + +img.footer { + border: 0px; + vertical-align: middle; +} + +/* @group Code Colorization */ + +span.keyword { + color: #008000 +} + +span.keywordtype { + color: #604020 +} + +span.keywordflow { + color: #e08000 +} + +span.comment { + color: #800000 +} + +span.preprocessor { + color: #806020 +} + +span.stringliteral { + color: #002080 +} + +span.charliteral { + color: #008080 +} + +span.vhdldigit { + color: #ff00ff +} + +span.vhdlchar { + color: #000000 +} + +span.vhdlkeyword { + color: #700070 +} + +span.vhdllogic { + color: #ff0000 +} + +blockquote { + background-color: #F7F8FB; + border-left: 2px solid #9AAED5; + margin: 0 24px 0 4px; + padding: 0 12px 0 16px; +} + +/* @end */ + +/* +.search { + color: #003399; + font-weight: bold; +} + +form.search { + margin-bottom: 0px; + margin-top: 0px; +} + +input.search { + font-size: 75%; + color: #000080; + font-weight: normal; + background-color: #e8eef2; +} +*/ + +td.tiny { + font-size: 75%; +} + +.dirtab { + padding: 4px; + border-collapse: collapse; + border: 1px solid #A2B4D8; +} + +th.dirtab { + background: #EBEFF6; + font-weight: bold; +} + +hr { + height: 0px; + border: none; + border-top: 1px solid #4769AD; +} + +hr.footer { + height: 1px; +} + +/* @group Member Descriptions */ + +table.memberdecls { + border-spacing: 0px; + padding: 0px; +} + +.memberdecls td { + -webkit-transition-property: background-color, box-shadow; + -webkit-transition-duration: 0.5s; + -moz-transition-property: background-color, box-shadow; + -moz-transition-duration: 0.5s; + -ms-transition-property: background-color, box-shadow; + -ms-transition-duration: 0.5s; + -o-transition-property: background-color, box-shadow; + -o-transition-duration: 0.5s; + transition-property: background-color, box-shadow; + transition-duration: 0.5s; +} + +.memberdecls td.glow { + background-color: cyan; + box-shadow: 0 0 15px cyan; +} + +.mdescLeft, .mdescRight, +.memItemLeft, .memItemRight, +.memTemplItemLeft, .memTemplItemRight, .memTemplParams { + background-color: #F9FAFC; + border: none; + margin: 4px; + padding: 1px 0 0 8px; +} + +.mdescLeft, .mdescRight { + padding: 0px 8px 4px 8px; + color: #555; +} + +.memItemLeft, .memItemRight, .memTemplParams { + border-top: 1px solid #C3CFE6; +} + +.memItemLeft, .memTemplItemLeft { + white-space: nowrap; +} + +.memItemRight { + width: 100%; +} + +.memTemplParams { + color: #4464A5; + white-space: nowrap; +} + +/* @end */ + +/* @group Member Details */ + +/* Styles for detailed member documentation */ + +.memtemplate { + font-size: 80%; + color: #4464A5; + font-weight: normal; + margin-left: 9px; +} + +.memnav { + background-color: #EBEFF6; + border: 1px solid #A2B4D8; + text-align: center; + margin: 2px; + margin-right: 15px; + padding: 2px; +} + +.mempage { + width: 100%; +} + +.memitem { + padding: 0; + margin-bottom: 10px; + margin-right: 5px; + -webkit-transition: box-shadow 0.5s linear; + -moz-transition: box-shadow 0.5s linear; + -ms-transition: box-shadow 0.5s linear; + -o-transition: box-shadow 0.5s linear; + transition: box-shadow 0.5s linear; +} + +.memitem.glow { + box-shadow: 0 0 15px cyan; +} + +.memname { + font-weight: bold; + margin-left: 6px; +} + +.memname td { + vertical-align: bottom; +} + +.memproto, dl.reflist dt { + border-top: 1px solid #A7B8DA; + border-left: 1px solid #A7B8DA; + border-right: 1px solid #A7B8DA; + padding: 6px 0px 6px 0px; + color: #233456; + font-weight: bold; + text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); + background-image:url('nav_f.png'); + background-repeat:repeat-x; + background-color: #E2E7F3; + /* opera specific markup */ + box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + border-top-right-radius: 4px; + border-top-left-radius: 4px; + /* firefox specific markup */ + -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; + -moz-border-radius-topright: 4px; + -moz-border-radius-topleft: 4px; + /* webkit specific markup */ + -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + -webkit-border-top-right-radius: 4px; + -webkit-border-top-left-radius: 4px; + +} + +.memdoc, dl.reflist dd { + border-bottom: 1px solid #A7B8DA; + border-left: 1px solid #A7B8DA; + border-right: 1px solid #A7B8DA; + padding: 6px 10px 2px 10px; + background-color: #FBFCFD; + border-top-width: 0; + background-image:url('nav_g.png'); + background-repeat:repeat-x; + background-color: #FFFFFF; + /* opera specific markup */ + border-bottom-left-radius: 4px; + border-bottom-right-radius: 4px; + box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + /* firefox specific markup */ + -moz-border-radius-bottomleft: 4px; + -moz-border-radius-bottomright: 4px; + -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; + /* webkit specific markup */ + -webkit-border-bottom-left-radius: 4px; + -webkit-border-bottom-right-radius: 4px; + -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); +} + +dl.reflist dt { + padding: 5px; +} + +dl.reflist dd { + margin: 0px 0px 10px 0px; + padding: 5px; +} + +.paramkey { + text-align: right; +} + +.paramtype { + white-space: nowrap; +} + +.paramname { + color: #602020; + white-space: nowrap; +} +.paramname em { + font-style: normal; +} + +.params, .retval, .exception, .tparams { + margin-left: 0px; + padding-left: 0px; +} + +.params .paramname, .retval .paramname { + font-weight: bold; + vertical-align: top; +} + +.params .paramtype { + font-style: italic; + vertical-align: top; +} + +.params .paramdir { + font-family: "courier new",courier,monospace; + vertical-align: top; +} + +table.mlabels { + border-spacing: 0px; +} + +td.mlabels-left { + width: 100%; + padding: 0px; +} + +td.mlabels-right { + vertical-align: bottom; + padding: 0px; + white-space: nowrap; +} + +span.mlabels { + margin-left: 8px; +} + +span.mlabel { + background-color: #708CC4; + border-top:1px solid #5072B7; + border-left:1px solid #5072B7; + border-right:1px solid #C3CFE6; + border-bottom:1px solid #C3CFE6; + text-shadow: none; + color: white; + margin-right: 4px; + padding: 2px 3px; + border-radius: 3px; + font-size: 7pt; + white-space: nowrap; +} + + + +/* @end */ + +/* these are for tree view when not used as main index */ + +div.directory { + margin: 10px 0px; + border-top: 1px solid #A8B8D9; + border-bottom: 1px solid #A8B8D9; + width: 100%; +} + +.directory table { + border-collapse:collapse; +} + +.directory td { + margin: 0px; + padding: 0px; + vertical-align: top; +} + +.directory td.entry { + white-space: nowrap; + padding-right: 6px; +} + +.directory td.entry a { + outline:none; +} + +.directory td.desc { + width: 100%; + padding-left: 6px; + padding-right: 6px; + border-left: 1px solid rgba(0,0,0,0.05); +} + +.directory tr.even { + padding-left: 6px; + background-color: #F7F8FB; +} + +.directory img { + vertical-align: -30%; +} + +.directory .levels { + white-space: nowrap; + width: 100%; + text-align: right; + font-size: 9pt; +} + +.directory .levels span { + cursor: pointer; + padding-left: 2px; + padding-right: 2px; + color: #3A568E; +} + +div.dynheader { + margin-top: 8px; + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +address { + font-style: normal; + color: #293C63; +} + +table.doxtable { + border-collapse:collapse; + margin-top: 4px; + margin-bottom: 4px; +} + +table.doxtable td, table.doxtable th { + border: 1px solid #2B4069; + padding: 3px 7px 2px; +} + +table.doxtable th { + background-color: #EBEFF6; + color: #000000; + font-size: 110%; + padding-bottom: 4px; + padding-top: 5px; +} + +table.fieldtable { + width: 100%; + margin-bottom: 10px; + border: 1px solid #A7B8DA; + border-spacing: 0px; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; + -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px; + -webkit-box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15); + box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15); +} + +.fieldtable td, .fieldtable th { + padding: 3px 7px 2px; +} + +.fieldtable td.fieldtype, .fieldtable td.fieldname { + white-space: nowrap; + border-right: 1px solid #A7B8DA; + border-bottom: 1px solid #A7B8DA; + vertical-align: top; +} + +.fieldtable td.fielddoc { + border-bottom: 1px solid #A7B8DA; + width: 100%; +} + +.fieldtable tr:last-child td { + border-bottom: none; +} + +.fieldtable th { + background-image:url('nav_f.png'); + background-repeat:repeat-x; + background-color: #E2E7F3; + font-size: 90%; + color: #233456; + padding-bottom: 4px; + padding-top: 5px; + text-align:left; + -moz-border-radius-topleft: 4px; + -moz-border-radius-topright: 4px; + -webkit-border-top-left-radius: 4px; + -webkit-border-top-right-radius: 4px; + border-top-left-radius: 4px; + border-top-right-radius: 4px; + border-bottom: 1px solid #A7B8DA; +} + + +.tabsearch { + top: 0px; + left: 10px; + height: 36px; + background-image: url('tab_b.png'); + z-index: 101; + overflow: hidden; + font-size: 13px; +} + +.navpath ul +{ + font-size: 11px; + background-image:url('tab_b.png'); + background-repeat:repeat-x; + height:30px; + line-height:30px; + color:#889FCE; + border:solid 1px #C1CDE5; + overflow:hidden; + margin:0px; + padding:0px; +} + +.navpath li +{ + list-style-type:none; + float:left; + padding-left:10px; + padding-right:15px; + background-image:url('bc_s.png'); + background-repeat:no-repeat; + background-position:right; + color:#344D7E; +} + +.navpath li.navelem a +{ + height:32px; + display:block; + text-decoration: none; + outline: none; +} + +.navpath li.navelem a:hover +{ + color:#6583BF; +} + +.navpath li.footer +{ + list-style-type:none; + float:right; + padding-left:10px; + padding-right:15px; + background-image:none; + background-repeat:no-repeat; + background-position:right; + color:#344D7E; + font-size: 8pt; +} + + +div.summary +{ + float: right; + font-size: 8pt; + padding-right: 5px; + width: 50%; + text-align: right; +} + +div.summary a +{ + white-space: nowrap; +} + +div.ingroups +{ + margin-left: 5px; + font-size: 8pt; + padding-left: 5px; + width: 50%; + text-align: left; +} + +div.ingroups a +{ + white-space: nowrap; +} + +div.header +{ + background-image:url('nav_h.png'); + background-repeat:repeat-x; + background-color: #F9FAFC; + margin: 0px; + border-bottom: 1px solid #C3CFE6; +} + +div.headertitle +{ + padding: 5px 5px 5px 7px; +} + +dl +{ + padding: 0 0 0 10px; +} + +/* dl.note, dl.warning, dl.attention, dl.pre, dl.post, dl.invariant, dl.deprecated, dl.todo, dl.test, dl.bug */ +dl.section +{ + margin-left: 0px; + padding-left: 0px; +} + +dl.note +{ + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; + border-color: #D0C000; +} + +dl.warning, dl.attention +{ + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; + border-color: #FF0000; +} + +dl.pre, dl.post, dl.invariant +{ + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; + border-color: #00D000; +} + +dl.deprecated +{ + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; + border-color: #505050; +} + +dl.todo +{ + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; + border-color: #00C0E0; +} + +dl.test +{ + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; + border-color: #3030E0; +} + +dl.bug +{ + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; + border-color: #C08050; +} + +dl.section dd { + margin-bottom: 6px; +} + + +#projectlogo +{ + text-align: center; + vertical-align: bottom; + border-collapse: separate; +} + +#projectlogo img +{ + border: 0px none; +} + +#projectname +{ + font: 300% Tahoma, Arial,sans-serif; + margin: 0px; + padding: 2px 0px; +} + +#projectbrief +{ + font: 120% Tahoma, Arial,sans-serif; + margin: 0px; + padding: 0px; +} + +#projectnumber +{ + font: 50% Tahoma, Arial,sans-serif; + margin: 0px; + padding: 0px; +} + +#titlearea +{ + padding: 0px; + margin: 0px; + width: 100%; + border-bottom: 1px solid #5072B7; +} + +.image +{ + text-align: center; +} + +.dotgraph +{ + text-align: center; +} + +.mscgraph +{ + text-align: center; +} + +.caption +{ + font-weight: bold; +} + +div.zoom +{ + border: 1px solid #8EA4D0; +} + +dl.citelist { + margin-bottom:50px; +} + +dl.citelist dt { + color:#314877; + float:left; + font-weight:bold; + margin-right:10px; + padding:5px; +} + +dl.citelist dd { + margin:2px 0; + padding:5px 0; +} + +div.toc { + padding: 14px 25px; + background-color: #F4F6FA; + border: 1px solid #D7DFEE; + border-radius: 7px 7px 7px 7px; + float: right; + height: auto; + margin: 0 20px 10px 10px; + width: 200px; +} + +div.toc li { + background: url("bdwn.png") no-repeat scroll 0 5px transparent; + font: 10px/1.2 Verdana,DejaVu Sans,Geneva,sans-serif; + margin-top: 5px; + padding-left: 10px; + padding-top: 2px; +} + +div.toc h3 { + font: bold 12px/1.2 Arial,FreeSans,sans-serif; + color: #4464A5; + border-bottom: 0 none; + margin: 0; +} + +div.toc ul { + list-style: none outside none; + border: medium none; + padding: 0px; +} + +div.toc li.level1 { + margin-left: 0px; +} + +div.toc li.level2 { + margin-left: 15px; +} + +div.toc li.level3 { + margin-left: 30px; +} + +div.toc li.level4 { + margin-left: 45px; +} + +.inherit_header { + font-weight: bold; + color: gray; + cursor: pointer; + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +.inherit_header td { + padding: 6px 0px 2px 5px; +} + +.inherit { + display: none; +} + +tr.heading h2 { + margin-top: 12px; + margin-bottom: 4px; +} + +@media print +{ + #top { display: none; } + #side-nav { display: none; } + #nav-path { display: none; } + body { overflow:visible; } + h1, h2, h3, h4, h5, h6 { page-break-after: avoid; } + .summary { display: none; } + .memitem { page-break-inside: avoid; } + #doc-content + { + margin-left:0 !important; + height:auto !important; + width:auto !important; + overflow:inherit; + display:inline; + } +} + diff --git a/Documentation/RTOS/html/cmsis__os_8h.html b/Documentation/RTOS/html/cmsis__os_8h.html new file mode 100644 index 0000000..8ff05bf --- /dev/null +++ b/Documentation/RTOS/html/cmsis__os_8h.html @@ -0,0 +1,689 @@ + + + + + +cmsis_os.h File Reference +CMSIS-RTOS: cmsis_os.h File Reference + + + + + + + + + + + + +
+
+ + + + + + + +
+
CMSIS-RTOS +  Version 1.02 +
+
CMSIS-RTOS API: Generic RTOS interface for Cortex-M processor-based devices.
+
+
+ +
+
    + +
+
+ + +
+
+ +
+
+
+ +
+
+ +
+
cmsis_os.h File Reference
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

+Data Structures

struct  osThreadDef_t
 Thread Definition structure contains startup information of a thread. More...
 
struct  osTimerDef_t
 Timer Definition structure contains timer parameters. More...
 
struct  osMutexDef_t
 Mutex Definition structure contains setup information for a mutex. More...
 
struct  osSemaphoreDef_t
 Semaphore Definition structure contains setup information for a semaphore. More...
 
struct  osPoolDef_t
 Definition structure for memory block allocation. More...
 
struct  osMessageQDef_t
 Definition structure for message queue. More...
 
struct  osMailQDef_t
 Definition structure for mail queue. More...
 
struct  osEvent
 Event structure contains detailed information about an event. More...
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Macros

#define osCMSIS   0x10002
 API version (main [31:16] .sub [15:0])
 
#define osCMSIS_KERNEL   0x10000
 RTOS identification and version (main [31:16] .sub [15:0])
 
#define osKernelSystemId   "KERNEL V1.00"
 RTOS identification string.
 
#define osFeature_MainThread   1
 main thread 1=main can be thread, 0=not available
 
#define osFeature_Pool   1
 Memory Pools: 1=available, 0=not available.
 
#define osFeature_MailQ   1
 Mail Queues: 1=available, 0=not available.
 
#define osFeature_MessageQ   1
 Message Queues: 1=available, 0=not available.
 
#define osFeature_Signals   8
 maximum number of Signal Flags available per thread
 
#define osFeature_Semaphore   30
 maximum count for osSemaphoreCreate function
 
#define osFeature_Wait   1
 osWait function: 1=available, 0=not available
 
#define osFeature_SysTick   1
 osKernelSysTick functions: 1=available, 0=not available
 
#define osWaitForever   0xFFFFFFFF
 Timeout value.
 
#define osKernelSysTickFrequency   100000000
 The RTOS kernel system timer frequency in Hz.
 
#define osKernelSysTickMicroSec(microsec)   (((uint64_t)microsec * (osKernelSysTickFrequency)) / 1000000)
 Convert a microseconds value to a RTOS kernel system timer value.
 
#define osThreadDef(name, priority, instances, stacksz)
 Create a Thread Definition with function, priority, and stack requirements.
 
#define osThread(name)   &os_thread_def_##name
 Access a Thread definition.
 
#define osTimerDef(name, function)
 Define a Timer object.
 
#define osTimer(name)   &os_timer_def_##name
 Access a Timer definition.
 
#define osMutexDef(name)   const osMutexDef_t os_mutex_def_##name = { 0 }
 Define a Mutex.
 
#define osMutex(name)   &os_mutex_def_##name
 Access a Mutex definition.
 
#define osSemaphoreDef(name)   const osSemaphoreDef_t os_semaphore_def_##name = { 0 }
 Define a Semaphore object.
 
#define osSemaphore(name)   &os_semaphore_def_##name
 Access a Semaphore definition.
 
#define osPoolDef(name, no, type)
 Define a Memory Pool.
 
#define osPool(name)   &os_pool_def_##name
 Access a Memory Pool definition.
 
#define osMessageQDef(name, queue_sz, type)
 Create a Message Queue Definition.
 
#define osMessageQ(name)   &os_messageQ_def_##name
 Access a Message Queue Definition.
 
#define osMailQDef(name, queue_sz, type)
 Create a Mail Queue Definition.
 
#define osMailQ(name)   &os_mailQ_def_##name
 Access a Mail Queue Definition.
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Typedefs

typedef void(* os_pthread )(void const *argument)
 Entry point of a thread.
 
typedef void(* os_ptimer )(void const *argument)
 Entry point of a timer call back function.
 
typedef struct os_thread_cb * osThreadId
 Thread ID identifies the thread (pointer to a thread control block).
 
typedef struct os_timer_cb * osTimerId
 Timer ID identifies the timer (pointer to a timer control block).
 
typedef struct os_mutex_cb * osMutexId
 Mutex ID identifies the mutex (pointer to a mutex control block).
 
typedef struct os_semaphore_cb * osSemaphoreId
 Semaphore ID identifies the semaphore (pointer to a semaphore control block).
 
typedef struct os_pool_cb * osPoolId
 Pool ID identifies the memory pool (pointer to a memory pool control block).
 
typedef struct os_messageQ_cb * osMessageQId
 Message ID identifies the message queue (pointer to a message queue control block).
 
typedef struct os_mailQ_cb * osMailQId
 Mail ID identifies the mail queue (pointer to a mail queue control block).
 
+ + + + + + + + + + +

+Enumerations

enum  osPriority {
+  osPriorityIdle = -3, +
+  osPriorityLow = -2, +
+  osPriorityBelowNormal = -1, +
+  osPriorityNormal = 0, +
+  osPriorityAboveNormal = +1, +
+  osPriorityHigh = +2, +
+  osPriorityRealtime = +3, +
+  osPriorityError = 0x84 +
+ }
 Priority used for thread control. More...
 
enum  osStatus {
+  osOK = 0, +
+  osEventSignal = 0x08, +
+  osEventMessage = 0x10, +
+  osEventMail = 0x20, +
+  osEventTimeout = 0x40, +
+  osErrorParameter = 0x80, +
+  osErrorResource = 0x81, +
+  osErrorTimeoutResource = 0xC1, +
+  osErrorISR = 0x82, +
+  osErrorISRRecursive = 0x83, +
+  osErrorPriority = 0x84, +
+  osErrorNoMemory = 0x85, +
+  osErrorValue = 0x86, +
+  osErrorOS = 0xFF, +
+  os_status_reserved = 0x7FFFFFFF +
+ }
 Status code values returned by CMSIS-RTOS functions. More...
 
enum  os_timer_type {
+  osTimerOnce = 0, +
+  osTimerPeriodic = 1 +
+ }
 Timer type value for the timer definition. More...
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Functions

osStatus osKernelInitialize (void)
 Initialize the RTOS Kernel for creating objects.
 
osStatus osKernelStart (void)
 Start the RTOS Kernel.
 
int32_t osKernelRunning (void)
 Check if the RTOS kernel is already started.
 
uint32_t osKernelSysTick (void)
 Get the RTOS kernel system timer counter.
 
osThreadId osThreadCreate (const osThreadDef_t *thread_def, void *argument)
 Create a thread and add it to Active Threads and set it to state READY.
 
osThreadId osThreadGetId (void)
 Return the thread ID of the current running thread.
 
osStatus osThreadTerminate (osThreadId thread_id)
 Terminate execution of a thread and remove it from Active Threads.
 
osStatus osThreadYield (void)
 Pass control to next thread that is in state READY.
 
osStatus osThreadSetPriority (osThreadId thread_id, osPriority priority)
 Change priority of an active thread.
 
osPriority osThreadGetPriority (osThreadId thread_id)
 Get current priority of an active thread.
 
osStatus osDelay (uint32_t millisec)
 Wait for Timeout (Time Delay).
 
osEvent osWait (uint32_t millisec)
 Wait for Signal, Message, Mail, or Timeout.
 
osTimerId osTimerCreate (const osTimerDef_t *timer_def, os_timer_type type, void *argument)
 Create a timer.
 
osStatus osTimerStart (osTimerId timer_id, uint32_t millisec)
 Start or restart a timer.
 
osStatus osTimerStop (osTimerId timer_id)
 Stop the timer.
 
osStatus osTimerDelete (osTimerId timer_id)
 Delete a timer that was created by osTimerCreate.
 
int32_t osSignalSet (osThreadId thread_id, int32_t signals)
 Set the specified Signal Flags of an active thread.
 
int32_t osSignalClear (osThreadId thread_id, int32_t signals)
 Clear the specified Signal Flags of an active thread.
 
osEvent osSignalWait (int32_t signals, uint32_t millisec)
 Wait for one or more Signal Flags to become signaled for the current RUNNING thread.
 
osMutexId osMutexCreate (const osMutexDef_t *mutex_def)
 Create and Initialize a Mutex object.
 
osStatus osMutexWait (osMutexId mutex_id, uint32_t millisec)
 Wait until a Mutex becomes available.
 
osStatus osMutexRelease (osMutexId mutex_id)
 Release a Mutex that was obtained by osMutexWait.
 
osStatus osMutexDelete (osMutexId mutex_id)
 Delete a Mutex that was created by osMutexCreate.
 
osSemaphoreId osSemaphoreCreate (const osSemaphoreDef_t *semaphore_def, int32_t count)
 Create and Initialize a Semaphore object used for managing resources.
 
int32_t osSemaphoreWait (osSemaphoreId semaphore_id, uint32_t millisec)
 Wait until a Semaphore token becomes available.
 
osStatus osSemaphoreRelease (osSemaphoreId semaphore_id)
 Release a Semaphore token.
 
osStatus osSemaphoreDelete (osSemaphoreId semaphore_id)
 Delete a Semaphore that was created by osSemaphoreCreate.
 
osPoolId osPoolCreate (const osPoolDef_t *pool_def)
 Create and Initialize a memory pool.
 
void * osPoolAlloc (osPoolId pool_id)
 Allocate a memory block from a memory pool.
 
void * osPoolCAlloc (osPoolId pool_id)
 Allocate a memory block from a memory pool and set memory block to zero.
 
osStatus osPoolFree (osPoolId pool_id, void *block)
 Return an allocated memory block back to a specific memory pool.
 
osMessageQId osMessageCreate (const osMessageQDef_t *queue_def, osThreadId thread_id)
 Create and Initialize a Message Queue.
 
osStatus osMessagePut (osMessageQId queue_id, uint32_t info, uint32_t millisec)
 Put a Message to a Queue.
 
osEvent osMessageGet (osMessageQId queue_id, uint32_t millisec)
 Get a Message or Wait for a Message from a Queue.
 
osMailQId osMailCreate (const osMailQDef_t *queue_def, osThreadId thread_id)
 Create and Initialize mail queue.
 
void * osMailAlloc (osMailQId queue_id, uint32_t millisec)
 Allocate a memory block from a mail.
 
void * osMailCAlloc (osMailQId queue_id, uint32_t millisec)
 Allocate a memory block from a mail and set memory block to zero.
 
osStatus osMailPut (osMailQId queue_id, void *mail)
 Put a mail to a queue.
 
osEvent osMailGet (osMailQId queue_id, uint32_t millisec)
 Get a mail from a queue.
 
osStatus osMailFree (osMailQId queue_id, void *mail)
 Free a memory block from a mail.
 
+

Macro Definition Documentation

+ +
+
+ + + + +
#define osWaitForever   0xFFFFFFFF
+
+
Note
MUST REMAIN UNCHANGED: osWaitForever shall be consistent in every CMSIS-RTOS. wait forever timeout value
+ +
+
+

Typedef Documentation

+ +
+
+ + + + +
typedef void(* os_pthread)(void const *argument)
+
+
Note
MUST REMAIN UNCHANGED: os_pthread shall be consistent in every CMSIS-RTOS.
+ +
+
+ +
+
+ + + + +
typedef void(* os_ptimer)(void const *argument)
+
+
Note
MUST REMAIN UNCHANGED: os_ptimer shall be consistent in every CMSIS-RTOS.
+ +
+
+ +
+
+ + + + +
typedef struct os_mailQ_cb* osMailQId
+
+
Note
CAN BE CHANGED: os_mailQ_cb is implementation specific in every CMSIS-RTOS.
+ +
+
+ +
+
+ + + + +
typedef struct os_messageQ_cb* osMessageQId
+
+
Note
CAN BE CHANGED: os_messageQ_cb is implementation specific in every CMSIS-RTOS.
+ +
+
+ +
+
+ + + + +
typedef struct os_mutex_cb* osMutexId
+
+
Note
CAN BE CHANGED: os_mutex_cb is implementation specific in every CMSIS-RTOS.
+ +
+
+ +
+
+ + + + +
typedef struct os_pool_cb* osPoolId
+
+
Note
CAN BE CHANGED: os_pool_cb is implementation specific in every CMSIS-RTOS.
+ +
+
+ +
+
+ + + + +
typedef struct os_semaphore_cb* osSemaphoreId
+
+
Note
CAN BE CHANGED: os_semaphore_cb is implementation specific in every CMSIS-RTOS.
+ +
+
+ +
+
+ + + + +
typedef struct os_thread_cb* osThreadId
+
+
Note
CAN BE CHANGED: os_thread_cb is implementation specific in every CMSIS-RTOS.
+ +
+
+ +
+
+ + + + +
typedef struct os_timer_cb* osTimerId
+
+
Note
CAN BE CHANGED: os_timer_cb is implementation specific in every CMSIS-RTOS.
+ +
+
+

Enumeration Type Documentation

+ +
+
+ + + + +
enum os_timer_type
+
+
Note
MUST REMAIN UNCHANGED: os_timer_type shall be consistent in every CMSIS-RTOS.
+
Enumerator:
+ + +
osTimerOnce  +

one-shot timer

+
osTimerPeriodic  +

repeating timer

+
+
+
+ +
+
+ +
+
+ + + + +
enum osPriority
+
+
Note
MUST REMAIN UNCHANGED: osPriority shall be consistent in every CMSIS-RTOS.
+
Enumerator:
+ + + + + + + + +
osPriorityIdle  +

priority: idle (lowest)

+
osPriorityLow  +

priority: low

+
osPriorityBelowNormal  +

priority: below normal

+
osPriorityNormal  +

priority: normal (default)

+
osPriorityAboveNormal  +

priority: above normal

+
osPriorityHigh  +

priority: high

+
osPriorityRealtime  +

priority: realtime (highest)

+
osPriorityError  +

system cannot determine priority or thread has illegal priority

+
+
+
+ +
+
+ +
+
+ + + + +
enum osStatus
+
+
Note
MUST REMAIN UNCHANGED: osStatus shall be consistent in every CMSIS-RTOS.
+
Enumerator:
+ + + + + + + + + + + + + + + +
osOK  +

function completed; no error or event occurred.

+
osEventSignal  +

function completed; signal event occurred.

+
osEventMessage  +

function completed; message event occurred.

+
osEventMail  +

function completed; mail event occurred.

+
osEventTimeout  +

function completed; timeout occurred.

+
osErrorParameter  +

parameter error: a mandatory parameter was missing or specified an incorrect object.

+
osErrorResource  +

resource not available: a specified resource was not available.

+
osErrorTimeoutResource  +

resource not available within given time: a specified resource was not available within the timeout period.

+
osErrorISR  +

not allowed in ISR context: the function cannot be called from interrupt service routines.

+
osErrorISRRecursive  +

function called multiple times from ISR with same object.

+
osErrorPriority  +

system cannot determine priority or thread has illegal priority.

+
osErrorNoMemory  +

system is out of memory: it was impossible to allocate or reserve memory for the operation.

+
osErrorValue  +

value of a parameter is out of range.

+
osErrorOS  +

unspecified RTOS error: run-time error but no other error message fits.

+
os_status_reserved  +

prevent from enum down-size compiler optimization.

+
+
+
+ +
+
+
+
+ + + + diff --git a/Documentation/RTOS/html/cmsis__os_8txt.html b/Documentation/RTOS/html/cmsis__os_8txt.html new file mode 100644 index 0000000..5941e23 --- /dev/null +++ b/Documentation/RTOS/html/cmsis__os_8txt.html @@ -0,0 +1,156 @@ + + + + + +cmsis_os.txt File Reference +CMSIS-RTOS: cmsis_os.txt File Reference + + + + + + + + + + + + +
+
+ + + + + + + +
+
CMSIS-RTOS +  Version 1.02 +
+
CMSIS-RTOS API: Generic RTOS interface for Cortex-M processor-based devices.
+
+
+ +
+
    + +
+
+ + +
+
+ +
+
+
+ +
+
+ +
+
cmsis_os.txt File Reference
+
+
+ + + + + + + + +

+Enumerations

enum  osPriority {
+  osPriorityIdle = -3, +
+  osPriorityLow = -2, +
+  osPriorityBelowNormal = -1, +
+  osPriorityNormal = 0, +
+  osPriorityAboveNormal = +1, +
+  osPriorityHigh = +2, +
+  osPriorityRealtime = +3, +
+  osPriorityError = 0x84 +
+ }
 
enum  os_timer_type {
+  osTimerOnce = 0, +
+  osTimerPeriodic = 1 +
+ }
 
enum  osStatus {
+  osOK = 0, +
+  osEventSignal = 0x08, +
+  osEventMessage = 0x10, +
+  osEventMail = 0x20, +
+  osEventTimeout = 0x40, +
+  osErrorParameter = 0x80, +
+  osErrorResource = 0x81, +
+  osErrorTimeoutResource = 0xC1, +
+  osErrorISR = 0x82, +
+  osErrorISRRecursive = 0x83, +
+  osErrorPriority = 0x84, +
+  osErrorNoMemory = 0x85, +
+  osErrorValue = 0x86, +
+  osErrorOS = 0xFF, +
+  os_status_reserved = 0x7FFFFFFF +
+ }
 
+
+
+ + + + diff --git a/Documentation/RTOS/html/cmsis_os_h.html b/Documentation/RTOS/html/cmsis_os_h.html new file mode 100644 index 0000000..5e50d38 --- /dev/null +++ b/Documentation/RTOS/html/cmsis_os_h.html @@ -0,0 +1,826 @@ + + + + + +Header File Template: cmsis_os.h +CMSIS-RTOS: Header File Template: cmsis_os.h + + + + + + + + + + + + +
+
+ + + + + + + +
+
CMSIS-RTOS +  Version 1.02 +
+
CMSIS-RTOS API: Generic RTOS interface for Cortex-M processor-based devices.
+
+
+ +
+
    + +
+
+ + +
+
+ +
+
+
+ +
+
+
+
Header File Template: cmsis_os.h
+
+
+

The file cmsis_os.h is a template header file for a CMSIS-RTOS compliant Real-Time Operating System (RTOS). Each RTOS that is compliant with CMSIS-RTOS shall provide a specific cmsis_os.h header file that represents its implementation.

+

The file cmsis_os.h contains:

+
    +
  • CMSIS-RTOS API function definitions
  • +
  • struct definitions for parameters and return types
  • +
  • status and priority values used by CMSIS-RTOS API functions
  • +
  • macros for defining threads and other kernel objects
  • +
+

Name conventions and header file modifications

+

All definitions are prefixed with os to give an unique name space for CMSIS-RTOS functions. Definitions that are prefixed os_ are not used in the application code but local to this header file. All definitions and functions that belong to a module are grouped and have a common prefix, i.e. osThread.

+

Definitions that are marked with CAN BE CHANGED can be adapted towards the needs of the actual CMSIS-RTOS implementation. These definitions can be specific to the underlying RTOS kernel.

+

Definitions that are marked with MUST REMAIN UNCHANGED cannot be altered. Otherwise the CMSIS-RTOS implementation is no longer compliant to the standard. Note that some functions are optional and need not to be provided by every CMSIS-RTOS implementation.

+

Define and reference object definitions

+

With #define osObjectsExternal objects are defined as external symbols. This allows to create a consistent header file that is used throughout a project as shown below:

+

Header File

+
#include <cmsis_os.h> // CMSIS RTOS header file
+
+
// Thread definition
+
extern void thread_sample (void const *argument); // function prototype
+
osThreadDef (thread_sample, osPriorityBelowNormal, 1, 100);
+
+
// Pool definition
+
osPoolDef(MyPool, 10, long);
+

This header file defines all objects when included in a C/C++ source file. When #define osObjectsExternal is present before the header file, the objects are defined as external symbols. A single consistent header file can therefore be used throughout the whole project.

+

Example

+
#include "osObjects.h" // Definition of the CMSIS-RTOS objects
+
#define osObjectsExternal // Objects will be defined as external symbols
+
#include "osObjects.h" // Reference to the CMSIS-RTOS objects
+

Header file cmsis_os.h

+
/* ----------------------------------------------------------------------
+
* $Date: 5. February 2013
+
* $Revision: V1.02
+
*
+
* Project: CMSIS-RTOS API
+
* Title: cmsis_os.h template header file
+
*
+
* Version 0.02
+
* Initial Proposal Phase
+
* Version 0.03
+
* osKernelStart added, optional feature: main started as thread
+
* osSemaphores have standard behavior
+
* osTimerCreate does not start the timer, added osTimerStart
+
* osThreadPass is renamed to osThreadYield
+
* Version 1.01
+
* Support for C++ interface
+
* - const attribute removed from the osXxxxDef_t typedef's
+
* - const attribute added to the osXxxxDef macros
+
* Added: osTimerDelete, osMutexDelete, osSemaphoreDelete
+
* Added: osKernelInitialize
+
* Version 1.02
+
* Control functions for short timeouts in microsecond resolution:
+
* Added: osKernelSysTick, osKernelSysTickFrequency, osKernelSysTickMicroSec
+
* Removed: osSignalGet
+
*----------------------------------------------------------------------------
+
*
+
* Copyright (c) 2013 ARM LIMITED
+
* All rights reserved.
+
* Redistribution and use in source and binary forms, with or without
+
* modification, are permitted provided that the following conditions are met:
+
* - Redistributions of source code must retain the above copyright
+
* notice, this list of conditions and the following disclaimer.
+
* - Redistributions in binary form must reproduce the above copyright
+
* notice, this list of conditions and the following disclaimer in the
+
* documentation and/or other materials provided with the distribution.
+
* - Neither the name of ARM nor the names of its contributors may be used
+
* to endorse or promote products derived from this software without
+
* specific prior written permission.
+
*
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+
* ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
+
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+
* POSSIBILITY OF SUCH DAMAGE.
+
*---------------------------------------------------------------------------*/
+
+
+
#ifndef _CMSIS_OS_H
+
#define _CMSIS_OS_H
+
+
/// \note MUST REMAIN UNCHANGED: \b osCMSIS identifies the CMSIS-RTOS API version.
+
#define osCMSIS 0x10002 ///< API version (main [31:16] .sub [15:0])
+
+
/// \note CAN BE CHANGED: \b osCMSIS_KERNEL identifies the underlying RTOS kernel and version number.
+
#define osCMSIS_KERNEL 0x10000 ///< RTOS identification and version (main [31:16] .sub [15:0])
+
+
/// \note MUST REMAIN UNCHANGED: \b osKernelSystemId shall be consistent in every CMSIS-RTOS.
+
#define osKernelSystemId "KERNEL V1.00" ///< RTOS identification string
+
+
/// \note MUST REMAIN UNCHANGED: \b osFeature_xxx shall be consistent in every CMSIS-RTOS.
+
#define osFeature_MainThread 1 ///< main thread 1=main can be thread, 0=not available
+
#define osFeature_Pool 1 ///< Memory Pools: 1=available, 0=not available
+
#define osFeature_MailQ 1 ///< Mail Queues: 1=available, 0=not available
+
#define osFeature_MessageQ 1 ///< Message Queues: 1=available, 0=not available
+
#define osFeature_Signals 8 ///< maximum number of Signal Flags available per thread
+
#define osFeature_Semaphore 30 ///< maximum count for \ref osSemaphoreCreate function
+
#define osFeature_Wait 1 ///< osWait function: 1=available, 0=not available
+
#define osFeature_SysTick 1 ///< osKernelSysTick functions: 1=available, 0=not available
+
+
#include <stdint.h>
+
#include <stddef.h>
+
+
#ifdef __cplusplus
+
extern "C"
+
{
+
#endif
+
+
+
// ==== Enumeration, structures, defines ====
+
+
/// Priority used for thread control.
+
/// \note MUST REMAIN UNCHANGED: \b osPriority shall be consistent in every CMSIS-RTOS.
+
typedef enum {
+
osPriorityIdle = -3, ///< priority: idle (lowest)
+
osPriorityLow = -2, ///< priority: low
+
osPriorityBelowNormal = -1, ///< priority: below normal
+
osPriorityNormal = 0, ///< priority: normal (default)
+
osPriorityAboveNormal = +1, ///< priority: above normal
+
osPriorityHigh = +2, ///< priority: high
+
osPriorityRealtime = +3, ///< priority: realtime (highest)
+
osPriorityError = 0x84 ///< system cannot determine priority or thread has illegal priority
+ +
+
/// Timeout value.
+
/// \note MUST REMAIN UNCHANGED: \b osWaitForever shall be consistent in every CMSIS-RTOS.
+
#define osWaitForever 0xFFFFFFFF ///< wait forever timeout value
+
+
/// Status code values returned by CMSIS-RTOS functions.
+
/// \note MUST REMAIN UNCHANGED: \b osStatus shall be consistent in every CMSIS-RTOS.
+
typedef enum {
+
osOK = 0, ///< function completed; no error or event occurred.
+
osEventSignal = 0x08, ///< function completed; signal event occurred.
+
osEventMessage = 0x10, ///< function completed; message event occurred.
+
osEventMail = 0x20, ///< function completed; mail event occurred.
+
osEventTimeout = 0x40, ///< function completed; timeout occurred.
+
osErrorParameter = 0x80, ///< parameter error: a mandatory parameter was missing or specified an incorrect object.
+
osErrorResource = 0x81, ///< resource not available: a specified resource was not available.
+
osErrorTimeoutResource = 0xC1, ///< resource not available within given time: a specified resource was not available within the timeout period.
+
osErrorISR = 0x82, ///< not allowed in ISR context: the function cannot be called from interrupt service routines.
+
osErrorISRRecursive = 0x83, ///< function called multiple times from ISR with same object.
+
osErrorPriority = 0x84, ///< system cannot determine priority or thread has illegal priority.
+
osErrorNoMemory = 0x85, ///< system is out of memory: it was impossible to allocate or reserve memory for the operation.
+
osErrorValue = 0x86, ///< value of a parameter is out of range.
+
osErrorOS = 0xFF, ///< unspecified RTOS error: run-time error but no other error message fits.
+
os_status_reserved = 0x7FFFFFFF ///< prevent from enum down-size compiler optimization.
+ +
+
+
/// Timer type value for the timer definition.
+
/// \note MUST REMAIN UNCHANGED: \b os_timer_type shall be consistent in every CMSIS-RTOS.
+
typedef enum {
+
osTimerOnce = 0, ///< one-shot timer
+
osTimerPeriodic = 1 ///< repeating timer
+ +
+
/// Entry point of a thread.
+
/// \note MUST REMAIN UNCHANGED: \b os_pthread shall be consistent in every CMSIS-RTOS.
+
typedef void (*os_pthread) (void const *argument);
+
+
/// Entry point of a timer call back function.
+
/// \note MUST REMAIN UNCHANGED: \b os_ptimer shall be consistent in every CMSIS-RTOS.
+
typedef void (*os_ptimer) (void const *argument);
+
+
// >>> the following data type definitions may shall adapted towards a specific RTOS
+
+
/// Thread ID identifies the thread (pointer to a thread control block).
+
/// \note CAN BE CHANGED: \b os_thread_cb is implementation specific in every CMSIS-RTOS.
+
typedef struct os_thread_cb *osThreadId;
+
+
/// Timer ID identifies the timer (pointer to a timer control block).
+
/// \note CAN BE CHANGED: \b os_timer_cb is implementation specific in every CMSIS-RTOS.
+
typedef struct os_timer_cb *osTimerId;
+
+
/// Mutex ID identifies the mutex (pointer to a mutex control block).
+
/// \note CAN BE CHANGED: \b os_mutex_cb is implementation specific in every CMSIS-RTOS.
+
typedef struct os_mutex_cb *osMutexId;
+
+
/// Semaphore ID identifies the semaphore (pointer to a semaphore control block).
+
/// \note CAN BE CHANGED: \b os_semaphore_cb is implementation specific in every CMSIS-RTOS.
+
typedef struct os_semaphore_cb *osSemaphoreId;
+
+
/// Pool ID identifies the memory pool (pointer to a memory pool control block).
+
/// \note CAN BE CHANGED: \b os_pool_cb is implementation specific in every CMSIS-RTOS.
+
typedef struct os_pool_cb *osPoolId;
+
+
/// Message ID identifies the message queue (pointer to a message queue control block).
+
/// \note CAN BE CHANGED: \b os_messageQ_cb is implementation specific in every CMSIS-RTOS.
+
typedef struct os_messageQ_cb *osMessageQId;
+
+
/// Mail ID identifies the mail queue (pointer to a mail queue control block).
+
/// \note CAN BE CHANGED: \b os_mailQ_cb is implementation specific in every CMSIS-RTOS.
+
typedef struct os_mailQ_cb *osMailQId;
+
+
+
/// Thread Definition structure contains startup information of a thread.
+
/// \note CAN BE CHANGED: \b os_thread_def is implementation specific in every CMSIS-RTOS.
+
typedef struct os_thread_def {
+
os_pthread pthread; ///< start address of thread function
+
osPriority tpriority; ///< initial thread priority
+
uint32_t instances; ///< maximum number of instances of that thread function
+
uint32_t stacksize; ///< stack size requirements in bytes; 0 is default stack size
+ +
+
/// Timer Definition structure contains timer parameters.
+
/// \note CAN BE CHANGED: \b os_timer_def is implementation specific in every CMSIS-RTOS.
+
typedef struct os_timer_def {
+
os_ptimer ptimer; ///< start address of a timer function
+ +
+
/// Mutex Definition structure contains setup information for a mutex.
+
/// \note CAN BE CHANGED: \b os_mutex_def is implementation specific in every CMSIS-RTOS.
+
typedef struct os_mutex_def {
+
uint32_t dummy; ///< dummy value.
+ +
+
/// Semaphore Definition structure contains setup information for a semaphore.
+
/// \note CAN BE CHANGED: \b os_semaphore_def is implementation specific in every CMSIS-RTOS.
+
typedef struct os_semaphore_def {
+
uint32_t dummy; ///< dummy value.
+ +
+
/// Definition structure for memory block allocation.
+
/// \note CAN BE CHANGED: \b os_pool_def is implementation specific in every CMSIS-RTOS.
+
typedef struct os_pool_def {
+
uint32_t pool_sz; ///< number of items (elements) in the pool
+
uint32_t item_sz; ///< size of an item
+
void *pool; ///< pointer to memory for pool
+ +
+
/// Definition structure for message queue.
+
/// \note CAN BE CHANGED: \b os_messageQ_def is implementation specific in every CMSIS-RTOS.
+
typedef struct os_messageQ_def {
+
uint32_t queue_sz; ///< number of elements in the queue
+
uint32_t item_sz; ///< size of an item
+
void *pool; ///< memory array for messages
+ +
+
/// Definition structure for mail queue.
+
/// \note CAN BE CHANGED: \b os_mailQ_def is implementation specific in every CMSIS-RTOS.
+
typedef struct os_mailQ_def {
+
uint32_t queue_sz; ///< number of elements in the queue
+
uint32_t item_sz; ///< size of an item
+
void *pool; ///< memory array for mail
+ +
+
/// Event structure contains detailed information about an event.
+
/// \note MUST REMAIN UNCHANGED: \b os_event shall be consistent in every CMSIS-RTOS.
+
/// However the struct may be extended at the end.
+
typedef struct {
+
osStatus status; ///< status code: event or error information
+
union {
+
uint32_t v; ///< message as 32-bit value
+
void *p; ///< message or mail as void pointer
+
int32_t signals; ///< signal flags
+
} value; ///< event value
+
union {
+
osMailQId mail_id; ///< mail id obtained by \ref osMailCreate
+
osMessageQId message_id; ///< message id obtained by \ref osMessageCreate
+
} def; ///< event definition
+ +
+
+
// ==== Kernel Control Functions ====
+
+
/// Initialize the RTOS Kernel for creating objects.
+
/// \return status code that indicates the execution status of the function.
+
/// \note MUST REMAIN UNCHANGED: \b osKernelInitialize shall be consistent in every CMSIS-RTOS.
+ +
+
/// Start the RTOS Kernel.
+
/// \return status code that indicates the execution status of the function.
+
/// \note MUST REMAIN UNCHANGED: \b osKernelStart shall be consistent in every CMSIS-RTOS.
+ +
+
/// Check if the RTOS kernel is already started.
+
/// \note MUST REMAIN UNCHANGED: \b osKernelRunning shall be consistent in every CMSIS-RTOS.
+
/// \return 0 RTOS is not started, 1 RTOS is started.
+
int32_t osKernelRunning(void);
+
+
#if (defined (osFeature_SysTick) && (osFeature_SysTick != 0)) // System Timer available
+
+
/// Get the RTOS kernel system timer counter
+
/// \note MUST REMAIN UNCHANGED: \b osKernelSysTick shall be consistent in every CMSIS-RTOS.
+
/// \return RTOS kernel system timer as 32-bit value
+
uint32_t osKernelSysTick (void);
+
+
/// The RTOS kernel system timer frequency in Hz
+
/// \note Reflects the system timer setting and is typically defined in a configuration file.
+
#define osKernelSysTickFrequency 100000000
+
+
/// Convert a microseconds value to a RTOS kernel system timer value.
+
/// \param microsec time value in microseconds.
+
/// \return time value normalized to the \ref osKernelSysTickFrequency
+
#define osKernelSysTickMicroSec(microsec) (((uint64_t)microsec * (osKernelSysTickFrequency)) / 1000000)
+
+
#endif // System Timer available
+
+
// ==== Thread Management ====
+
+
/// Create a Thread Definition with function, priority, and stack requirements.
+
/// \param name name of the thread function.
+
/// \param priority initial priority of the thread function.
+
/// \param instances number of possible thread instances.
+
/// \param stacksz stack size (in bytes) requirements for the thread function.
+
/// \note CAN BE CHANGED: The parameters to \b osThreadDef shall be consistent but the
+
/// macro body is implementation specific in every CMSIS-RTOS.
+
#if defined (osObjectsExternal) // object is external
+
#define osThreadDef(name, priority, instances, stacksz) \
+
extern const osThreadDef_t os_thread_def_##name
+
#else // define the object
+
#define osThreadDef(name, priority, instances, stacksz) \
+
const osThreadDef_t os_thread_def_##name = \
+
{ (name), (priority), (instances), (stacksz) }
+
#endif
+
+
/// Access a Thread definition.
+
/// \param name name of the thread definition object.
+
/// \note CAN BE CHANGED: The parameter to \b osThread shall be consistent but the
+
/// macro body is implementation specific in every CMSIS-RTOS.
+
#define osThread(name) \
+
&os_thread_def_##name
+
+
/// Create a thread and add it to Active Threads and set it to state READY.
+
/// \param[in] thread_def thread definition referenced with \ref osThread.
+
/// \param[in] argument pointer that is passed to the thread function as start argument.
+
/// \return thread ID for reference by other functions or NULL in case of error.
+
/// \note MUST REMAIN UNCHANGED: \b osThreadCreate shall be consistent in every CMSIS-RTOS.
+
osThreadId osThreadCreate (const osThreadDef_t *thread_def, void *argument);
+
+
/// Return the thread ID of the current running thread.
+
/// \return thread ID for reference by other functions or NULL in case of error.
+
/// \note MUST REMAIN UNCHANGED: \b osThreadGetId shall be consistent in every CMSIS-RTOS.
+
osThreadId osThreadGetId (void);
+
+
/// Terminate execution of a thread and remove it from Active Threads.
+
/// \param[in] thread_id thread ID obtained by \ref osThreadCreate or \ref osThreadGetId.
+
/// \return status code that indicates the execution status of the function.
+
/// \note MUST REMAIN UNCHANGED: \b osThreadTerminate shall be consistent in every CMSIS-RTOS.
+
osStatus osThreadTerminate (osThreadId thread_id);
+
+
/// Pass control to next thread that is in state \b READY.
+
/// \return status code that indicates the execution status of the function.
+
/// \note MUST REMAIN UNCHANGED: \b osThreadYield shall be consistent in every CMSIS-RTOS.
+ +
+
/// Change priority of an active thread.
+
/// \param[in] thread_id thread ID obtained by \ref osThreadCreate or \ref osThreadGetId.
+
/// \param[in] priority new priority value for the thread function.
+
/// \return status code that indicates the execution status of the function.
+
/// \note MUST REMAIN UNCHANGED: \b osThreadSetPriority shall be consistent in every CMSIS-RTOS.
+
osStatus osThreadSetPriority (osThreadId thread_id, osPriority priority);
+
+
/// Get current priority of an active thread.
+
/// \param[in] thread_id thread ID obtained by \ref osThreadCreate or \ref osThreadGetId.
+
/// \return current priority value of the thread function.
+
/// \note MUST REMAIN UNCHANGED: \b osThreadGetPriority shall be consistent in every CMSIS-RTOS.
+
osPriority osThreadGetPriority (osThreadId thread_id);
+
+
+
// ==== Generic Wait Functions ====
+
+
/// Wait for Timeout (Time Delay).
+
/// \param[in] millisec \ref CMSIS_RTOS_TimeOutValue "time delay" value
+
/// \return status code that indicates the execution status of the function.
+
osStatus osDelay (uint32_t millisec);
+
+
#if (defined (osFeature_Wait) && (osFeature_Wait != 0)) // Generic Wait available
+
+
/// Wait for Signal, Message, Mail, or Timeout.
+
/// \param[in] millisec \ref CMSIS_RTOS_TimeOutValue or 0 in case of no time-out
+
/// \return event that contains signal, message, or mail information or error code.
+
/// \note MUST REMAIN UNCHANGED: \b osWait shall be consistent in every CMSIS-RTOS.
+
osEvent osWait (uint32_t millisec);
+
+
#endif // Generic Wait available
+
+
+
// ==== Timer Management Functions ====
+
/// Define a Timer object.
+
/// \param name name of the timer object.
+
/// \param function name of the timer call back function.
+
/// \note CAN BE CHANGED: The parameter to \b osTimerDef shall be consistent but the
+
/// macro body is implementation specific in every CMSIS-RTOS.
+
#if defined (osObjectsExternal) // object is external
+
#define osTimerDef(name, function) \
+
extern const osTimerDef_t os_timer_def_##name
+
#else // define the object
+
#define osTimerDef(name, function) \
+
const osTimerDef_t os_timer_def_##name = \
+
{ (function) }
+
#endif
+
+
/// Access a Timer definition.
+
/// \param name name of the timer object.
+
/// \note CAN BE CHANGED: The parameter to \b osTimer shall be consistent but the
+
/// macro body is implementation specific in every CMSIS-RTOS.
+
#define osTimer(name) \
+
&os_timer_def_##name
+
+
/// Create a timer.
+
/// \param[in] timer_def timer object referenced with \ref osTimer.
+
/// \param[in] type osTimerOnce for one-shot or osTimerPeriodic for periodic behavior.
+
/// \param[in] argument argument to the timer call back function.
+
/// \return timer ID for reference by other functions or NULL in case of error.
+
/// \note MUST REMAIN UNCHANGED: \b osTimerCreate shall be consistent in every CMSIS-RTOS.
+
osTimerId osTimerCreate (const osTimerDef_t *timer_def, os_timer_type type, void *argument);
+
+
/// Start or restart a timer.
+
/// \param[in] timer_id timer ID obtained by \ref osTimerCreate.
+
/// \param[in] millisec \ref CMSIS_RTOS_TimeOutValue "time delay" value of the timer.
+
/// \return status code that indicates the execution status of the function.
+
/// \note MUST REMAIN UNCHANGED: \b osTimerStart shall be consistent in every CMSIS-RTOS.
+
osStatus osTimerStart (osTimerId timer_id, uint32_t millisec);
+
+
/// Stop the timer.
+
/// \param[in] timer_id timer ID obtained by \ref osTimerCreate.
+
/// \return status code that indicates the execution status of the function.
+
/// \note MUST REMAIN UNCHANGED: \b osTimerStop shall be consistent in every CMSIS-RTOS.
+
osStatus osTimerStop (osTimerId timer_id);
+
+
/// Delete a timer that was created by \ref osTimerCreate.
+
/// \param[in] timer_id timer ID obtained by \ref osTimerCreate.
+
/// \return status code that indicates the execution status of the function.
+
/// \note MUST REMAIN UNCHANGED: \b osTimerDelete shall be consistent in every CMSIS-RTOS.
+
osStatus osTimerDelete (osTimerId timer_id);
+
+
+
// ==== Signal Management ====
+
+
/// Set the specified Signal Flags of an active thread.
+
/// \param[in] thread_id thread ID obtained by \ref osThreadCreate or \ref osThreadGetId.
+
/// \param[in] signals specifies the signal flags of the thread that should be set.
+
/// \return previous signal flags of the specified thread or 0x80000000 in case of incorrect parameters.
+
/// \note MUST REMAIN UNCHANGED: \b osSignalSet shall be consistent in every CMSIS-RTOS.
+
int32_t osSignalSet (osThreadId thread_id, int32_t signals);
+
+
/// Clear the specified Signal Flags of an active thread.
+
/// \param[in] thread_id thread ID obtained by \ref osThreadCreate or \ref osThreadGetId.
+
/// \param[in] signals specifies the signal flags of the thread that shall be cleared.
+
/// \return previous signal flags of the specified thread or 0x80000000 in case of incorrect parameters or call from ISR.
+
/// \note MUST REMAIN UNCHANGED: \b osSignalClear shall be consistent in every CMSIS-RTOS.
+
int32_t osSignalClear (osThreadId thread_id, int32_t signals);
+
+
/// Wait for one or more Signal Flags to become signaled for the current \b RUNNING thread.
+
/// \param[in] signals wait until all specified signal flags set or 0 for any single signal flag.
+
/// \param[in] millisec \ref CMSIS_RTOS_TimeOutValue or 0 in case of no time-out.
+
/// \return event flag information or error code.
+
/// \note MUST REMAIN UNCHANGED: \b osSignalWait shall be consistent in every CMSIS-RTOS.
+
osEvent osSignalWait (int32_t signals, uint32_t millisec);
+
+
+
// ==== Mutex Management ====
+
+
/// Define a Mutex.
+
/// \param name name of the mutex object.
+
/// \note CAN BE CHANGED: The parameter to \b osMutexDef shall be consistent but the
+
/// macro body is implementation specific in every CMSIS-RTOS.
+
#if defined (osObjectsExternal) // object is external
+
#define osMutexDef(name) \
+
extern const osMutexDef_t os_mutex_def_##name
+
#else // define the object
+
#define osMutexDef(name) \
+
const osMutexDef_t os_mutex_def_##name = { 0 }
+
#endif
+
+
/// Access a Mutex definition.
+
/// \param name name of the mutex object.
+
/// \note CAN BE CHANGED: The parameter to \b osMutex shall be consistent but the
+
/// macro body is implementation specific in every CMSIS-RTOS.
+
#define osMutex(name) \
+
&os_mutex_def_##name
+
+
/// Create and Initialize a Mutex object.
+
/// \param[in] mutex_def mutex definition referenced with \ref osMutex.
+
/// \return mutex ID for reference by other functions or NULL in case of error.
+
/// \note MUST REMAIN UNCHANGED: \b osMutexCreate shall be consistent in every CMSIS-RTOS.
+
osMutexId osMutexCreate (const osMutexDef_t *mutex_def);
+
+
/// Wait until a Mutex becomes available.
+
/// \param[in] mutex_id mutex ID obtained by \ref osMutexCreate.
+
/// \param[in] millisec \ref CMSIS_RTOS_TimeOutValue or 0 in case of no time-out.
+
/// \return status code that indicates the execution status of the function.
+
/// \note MUST REMAIN UNCHANGED: \b osMutexWait shall be consistent in every CMSIS-RTOS.
+
osStatus osMutexWait (osMutexId mutex_id, uint32_t millisec);
+
+
/// Release a Mutex that was obtained by \ref osMutexWait.
+
/// \param[in] mutex_id mutex ID obtained by \ref osMutexCreate.
+
/// \return status code that indicates the execution status of the function.
+
/// \note MUST REMAIN UNCHANGED: \b osMutexRelease shall be consistent in every CMSIS-RTOS.
+
osStatus osMutexRelease (osMutexId mutex_id);
+
+
/// Delete a Mutex that was created by \ref osMutexCreate.
+
/// \param[in] mutex_id mutex ID obtained by \ref osMutexCreate.
+
/// \return status code that indicates the execution status of the function.
+
/// \note MUST REMAIN UNCHANGED: \b osMutexDelete shall be consistent in every CMSIS-RTOS.
+
osStatus osMutexDelete (osMutexId mutex_id);
+
+
+
// ==== Semaphore Management Functions ====
+
+
#if (defined (osFeature_Semaphore) && (osFeature_Semaphore != 0)) // Semaphore available
+
+
/// Define a Semaphore object.
+
/// \param name name of the semaphore object.
+
/// \note CAN BE CHANGED: The parameter to \b osSemaphoreDef shall be consistent but the
+
/// macro body is implementation specific in every CMSIS-RTOS.
+
#if defined (osObjectsExternal) // object is external
+
#define osSemaphoreDef(name) \
+
extern const osSemaphoreDef_t os_semaphore_def_##name
+
#else // define the object
+
#define osSemaphoreDef(name) \
+
const osSemaphoreDef_t os_semaphore_def_##name = { 0 }
+
#endif
+
+
/// Access a Semaphore definition.
+
/// \param name name of the semaphore object.
+
/// \note CAN BE CHANGED: The parameter to \b osSemaphore shall be consistent but the
+
/// macro body is implementation specific in every CMSIS-RTOS.
+
#define osSemaphore(name) \
+
&os_semaphore_def_##name
+
+
/// Create and Initialize a Semaphore object used for managing resources.
+
/// \param[in] semaphore_def semaphore definition referenced with \ref osSemaphore.
+
/// \param[in] count number of available resources.
+
/// \return semaphore ID for reference by other functions or NULL in case of error.
+
/// \note MUST REMAIN UNCHANGED: \b osSemaphoreCreate shall be consistent in every CMSIS-RTOS.
+
osSemaphoreId osSemaphoreCreate (const osSemaphoreDef_t *semaphore_def, int32_t count);
+
+
/// Wait until a Semaphore token becomes available.
+
/// \param[in] semaphore_id semaphore object referenced with \ref osSemaphoreCreate.
+
/// \param[in] millisec \ref CMSIS_RTOS_TimeOutValue or 0 in case of no time-out.
+
/// \return number of available tokens, or -1 in case of incorrect parameters.
+
/// \note MUST REMAIN UNCHANGED: \b osSemaphoreWait shall be consistent in every CMSIS-RTOS.
+
int32_t osSemaphoreWait (osSemaphoreId semaphore_id, uint32_t millisec);
+
+
/// Release a Semaphore token.
+
/// \param[in] semaphore_id semaphore object referenced with \ref osSemaphoreCreate.
+
/// \return status code that indicates the execution status of the function.
+
/// \note MUST REMAIN UNCHANGED: \b osSemaphoreRelease shall be consistent in every CMSIS-RTOS.
+
osStatus osSemaphoreRelease (osSemaphoreId semaphore_id);
+
+
/// Delete a Semaphore that was created by \ref osSemaphoreCreate.
+
/// \param[in] semaphore_id semaphore object referenced with \ref osSemaphoreCreate.
+
/// \return status code that indicates the execution status of the function.
+
/// \note MUST REMAIN UNCHANGED: \b osSemaphoreDelete shall be consistent in every CMSIS-RTOS.
+
osStatus osSemaphoreDelete (osSemaphoreId semaphore_id);
+
+
#endif // Semaphore available
+
+
+
// ==== Memory Pool Management Functions ====
+
+
#if (defined (osFeature_Pool) && (osFeature_Pool != 0)) // Memory Pool Management available
+
+
/// \brief Define a Memory Pool.
+
/// \param name name of the memory pool.
+
/// \param no maximum number of blocks (objects) in the memory pool.
+
/// \param type data type of a single block (object).
+
/// \note CAN BE CHANGED: The parameter to \b osPoolDef shall be consistent but the
+
/// macro body is implementation specific in every CMSIS-RTOS.
+
#if defined (osObjectsExternal) // object is external
+
#define osPoolDef(name, no, type) \
+
extern const osPoolDef_t os_pool_def_##name
+
#else // define the object
+
#define osPoolDef(name, no, type) \
+
const osPoolDef_t os_pool_def_##name = \
+
{ (no), sizeof(type), NULL }
+
#endif
+
+
/// \brief Access a Memory Pool definition.
+
/// \param name name of the memory pool
+
/// \note CAN BE CHANGED: The parameter to \b osPool shall be consistent but the
+
/// macro body is implementation specific in every CMSIS-RTOS.
+
#define osPool(name) \
+
&os_pool_def_##name
+
+
/// Create and Initialize a memory pool.
+
/// \param[in] pool_def memory pool definition referenced with \ref osPool.
+
/// \return memory pool ID for reference by other functions or NULL in case of error.
+
/// \note MUST REMAIN UNCHANGED: \b osPoolCreate shall be consistent in every CMSIS-RTOS.
+
osPoolId osPoolCreate (const osPoolDef_t *pool_def);
+
+
/// Allocate a memory block from a memory pool.
+
/// \param[in] pool_id memory pool ID obtain referenced with \ref osPoolCreate.
+
/// \return address of the allocated memory block or NULL in case of no memory available.
+
/// \note MUST REMAIN UNCHANGED: \b osPoolAlloc shall be consistent in every CMSIS-RTOS.
+
void *osPoolAlloc (osPoolId pool_id);
+
+
/// Allocate a memory block from a memory pool and set memory block to zero.
+
/// \param[in] pool_id memory pool ID obtain referenced with \ref osPoolCreate.
+
/// \return address of the allocated memory block or NULL in case of no memory available.
+
/// \note MUST REMAIN UNCHANGED: \b osPoolCAlloc shall be consistent in every CMSIS-RTOS.
+
void *osPoolCAlloc (osPoolId pool_id);
+
+
/// Return an allocated memory block back to a specific memory pool.
+
/// \param[in] pool_id memory pool ID obtain referenced with \ref osPoolCreate.
+
/// \param[in] block address of the allocated memory block that is returned to the memory pool.
+
/// \return status code that indicates the execution status of the function.
+
/// \note MUST REMAIN UNCHANGED: \b osPoolFree shall be consistent in every CMSIS-RTOS.
+
osStatus osPoolFree (osPoolId pool_id, void *block);
+
+
#endif // Memory Pool Management available
+
+
+
// ==== Message Queue Management Functions ====
+
+
#if (defined (osFeature_MessageQ) && (osFeature_MessageQ != 0)) // Message Queues available
+
+
/// \brief Create a Message Queue Definition.
+
/// \param name name of the queue.
+
/// \param queue_sz maximum number of messages in the queue.
+
/// \param type data type of a single message element (for debugger).
+
/// \note CAN BE CHANGED: The parameter to \b osMessageQDef shall be consistent but the
+
/// macro body is implementation specific in every CMSIS-RTOS.
+
#if defined (osObjectsExternal) // object is external
+
#define osMessageQDef(name, queue_sz, type) \
+
extern const osMessageQDef_t os_messageQ_def_##name
+
#else // define the object
+
#define osMessageQDef(name, queue_sz, type) \
+
const osMessageQDef_t os_messageQ_def_##name = \
+
{ (queue_sz), sizeof (type) }
+
#endif
+
+
/// \brief Access a Message Queue Definition.
+
/// \param name name of the queue
+
/// \note CAN BE CHANGED: The parameter to \b osMessageQ shall be consistent but the
+
/// macro body is implementation specific in every CMSIS-RTOS.
+
#define osMessageQ(name) \
+
&os_messageQ_def_##name
+
+
/// Create and Initialize a Message Queue.
+
/// \param[in] queue_def queue definition referenced with \ref osMessageQ.
+
/// \param[in] thread_id thread ID (obtained by \ref osThreadCreate or \ref osThreadGetId) or NULL.
+
/// \return message queue ID for reference by other functions or NULL in case of error.
+
/// \note MUST REMAIN UNCHANGED: \b osMessageCreate shall be consistent in every CMSIS-RTOS.
+
osMessageQId osMessageCreate (const osMessageQDef_t *queue_def, osThreadId thread_id);
+
+
/// Put a Message to a Queue.
+
/// \param[in] queue_id message queue ID obtained with \ref osMessageCreate.
+
/// \param[in] info message information.
+
/// \param[in] millisec \ref CMSIS_RTOS_TimeOutValue or 0 in case of no time-out.
+
/// \return status code that indicates the execution status of the function.
+
/// \note MUST REMAIN UNCHANGED: \b osMessagePut shall be consistent in every CMSIS-RTOS.
+
osStatus osMessagePut (osMessageQId queue_id, uint32_t info, uint32_t millisec);
+
+
/// Get a Message or Wait for a Message from a Queue.
+
/// \param[in] queue_id message queue ID obtained with \ref osMessageCreate.
+
/// \param[in] millisec \ref CMSIS_RTOS_TimeOutValue or 0 in case of no time-out.
+
/// \return event information that includes status code.
+
/// \note MUST REMAIN UNCHANGED: \b osMessageGet shall be consistent in every CMSIS-RTOS.
+
osEvent osMessageGet (osMessageQId queue_id, uint32_t millisec);
+
+
#endif // Message Queues available
+
+
+
// ==== Mail Queue Management Functions ====
+
+
#if (defined (osFeature_MailQ) && (osFeature_MailQ != 0)) // Mail Queues available
+
+
/// \brief Create a Mail Queue Definition.
+
/// \param name name of the queue
+
/// \param queue_sz maximum number of messages in queue
+
/// \param type data type of a single message element
+
/// \note CAN BE CHANGED: The parameter to \b osMailQDef shall be consistent but the
+
/// macro body is implementation specific in every CMSIS-RTOS.
+
#if defined (osObjectsExternal) // object is external
+
#define osMailQDef(name, queue_sz, type) \
+
extern const osMailQDef_t os_mailQ_def_##name
+
#else // define the object
+
#define osMailQDef(name, queue_sz, type) \
+
const osMailQDef_t os_mailQ_def_##name = \
+
{ (queue_sz), sizeof (type) }
+
#endif
+
+
/// \brief Access a Mail Queue Definition.
+
/// \param name name of the queue
+
/// \note CAN BE CHANGED: The parameter to \b osMailQ shall be consistent but the
+
/// macro body is implementation specific in every CMSIS-RTOS.
+
#define osMailQ(name) \
+
&os_mailQ_def_##name
+
+
/// Create and Initialize mail queue.
+
/// \param[in] queue_def reference to the mail queue definition obtain with \ref osMailQ
+
/// \param[in] thread_id thread ID (obtained by \ref osThreadCreate or \ref osThreadGetId) or NULL.
+
/// \return mail queue ID for reference by other functions or NULL in case of error.
+
/// \note MUST REMAIN UNCHANGED: \b osMailCreate shall be consistent in every CMSIS-RTOS.
+
osMailQId osMailCreate (const osMailQDef_t *queue_def, osThreadId thread_id);
+
+
/// Allocate a memory block from a mail.
+
/// \param[in] queue_id mail queue ID obtained with \ref osMailCreate.
+
/// \param[in] millisec \ref CMSIS_RTOS_TimeOutValue or 0 in case of no time-out
+
/// \return pointer to memory block that can be filled with mail or NULL in case of error.
+
/// \note MUST REMAIN UNCHANGED: \b osMailAlloc shall be consistent in every CMSIS-RTOS.
+
void *osMailAlloc (osMailQId queue_id, uint32_t millisec);
+
+
/// Allocate a memory block from a mail and set memory block to zero.
+
/// \param[in] queue_id mail queue ID obtained with \ref osMailCreate.
+
/// \param[in] millisec \ref CMSIS_RTOS_TimeOutValue or 0 in case of no time-out
+
/// \return pointer to memory block that can be filled with mail or NULL in case of error.
+
/// \note MUST REMAIN UNCHANGED: \b osMailCAlloc shall be consistent in every CMSIS-RTOS.
+
void *osMailCAlloc (osMailQId queue_id, uint32_t millisec);
+
+
/// Put a mail to a queue.
+
/// \param[in] queue_id mail queue ID obtained with \ref osMailCreate.
+
/// \param[in] mail memory block previously allocated with \ref osMailAlloc or \ref osMailCAlloc.
+
/// \return status code that indicates the execution status of the function.
+
/// \note MUST REMAIN UNCHANGED: \b osMailPut shall be consistent in every CMSIS-RTOS.
+
osStatus osMailPut (osMailQId queue_id, void *mail);
+
+
/// Get a mail from a queue.
+
/// \param[in] queue_id mail queue ID obtained with \ref osMailCreate.
+
/// \param[in] millisec \ref CMSIS_RTOS_TimeOutValue or 0 in case of no time-out
+
/// \return event that contains mail information or error code.
+
/// \note MUST REMAIN UNCHANGED: \b osMailGet shall be consistent in every CMSIS-RTOS.
+
osEvent osMailGet (osMailQId queue_id, uint32_t millisec);
+
+
/// Free a memory block from a mail.
+
/// \param[in] queue_id mail queue ID obtained with \ref osMailCreate.
+
/// \param[in] mail pointer to the memory block that was obtained with \ref osMailGet.
+
/// \return status code that indicates the execution status of the function.
+
/// \note MUST REMAIN UNCHANGED: \b osMailFree shall be consistent in every CMSIS-RTOS.
+
osStatus osMailFree (osMailQId queue_id, void *mail);
+
+
#endif // Mail Queues available
+
+
+
#ifdef __cplusplus
+
}
+
#endif
+
+
#endif // _CMSIS_OS_H
+
+
+ + + + diff --git a/Documentation/RTOS/html/dir_67baed4ff719a838d401a6dc7774cf41.html b/Documentation/RTOS/html/dir_67baed4ff719a838d401a6dc7774cf41.html new file mode 100644 index 0000000..2b807ff --- /dev/null +++ b/Documentation/RTOS/html/dir_67baed4ff719a838d401a6dc7774cf41.html @@ -0,0 +1,97 @@ + + + + + +RTOS Directory Reference +CMSIS-RTOS: RTOS Directory Reference + + + + + + + + + + + + +
+
+ + + + + + + +
+
CMSIS-RTOS +  Version 1.02 +
+
CMSIS-RTOS API: Generic RTOS interface for Cortex-M processor-based devices.
+
+
+ +
+
    + +
+
+ + +
+
+ +
+
+
+ +
+
+
+
RTOS Directory Reference
+
+
+ + + + +

+Directories

directory  Template
 
+
+
+ + + + diff --git a/Documentation/RTOS/html/dir_9afdeffb8e409a4e0df5c5bf9ab1a7d2.html b/Documentation/RTOS/html/dir_9afdeffb8e409a4e0df5c5bf9ab1a7d2.html new file mode 100644 index 0000000..7130d21 --- /dev/null +++ b/Documentation/RTOS/html/dir_9afdeffb8e409a4e0df5c5bf9ab1a7d2.html @@ -0,0 +1,97 @@ + + + + + +Template Directory Reference +CMSIS-RTOS: Template Directory Reference + + + + + + + + + + + + +
+
+ + + + + + + +
+
CMSIS-RTOS +  Version 1.02 +
+
CMSIS-RTOS API: Generic RTOS interface for Cortex-M processor-based devices.
+
+
+ +
+
    + +
+
+ + +
+
+ +
+
+
+ +
+
+
+
Template Directory Reference
+
+
+ + + + +

+Files

file  cmsis_os.h
 
+
+
+ + + + diff --git a/Documentation/RTOS/html/doxygen.css b/Documentation/RTOS/html/doxygen.css new file mode 100644 index 0000000..2642e8f --- /dev/null +++ b/Documentation/RTOS/html/doxygen.css @@ -0,0 +1,1172 @@ +/* The standard CSS for doxygen */ + +body, table, div, p, dl { + font: 400 14px/19px Roboto,sans-serif; +} + +/* @group Heading Levels */ + +h1.groupheader { + font-size: 150%; +} + +.title { + font-size: 150%; + font-weight: bold; + margin: 10px 2px; +} + +h2.groupheader { + border-bottom: 1px solid #879ECB; + color: #354C7B; + font-size: 150%; + font-weight: normal; + margin-top: 1.75em; + padding-top: 8px; + padding-bottom: 4px; + width: 100%; +} + +h3.groupheader { + font-size: 100%; +} + +h1, h2, h3, h4, h5, h6 { + -webkit-transition: text-shadow 0.5s linear; + -moz-transition: text-shadow 0.5s linear; + -ms-transition: text-shadow 0.5s linear; + -o-transition: text-shadow 0.5s linear; + transition: text-shadow 0.5s linear; + margin-right: 15px; +} + +h1.glow, h2.glow, h3.glow, h4.glow, h5.glow, h6.glow { + text-shadow: 0 0 15px cyan; +} + +dt { + font-weight: bold; +} + +div.multicol { + -moz-column-gap: 1em; + -webkit-column-gap: 1em; + -moz-column-count: 3; + -webkit-column-count: 3; +} + +p.startli, p.startdd, p.starttd { + margin-top: 2px; +} + +p.endli { + margin-bottom: 0px; +} + +p.enddd { + margin-bottom: 4px; +} + +p.endtd { + margin-bottom: 2px; +} + +/* @end */ + +caption { + font-weight: bold; +} + +span.legend { + font-size: 70%; + text-align: center; +} + +h3.version { + font-size: 90%; + text-align: center; +} + +div.qindex, div.navtab{ + background-color: #EBEFF6; + border: 1px solid #A3B4D7; + text-align: center; +} + +div.qindex, div.navpath { + width: 100%; + line-height: 140%; +} + +div.navtab { + margin-right: 15px; +} + +/* @group Link Styling */ + +a { + color: #3D578C; + font-weight: normal; + text-decoration: none; +} + +.contents a:visited { + color: #4665A2; +} + +a:hover { + text-decoration: underline; +} + +a.qindex { + font-weight: bold; +} + +a.qindexHL { + font-weight: bold; + background-color: #9CAFD4; + color: #ffffff; + border: 1px double #869DCA; +} + +.contents a.qindexHL:visited { + color: #ffffff; +} + +a.el { + font-weight: bold; +} + +a.elRef { +} + +a.code, a.code:visited { + color: #4665A2; +} + +a.codeRef, a.codeRef:visited { + color: #4665A2; +} + +/* @end */ + +dl.el { + margin-left: -1cm; +} + +pre.fragment { + border: 1px solid #C4CFE5; + background-color: #FBFCFD; + padding: 4px 6px; + margin: 4px 8px 4px 2px; + overflow: auto; + word-wrap: break-word; + font-size: 9pt; + line-height: 125%; + font-family: monospace, fixed; + font-size: 105%; +} + +div.fragment { + padding: 4px; + margin: 4px; + background-color: #FBFCFD; + border: 1px solid #C4CFE5; +} + +div.line { + font-family: monospace, fixed; + font-size: 13px; + min-height: 13px; + line-height: 1.0; + text-wrap: unrestricted; + white-space: -moz-pre-wrap; /* Moz */ + white-space: -pre-wrap; /* Opera 4-6 */ + white-space: -o-pre-wrap; /* Opera 7 */ + white-space: pre-wrap; /* CSS3 */ + word-wrap: break-word; /* IE 5.5+ */ + text-indent: -53px; + padding-left: 53px; + padding-bottom: 0px; + margin: 0px; + -webkit-transition-property: background-color, box-shadow; + -webkit-transition-duration: 0.5s; + -moz-transition-property: background-color, box-shadow; + -moz-transition-duration: 0.5s; + -ms-transition-property: background-color, box-shadow; + -ms-transition-duration: 0.5s; + -o-transition-property: background-color, box-shadow; + -o-transition-duration: 0.5s; + transition-property: background-color, box-shadow; + transition-duration: 0.5s; +} + +div.line.glow { + background-color: cyan; + box-shadow: 0 0 10px cyan; +} + + +span.lineno { + padding-right: 4px; + text-align: right; + border-right: 2px solid #0F0; + background-color: #E8E8E8; + white-space: pre; +} +span.lineno a { + background-color: #D8D8D8; +} + +span.lineno a:hover { + background-color: #C8C8C8; +} + +div.ah { + background-color: black; + font-weight: bold; + color: #ffffff; + margin-bottom: 3px; + margin-top: 3px; + padding: 0.2em; + border: solid thin #333; + border-radius: 0.5em; + -webkit-border-radius: .5em; + -moz-border-radius: .5em; + box-shadow: 2px 2px 3px #999; + -webkit-box-shadow: 2px 2px 3px #999; + -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px; + background-image: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#000),color-stop(0.3, #444)); + background-image: -moz-linear-gradient(center top, #eee 0%, #444 40%, #000); +} + +div.groupHeader { + margin-left: 16px; + margin-top: 12px; + font-weight: bold; +} + +div.groupText { + margin-left: 16px; + font-style: italic; +} + +body { + background-color: white; + color: black; + margin: 0; +} + +div.contents { + margin-top: 10px; + margin-left: 12px; + margin-right: 8px; +} + +td.indexkey { + background-color: #EBEFF6; + font-weight: bold; + border: 1px solid #C4CFE5; + margin: 2px 0px 2px 0; + padding: 2px 10px; + white-space: nowrap; + vertical-align: top; +} + +td.indexvalue { + background-color: #EBEFF6; + border: 1px solid #C4CFE5; + padding: 2px 10px; + margin: 2px 0px; +} + +tr.memlist { + background-color: #EEF1F7; +} + +p.formulaDsp { + text-align: center; +} + +img.formulaDsp { + +} + +img.formulaInl { + vertical-align: middle; +} + +div.center { + text-align: center; + margin-top: 0px; + margin-bottom: 0px; + padding: 0px; +} + +div.center img { + border: 0px; +} + +address.footer { + text-align: right; + padding-right: 12px; +} + +img.footer { + border: 0px; + vertical-align: middle; +} + +/* @group Code Colorization */ + +span.keyword { + color: #008000 +} + +span.keywordtype { + color: #604020 +} + +span.keywordflow { + color: #e08000 +} + +span.comment { + color: #800000 +} + +span.preprocessor { + color: #806020 +} + +span.stringliteral { + color: #002080 +} + +span.charliteral { + color: #008080 +} + +span.vhdldigit { + color: #ff00ff +} + +span.vhdlchar { + color: #000000 +} + +span.vhdlkeyword { + color: #700070 +} + +span.vhdllogic { + color: #ff0000 +} + +blockquote { + background-color: #F7F8FB; + border-left: 2px solid #9CAFD4; + margin: 0 24px 0 4px; + padding: 0 12px 0 16px; +} + +/* @end */ + +/* +.search { + color: #003399; + font-weight: bold; +} + +form.search { + margin-bottom: 0px; + margin-top: 0px; +} + +input.search { + font-size: 75%; + color: #000080; + font-weight: normal; + background-color: #e8eef2; +} +*/ + +td.tiny { + font-size: 75%; +} + +.dirtab { + padding: 4px; + border-collapse: collapse; + border: 1px solid #A3B4D7; +} + +th.dirtab { + background: #EBEFF6; + font-weight: bold; +} + +hr { + height: 0px; + border: none; + border-top: 1px solid #4A6AAA; +} + +hr.footer { + height: 1px; +} + +/* @group Member Descriptions */ + +table.memberdecls { + border-spacing: 0px; + padding: 0px; +} + +.memberdecls td, .fieldtable tr { + -webkit-transition-property: background-color, box-shadow; + -webkit-transition-duration: 0.5s; + -moz-transition-property: background-color, box-shadow; + -moz-transition-duration: 0.5s; + -ms-transition-property: background-color, box-shadow; + -ms-transition-duration: 0.5s; + -o-transition-property: background-color, box-shadow; + -o-transition-duration: 0.5s; + transition-property: background-color, box-shadow; + transition-duration: 0.5s; +} + +.memberdecls td.glow, .fieldtable tr.glow { + background-color: cyan; + box-shadow: 0 0 15px cyan; +} + +.mdescLeft, .mdescRight, +.memItemLeft, .memItemRight, +.memTemplItemLeft, .memTemplItemRight, .memTemplParams { + background-color: #F9FAFC; + border: none; + margin: 4px; + padding: 1px 0 0 8px; +} + +.mdescLeft, .mdescRight { + padding: 0px 8px 4px 8px; + color: #555; +} + +.memSeparator { + border-bottom: 1px solid #DEE4F0; + line-height: 1px; + margin: 0px; + padding: 0px; +} + +.memItemLeft, .memTemplItemLeft { + white-space: nowrap; +} + +.memItemRight { + width: 100%; +} + +.memTemplParams { + color: #4665A2; + white-space: nowrap; + font-size: 80%; +} + +/* @end */ + +/* @group Member Details */ + +/* Styles for detailed member documentation */ + +.memtemplate { + font-size: 80%; + color: #4665A2; + font-weight: normal; + margin-left: 9px; +} + +.memnav { + background-color: #EBEFF6; + border: 1px solid #A3B4D7; + text-align: center; + margin: 2px; + margin-right: 15px; + padding: 2px; +} + +.mempage { + width: 100%; +} + +.memitem { + padding: 0; + margin-bottom: 10px; + margin-right: 5px; + -webkit-transition: box-shadow 0.5s linear; + -moz-transition: box-shadow 0.5s linear; + -ms-transition: box-shadow 0.5s linear; + -o-transition: box-shadow 0.5s linear; + transition: box-shadow 0.5s linear; + display: table !important; + width: 100%; +} + +.memitem.glow { + box-shadow: 0 0 15px cyan; +} + +.memname { + font-weight: bold; + margin-left: 6px; +} + +.memname td { + vertical-align: bottom; +} + +.memproto, dl.reflist dt { + border-top: 1px solid #A8B8D9; + border-left: 1px solid #A8B8D9; + border-right: 1px solid #A8B8D9; + padding: 6px 0px 6px 0px; + color: #253555; + font-weight: bold; + text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); + background-image:url('nav_f.png'); + background-repeat:repeat-x; + background-color: #E2E8F2; + /* opera specific markup */ + box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + border-top-right-radius: 4px; + border-top-left-radius: 4px; + /* firefox specific markup */ + -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; + -moz-border-radius-topright: 4px; + -moz-border-radius-topleft: 4px; + /* webkit specific markup */ + -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + -webkit-border-top-right-radius: 4px; + -webkit-border-top-left-radius: 4px; + +} + +.memdoc, dl.reflist dd { + border-bottom: 1px solid #A8B8D9; + border-left: 1px solid #A8B8D9; + border-right: 1px solid #A8B8D9; + padding: 6px 10px 2px 10px; + background-color: #FBFCFD; + border-top-width: 0; + background-image:url('nav_g.png'); + background-repeat:repeat-x; + background-color: #FFFFFF; + /* opera specific markup */ + border-bottom-left-radius: 4px; + border-bottom-right-radius: 4px; + box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + /* firefox specific markup */ + -moz-border-radius-bottomleft: 4px; + -moz-border-radius-bottomright: 4px; + -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; + /* webkit specific markup */ + -webkit-border-bottom-left-radius: 4px; + -webkit-border-bottom-right-radius: 4px; + -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); +} + +dl.reflist dt { + padding: 5px; +} + +dl.reflist dd { + margin: 0px 0px 10px 0px; + padding: 5px; +} + +.paramkey { + text-align: right; +} + +.paramtype { + white-space: nowrap; +} + +.paramname { + color: #602020; + white-space: nowrap; +} +.paramname em { + font-style: normal; +} +.paramname code { + line-height: 14px; +} + +.params, .retval, .exception, .tparams { + margin-left: 0px; + padding-left: 0px; +} + +.params .paramname, .retval .paramname { + font-weight: bold; + vertical-align: top; +} + +.params .paramtype { + font-style: italic; + vertical-align: top; +} + +.params .paramdir { + font-family: "courier new",courier,monospace; + vertical-align: top; +} + +table.mlabels { + border-spacing: 0px; +} + +td.mlabels-left { + width: 100%; + padding: 0px; +} + +td.mlabels-right { + vertical-align: bottom; + padding: 0px; + white-space: nowrap; +} + +span.mlabels { + margin-left: 8px; +} + +span.mlabel { + background-color: #728DC1; + border-top:1px solid #5373B4; + border-left:1px solid #5373B4; + border-right:1px solid #C4CFE5; + border-bottom:1px solid #C4CFE5; + text-shadow: none; + color: white; + margin-right: 4px; + padding: 2px 3px; + border-radius: 3px; + font-size: 7pt; + white-space: nowrap; + vertical-align: middle; +} + + + +/* @end */ + +/* these are for tree view when not used as main index */ + +div.directory { + margin: 10px 0px; + border-top: 1px solid #A8B8D9; + border-bottom: 1px solid #A8B8D9; + width: 100%; +} + +.directory table { + border-collapse:collapse; +} + +.directory td { + margin: 0px; + padding: 0px; + vertical-align: top; +} + +.directory td.entry { + white-space: nowrap; + padding-right: 6px; +} + +.directory td.entry a { + outline:none; +} + +.directory td.entry a img { + border: none; +} + +.directory td.desc { + width: 100%; + padding-left: 6px; + padding-right: 6px; + padding-top: 3px; + border-left: 1px solid rgba(0,0,0,0.05); +} + +.directory tr.even { + padding-left: 6px; + background-color: #F7F8FB; +} + +.directory img { + vertical-align: -30%; +} + +.directory .levels { + white-space: nowrap; + width: 100%; + text-align: right; + font-size: 9pt; +} + +.directory .levels span { + cursor: pointer; + padding-left: 2px; + padding-right: 2px; + color: #3D578C; +} + +div.dynheader { + margin-top: 8px; + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +address { + font-style: normal; + color: #2A3D61; +} + +table.doxtable { + border-collapse:collapse; + margin-top: 4px; + margin-bottom: 4px; +} + +table.doxtable td, table.doxtable th { + border: 1px solid #2D4068; + padding: 3px 7px 2px; +} + +table.doxtable th { + background-color: #374F7F; + color: #FFFFFF; + font-size: 110%; + padding-bottom: 4px; + padding-top: 5px; +} + +table.fieldtable { + width: 100%; + margin-bottom: 10px; + border: 1px solid #A8B8D9; + border-spacing: 0px; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; + -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px; + -webkit-box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15); + box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15); +} + +.fieldtable td, .fieldtable th { + padding: 3px 7px 2px; +} + +.fieldtable td.fieldtype, .fieldtable td.fieldname { + white-space: nowrap; + border-right: 1px solid #A8B8D9; + border-bottom: 1px solid #A8B8D9; + vertical-align: top; +} + +.fieldtable td.fielddoc { + border-bottom: 1px solid #A8B8D9; + width: 100%; +} + +.fieldtable tr:last-child td { + border-bottom: none; +} + +.fieldtable th { + background-image:url('nav_f.png'); + background-repeat:repeat-x; + background-color: #E2E8F2; + font-size: 90%; + color: #253555; + padding-bottom: 4px; + padding-top: 5px; + text-align:left; + -moz-border-radius-topleft: 4px; + -moz-border-radius-topright: 4px; + -webkit-border-top-left-radius: 4px; + -webkit-border-top-right-radius: 4px; + border-top-left-radius: 4px; + border-top-right-radius: 4px; + border-bottom: 1px solid #A8B8D9; +} + + +.tabsearch { + top: 0px; + left: 10px; + height: 36px; + background-image: url('tab_b.png'); + z-index: 101; + overflow: hidden; + font-size: 13px; +} + +.navpath ul +{ + font-size: 11px; + background-image:url('tab_b.png'); + background-repeat:repeat-x; + background-position: 0 -5px; + height:30px; + line-height:30px; + color:#8AA0CC; + border:solid 1px #C2CDE4; + overflow:hidden; + margin:0px; + padding:0px; +} + +.navpath li +{ + list-style-type:none; + float:left; + padding-left:10px; + padding-right:15px; + background-image:url('bc_s.png'); + background-repeat:no-repeat; + background-position:right; + color:#364D7C; +} + +.navpath li.navelem a +{ + height:32px; + display:block; + text-decoration: none; + outline: none; + color: #283A5D; + font-family: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; + text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); + text-decoration: none; +} + +.navpath li.navelem a:hover +{ + color:#6884BD; +} + +.navpath li.footer +{ + list-style-type:none; + float:right; + padding-left:10px; + padding-right:15px; + background-image:none; + background-repeat:no-repeat; + background-position:right; + color:#364D7C; + font-size: 8pt; +} + + +div.summary +{ + float: right; + font-size: 8pt; + padding-right: 5px; + width: 50%; + text-align: right; +} + +div.summary a +{ + white-space: nowrap; +} + +div.ingroups +{ + font-size: 8pt; + width: 50%; + text-align: left; +} + +div.ingroups a +{ + white-space: nowrap; +} + +div.header +{ + background-image:url('nav_h.png'); + background-repeat:repeat-x; + background-color: #F9FAFC; + margin: 0px; + border-bottom: 1px solid #C4CFE5; +} + +div.headertitle +{ + padding: 5px 5px 5px 10px; +} + +dl +{ + padding: 0 0 0 10px; +} + +/* dl.note, dl.warning, dl.attention, dl.pre, dl.post, dl.invariant, dl.deprecated, dl.todo, dl.test, dl.bug */ +dl.section +{ + margin-left: 0px; + padding-left: 0px; +} + +dl.note +{ + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; + border-color: #D0C000; +} + +dl.warning, dl.attention +{ + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; + border-color: #FF0000; +} + +dl.pre, dl.post, dl.invariant +{ + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; + border-color: #00D000; +} + +dl.deprecated +{ + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; + border-color: #505050; +} + +dl.todo +{ + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; + border-color: #00C0E0; +} + +dl.test +{ + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; + border-color: #3030E0; +} + +dl.bug +{ + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; + border-color: #C08050; +} + +dl.section dd { + margin-bottom: 6px; +} + + +#projectlogo +{ + text-align: center; + vertical-align: bottom; + border-collapse: separate; +} + +#projectlogo img +{ + border: 0px none; +} + +#projectname +{ + font: 300% Tahoma, Arial,sans-serif; + margin: 0px; + padding: 2px 0px; +} + +#projectbrief +{ + font: 120% Tahoma, Arial,sans-serif; + margin: 0px; + padding: 0px; +} + +#projectnumber +{ + font: 50% Tahoma, Arial,sans-serif; + margin: 0px; + padding: 0px; +} + +#titlearea +{ + padding: 0px; + margin: 0px; + width: 100%; + border-bottom: 1px solid #5373B4; +} + +.image +{ + text-align: center; +} + +.dotgraph +{ + text-align: center; +} + +.mscgraph +{ + text-align: center; +} + +.caption +{ + font-weight: bold; +} + +div.zoom +{ + border: 1px solid #90A5CE; +} + +dl.citelist { + margin-bottom:50px; +} + +dl.citelist dt { + color:#334975; + float:left; + font-weight:bold; + margin-right:10px; + padding:5px; +} + +dl.citelist dd { + margin:2px 0; + padding:5px 0; +} + +div.toc { + padding: 14px 25px; + background-color: #F4F6FA; + border: 1px solid #D8DFEE; + border-radius: 7px 7px 7px 7px; + float: right; + height: auto; + margin: 0 20px 10px 10px; + width: 200px; +} + +div.toc li { + background: url("bdwn.png") no-repeat scroll 0 5px transparent; + font: 10px/1.2 Verdana,DejaVu Sans,Geneva,sans-serif; + margin-top: 5px; + padding-left: 10px; + padding-top: 2px; +} + +div.toc h3 { + font: bold 12px/1.2 Arial,FreeSans,sans-serif; + color: #4665A2; + border-bottom: 0 none; + margin: 0; +} + +div.toc ul { + list-style: none outside none; + border: medium none; + padding: 0px; +} + +div.toc li.level1 { + margin-left: 0px; +} + +div.toc li.level2 { + margin-left: 15px; +} + +div.toc li.level3 { + margin-left: 30px; +} + +div.toc li.level4 { + margin-left: 45px; +} + +.inherit_header { + font-weight: bold; + color: gray; + cursor: pointer; + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +.inherit_header td { + padding: 6px 0px 2px 5px; +} + +.inherit { + display: none; +} + +tr.heading h2 { + margin-top: 12px; + margin-bottom: 4px; +} + +@media print +{ + #top { display: none; } + #side-nav { display: none; } + #nav-path { display: none; } + body { overflow:visible; } + h1, h2, h3, h4, h5, h6 { page-break-after: avoid; } + .summary { display: none; } + .memitem { page-break-inside: avoid; } + #doc-content + { + margin-left:0 !important; + height:auto !important; + width:auto !important; + overflow:inherit; + display:inline; + } +} + diff --git a/Documentation/RTOS/html/doxygen.png b/Documentation/RTOS/html/doxygen.png new file mode 100644 index 0000000..3ff17d8 Binary files /dev/null and b/Documentation/RTOS/html/doxygen.png differ diff --git a/Documentation/RTOS/html/dynsections.js b/Documentation/RTOS/html/dynsections.js new file mode 100644 index 0000000..116542f --- /dev/null +++ b/Documentation/RTOS/html/dynsections.js @@ -0,0 +1,78 @@ +function toggleVisibility(linkObj) +{ + var base = $(linkObj).attr('id'); + var summary = $('#'+base+'-summary'); + var content = $('#'+base+'-content'); + var trigger = $('#'+base+'-trigger'); + var src=$(trigger).attr('src'); + if (content.is(':visible')===true) { + content.hide(); + summary.show(); + $(linkObj).addClass('closed').removeClass('opened'); + $(trigger).attr('src',src.substring(0,src.length-8)+'closed.png'); + } else { + content.show(); + summary.hide(); + $(linkObj).removeClass('closed').addClass('opened'); + $(trigger).attr('src',src.substring(0,src.length-10)+'open.png'); + } + return false; +} + +function updateStripes() +{ + $('table.directory tr'). + removeClass('even').filter(':visible:even').addClass('even'); +} +function toggleLevel(level) +{ + $('table.directory tr').each(function(){ + var l = this.id.split('_').length-1; + var i = $('#img'+this.id.substring(3)); + var a = $('#arr'+this.id.substring(3)); + if (l + + + + +File List +CMSIS-RTOS: File List + + + + + + + + + + + + +
+
+ + + + + + + +
+
CMSIS-RTOS +  Version 1.02 +
+
CMSIS-RTOS API: Generic RTOS interface for Cortex-M processor-based devices.
+
+
+ +
+
    + +
+
+ + +
+
+ +
+
+
+ +
+
+
+
File List
+
+
+
Here is a list of all files with brief descriptions:
+ + +
\*cmsis_os.h
+
+
+
+ + + + diff --git a/Documentation/RTOS/html/ftv2blank.png b/Documentation/RTOS/html/ftv2blank.png new file mode 100644 index 0000000..63c605b Binary files /dev/null and b/Documentation/RTOS/html/ftv2blank.png differ diff --git a/Documentation/RTOS/html/ftv2cl.png b/Documentation/RTOS/html/ftv2cl.png new file mode 100644 index 0000000..132f657 Binary files /dev/null and b/Documentation/RTOS/html/ftv2cl.png differ diff --git a/Documentation/RTOS/html/ftv2doc.png b/Documentation/RTOS/html/ftv2doc.png new file mode 100644 index 0000000..17edabf Binary files /dev/null and b/Documentation/RTOS/html/ftv2doc.png differ diff --git a/Documentation/RTOS/html/ftv2folderclosed.png b/Documentation/RTOS/html/ftv2folderclosed.png new file mode 100644 index 0000000..bb8ab35 Binary files /dev/null and b/Documentation/RTOS/html/ftv2folderclosed.png differ diff --git a/Documentation/RTOS/html/ftv2folderopen.png b/Documentation/RTOS/html/ftv2folderopen.png new file mode 100644 index 0000000..d6c7f67 Binary files /dev/null and b/Documentation/RTOS/html/ftv2folderopen.png differ diff --git a/Documentation/RTOS/html/ftv2lastnode.png b/Documentation/RTOS/html/ftv2lastnode.png new file mode 100644 index 0000000..63c605b Binary files /dev/null and b/Documentation/RTOS/html/ftv2lastnode.png differ diff --git a/Documentation/RTOS/html/ftv2link.png b/Documentation/RTOS/html/ftv2link.png new file mode 100644 index 0000000..17edabf Binary files /dev/null and b/Documentation/RTOS/html/ftv2link.png differ diff --git a/Documentation/RTOS/html/ftv2mlastnode.png b/Documentation/RTOS/html/ftv2mlastnode.png new file mode 100644 index 0000000..0b63f6d Binary files /dev/null and b/Documentation/RTOS/html/ftv2mlastnode.png differ diff --git a/Documentation/RTOS/html/ftv2mnode.png b/Documentation/RTOS/html/ftv2mnode.png new file mode 100644 index 0000000..0b63f6d Binary files /dev/null and b/Documentation/RTOS/html/ftv2mnode.png differ diff --git a/Documentation/RTOS/html/ftv2mo.png b/Documentation/RTOS/html/ftv2mo.png new file mode 100644 index 0000000..4bfb80f Binary files /dev/null and b/Documentation/RTOS/html/ftv2mo.png differ diff --git a/Documentation/RTOS/html/ftv2node.png b/Documentation/RTOS/html/ftv2node.png new file mode 100644 index 0000000..63c605b Binary files /dev/null and b/Documentation/RTOS/html/ftv2node.png differ diff --git a/Documentation/RTOS/html/ftv2ns.png b/Documentation/RTOS/html/ftv2ns.png new file mode 100644 index 0000000..72e3d71 Binary files /dev/null and b/Documentation/RTOS/html/ftv2ns.png differ diff --git a/Documentation/RTOS/html/ftv2plastnode.png b/Documentation/RTOS/html/ftv2plastnode.png new file mode 100644 index 0000000..c6ee22f Binary files /dev/null and b/Documentation/RTOS/html/ftv2plastnode.png differ diff --git a/Documentation/RTOS/html/ftv2pnode.png b/Documentation/RTOS/html/ftv2pnode.png new file mode 100644 index 0000000..c6ee22f Binary files /dev/null and b/Documentation/RTOS/html/ftv2pnode.png differ diff --git a/Documentation/RTOS/html/ftv2splitbar.png b/Documentation/RTOS/html/ftv2splitbar.png new file mode 100644 index 0000000..fe895f2 Binary files /dev/null and b/Documentation/RTOS/html/ftv2splitbar.png differ diff --git a/Documentation/RTOS/html/ftv2vertline.png b/Documentation/RTOS/html/ftv2vertline.png new file mode 100644 index 0000000..63c605b Binary files /dev/null and b/Documentation/RTOS/html/ftv2vertline.png differ diff --git a/Documentation/RTOS/html/functions.html b/Documentation/RTOS/html/functions.html new file mode 100644 index 0000000..489dcb6 --- /dev/null +++ b/Documentation/RTOS/html/functions.html @@ -0,0 +1,161 @@ + + + + + +Data Fields +CMSIS-RTOS: Data Fields + + + + + + + + + + + + +
+
+ + + + + + + +
+
CMSIS-RTOS +  Version 1.02 +
+
CMSIS-RTOS API: Generic RTOS interface for Cortex-M processor-based devices.
+
+
+ +
+
    + +
+
+ + + + +
+
+ +
+
+
+ +
+
+
Here is a list of all struct and union fields with links to the structures/unions they belong to:
+
+
+ + + + diff --git a/Documentation/RTOS/html/functions_vars.html b/Documentation/RTOS/html/functions_vars.html new file mode 100644 index 0000000..aaa3ef2 --- /dev/null +++ b/Documentation/RTOS/html/functions_vars.html @@ -0,0 +1,161 @@ + + + + + +Data Fields - Variables +CMSIS-RTOS: Data Fields - Variables + + + + + + + + + + + + +
+
+ + + + + + + +
+
CMSIS-RTOS +  Version 1.02 +
+
CMSIS-RTOS API: Generic RTOS interface for Cortex-M processor-based devices.
+
+
+ +
+
    + +
+
+ + + + +
+
+ +
+
+
+ +
+
+
+
+ + + + diff --git a/Documentation/RTOS/html/globals.html b/Documentation/RTOS/html/globals.html new file mode 100644 index 0000000..484e7b3 --- /dev/null +++ b/Documentation/RTOS/html/globals.html @@ -0,0 +1,423 @@ + + + + + +Globals +CMSIS-RTOS: Globals + + + + + + + + + + + + +
+
+ + + + + + + +
+
CMSIS-RTOS +  Version 1.02 +
+
CMSIS-RTOS API: Generic RTOS interface for Cortex-M processor-based devices.
+
+
+ +
+
    + +
+
+ + + + +
+
+ +
+
+
+ +
+
+
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:
+ +

- o -

+
+
+ + + + diff --git a/Documentation/RTOS/html/globals_defs.html b/Documentation/RTOS/html/globals_defs.html new file mode 100644 index 0000000..5396235 --- /dev/null +++ b/Documentation/RTOS/html/globals_defs.html @@ -0,0 +1,182 @@ + + + + + +Globals +CMSIS-RTOS: Globals + + + + + + + + + + + + +
+
+ + + + + + + +
+
CMSIS-RTOS +  Version 1.02 +
+
CMSIS-RTOS API: Generic RTOS interface for Cortex-M processor-based devices.
+
+
+ +
+
    + +
+
+ + + +
+
+ +
+
+
+ +
+
+
+
+ + + + diff --git a/Documentation/RTOS/html/globals_enum.html b/Documentation/RTOS/html/globals_enum.html new file mode 100644 index 0000000..a07156b --- /dev/null +++ b/Documentation/RTOS/html/globals_enum.html @@ -0,0 +1,110 @@ + + + + + +Globals +CMSIS-RTOS: Globals + + + + + + + + + + + + +
+
+ + + + + + + +
+
CMSIS-RTOS +  Version 1.02 +
+
CMSIS-RTOS API: Generic RTOS interface for Cortex-M processor-based devices.
+
+
+ +
+
    + +
+
+ + + +
+
+ +
+
+
+ +
+
+
+
+ + + + diff --git a/Documentation/RTOS/html/globals_eval.html b/Documentation/RTOS/html/globals_eval.html new file mode 100644 index 0000000..8b896e2 --- /dev/null +++ b/Documentation/RTOS/html/globals_eval.html @@ -0,0 +1,173 @@ + + + + + +Globals +CMSIS-RTOS: Globals + + + + + + + + + + + + +
+
+ + + + + + + +
+
CMSIS-RTOS +  Version 1.02 +
+
CMSIS-RTOS API: Generic RTOS interface for Cortex-M processor-based devices.
+
+
+ +
+
    + +
+
+ + + +
+
+ +
+
+
+ +
+
+
+
+ + + + diff --git a/Documentation/RTOS/html/globals_func.html b/Documentation/RTOS/html/globals_func.html new file mode 100644 index 0000000..4c7ec3c --- /dev/null +++ b/Documentation/RTOS/html/globals_func.html @@ -0,0 +1,225 @@ + + + + + +Globals +CMSIS-RTOS: Globals + + + + + + + + + + + + +
+
+ + + + + + + +
+
CMSIS-RTOS +  Version 1.02 +
+
CMSIS-RTOS API: Generic RTOS interface for Cortex-M processor-based devices.
+
+
+ +
+
    + +
+
+ + + + +
+
+ +
+
+
+ +
+
+  + +

- o -

+
+
+ + + + diff --git a/Documentation/RTOS/html/globals_type.html b/Documentation/RTOS/html/globals_type.html new file mode 100644 index 0000000..32d4d3d --- /dev/null +++ b/Documentation/RTOS/html/globals_type.html @@ -0,0 +1,125 @@ + + + + + +Globals +CMSIS-RTOS: Globals + + + + + + + + + + + + +
+
+ + + + + + + +
+
CMSIS-RTOS +  Version 1.02 +
+
CMSIS-RTOS API: Generic RTOS interface for Cortex-M processor-based devices.
+
+
+ +
+
    + +
+
+ + + +
+
+ +
+
+
+ +
+
+
+
+ + + + diff --git a/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s.html b/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s.html new file mode 100644 index 0000000..fec85f6 --- /dev/null +++ b/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s.html @@ -0,0 +1,122 @@ + + + + + +CMSIS-RTOS API +CMSIS-RTOS: CMSIS-RTOS API + + + + + + + + + + + + +
+
+ + + + + + + +
+
CMSIS-RTOS +  Version 1.02 +
+
CMSIS-RTOS API: Generic RTOS interface for Cortex-M processor-based devices.
+
+
+ +
+
    + +
+
+ + +
+
+ +
+
+
+ +
+
+ +
+
CMSIS-RTOS API
+
+
+ +

This section describes the CMSIS-RTOS API. +More...

+ + + + + + + + + + + + + + + + + + + + + + + +

+Content

 Kernel Information and Control
 Provide version/system information and start the RTOS Kernel.
 
 Thread Management
 Define, create, and control thread functions.
 
 Generic Wait Functions
 Wait for a time period or unspecified events.
 
 Timer Management
 Create and control timer and timer callback functions.
 
 Inter-Thread Communication and Resource Sharing
 Functions for inter-thread communication.
 
 Generic Data Types and Definitions
 Data Type Definitions used by the CMSIS-RTOS API functions.
 
 Status and Error Codes
 Status and Error Codes returned by CMSIS-RTOS API functions.
 
+

Description

+

The CMSIS-RTOS is a generic API layer that interfaces to an existing RTOS kernel.

+
+
+ + + + diff --git a/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s.js b/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s.js new file mode 100644 index 0000000..3df2489 --- /dev/null +++ b/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s.js @@ -0,0 +1,10 @@ +var group___c_m_s_i_s___r_t_o_s = +[ + [ "Kernel Information and Control", "group___c_m_s_i_s___r_t_o_s___kernel_ctrl.html", "group___c_m_s_i_s___r_t_o_s___kernel_ctrl" ], + [ "Thread Management", "group___c_m_s_i_s___r_t_o_s___thread_mgmt.html", "group___c_m_s_i_s___r_t_o_s___thread_mgmt" ], + [ "Generic Wait Functions", "group___c_m_s_i_s___r_t_o_s___wait.html", "group___c_m_s_i_s___r_t_o_s___wait" ], + [ "Timer Management", "group___c_m_s_i_s___r_t_o_s___timer_mgmt.html", "group___c_m_s_i_s___r_t_o_s___timer_mgmt" ], + [ "Inter-Thread Communication and Resource Sharing", "group___c_m_s_i_s___r_t_o_s___inter_thread.html", "group___c_m_s_i_s___r_t_o_s___inter_thread" ], + [ "Generic Data Types and Definitions", "group___c_m_s_i_s___r_t_o_s___definitions.html", "group___c_m_s_i_s___r_t_o_s___definitions" ], + [ "Status and Error Codes", "group___c_m_s_i_s___r_t_o_s___status.html", "group___c_m_s_i_s___r_t_o_s___status" ] +]; \ No newline at end of file diff --git a/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___definitions.html b/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___definitions.html new file mode 100644 index 0000000..e62e66b --- /dev/null +++ b/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___definitions.html @@ -0,0 +1,260 @@ + + + + + +Generic Data Types and Definitions +CMSIS-RTOS: Generic Data Types and Definitions + + + + + + + + + + + + +
+
+ + + + + + + +
+
CMSIS-RTOS +  Version 1.02 +
+
CMSIS-RTOS API: Generic RTOS interface for Cortex-M processor-based devices.
+
+
+ +
+
    + +
+
+ + +
+
+ +
+
+
+ +
+
+ +
+
Generic Data Types and Definitions
+
+
+ +

Data Type Definitions used by the CMSIS-RTOS API functions. +More...

+ + + + + + + +

+Data Structures

struct  osEvent
 Event structure contains detailed information about an event. More...
 
struct  os_mailQ
 
+

Description

+

The Data Type section lists all data types that are used to exchange information with CMSIS-RTOS functions.

+

Data Structure Documentation

+ +
+
+ + + + +
struct osEvent
+
+
Note
MUST REMAIN UNCHANGED: os_event shall be consistent in every CMSIS-RTOS. However the struct may be extended at the end.
+

The osEvent structure describes the events returned by CMSIS-RTOS functions.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +

Data Fields

osStatus status
 status code: event or error information
 
union {
   uint32_t   v
 message as 32-bit value
 
   void *   p
 message or mail as void pointer
 
   int32_t   signals
 signal flags
 
value
 event value
 
union {
   osMailQId   mail_id
 mail id obtained by osMailCreate
 
   osMessageQId   message_id
 message id obtained by osMessageCreate
 
def
 event definition
 
+

Field Documentation

+ +
+
+ + + + +
union { ... } def
+
+ +
+
+ +
+
+ + + + +
osMailQId mail_id
+
+ +
+
+ +
+
+ + + + +
osMessageQId message_id
+
+ +
+
+ +
+
+ + + + +
void* p
+
+ +
+
+ +
+
+ + + + +
int32_t signals
+
+ +
+
+ +
+
+ + + + +
osStatus status
+
+ +
+
+ +
+
+ + + + +
uint32_t v
+
+ +
+
+ +
+
+ + + + +
union { ... } value
+
+ +
+
+ +
+
+ +
+
+ + + + +
struct os_mailQ
+
+

The osEvent structure describes the events returned by CMSIS-RTOS functions.

+
+
+
+
+
+ + + + diff --git a/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___definitions.js b/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___definitions.js new file mode 100644 index 0000000..5eab500 --- /dev/null +++ b/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___definitions.js @@ -0,0 +1,14 @@ +var group___c_m_s_i_s___r_t_o_s___definitions = +[ + [ "osEvent", "group___c_m_s_i_s___r_t_o_s___definitions.html#structos_event", [ + [ "def", "group___c_m_s_i_s___r_t_o_s___definitions.html#a596b6d55c3321db19239256bbe403df6", null ], + [ "mail_id", "group___c_m_s_i_s___r_t_o_s___definitions.html#ac86175a4b1706bee596f3018322df26e", null ], + [ "message_id", "group___c_m_s_i_s___r_t_o_s___definitions.html#af394cbe21dde7377974e63af38cd87b0", null ], + [ "p", "group___c_m_s_i_s___r_t_o_s___definitions.html#a117104b82864d3b23ec174af6d392709", null ], + [ "signals", "group___c_m_s_i_s___r_t_o_s___definitions.html#ad0dda1bf7e74f1576261d493fba232b6", null ], + [ "status", "group___c_m_s_i_s___r_t_o_s___definitions.html#ad477a289f1f03ac45407b64268d707d3", null ], + [ "v", "group___c_m_s_i_s___r_t_o_s___definitions.html#a9e0a00edabf3b8a5dafff624fff7bbfc", null ], + [ "value", "group___c_m_s_i_s___r_t_o_s___definitions.html#a0b9f8fd3645f01d8cb09cae82add2d7f", null ] + ] ], + [ "os_mailQ", "group___c_m_s_i_s___r_t_o_s___definitions.html#structos__mail_q", null ] +]; \ No newline at end of file diff --git a/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___inter_thread.html b/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___inter_thread.html new file mode 100644 index 0000000..843de70 --- /dev/null +++ b/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___inter_thread.html @@ -0,0 +1,133 @@ + + + + + +Inter-Thread Communication and Resource Sharing +CMSIS-RTOS: Inter-Thread Communication and Resource Sharing + + + + + + + + + + + + +
+
+ + + + + + + +
+
CMSIS-RTOS +  Version 1.02 +
+
CMSIS-RTOS API: Generic RTOS interface for Cortex-M processor-based devices.
+
+
+ +
+
    + +
+
+ + +
+
+ +
+
+
+ +
+
+ +
+
Inter-Thread Communication and Resource Sharing
+
+
+ +

Functions for inter-thread communication. +More...

+ + + + + + + + + + + + + + + + + + + + +

+Content

 Signal Events
 Synchronize threads using signals.
 
 Message Queue
 Exchange messages between threads in a FIFO-like operation.
 
 Memory Pool
 Manage thread-safe fixed-size blocks of dynamic memory.
 
 Mail Queue
 Exchange data between threads using a queue of memory blocks.
 
 Mutexes
 Synchronize resource access using Mutual Exclusion (Mutex).
 
 Semaphores
 Access shared resources simultaneously from different threads.
 
+

Description

+

In most applications, threads need to communicate with each other or access shared resources together. There are many ways to exchange data between threads, for example using shared data, polling loops and message passing.

+

Many resources in a microcontroller can be considered as serially-reusable. This means that they can be used repeatedly by different threads, but only by one thread at a time (for example communication peripherals such as UARTs, memory, and files that need to be modified).

+

The CMSIS-RTOS API provides different means to pass messages between threads to make inter-thread communication more efficient. Also, resource sharing is inherently supported. The following methods are available to the user:

+

Inter-Thread Communication

+ +

Resource Sharing

+ +
+
+ + + + diff --git a/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___inter_thread.js b/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___inter_thread.js new file mode 100644 index 0000000..12c2295 --- /dev/null +++ b/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___inter_thread.js @@ -0,0 +1,9 @@ +var group___c_m_s_i_s___r_t_o_s___inter_thread = +[ + [ "Signal Events", "group___c_m_s_i_s___r_t_o_s___signal_mgmt.html", "group___c_m_s_i_s___r_t_o_s___signal_mgmt" ], + [ "Message Queue", "group___c_m_s_i_s___r_t_o_s___message.html", "group___c_m_s_i_s___r_t_o_s___message" ], + [ "Memory Pool", "group___c_m_s_i_s___r_t_o_s___pool_mgmt.html", "group___c_m_s_i_s___r_t_o_s___pool_mgmt" ], + [ "Mail Queue", "group___c_m_s_i_s___r_t_o_s___mail.html", "group___c_m_s_i_s___r_t_o_s___mail" ], + [ "Mutexes", "group___c_m_s_i_s___r_t_o_s___mutex_mgmt.html", "group___c_m_s_i_s___r_t_o_s___mutex_mgmt" ], + [ "Semaphores", "group___c_m_s_i_s___r_t_o_s___semaphore_mgmt.html", "group___c_m_s_i_s___r_t_o_s___semaphore_mgmt" ] +]; \ No newline at end of file diff --git a/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___kernel_ctrl.html b/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___kernel_ctrl.html new file mode 100644 index 0000000..4adc773 --- /dev/null +++ b/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___kernel_ctrl.html @@ -0,0 +1,429 @@ + + + + + +Kernel Information and Control +CMSIS-RTOS: Kernel Information and Control + + + + + + + + + + + + +
+
+ + + + + + + +
+
CMSIS-RTOS +  Version 1.02 +
+
CMSIS-RTOS API: Generic RTOS interface for Cortex-M processor-based devices.
+
+
+ +
+
    + +
+
+ + +
+
+ +
+
+
+ +
+
+ +
+
Kernel Information and Control
+
+
+ +

Provide version/system information and start the RTOS Kernel. +More...

+ + + + + + + + + + + + + + + + + + + + + + + +

+Macros

#define osFeature_MainThread   1
 main thread 1=main can be thread, 0=not available
 
#define osFeature_SysTick   1
 osKernelSysTick functions: 1=available, 0=not available
 
#define osCMSIS   0x10002
 API version (main [31:16] .sub [15:0])
 
#define osCMSIS_KERNEL   0x10000
 RTOS identification and version (main [31:16] .sub [15:0])
 
#define osKernelSystemId   "KERNEL V1.00"
 RTOS identification string.
 
#define osKernelSysTickFrequency   100000000
 The RTOS kernel system timer frequency in Hz.
 
#define osKernelSysTickMicroSec(microsec)   (((uint64_t)microsec * (osKernelSysTickFrequency)) / 1000000)
 Convert a microseconds value to a RTOS kernel system timer value.
 
+ + + + + + + + + + + + + +

+Functions

osStatus osKernelInitialize (void)
 Initialize the RTOS Kernel for creating objects.
 
osStatus osKernelStart (void)
 Start the RTOS Kernel.
 
int32_t osKernelRunning (void)
 Check if the RTOS kernel is already started.
 
uint32_t osKernelSysTick (void)
 Get the RTOS kernel system timer counter.
 
+

Description

+

The Kernel Information and Control function group allows to:

+
    +
  • obtain information about the system and the underlying kernel.
  • +
  • obtain version information about the CMSIS-RTOS API.
  • +
  • initialize of the RTOS kernel for creating objects.
  • +
  • start the RTOS kernel and thread switching.
  • +
  • check the execution status of the RTOS kernel.
  • +
+

The function main is a special thread function that may be started at system initialization. In this case it has the initial priority osPriorityNormal.

+

When reaching main, it is necessary to:

+
    +
  1. Call osKernelInitialize() to initialize the CMSIS-RTOS Kernel
  2. +
  3. Setup device peripherals and create other RTOS objects using the os*Create functions.
  4. +
  5. Start the Kernel and begin thread switching by calling osKernelStart().
  6. +
+

Code Example

+
int main (void) {
+
osKernelInitialize (); // initialize CMSIS-RTOS
+
+
// initialize peripherals here
+
+
// create 'thread' functions that start executing,
+
// example: tid_name = osThreadCreate (osThread(name), NULL);
+
+
osKernelStart (); // start thread execution
+
}
+

Macro Definition Documentation

+ +
+
+ + + + +
#define osCMSIS   0x10002
+
+

Version information of the CMSIS-RTOS API whereby major version is in bits [31:16] and sub version in bits [15:0]. The value 0x10000 represents version 1.00.

+
Note
MUST REMAIN UNCHANGED: osCMSIS identifies the CMSIS-RTOS API version.
+ +
+
+ +
+
+ + + + +
#define osCMSIS_KERNEL   0x10000
+
+

Identifies the underlying RTOS kernel and version number. The actual name of that define depends on the RTOS Kernel used in the implementation. For example, osCMSIS_FreeRTOS identifies the FreeRTOS kernel and the value indicates the version number of that kernel whereby the major version is in bits [31:16] and sub version in bits [15:0]. The value 0x10000 represents version 1.00.

+
Note
CAN BE CHANGED: osCMSIS_KERNEL identifies the underlying RTOS kernel and version number.
+ +
+
+ +
+
+ + + + +
#define osFeature_MainThread   1
+
+

A CMSIS-RTOS implementation may support to start thread execution with the function 'main'.

+ +
Note
MUST REMAIN UNCHANGED: osFeature_xxx shall be consistent in every CMSIS-RTOS.
+ +
+
+ +
+
+ + + + +
#define osFeature_SysTick   1
+
+

A CMSIS-RTOS implementation may provide access to the RTOS kernel system timer.

+ + +
+
+ +
+
+ + + + +
#define osKernelSystemId   "KERNEL V1.00"
+
+

Defines a string that identifies the underlying RTOS Kernel and provides version information. The length of that string is limited to 21 bytes. A valid identification string is for example, "FreeRTOS V1.00".

+
Note
MUST REMAIN UNCHANGED: osKernelSystemId shall be consistent in every CMSIS-RTOS.
+ +
+
+ +
+
+ + + + +
#define osKernelSysTickFrequency   100000000
+
+

Specifies the frequency of the Kernel SysTick timer in Hz. The value is typically use to scale a time value and is for example used in osKernelSysTickMicroSec.

+
See Also
osKernelSysTick
+
Note
Reflects the system timer setting and is typically defined in a configuration file.
+ +
+
+ +
+
+ + + + + + + + +
#define osKernelSysTickMicroSec( microsec)   (((uint64_t)microsec * (osKernelSysTickFrequency)) / 1000000)
+
+

Allows you to scale a microsecond value to the frequency of the Kernel SysTick timer. This macro is typically used to check for short timeouts in polling loops.

+
See Also
osKernelSysTick
+
Parameters
+ + +
microsectime value in microseconds.
+
+
+
Returns
time value normalized to the osKernelSysTickFrequency
+ +
+
+

Function Documentation

+ +
+
+ + + + + + + + +
osStatus osKernelInitialize (void )
+
+
Returns
status code that indicates the execution status of the function.
+
Note
MUST REMAIN UNCHANGED: osKernelInitialize shall be consistent in every CMSIS-RTOS.
+

Initialize of the RTOS Kernel to allow peripheral setup and creation of other RTOS objects with the functions:

+ +

The RTOS kernel does not start thread switching until the function osKernelStart is called.

+
Note
In case that the RTOS Kernel starts thread execution with the function main the function osKernelInitialize stops thread switching. This allows you to setup the system to a defined state before thread switching is resumed with osKernelStart.
+

Code Example

+
#include "cmsis_os.h"
+
+
int main (void) {
+
if (!osKernelRunning ()) { // if kernel is not running, initialize the kernel
+
if (osKernelInitialize () != osOK) { // check osStatus for other possible valid values
+
// exit with an error message
+
}
+
}
+
:
+
}
+
+
+
+ +
+
+ + + + + + + + +
int32_t osKernelRunning (void )
+
+
Note
MUST REMAIN UNCHANGED: osKernelRunning shall be consistent in every CMSIS-RTOS.
+
Returns
0 RTOS is not started, 1 RTOS is started.
+

Identifies if the RTOS kernel is started. For systems with the option to start the main function as a thread this allows you to identify that the RTOS kernel is already running.

+
Note
Interrupt Service Routines can call this function.
+

Code Example

+
#include "cmsis_os.h"
+
+
int main (void) { // program execution starts here
+
if (osKernelRunning ()) {
+
: // main is already a thread function
+
}
+
}
+
+
+
+ +
+
+ + + + + + + + +
osStatus osKernelStart (void )
+
+
Returns
status code that indicates the execution status of the function.
+
Note
MUST REMAIN UNCHANGED: osKernelStart shall be consistent in every CMSIS-RTOS.
+

Start the RTOS Kernel and begin thread switching.

+
Note
When the CMSIS-RTOS starts thread execution with the function main this function resumes thread switching. The main thread will continue executing after osKernelStart.
+

Status and Error Codes
+

+
    +
  • osOK: the RTOS kernel has been successfully started.
  • +
  • osErrorISR: osKernelStart cannot be called from interrupt service routines.
  • +
+
Note
Cannot be called from Interrupt Service Routines.
+

Code Example

+
#include "cmsis_os.h"
+
+
int main (void) {
+
if (osKernelInitialize () != osOK) { // check osStatus for other possible valid values
+
// exit with an error message
+
}
+
+
if (!osKernelRunning ()) { // is the kernel running ?
+
if (osKernelStart () != osOK) { // start the kernel
+
// kernel could not be started
+
}
+
}
+
}
+
+
+
+ +
+
+ + + + + + + + +
uint32_t osKernelSysTick (void )
+
+
Note
MUST REMAIN UNCHANGED: osKernelSysTick shall be consistent in every CMSIS-RTOS.
+
Returns
RTOS kernel system timer as 32-bit value
+

Get the value of the Kernel SysTick timer for time comparison. The value is a rolling 32-bit counter that is typically composed of the kernel system interrupt timer value and an counter that counts these interrupts.

+

This function allows the implementation of timeout checks. These are for example required when checking for a busy status in a device or peripheral initialization routine.

+
Note
Cannot be called from Interrupt Service Routines.
+

Code Example

+
#include "cmsis_os.h"
+
+
void SetupDevice (void) {
+
uint32_t tick;
+
+
tick = osKernelSysTick(); // get start value of the Kernel system tick
+
Device.Setup (); // initialize a device or peripheral
+
do { // poll device busy status for 100 microseconds
+
if (!Device.Busy) break; // check if device is correctly initialized
+
} while ((osKernelSysTick() - tick) < osKernelSysTickMicroSec(100));
+
if (Device.Busy) {
+
; // in case device still busy, signal error
+
}
+
// start interacting with device
+
}
+
+
+
+
+
+ + + + diff --git a/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___kernel_ctrl.js b/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___kernel_ctrl.js new file mode 100644 index 0000000..50eddf6 --- /dev/null +++ b/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___kernel_ctrl.js @@ -0,0 +1,14 @@ +var group___c_m_s_i_s___r_t_o_s___kernel_ctrl = +[ + [ "osCMSIS", "group___c_m_s_i_s___r_t_o_s___kernel_ctrl.html#ga702196bacccbb978620c736b209387f1", null ], + [ "osCMSIS_KERNEL", "group___c_m_s_i_s___r_t_o_s___kernel_ctrl.html#gab78dce646fabec479c5f34bc5175b7de", null ], + [ "osFeature_MainThread", "group___c_m_s_i_s___r_t_o_s___kernel_ctrl.html#ga22f7d235bc9f783933bd5a981fd79696", null ], + [ "osFeature_SysTick", "group___c_m_s_i_s___r_t_o_s___kernel_ctrl.html#gae554ec16c23c5b7d65affade2a351891", null ], + [ "osKernelSystemId", "group___c_m_s_i_s___r_t_o_s___kernel_ctrl.html#ga47cf03658f01cdffca688e9096b58289", null ], + [ "osKernelSysTickFrequency", "group___c_m_s_i_s___r_t_o_s___kernel_ctrl.html#ga9e0954d52722673e2031233a2ab99960", null ], + [ "osKernelSysTickMicroSec", "group___c_m_s_i_s___r_t_o_s___kernel_ctrl.html#gae12c190af42d7310d8006d64f4ed5a88", null ], + [ "osKernelInitialize", "group___c_m_s_i_s___r_t_o_s___kernel_ctrl.html#ga53d078a801022e202e8115c083ece68e", null ], + [ "osKernelRunning", "group___c_m_s_i_s___r_t_o_s___kernel_ctrl.html#ga3b571de44cd3094c643247a7397f86b5", null ], + [ "osKernelStart", "group___c_m_s_i_s___r_t_o_s___kernel_ctrl.html#gaab668ffd2ea76bb0a77ab0ab385eaef2", null ], + [ "osKernelSysTick", "group___c_m_s_i_s___r_t_o_s___kernel_ctrl.html#gad0262e4688e95d1e9038afd9bcc16001", null ] +]; \ No newline at end of file diff --git a/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___mail.html b/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___mail.html new file mode 100644 index 0000000..a28161e --- /dev/null +++ b/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___mail.html @@ -0,0 +1,594 @@ + + + + + +Mail Queue +CMSIS-RTOS: Mail Queue + + + + + + + + + + + + +
+
+ + + + + + + +
+
CMSIS-RTOS +  Version 1.02 +
+
CMSIS-RTOS API: Generic RTOS interface for Cortex-M processor-based devices.
+
+
+ +
+
    + +
+
+ + +
+
+ +
+
+
+ +
+ +
+ +

Exchange data between threads using a queue of memory blocks. +More...

+ + + + + + + + + + + +

+Macros

#define osFeature_MailQ   1
 Mail Queues: 1=available, 0=not available.
 
#define osMailQDef(name, queue_sz, type)
 Create a Mail Queue Definition.
 
#define osMailQ(name)   &os_mailQ_def_##name
 Access a Mail Queue Definition.
 
+ + + + + + + + + + + + + + + + + + + +

+Functions

osMailQId osMailCreate (const osMailQDef_t *queue_def, osThreadId thread_id)
 Create and Initialize mail queue.
 
void * osMailAlloc (osMailQId queue_id, uint32_t millisec)
 Allocate a memory block from a mail.
 
void * osMailCAlloc (osMailQId queue_id, uint32_t millisec)
 Allocate a memory block from a mail and set memory block to zero.
 
osStatus osMailPut (osMailQId queue_id, void *mail)
 Put a mail to a queue.
 
osEvent osMailGet (osMailQId queue_id, uint32_t millisec)
 Get a mail from a queue.
 
osStatus osMailFree (osMailQId queue_id, void *mail)
 Free a memory block from a mail.
 
+

Description

+

A mail queue resembles a Message Queue, but the data that is being transferred consists of memory blocks that need to be allocated (before putting data in) and freed (after taking data out). The mail queue uses a Memory Pool to create formatted memory blocks and passes pointers to these blocks in a message queue. This allows the data to stay in an allocated memory block while only a pointer is moved between the separate threads. This is an advantage over messages that can transfer only a 32-bit value or a pointer. Using the mail queue functions, you can control, send, receive, or wait for mail.

+
+MailQueue.png +
+CMSIS-RTOS Mail Queue
+

Working with Mail Queues

+

Follow these steps to create and use a mail queue:

+
    +
  1. Declare a data structure that combines a number of elements:
    typedef struct {
    +
    uint32_t length;
    +
    uint32_t width;
    +
    uint32_t height;
    +
    uint32_t weight;
    +
    } properties_t;
    +
  2. +
  3. Declare a mail queue made up of these objects:
    osMailQDef (object_pool_q, 10, properties_t); // Declare mail queue
    +
    osMailQId (object_pool_q_id); // Mail queue ID
    +
  4. +
  5. Then, create the mail pool in a thread:
    object_pool_q_id = osMailCreate(osMailQ(object_pool_q), NULL);
    +
  6. +
  7. Allocate the mail queue within a thread and fill it with data:
    properties_t *object_data;
    +
    *object_data = (properties_t *) osMailAlloc(object_pool_q_id, osWaitForever);
    +
    +
    object_data->length = 100;
    +
    object_data->width = 10;
    +
    object_data->height = 23;
    +
    object_data->weight = 1000;
    +
  8. +
  9. Pass the pointer to the mail queue to another thread:
    osMailPut(object_pool_q_id, object_data);
    +
  10. +
  11. Access the data in another thread:
    osEvent event = osMailGet(properties_q_id, osWaitForever);
    +
    properties_t *received = (properties_t *)event.value.p; // ".p" indicates that the message is a pointer
    +
    my_length(received->length);
    +
  12. +
  13. Once the data has been used, the memory block must be freed so that the memory pool can be reused
    osMailFree(object_pool_q_id, received);
    +
  14. +
+

Macro Definition Documentation

+ +
+
+ + + + +
#define osFeature_MailQ   1
+
+

A CMSIS-RTOS implementation may support mail queues.

+ + +
+
+ +
+
+ + + + + + + + +
#define osMailQ( name)   &os_mailQ_def_##name
+
+

Access to the mail queue definition for the function osMailCreate.

+
Parameters
+ + +
namename of the queue
+
+
+
Note
CAN BE CHANGED: The parameter to osMailQ shall be consistent but the macro body is implementation specific in every CMSIS-RTOS.
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
#define osMailQDef( name,
 queue_sz,
 type 
)
+
+

Define the attributes of a mail queue that can by the function osMailCreate using osMailQ.

+
Note
The parameter thread registers the receiving thread for a mail and is needed for the general osWait function to deliver the mail.
+
Parameters
+ + + + +
namename of the queue
queue_szmaximum number of messages in queue
typedata type of a single message element
+
+
+
Note
CAN BE CHANGED: The parameter to osMailQDef shall be consistent but the macro body is implementation specific in every CMSIS-RTOS.
+ +
+
+

Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + +
void * osMailAlloc (osMailQId queue_id,
uint32_t millisec 
)
+
+
Parameters
+ + + +
[in]queue_idmail queue ID obtained with osMailCreate.
[in]millisecTimout Value or 0 in case of no time-out
+
+
+
Returns
pointer to memory block that can be filled with mail or NULL in case of error.
+
Note
MUST REMAIN UNCHANGED: osMailAlloc shall be consistent in every CMSIS-RTOS.
+

Allocate a memory block from the mail queue that is filled with the mail information.

+

The argument queue_id specifies a mail queue identifier that is obtain with osMailCreate.

+

The argument millisec specifies how long the system waits for a mail slot to become available. While the system waits the tread calling this function is put into the state WAITING. The millisec timeout can have the following values:

+
    +
  • when millisec is 0, the function returns instantly.
  • +
  • when millisec is set to osWaitForever the function will wait for an infinite time until a mail slot can be allocated.
  • +
  • all other values specify a time in millisecond for a timeout.
  • +
+
Note
The parameter millisec must be 0 for using this function in an ISR.
+
+Interrupt Service Routines can call this function.
+

A NULL pointer is returned when no memory slot can be obtained or queue specifies an illegal parameter.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
void * osMailCAlloc (osMailQId queue_id,
uint32_t millisec 
)
+
+
Parameters
+ + + +
[in]queue_idmail queue ID obtained with osMailCreate.
[in]millisecTimout Value or 0 in case of no time-out
+
+
+
Returns
pointer to memory block that can be filled with mail or NULL in case of error.
+
Note
MUST REMAIN UNCHANGED: osMailCAlloc shall be consistent in every CMSIS-RTOS.
+

Allocate a memory block from the mail queue that is filled with the mail information. The memory block returned is cleared.

+

The argument queue_id specifies a mail queue identifier that is obtain with osMailCreate.

+

The argument millisec specifies how long the system waits for a mail slot to become available. While the system waits the thread that is calling this function is put into the state WAITING. The millisec timeout can have the following values:

+
    +
  • when millisec is 0, the function returns instantly.
  • +
  • when millisec is set to osWaitForever the function will wait for an infinite time until a mail slot can be allocated.
  • +
  • all other values specify a time in millisecond for a timeout.
  • +
+
Note
The parameter millisec must be 0 for using this function in an ISR.
+
+Interrupt Service Routines can call this function.
+

A NULL pointer is returned when no memory block can be obtained or queue specifies an illegal parameter.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
osMailQId osMailCreate (const osMailQDef_tqueue_def,
osThreadId thread_id 
)
+
+
Parameters
+ + + +
[in]queue_defreference to the mail queue definition obtain with osMailQ
[in]thread_idthread ID (obtained by osThreadCreate or osThreadGetId) or NULL.
+
+
+
Returns
mail queue ID for reference by other functions or NULL in case of error.
+
Note
MUST REMAIN UNCHANGED: osMailCreate shall be consistent in every CMSIS-RTOS.
+

Initialize and create a mail queue.

+
Note
Cannot be called from Interrupt Service Routines.
+

Code Example

+
#include "cmsis_os.h"
+
+
osThreadId tid_thread1; // ID for thread 1
+
osThreadId tid_thread2; // ID for thread 2
+
+
typedef struct { // Mail object structure
+
float voltage; // AD result of measured voltage
+
float current; // AD result of measured current
+
int counter; // A counter value
+
} T_MEAS;
+
+
osMailQDef(mail, 16, T_MEAS); // Define mail queue
+
osMailQId mail;
+
+
void send_thread (void const *argument); // forward reference
+
void recv_thread (void const *argument);
+
+
osThreadDef(send_thread, osPriorityNormal, 1, 0); // thread definitions
+
osThreadDef(recv_thread, osPriorityNormal, 1, 2000);
+
+
//
+
// Thread 1: Send thread
+
//
+
void send_thread (void const *argument) {
+
T_MEAS *mptr;
+
+
mptr = osMailAlloc(mail, osWaitForever); // Allocate memory
+
mptr->voltage = 223.72; // Set the mail content
+
mptr->current = 17.54;
+
mptr->counter = 120786;
+
osMailPut(mail, mptr); // Send Mail
+
osDelay(100);
+
+
mptr = osMailAlloc(mail, osWaitForever); // Allocate memory
+
mptr->voltage = 227.23; // Prepare 2nd mail
+
mptr->current = 12.41;
+
mptr->counter = 170823;
+
osMailPut(mail, mptr); // Send Mail
+
osThreadYield(); // Cooperative multitasking
+
// We are done here, exit this thread
+
}
+
+
//
+
// Thread 2: Receive thread
+
//
+
void recv_thread (void const *argument) {
+
T_MEAS *rptr;
+
osEvent evt;
+
+
for (;;) {
+
evt = osMailGet(mail, osWaitForever); // wait for mail
+
if (evt.status == osEventMail) {
+
rptr = evt.value.p;
+
printf ("\nVoltage: %.2f V\n", rptr->voltage);
+
printf ("Current: %.2f A\n", rptr->current);
+
printf ("Number of cycles: %d\n", rptr->counter);
+
osMailFree(mail, rptr); // free memory allocated for mail
+
}
+
}
+
}
+
+
void StartApplication (void) {
+
mail = osMailCreate(osMailQ(mail), NULL); // create mail queue
+
+
tid_thread1 = osThreadCreate(osThread(send_thread), NULL);
+
tid_thread2 = osThreadCreate(osThread(recv_thread), NULL);
+
:
+
}
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
osStatus osMailFree (osMailQId queue_id,
void * mail 
)
+
+
Parameters
+ + + +
[in]queue_idmail queue ID obtained with osMailCreate.
[in]mailpointer to the memory block that was obtained with osMailGet.
+
+
+
Returns
status code that indicates the execution status of the function.
+
Note
MUST REMAIN UNCHANGED: osMailFree shall be consistent in every CMSIS-RTOS.
+

Free the memory block specified by mail and return it to the mail queue.

+
Note
Interrupt Service Routines can call this function.
+

Status and Error Codes
+

+
    +
  • osOK: the mail block is released.
  • +
  • osErrorValue: mail block does not belong to the mail queue pool.
  • +
  • osErrorParameter: the value to the parameter queue_id is incorrect.
  • +
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
osEvent osMailGet (osMailQId queue_id,
uint32_t millisec 
)
+
+
Parameters
+ + + +
[in]queue_idmail queue ID obtained with osMailCreate.
[in]millisecTimout Value or 0 in case of no time-out
+
+
+
Returns
event that contains mail information or error code.
+
Note
MUST REMAIN UNCHANGED: osMailGet shall be consistent in every CMSIS-RTOS.
+

Suspend the execution of the current RUNNING thread until a mail arrives. When a mail is already in the queue, the function returns instantly with the mail information.

+

The argument millisec specifies how long the system waits for a mail to arrive. While the system waits the thread that is calling this function is put into the state WAITING. The millisec timeout can have the following values:

+
    +
  • when millisec is 0, the function returns instantly.
  • +
  • when millisec is set to osWaitForever the function will wait for an infinite time until a mail arrives.
  • +
  • all other values specify a time in millisecond for a timeout.
  • +
+
Note
The parameter millisec must be 0 for using this function in an ISR.
+
+Interrupt Service Routines can call this function.
+

Status and Error Codes
+

+
    +
  • osOK: no mail is available in the queue and no timeout was specified
  • +
  • osEventTimeout: no mail has arrived during the given timeout period.
  • +
  • osEventMail: mail received, value.p contains the pointer to mail content.
  • +
  • osErrorParameter: a parameter is invalid or outside of a permitted range.
  • +
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
osStatus osMailPut (osMailQId queue_id,
void * mail 
)
+
+
Parameters
+ + + +
[in]queue_idmail queue ID obtained with osMailCreate.
[in]mailmemory block previously allocated with osMailAlloc or osMailCAlloc.
+
+
+
Returns
status code that indicates the execution status of the function.
+
Note
MUST REMAIN UNCHANGED: osMailPut shall be consistent in every CMSIS-RTOS.
+

Put the memory block specified with mail into the mail queue specified by queue.

+

Status and Error Codes
+

+
    +
  • osOK: the message is put into the queue.
  • +
  • osErrorValue: mail was previously not allocated as memory slot.
  • +
  • osErrorParameter: a parameter is invalid or outside of a permitted range.
  • +
+ +
+
+
+
+ + + + diff --git a/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___mail.js b/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___mail.js new file mode 100644 index 0000000..72ce801 --- /dev/null +++ b/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___mail.js @@ -0,0 +1,12 @@ +var group___c_m_s_i_s___r_t_o_s___mail = +[ + [ "osFeature_MailQ", "group___c_m_s_i_s___r_t_o_s___mail.html#gaceb2e0071ce160d153047f2eac1aca8e", null ], + [ "osMailQ", "group___c_m_s_i_s___r_t_o_s___mail.html#gad2deeb66d51ade54e63d8f87ff2ec9d2", null ], + [ "osMailQDef", "group___c_m_s_i_s___r_t_o_s___mail.html#ga58d712b16c0c6668059f509386d1e55b", null ], + [ "osMailAlloc", "group___c_m_s_i_s___r_t_o_s___mail.html#gadf5ce811bd6a56e617e902a1db6c2194", null ], + [ "osMailCAlloc", "group___c_m_s_i_s___r_t_o_s___mail.html#ga8fde74f6fe5b9e88f75cc5eb8f2124fd", null ], + [ "osMailCreate", "group___c_m_s_i_s___r_t_o_s___mail.html#gaa177e7fe5820dd70d8c9e46ded131174", null ], + [ "osMailFree", "group___c_m_s_i_s___r_t_o_s___mail.html#ga27c1060cf21393f96b4fd1ed1c0167cc", null ], + [ "osMailGet", "group___c_m_s_i_s___r_t_o_s___mail.html#gac6ad7e6e7d6c4a80e60da22c57a42ccd", null ], + [ "osMailPut", "group___c_m_s_i_s___r_t_o_s___mail.html#ga485ef6f81854ebda8ffbce4832181e02", null ] +]; \ No newline at end of file diff --git a/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___message.html b/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___message.html new file mode 100644 index 0000000..336fd47 --- /dev/null +++ b/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___message.html @@ -0,0 +1,451 @@ + + + + + +Message Queue +CMSIS-RTOS: Message Queue + + + + + + + + + + + + +
+
+ + + + + + + +
+
CMSIS-RTOS +  Version 1.02 +
+
CMSIS-RTOS API: Generic RTOS interface for Cortex-M processor-based devices.
+
+
+ +
+
    + +
+
+ + +
+
+ +
+
+
+ +
+ +
+ +

Exchange messages between threads in a FIFO-like operation. +More...

+ + + + + + + + + + + +

+Macros

#define osFeature_MessageQ   1
 Message Queues: 1=available, 0=not available.
 
#define osMessageQDef(name, queue_sz, type)
 Create a Message Queue Definition.
 
#define osMessageQ(name)   &os_messageQ_def_##name
 Access a Message Queue Definition.
 
+ + + + + + + + + + +

+Functions

osMessageQId osMessageCreate (const osMessageQDef_t *queue_def, osThreadId thread_id)
 Create and Initialize a Message Queue.
 
osStatus osMessagePut (osMessageQId queue_id, uint32_t info, uint32_t millisec)
 Put a Message to a Queue.
 
osEvent osMessageGet (osMessageQId queue_id, uint32_t millisec)
 Get a Message or Wait for a Message from a Queue.
 
+

Description

+

Message passing is another basic communication model between threads. In the message passing model, one thread sends data explicitly, while another thread receives it. The operation is more like some kind of I/O rather than a direct access to information to be shared. In CMSIS-RTOS, this mechanism is called s message queue. The data is passed from one thread to another in a FIFO-like operation. Using message queue functions, you can control, send, receive, or wait for messages. The data to be passed can be of integer or pointer type:

+
+MessageQueue.png +
+CMSIS-RTOS Message Queue
+

Compared to a Memory Pool, message queues are less efficient in general, but solve a broader range of problems. Sometimes, threads do not have a common address space or the use of shared memory raises problems, such as mutual exclusion.

+

Working with Message Queues

+

Follow these steps to create and use a message queue:

+
    +
  1. Setup the message queue:
    osMessageQDef(message_q, 5, uint32_t); // Declare a message queue
    +
    osMessageQId (message_q_id); // Declare an ID for the message queue
    +
  2. +
  3. Then, create the message queue in a thread:
    message_q_id = osMessageCreate(osMessageQ(message_q), NULL);
    +
  4. +
  5. Fill the message queue with data:
    uint32_t data = 512;
    +
    +
    osMailPut(message_q_id, data, osWaitForever);
    +
  6. +
  7. From the receiving thread access the data using:
    osEvent event = osMessageGet(message_q_id, osWaitForever);
    +
  8. +
+

Macro Definition Documentation

+ +
+
+ + + + +
#define osFeature_MessageQ   1
+
+

A CMSIS-RTOS implementation may support message queues.

+ + +
+
+ +
+
+ + + + + + + + +
#define osMessageQ( name)   &os_messageQ_def_##name
+
+

Access to the message queue definition for the function osMessageCreate.

+
Parameters
+ + +
namename of the queue
+
+
+
Note
CAN BE CHANGED: The parameter to osMessageQ shall be consistent but the macro body is implementation specific in every CMSIS-RTOS.
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
#define osMessageQDef( name,
 queue_sz,
 type 
)
+
+

Define the attributes of a message queue created by the function osMessageCreate using osMessageQ.

+
Note
The parameter thread registers the receiving thread for a message and is needed for the general osWait function to deliver the message.
+
Parameters
+ + + + +
namename of the queue.
queue_szmaximum number of messages in the queue.
typedata type of a single message element (for debugger).
+
+
+
Note
CAN BE CHANGED: The parameter to osMessageQDef shall be consistent but the macro body is implementation specific in every CMSIS-RTOS.
+ +
+
+

Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + +
osMessageQId osMessageCreate (const osMessageQDef_tqueue_def,
osThreadId thread_id 
)
+
+
Parameters
+ + + +
[in]queue_defqueue definition referenced with osMessageQ.
[in]thread_idthread ID (obtained by osThreadCreate or osThreadGetId) or NULL.
+
+
+
Returns
message queue ID for reference by other functions or NULL in case of error.
+
Note
MUST REMAIN UNCHANGED: osMessageCreate shall be consistent in every CMSIS-RTOS.
+

Create and initialize a message queue.

+
Note
Cannot be called from Interrupt Service Routines.
+

Code Example

+
#include "cmsis_os.h"
+
+
osThreadId tid_thread1; // ID for thread 1
+
osThreadId tid_thread2; // for thread 2
+
+
typedef struct { // Message object structure
+
float voltage; // AD result of measured voltage
+
float current; // AD result of measured current
+
int counter; // A counter value
+
} T_MEAS;
+
+
osPoolDef(mpool, 16, T_MEAS); // Define memory pool
+
osPoolId mpool;
+
osMessageQDef(MsgBox, 16, T_MEAS); // Define message queue
+
osMessageQId MsgBox;
+
+
void send_thread (void const *argument); // forward reference
+
void recv_thread (void const *argument); // forward reference
+
// Thread definitions
+
osThreadDef(send_thread, osPriorityNormal, 1, 0);
+
osThreadDef(recv_thread, osPriorityNormal, 1, 2000);
+
+
//
+
// Thread 1: Send thread
+
//
+
void send_thread (void const *argument) {
+
T_MEAS *mptr;
+
+
mptr = osPoolAlloc(mpool); // Allocate memory for the message
+
mptr->voltage = 223.72; // Set the message content
+
mptr->current = 17.54;
+
mptr->counter = 120786;
+
osMessagePut(MsgBox, (uint32_t)mptr, osWaitForever); // Send Message
+
osDelay(100);
+
+
mptr = osPoolAlloc(mpool); // Allocate memory for the message
+
mptr->voltage = 227.23; // Prepare a 2nd message
+
mptr->current = 12.41;
+
mptr->counter = 170823;
+
osMessagePut(MsgBox, (uint32_t)mptr, osWaitForever); // Send Message
+
osThreadYield(); // Cooperative multitasking
+
// We are done here, exit this thread
+
}
+
+
//
+
// Thread 2: Receive thread
+
//
+
void recv_thread (void const *argument) {
+
T_MEAS *rptr;
+
osEvent evt;
+
+
for (;;) {
+
evt = osMessageGet(MsgBox, osWaitForever); // wait for message
+
if (evt.status == osEventMessage) {
+
rptr = evt.value.p;
+
printf ("\nVoltage: %.2f V\n", rptr->voltage);
+
printf ("Current: %.2f A\n", rptr->current);
+
printf ("Number of cycles: %d\n", rptr->counter);
+
osPoolFree(mpool, rptr); // free memory allocated for message
+
}
+
}
+
}
+
+
void StartApplication (void) {
+
mpool = osPoolCreate(osPool(mpool)); // create memory pool
+
MsgBox = osMessageCreate(osMessageQ(MsgBox), NULL); // create msg queue
+
+
tid_thread1 = osThreadCreate(osThread(send_thread), NULL);
+
tid_thread2 = osThreadCreate(osThread(recv_thread), NULL);
+
:
+
}
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
osEvent osMessageGet (osMessageQId queue_id,
uint32_t millisec 
)
+
+
Parameters
+ + + +
[in]queue_idmessage queue ID obtained with osMessageCreate.
[in]millisecTimout Value or 0 in case of no time-out.
+
+
+
Returns
event information that includes status code.
+
Note
MUST REMAIN UNCHANGED: osMessageGet shall be consistent in every CMSIS-RTOS.
+

Suspend the execution of the current RUNNING thread until a message arrives. When a message is already in the queue, the function returns instantly with the message information.

+

The argument millisec specifies how long the system waits for a message to become available. While the system waits the thread that is calling this function is put into the state WAITING. The millisec timeout value can have the following values:

+
    +
  • when millisec is 0, the function returns instantly.
  • +
  • when millisec is set to osWaitForever the function will wait for an infinite time until a message arrives.
  • +
  • all other values specify a time in millisecond for a timeout.
  • +
+
Note
The parameter millisec must be 0 for using this function in an ISR.
+
+Interrupt Service Routines can call this function.
+

Status and Error Codes
+

+
    +
  • osOK: no message is available in the queue and no timeout was specified.
  • +
  • osEventTimeout: no message has arrived during the given timeout period.
  • +
  • osEventMessage: message received, value.p contains the pointer to message.
  • +
  • osErrorParameter: a parameter is invalid or outside of a permitted range.
  • +
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
osStatus osMessagePut (osMessageQId queue_id,
uint32_t info,
uint32_t millisec 
)
+
+
Parameters
+ + + + +
[in]queue_idmessage queue ID obtained with osMessageCreate.
[in]infomessage information.
[in]millisecTimout Value or 0 in case of no time-out.
+
+
+
Returns
status code that indicates the execution status of the function.
+
Note
MUST REMAIN UNCHANGED: osMessagePut shall be consistent in every CMSIS-RTOS.
+

Put the message info in a message queue specified by queue_id.

+

When the message queue is full, the system retries for a specified time with millisec. While the system retries the thread that is calling this function is put into the state WAITING. The millisec timeout can have the following values:

+
    +
  • when millisec is 0, the function returns instantly.
  • +
  • when millisec is set to osWaitForever the function will wait for an infinite time until a message queue slot becomes available.
  • +
  • all other values specify a time in millisecond for a timeout.
  • +
+
Note
The parameter millisec must be 0 for using this function in an ISR.
+
+Interrupt Service Routines can call this function.
+

Status and Error Codes
+

+
    +
  • osOK: the message is put into the queue.
  • +
  • osErrorResource: no memory in the queue was available.
  • +
  • osErrorTimeoutResource: no memory in the queue was available during the given time limit.
  • +
  • osErrorParameter: a parameter is invalid or outside of a permitted range.
  • +
+ +
+
+
+
+ + + + diff --git a/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___message.js b/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___message.js new file mode 100644 index 0000000..38de1fa --- /dev/null +++ b/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___message.js @@ -0,0 +1,9 @@ +var group___c_m_s_i_s___r_t_o_s___message = +[ + [ "osFeature_MessageQ", "group___c_m_s_i_s___r_t_o_s___message.html#ga479a6561f859e3d4818e25708593d203", null ], + [ "osMessageQ", "group___c_m_s_i_s___r_t_o_s___message.html#ga2d446a0b4bb90bf05d6f92eedeaabc97", null ], + [ "osMessageQDef", "group___c_m_s_i_s___r_t_o_s___message.html#gac9a6a6276c12609793e7701afcc82326", null ], + [ "osMessageCreate", "group___c_m_s_i_s___r_t_o_s___message.html#gaf3b9345cf426304d46565152bc26fb78", null ], + [ "osMessageGet", "group___c_m_s_i_s___r_t_o_s___message.html#ga6c6892b8f2296cca6becd57ca2d7e1ae", null ], + [ "osMessagePut", "group___c_m_s_i_s___r_t_o_s___message.html#gac0dcf462fc92de8ffaba6cc004514a6d", null ] +]; \ No newline at end of file diff --git a/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___mutex_mgmt.html b/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___mutex_mgmt.html new file mode 100644 index 0000000..5cebaa7 --- /dev/null +++ b/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___mutex_mgmt.html @@ -0,0 +1,405 @@ + + + + + +Mutexes +CMSIS-RTOS: Mutexes + + + + + + + + + + + + +
+
+ + + + + + + +
+
CMSIS-RTOS +  Version 1.02 +
+
CMSIS-RTOS API: Generic RTOS interface for Cortex-M processor-based devices.
+
+
+ +
+
    + +
+
+ + +
+
+ +
+
+
+ +
+ +
+ +

Synchronize resource access using Mutual Exclusion (Mutex). +More...

+ + + + + + + + +

+Macros

#define osMutexDef(name)   const osMutexDef_t os_mutex_def_##name = { 0 }
 Define a Mutex.
 
#define osMutex(name)   &os_mutex_def_##name
 Access a Mutex definition.
 
+ + + + + + + + + + + + + +

+Functions

osMutexId osMutexCreate (const osMutexDef_t *mutex_def)
 Create and Initialize a Mutex object.
 
osStatus osMutexWait (osMutexId mutex_id, uint32_t millisec)
 Wait until a Mutex becomes available.
 
osStatus osMutexRelease (osMutexId mutex_id)
 Release a Mutex that was obtained by osMutexWait.
 
osStatus osMutexDelete (osMutexId mutex_id)
 Delete a Mutex that was created by osMutexCreate.
 
+

Description

+

Mutual exclusion (widely known as Mutex) is used in various operating systems for resource management. Many resources in a microcontroller device can be used repeatedly, but only by one thread at a time (for example communication channels, memory, and files). Mutexes are used to protect access to a shared resource. A mutex is created and then passed between the threads (they can acquire and release the mutex).

+
+Mutex.png +
+CMSIS-RTOS Mutex
+

A mutex is a special version of a semaphore. Like the semaphore, it is a container for tokens. But instead of being able to have multiple tokens, a mutex can only carry one (representing the resource). Thus, a mutex token is binary and bounded. The advantage of a mutex is that it introduces thread ownership. When a thread acquires a mutex and becomes its owner, subsequent mutex acquires from that thread will succeed immediately without any latency. Thus, mutex acquires/releases can be nested.

+
Note
    +
  • Mutex management functions cannot be called from interrupt service routines (ISR), unlike a binary semaphore that can be released from an ISR.
  • +
+
+

Working with Mutexes

+

To use mutexes, you need to follow these steps for creating and using them:

+
    +
  1. Declare the mutex container and initialize the mutex:
    osMutexDef (uart_mutex); // Declare mutex
    +
    osMutexId (uart_mutex_id); // Mutex ID
    +
  2. +
  3. Create the mutex in a thread:
    uart_mutex_id = osMutexCreate(osMutex(uart_mutex));
    +
  4. +
  5. Acquire the mutex when peripheral access is required:
    osMutexWait(uart_mutex_id, osWaitForever);
    +
  6. +
  7. When finished with the peripheral access, release the mutex:
    osMutexRelease(uart_mutex_id);
    +
  8. +
+

Macro Definition Documentation

+ +
+
+ + + + + + + + +
#define osMutex( name)   &os_mutex_def_##name
+
+

Access to mutex object for the functions osMutexCreate.

+
Parameters
+ + +
namename of the mutex object.
+
+
+
Note
CAN BE CHANGED: The parameter to osMutex shall be consistent but the macro body is implementation specific in every CMSIS-RTOS.
+ +
+
+ +
+
+ + + + + + + + +
#define osMutexDef( name)   const osMutexDef_t os_mutex_def_##name = { 0 }
+
+

Define a mutex object that is referenced by osMutex.

+
Parameters
+ + +
namename of the mutex object.
+
+
+
Note
CAN BE CHANGED: The parameter to osMutexDef shall be consistent but the macro body is implementation specific in every CMSIS-RTOS.
+ +
+
+

Function Documentation

+ +
+
+ + + + + + + + +
osMutexId osMutexCreate (const osMutexDef_tmutex_def)
+
+
Parameters
+ + +
[in]mutex_defmutex definition referenced with osMutex.
+
+
+
Returns
mutex ID for reference by other functions or NULL in case of error.
+
Note
MUST REMAIN UNCHANGED: osMutexCreate shall be consistent in every CMSIS-RTOS.
+

Create and initialize a Mutex object.

+
Note
Cannot be called from Interrupt Service Routines.
+

Code Example

+
#include "cmsis_os.h"
+
+
osMutexDef (MutexIsr); // Mutex name definition
+
+
void CreateMutex (void) {
+
osMutexId mutex_id;
+
+
mutex_id = osMutexCreate (osMutex (MutexIsr));
+
if (mutex_id != NULL) {
+
// Mutex object created
+
}
+
}
+
+
+
+ +
+
+ + + + + + + + +
osStatus osMutexDelete (osMutexId mutex_id)
+
+
Parameters
+ + +
[in]mutex_idmutex ID obtained by osMutexCreate.
+
+
+
Returns
status code that indicates the execution status of the function.
+
Note
MUST REMAIN UNCHANGED: osMutexDelete shall be consistent in every CMSIS-RTOS.
+

Delete a Mutex object. The function releases internal memory obtained for Mutex handling. After this call the mutex_id is no longer valid and cannot be used. The Mutex may be created again using the function osMutexCreate.

+

Status and Error Codes
+

+
    +
  • osOK: the mutex object has been deleted.
  • +
  • osErrorISR: osMutexDelete cannot be called from interrupt service routines.
  • +
  • osErrorResource: all tokens have already been released.
  • +
  • osErrorParameter: the parameter mutex_id is incorrect.
  • +
+
Note
Cannot be called from Interrupt Service Routines.
+

Code Example

+
#include "cmsis_os.h"
+
+
osMutexDef (MutexIsr); // Mutex name definition
+
osMutexId mutex_id; // Mutex id populated by the function CreateMutex()
+
osMutexId CreateMutex (void); // function prototype that creates the Mutex
+
+
void DeleteMutex (osMutexId mutex_id) {
+
osStatus status;
+
+
if (mutex_id != NULL) {
+
status = osMutexDelete(mutex_id);
+
if (status != osOK) {
+
// handle failure code
+
}
+
}
+
}
+
+
+
+ +
+
+ + + + + + + + +
osStatus osMutexRelease (osMutexId mutex_id)
+
+
Parameters
+ + +
[in]mutex_idmutex ID obtained by osMutexCreate.
+
+
+
Returns
status code that indicates the execution status of the function.
+
Note
MUST REMAIN UNCHANGED: osMutexRelease shall be consistent in every CMSIS-RTOS.
+

Release a Mutex that was obtained with osMutexWait. Other threads that currently wait for the same mutex will be now put into the state READY.

+

Status and Error Codes
+

+
    +
  • osOK: the mutex has been correctly released.
  • +
  • osErrorResource: the mutex was not obtained before.
  • +
  • osErrorParameter: the parameter mutex_id is incorrect.
  • +
  • osErrorISR: osMutexRelease cannot be called from interrupt service routines.
  • +
+
Note
Cannot be called from Interrupt Service Routines.
+

Code Example

+
#include "cmsis_os.h"
+
+
osMutexDef (MutexIsr); // Mutex name definition
+
osMutexId mutex_id; // Mutex id populated by the function CreateMutex()
+
osMutexId CreateMutex (void); // function prototype that creates the Mutex
+
+
void ReleaseMutex (osMutexId mutex_id) {
+
osStatus status;
+
+
if (mutex_id != NULL) {
+
status = osMutexRelease(mutex_id);
+
if (status != osOK) {
+
// handle failure code
+
}
+
}
+
}
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
osStatus osMutexWait (osMutexId mutex_id,
uint32_t millisec 
)
+
+
Parameters
+ + + +
[in]mutex_idmutex ID obtained by osMutexCreate.
[in]millisecTimout Value or 0 in case of no time-out.
+
+
+
Returns
status code that indicates the execution status of the function.
+
Note
MUST REMAIN UNCHANGED: osMutexWait shall be consistent in every CMSIS-RTOS.
+

Wait until a Mutex becomes available. If no other thread has obtained the Mutex, the function instantly returns and blocks the mutex object.

+

The argument millisec specifies how long the system waits for a mutex. While the system waits the thread that is calling this function is put into the state WAITING. The millisec timeout can have the following values:

+
    +
  • when millisec is 0, the function returns instantly.
  • +
  • when millisec is set to osWaitForever the function will wait for an infinite time until the mutex becomes available.
  • +
  • all other values specify a time in millisecond for a timeout.
  • +
+

Status and Error Codes
+

+
    +
  • osOK: the mutex has been obtain.
  • +
  • osErrorTimeoutResource: the mutex could not be obtained in the given time.
  • +
  • osErrorResource: the mutex could not be obtained when no timeout was specified.
  • +
  • osErrorParameter: the parameter mutex_id is incorrect.
  • +
  • osErrorISR: osMutexWait cannot be called from interrupt service routines.
  • +
+
Note
Cannot be called from Interrupt Service Routines.
+

Code Example

+
#include "cmsis_os.h"
+
+
osMutexDef (MutexIsr);
+
+
void WaitMutex (void) {
+
osMutexId mutex_id;
+
osStatus status;
+
+
mutex_id = osMutexCreate (osMutex (MutexIsr));
+
if (mutex_id != NULL) {
+
status = osMutexWait (mutex_id, 0);
+
if (status != osOK) {
+
// handle failure code
+
}
+
}
+
}
+
+
+
+
+
+ + + + diff --git a/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___mutex_mgmt.js b/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___mutex_mgmt.js new file mode 100644 index 0000000..1587dca --- /dev/null +++ b/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___mutex_mgmt.js @@ -0,0 +1,9 @@ +var group___c_m_s_i_s___r_t_o_s___mutex_mgmt = +[ + [ "osMutex", "group___c_m_s_i_s___r_t_o_s___mutex_mgmt.html#ga1122a86faa64b4a0880c76cf68d0c934", null ], + [ "osMutexDef", "group___c_m_s_i_s___r_t_o_s___mutex_mgmt.html#ga9b522438489d7c402c95332b58bc94f3", null ], + [ "osMutexCreate", "group___c_m_s_i_s___r_t_o_s___mutex_mgmt.html#ga5c9de56e717016e39e788064e9a291cc", null ], + [ "osMutexDelete", "group___c_m_s_i_s___r_t_o_s___mutex_mgmt.html#gac27e24135185d51d18f3dabc20910219", null ], + [ "osMutexRelease", "group___c_m_s_i_s___r_t_o_s___mutex_mgmt.html#ga006e4744d741e8e132c3d5bbc295afe1", null ], + [ "osMutexWait", "group___c_m_s_i_s___r_t_o_s___mutex_mgmt.html#ga5e1752b73f573ee015dbd9ef1edaba13", null ] +]; \ No newline at end of file diff --git a/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___pool_mgmt.html b/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___pool_mgmt.html new file mode 100644 index 0000000..7a9d5dd --- /dev/null +++ b/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___pool_mgmt.html @@ -0,0 +1,456 @@ + + + + + +Memory Pool +CMSIS-RTOS: Memory Pool + + + + + + + + + + + + +
+
+ + + + + + + +
+
CMSIS-RTOS +  Version 1.02 +
+
CMSIS-RTOS API: Generic RTOS interface for Cortex-M processor-based devices.
+
+
+ +
+
    + +
+
+ + +
+
+ +
+
+
+ +
+ +
+ +

Manage thread-safe fixed-size blocks of dynamic memory. +More...

+ + + + + + + + + + + +

+Macros

#define osFeature_Pool   1
 Memory Pools: 1=available, 0=not available.
 
#define osPoolDef(name, no, type)
 Define a Memory Pool.
 
#define osPool(name)   &os_pool_def_##name
 Access a Memory Pool definition.
 
+ + + + + + + + + + + + + +

+Functions

osPoolId osPoolCreate (const osPoolDef_t *pool_def)
 Create and Initialize a memory pool.
 
void * osPoolAlloc (osPoolId pool_id)
 Allocate a memory block from a memory pool.
 
void * osPoolCAlloc (osPoolId pool_id)
 Allocate a memory block from a memory pool and set memory block to zero.
 
osStatus osPoolFree (osPoolId pool_id, void *block)
 Return an allocated memory block back to a specific memory pool.
 
+

Description

+

Memory pools are fixed-size blocks of memory that are thread-safe. They operate much faster than the dynamically allocated heap and do not suffer from fragmentation. Being thread-safe, they can be accessed from threads and ISRs alike.

+

Shared memory is one of the basic models to exchange information between threads. Using memory pools for exchanging data, you can share more complex objects between threads if compared to a Message Queue. Memory pool management functions are used to define and manage such fixed-sized memory pools.

+

Working with Memory Pools

+

Follow these steps to create and use a memory pool:

+
    +
  1. Declare a data structure that combines a number of elements:
    typedef struct {
    +
    uint32_t length;
    +
    uint32_t width;
    +
    uint32_t height;
    +
    uint32_t weight;
    +
    } properties_t;
    +
  2. +
  3. Declare a memory pool of these objects as a block of memory:
    osPoolDef (object_pool, 10, properties_t); // Declare memory pool
    +
    osPoolId (object_pool_id); // Memory pool ID
    +
  4. +
  5. Then, create the memory pool in a thread:
    object_pool_id = osPoolCreate(osPool(object_pool));
    +
  6. +
  7. Allocate the pool within a thread and fill it with data:
    properties_t *object_data;
    +
    *object_data = (properties_t *) osPoolAlloc(object_pool_id);
    +
    +
    object_data->length = 100;
    +
    object_data->width = 10;
    +
    object_data->height = 23;
    +
    object_data->weight = 1000;
    +
  8. +
+

Macro Definition Documentation

+ +
+
+ + + + +
#define osFeature_Pool   1
+
+

A CMSIS-RTOS implementation may support fixed-size memory pools.

+ + +
+
+ +
+
+ + + + + + + + +
#define osPool( name)   &os_pool_def_##name
+
+

Access a memory pool for the functions osPoolCreate.

+
Parameters
+ + +
namename of the memory pool
+
+
+
Note
CAN BE CHANGED: The parameter to osPool shall be consistent but the macro body is implementation specific in every CMSIS-RTOS.
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
#define osPoolDef( name,
 no,
 type 
)
+
+

Define a memory pool that is referenced by osPool.

+
Parameters
+ + + + +
namename of the memory pool.
nomaximum number of blocks (objects) in the memory pool.
typedata type of a single block (object).
+
+
+
Note
CAN BE CHANGED: The parameter to osPoolDef shall be consistent but the macro body is implementation specific in every CMSIS-RTOS.
+ +
+
+

Function Documentation

+ +
+
+ + + + + + + + +
void * osPoolAlloc (osPoolId pool_id)
+
+
Parameters
+ + +
[in]pool_idmemory pool ID obtain referenced with osPoolCreate.
+
+
+
Returns
address of the allocated memory block or NULL in case of no memory available.
+
Note
MUST REMAIN UNCHANGED: osPoolAlloc shall be consistent in every CMSIS-RTOS.
+

Allocate a memory block from the memory pool.

+
Note
Interrupt Service Routines can call this function.
+

Code Example

+
#include "cmsis_os.h"
+
+
typedef struct {
+
uint8_t Buf[32];
+
uint8_t Idx;
+
} MEM_BLOCK;
+
+
osPoolDef (MemPool, 8, MEM_BLOCK);
+
+
void AlocMemoryPoolBlock (void) {
+
osPoolId MemPool_Id;
+
MEM_BLOCK *addr;
+
+
MemPool_Id = osPoolCreate (osPool (MemPool));
+
if (MemPool_Id != NULL) {
+
:
+
// allocate a memory block
+
addr = (MEM_BLOCK *)osPoolAlloc (MemPool_Id);
+
+
if (addr != NULL) {
+
// memory block was allocated
+
:
+
}
+
}
+
}
+
+
+
+ +
+
+ + + + + + + + +
void * osPoolCAlloc (osPoolId pool_id)
+
+
Parameters
+ + +
[in]pool_idmemory pool ID obtain referenced with osPoolCreate.
+
+
+
Returns
address of the allocated memory block or NULL in case of no memory available.
+
Note
MUST REMAIN UNCHANGED: osPoolCAlloc shall be consistent in every CMSIS-RTOS.
+

Allocate a memory block from the memory pool. The block is initialized to zero.

+
Note
Interrupt Service Routines can call this function.
+

Code Example

+
#include "cmsis_os.h"
+
+
typedef struct {
+
uint8_t Buf[32];
+
uint8_t Idx;
+
} MEM_BLOCK;
+
+
osPoolDef (MemPool, 8, MEM_BLOCK);
+
+
void CAlocMemoryPoolBlock (void) {
+
osPoolId MemPool_Id;
+
MEM_BLOCK *addr;
+
+
MemPool_Id = osPoolCreate (osPool (MemPool));
+
if (MemPool_Id != NULL) {
+
:
+
// allocate a memory block
+
addr = (MEM_BLOCK *)osPoolCAlloc (MemPool_Id);
+
+
if (addr != NULL) {
+
// memory block was allocated
+
:
+
}
+
}
+
}
+
+
+
+ +
+
+ + + + + + + + +
osPoolId osPoolCreate (const osPoolDef_tpool_def)
+
+
Parameters
+ + +
[in]pool_defmemory pool definition referenced with osPool.
+
+
+
Returns
memory pool ID for reference by other functions or NULL in case of error.
+
Note
MUST REMAIN UNCHANGED: osPoolCreate shall be consistent in every CMSIS-RTOS.
+

Create and initialize a memory pool.

+
Note
Cannot be called from Interrupt Service Routines.
+

Code Example

+
#include "cmsis_os.h"
+
+
typedef struct {
+
uint8_t Buf[32];
+
uint8_t Idx;
+
} MEM_BLOCK;
+
+
osPoolDef (MemPool, 8, MEM_BLOCK);
+
+
void CreateMemoryPool (void) {
+
osPoolId MemPool_Id;
+
+
MemPool_Id = osPoolCreate (osPool (MemPool));
+
if (MemPool_Id != NULL) {
+
// memory pool created
+
}
+
}
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
osStatus osPoolFree (osPoolId pool_id,
void * block 
)
+
+
Parameters
+ + + +
[in]pool_idmemory pool ID obtain referenced with osPoolCreate.
[in]blockaddress of the allocated memory block that is returned to the memory pool.
+
+
+
Returns
status code that indicates the execution status of the function.
+
Note
MUST REMAIN UNCHANGED: osPoolFree shall be consistent in every CMSIS-RTOS.
+

Return a memory block to a memory pool.

+

Status and Error Codes
+

+
    +
  • osOK: the memory block is released.
  • +
  • osErrorValue: block does not belong to the memory pool.
  • +
  • osErrorParameter: a parameter is invalid or outside of a permitted range.
  • +
+
Note
Interrupt Service Routines can call this function.
+

Code Example

+
#include "cmsis_os.h"
+
+
typedef struct {
+
uint8_t Buf[32];
+
uint8_t Idx;
+
} MEM_BLOCK;
+
+
osPoolDef (MemPool, 8, MEM_BLOCK);
+
+
void CAlocMemoryPoolBlock (void) {
+
osPoolId MemPool_Id;
+
MEM_BLOCK *addr;
+
osStatus status;
+
+
MemPool_Id = osPoolCreate (osPool (MemPool));
+
if (MemPool_Id != NULL) {
+
addr = (MEM_BLOCK *)osPoolCAlloc (MemPool_Id);
+
if (addr != NULL) {
+
:
+
// return a memory block back to pool
+
status = osPoolFree (MemPool_Id, addr);
+
if (status==osOK) {
+
// handle status code
+
}
+
}
+
}
+
}
+
+
+
+
+
+ + + + diff --git a/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___pool_mgmt.js b/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___pool_mgmt.js new file mode 100644 index 0000000..51d5079 --- /dev/null +++ b/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___pool_mgmt.js @@ -0,0 +1,10 @@ +var group___c_m_s_i_s___r_t_o_s___pool_mgmt = +[ + [ "osFeature_Pool", "group___c_m_s_i_s___r_t_o_s___pool_mgmt.html#gadd84b683001de327894851b428587caa", null ], + [ "osPool", "group___c_m_s_i_s___r_t_o_s___pool_mgmt.html#ga5f0b204a82327533d420210125c90697", null ], + [ "osPoolDef", "group___c_m_s_i_s___r_t_o_s___pool_mgmt.html#ga87b471d4fe2d5dbd0040708edd52771b", null ], + [ "osPoolAlloc", "group___c_m_s_i_s___r_t_o_s___pool_mgmt.html#gaa0b2994f1a866c19e0d11e6e0d44f543", null ], + [ "osPoolCAlloc", "group___c_m_s_i_s___r_t_o_s___pool_mgmt.html#ga9f129fcad4730fbd1048ad4fa262f36a", null ], + [ "osPoolCreate", "group___c_m_s_i_s___r_t_o_s___pool_mgmt.html#ga34af5c4f4ab38f4138ea7f1f9ece3a1a", null ], + [ "osPoolFree", "group___c_m_s_i_s___r_t_o_s___pool_mgmt.html#ga4a861e9c469c9d0daf5721bf174f8e54", null ] +]; \ No newline at end of file diff --git a/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___semaphore_mgmt.html b/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___semaphore_mgmt.html new file mode 100644 index 0000000..916e331 --- /dev/null +++ b/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___semaphore_mgmt.html @@ -0,0 +1,424 @@ + + + + + +Semaphores +CMSIS-RTOS: Semaphores + + + + + + + + + + + + +
+
+ + + + + + + +
+
CMSIS-RTOS +  Version 1.02 +
+
CMSIS-RTOS API: Generic RTOS interface for Cortex-M processor-based devices.
+
+
+ +
+
    + +
+
+ + +
+
+ +
+
+
+ +
+ +
+ +

Access shared resources simultaneously from different threads. +More...

+ + + + + + + + + + + +

+Macros

#define osFeature_Semaphore   30
 maximum count for osSemaphoreCreate function
 
#define osSemaphoreDef(name)   const osSemaphoreDef_t os_semaphore_def_##name = { 0 }
 Define a Semaphore object.
 
#define osSemaphore(name)   &os_semaphore_def_##name
 Access a Semaphore definition.
 
+ + + + + + + + + + + + + +

+Functions

osSemaphoreId osSemaphoreCreate (const osSemaphoreDef_t *semaphore_def, int32_t count)
 Create and Initialize a Semaphore object used for managing resources.
 
int32_t osSemaphoreWait (osSemaphoreId semaphore_id, uint32_t millisec)
 Wait until a Semaphore token becomes available.
 
osStatus osSemaphoreRelease (osSemaphoreId semaphore_id)
 Release a Semaphore token.
 
osStatus osSemaphoreDelete (osSemaphoreId semaphore_id)
 Delete a Semaphore that was created by osSemaphoreCreate.
 
+

Description

+

Semaphores are used to manage and protect access to shared resources. Semaphores are very similar to Mutexes. Whereas a Mutex permits just one thread to access a shared resource at a time, a semaphore can be used to permit a fixed number of threads to access a pool of shared resources. Using semaphores, access to a group of identical peripherals can be managed (for example multiple DMA channels).

+
+Semaphore.png +
+CMSIS-RTOS Semaphore
+

A semaphore object should be initialized to the maximum number of available tokens. This number of available resources is specified as parameter of the osSemaphoreCreate function. Each time a semaphore token is obtained with osSemaphoreWait, the semaphore count is decremented. When the semaphore count is 0, no semaphore token can be obtained. The thread that tries to obtain the semaphore token needs to wait until the next token is free. Semaphores are released with osSemaphoreRelease incrementing the semaphore count.

+
Note
Semaphore tokens can be acquired from threads and released from threads and ISRs.
+

Working with Semaphores

+

Follow these steps to create and use a semaphore:

+
    +
  1. Declare the semaphore container and initialize the semaphore:
    osSemaphoreDef (my_semaphore); // Declare semaphore
    +
    osSemaphoreId (my_semaphore_id); // Semaphore ID
    +
  2. +
  3. Initialize the semaphore container with a number of tokens within a thread:
    my_semaphore_id = osSemaphoreCreate(osSemaphore(my_semaphore), 4); // Create semaphore with 4 tokens
    +
    Important: semaphore tokens can be created and destroyed as threads run. This means that can initialize a semaphore with zero tokens and then use one thread to add/create tokens to the semaphore while a second thread removes them. In this way you can distinguish between producer and consumer threads.
  4. +
  5. Acquire a token from the semaphore container:
    osSemaphoreWait(my_semaphore_id, osWaitForever);
    +
  6. +
  7. When finished using the semaphore resource, send the token back to the semaphore container:
    osSemaphoreRelease(my_semaphore_id);
    +
  8. +
+

Semaphore Use Cases

+

Due to their flexibility, semaphores cover a wide range of synchronizing applications. At the same time, they are perhaps the most challenging RTOS object to understand. The following explains a use case for semaphores, taken from the book The Little Book Of Semaphores by Allen B. Downey which is available for free download.

+

Non-binary Semaphore (Multiplex)

+

A multiplex limits the number of threads that can access a critical section of code. For example, this could be a function accessing DMA resources which can only support a limited number of calls.

+

To allow multiple threads to run the function, initialize a semaphore to the maximum number of threads that can be allowed. The number of tokens in the semaphore represents the number of additional threads that may enter. If this number is zero, then the next thread trying to access the function will have to wait until one of the other threads exits and releases its token. When all threads have exited the token number is back to n. Ths following example shows the code for one of the threads that might access the resource:

+
osSemaphoreDef(multiplex);
+
osSemaphoreId (multiplex_id);
+
+
void thread_n (void)
+
{
+
multiplex_id = osSemaphoreCreate(osSemaphore(multiplex), 3);
+
while(1)
+
{
+ +
// do something
+
osSemaphoreRelease(multiplex_id);
+
}
+
}
+

Macro Definition Documentation

+ +
+
+ + + + +
#define osFeature_Semaphore   30
+
+

A CMSIS-RTOS implementation may support semaphores. The value osFeature_Semaphore indicates the maximum index count for a semaphore.

+ +
+
+ +
+
+ + + + + + + + +
#define osSemaphore( name)   &os_semaphore_def_##name
+
+

Access to semaphore object for the functions osSemaphoreCreate.

+
Parameters
+ + +
namename of the semaphore object.
+
+
+
Note
CAN BE CHANGED: The parameter to osSemaphore shall be consistent but the macro body is implementation specific in every CMSIS-RTOS.
+ +
+
+ +
+
+ + + + + + + + +
#define osSemaphoreDef( name)   const osSemaphoreDef_t os_semaphore_def_##name = { 0 }
+
+

Define a semaphore object that is referenced by osSemaphore.

+
Parameters
+ + +
namename of the semaphore object.
+
+
+
Note
CAN BE CHANGED: The parameter to osSemaphoreDef shall be consistent but the macro body is implementation specific in every CMSIS-RTOS.
+ +
+
+

Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + +
osSemaphoreId osSemaphoreCreate (const osSemaphoreDef_tsemaphore_def,
int32_t count 
)
+
+
Parameters
+ + + +
[in]semaphore_defsemaphore definition referenced with osSemaphore.
[in]countnumber of available resources.
+
+
+
Returns
semaphore ID for reference by other functions or NULL in case of error.
+
Note
MUST REMAIN UNCHANGED: osSemaphoreCreate shall be consistent in every CMSIS-RTOS.
+

Create and initialize a Semaphore object that is used to manage access to shared resources. The parameter count specifies the number of available resources. The count value 1 creates a binary semaphore.

+
Note
Cannot be called from Interrupt Service Routines.
+

Code Example

+
#include "cmsis_os.h"
+
+
osThreadId tid_thread1; // ID for thread 1
+
osThreadId tid_thread2; // ID for thread 2
+
+
osSemaphoreId semaphore; // Semaphore ID
+
osSemaphoreDef(semaphore); // Semaphore definition
+
+
//
+
// Thread 1 - High Priority - Active every 3ms
+
//
+
void thread1 (void const *argument) {
+
int32_t value;
+
+
while (1) {
+
osDelay(3); // Pass control to other tasks for 3ms
+
val = osSemaphoreWait (semaphore, 1); // Wait 1ms for the free semaphore
+
if (val > 0) {
+
// If there was no time-out the semaphore was acquired
+
: // OK, the interface is free now, use it.
+
osSemaphoreRelease (semaphore); // Return a token back to a semaphore
+
}
+
}
+
}
+
+
//
+
// Thread 2 - Normal Priority - looks for a free semaphore and uses
+
// the resource whenever it is available
+
//
+
void thread2 (void const *argument) {
+
while (1) {
+
osSemaphoreWait (semaphore, osWaitForever); // Wait indefinitely for a free semaphore
+
// OK, the interface is free now, use it.
+
:
+
osSemaphoreRelease (semaphore); // Return a token back to a semaphore.
+
}
+
}
+
+
// Thread definitions
+
osThreadDef(thread1, osPriorityHigh, 1, 0);
+
osThreadDef(thread2, osPriorityNormal, 1, 0);
+
+
void StartApplication (void) {
+
semaphore = osSemaphoreCreate(osSemaphore(semaphore), 1);
+
+
tid_thread1 = osThreadCreate(osThread(thread1), NULL);
+
tid_thread2 = osThreadCreate(osThread(thread2), NULL);
+
:
+
}
+
+
+
+ +
+
+ + + + + + + + +
osStatus osSemaphoreDelete (osSemaphoreId semaphore_id)
+
+
Parameters
+ + +
[in]semaphore_idsemaphore object referenced with osSemaphoreCreate.
+
+
+
Returns
status code that indicates the execution status of the function.
+
Note
MUST REMAIN UNCHANGED: osSemaphoreDelete shall be consistent in every CMSIS-RTOS.
+

Delete a Semaphore object. The function releases internal memory obtained for Semaphore handling. After this call the semaphore_id is no longer valid and cannot be used. The Semaphore may be created again using the function osSemaphoreCreate.

+

Status and Error Codes
+

+
    +
  • osOK: the semaphore object has been deleted.
  • +
  • osErrorISR: osSemaphoreDelete cannot be called from interrupt service routines.
  • +
  • osErrorResource: the semaphore object could not be deleted.
  • +
  • osErrorParameter: the parameter semaphore_id is incorrect.
  • +
+
Note
Cannot be called from Interrupt Service Routines.
+ +
+
+ +
+
+ + + + + + + + +
osStatus osSemaphoreRelease (osSemaphoreId semaphore_id)
+
+
Parameters
+ + +
[in]semaphore_idsemaphore object referenced with osSemaphoreCreate.
+
+
+
Returns
status code that indicates the execution status of the function.
+
Note
MUST REMAIN UNCHANGED: osSemaphoreRelease shall be consistent in every CMSIS-RTOS.
+

Release a Semaphore token. This increments the count of available semaphore tokens.

+
Note
Interrupt Service Routines can call this function.
+

Status and Error Codes
+

+
    +
  • osOK: the semaphore has been released.
  • +
  • osErrorResource: all tokens have already been released.
  • +
  • osErrorParameter: the parameter semaphore_id is incorrect.
  • +
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
int32_t osSemaphoreWait (osSemaphoreId semaphore_id,
uint32_t millisec 
)
+
+
Parameters
+ + + +
[in]semaphore_idsemaphore object referenced with osSemaphoreCreate.
[in]millisecTimout Value or 0 in case of no time-out.
+
+
+
Returns
number of available tokens, or -1 in case of incorrect parameters.
+
Note
MUST REMAIN UNCHANGED: osSemaphoreWait shall be consistent in every CMSIS-RTOS.
+

Wait until a Semaphore token becomes available. When no Semaphore token is available, the function waits for the time specified with the parameter millisec.

+

The argument millisec specifies how long the system waits for a Semaphore token to become available. While the system waits the thread that is calling this function is put into the state WAITING. The millisec timeout can have the following values:

+
    +
  • when millisec is 0, the function returns instantly.
  • +
  • when millisec is set to osWaitForever the function will wait for an infinite time until the Semaphore token becomes available.
  • +
  • all other values specify a time in millisecond for a timeout.
  • +
+

The return value indicates the number of available tokens (the semaphore count value). If 0 is returned, then no semaphore was available.

+
Note
Cannot be called from Interrupt Service Routines.
+ +
+
+
+
+ + + + diff --git a/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___semaphore_mgmt.js b/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___semaphore_mgmt.js new file mode 100644 index 0000000..cb194a8 --- /dev/null +++ b/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___semaphore_mgmt.js @@ -0,0 +1,10 @@ +var group___c_m_s_i_s___r_t_o_s___semaphore_mgmt = +[ + [ "osFeature_Semaphore", "group___c_m_s_i_s___r_t_o_s___semaphore_mgmt.html#ga7da4c7bfb340779c9fc7b321f5ab3e3a", null ], + [ "osSemaphore", "group___c_m_s_i_s___r_t_o_s___semaphore_mgmt.html#ga03761ee8d2c3cd4544e18364ab301dac", null ], + [ "osSemaphoreDef", "group___c_m_s_i_s___r_t_o_s___semaphore_mgmt.html#ga9e66fe361749071e5ab87826c43c2f1b", null ], + [ "osSemaphoreCreate", "group___c_m_s_i_s___r_t_o_s___semaphore_mgmt.html#ga97381e8e55cd47cec390bf57c96d6edb", null ], + [ "osSemaphoreDelete", "group___c_m_s_i_s___r_t_o_s___semaphore_mgmt.html#gabae2801ac2c096f6e8c69a264908f595", null ], + [ "osSemaphoreRelease", "group___c_m_s_i_s___r_t_o_s___semaphore_mgmt.html#gab108914997c49e14d8ff1ae0d1988ca0", null ], + [ "osSemaphoreWait", "group___c_m_s_i_s___r_t_o_s___semaphore_mgmt.html#gacc15b0fc8ce1167fe43da33042e62098", null ] +]; \ No newline at end of file diff --git a/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___signal_mgmt.html b/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___signal_mgmt.html new file mode 100644 index 0000000..88524b9 --- /dev/null +++ b/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___signal_mgmt.html @@ -0,0 +1,337 @@ + + + + + +Signal Events +CMSIS-RTOS: Signal Events + + + + + + + + + + + + +
+
+ + + + + + + +
+
CMSIS-RTOS +  Version 1.02 +
+
CMSIS-RTOS API: Generic RTOS interface for Cortex-M processor-based devices.
+
+
+ +
+
    + +
+
+ + +
+
+ +
+
+
+ +
+ +
+ +

Synchronize threads using signals. +More...

+ + + + + +

+Macros

#define osFeature_Signals   8
 maximum number of Signal Flags available per thread
 
+ + + + + + + + + + +

+Functions

int32_t osSignalSet (osThreadId thread_id, int32_t signals)
 Set the specified Signal Flags of an active thread.
 
int32_t osSignalClear (osThreadId thread_id, int32_t signals)
 Clear the specified Signal Flags of an active thread.
 
osEvent osSignalWait (int32_t signals, uint32_t millisec)
 Wait for one or more Signal Flags to become signaled for the current RUNNING thread.
 
+

Description

+

Signals are used to trigger execution states between threads. The signal management functions in CMSIS-RTOS allow you to control or wait for signal flags. Each thread has up to 31 assigned signal flags. The maximum number of signal flags is defined in the cmsis_os.h file (#define osFeature_Signals).

+

A thread

+
    +
  • can wait for signals to be set (using osSignalWait). Using this function, it enters the WAITING state. The osSignalWait parameter signals defines the signals that are required to put the thread back into READY state.
  • +
  • may set one or more flags in any other given thread (using osSignalSet).
  • +
  • may clear its own signals or the signals of other threads (using osSignalClear).
  • +
+

When a thread wakes up and resumes execution, its signal flags are automatically cleared.

+

Working with Signals

+

Here is a simple example that shows how two thread can communicate with each others using signals:

+
+simple_signal.png +
+Simple signal event communication
+

The following steps are required to use signals:

+
    +
  1. In the thread (for example thread ID tid_thread1) that is supposed to wait for a signal, call the wait function:
    osSignalWait (0x0001, osWaitForever); // wait forever for the signal 0x0001
    +
  2. +
  3. In another thread (or threads) that are supposed to wake the waiting thread up call:
    osSignalSet (tid_thread1, 0x0001); // set the signal 0x0001 for thread tid_thread1
    +
    osDelay (1000); // wait for 1 second
    +
  4. +
+

Macro Definition Documentation

+ +
+
+ + + + +
#define osFeature_Signals   8
+
+

The CMSIS-RTOS API may support a variable number of signal flags. This define specifies the number of signal flags available per thread. The maximum value is 32 signal flags per thread.

+ +
+
+

Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + +
int32_t osSignalClear (osThreadId thread_id,
int32_t signals 
)
+
+
Parameters
+ + + +
[in]thread_idthread ID obtained by osThreadCreate or osThreadGetId.
[in]signalsspecifies the signal flags of the thread that shall be cleared.
+
+
+
Returns
previous signal flags of the specified thread or 0x80000000 in case of incorrect parameters or call from ISR.
+
Note
MUST REMAIN UNCHANGED: osSignalClear shall be consistent in every CMSIS-RTOS.
+

Clear the signal flags of an active thread.

+
Note
Cannot be called from Interrupt Service Routines.
+

Code Example

+
void Thread_2 (void const *arg);
+
+
osThreadDef (Thread_2, osPriorityHigh, 1, 0);
+
+
static void EX_Signal_1 (void) {
+
int32_t signals;
+
osThreadId thread_id;
+
+
thread_id = osThreadCreate (osThread(Thread_2), NULL);
+
if (thread_id == NULL) {
+
// Failed to create a thread.
+
}
+
else {
+
f :
+
signals = osSignalClear (thread_id, 0x01);
+
}
+
}
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
int32_t osSignalSet (osThreadId thread_id,
int32_t signals 
)
+
+
Parameters
+ + + +
[in]thread_idthread ID obtained by osThreadCreate or osThreadGetId.
[in]signalsspecifies the signal flags of the thread that should be set.
+
+
+
Returns
previous signal flags of the specified thread or 0x80000000 in case of incorrect parameters.
+
Note
MUST REMAIN UNCHANGED: osSignalSet shall be consistent in every CMSIS-RTOS.
+

Set the signal flags of an active thread. This function may be used also within interrupt service routines.

+
Note
Interrupt Service Routines can call this function.
+

Code Example

+
void Thread_2 (void const *arg);
+
+
osThreadDef (Thread_2, osPriorityHigh, 1, 0);
+
+
static void EX_Signal_1 (void) {
+
int32_t signals;
+
uint32_t exec;
+
osThreadId thread_id;
+
+
thread_id = osThreadCreate (osThread(Thread_2), NULL);
+
if (thread_id == NULL) {
+
// Failed to create a thread.
+
}
+
else {
+
signals = osSignalSet (thread_id, 0x00000005); // Send signals to the created thread
+
}
+
}
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
osEvent osSignalWait (int32_t signals,
uint32_t millisec 
)
+
+
Parameters
+ + + +
[in]signalswait until all specified signal flags set or 0 for any single signal flag.
[in]millisecTimout Value or 0 in case of no time-out.
+
+
+
Returns
event flag information or error code.
+
Note
MUST REMAIN UNCHANGED: osSignalWait shall be consistent in every CMSIS-RTOS.
+

Suspend the execution of the current RUNNING thread until all specified signal flags with the parameter signals are set. When the parameter signals is 0 the current RUNNING thread is suspended until any signal is set. When these signal flags are already set, the function returns instantly. Otherwise the thread is put into the state WAITING. Signal flags that are reported as event are automatically cleared.

+

The argument millisec specifies how long the system waits for the specified signal flags. While the system waits the tread calling this function is put into the state WAITING. The timeout value can have the following values:

+
    +
  • when millisec is 0, the function returns instantly.
  • +
  • when millisec is set to osWaitForever the function will wait for an infinite time until a specified signal is set.
  • +
  • all other values specify a time in millisecond for a timeout.
  • +
+

Status and Error Codes
+

+
    +
  • osOK: no signal received when the timeout value millisec was 0.
  • +
  • osEventTimeout: signal not occurred within timeout
  • +
  • osEventSignal: signal occurred, value.signals contains the signal flags; these signal flags are cleared.
  • +
  • osErrorValue: the value signals is outside of the permitted range.
  • +
  • osErrorISR: osSignalWait cannot be called from interrupt service routines.
  • +
+
Note
Cannot be called from Interrupt Service Routines.
+

Code Example

+
void Thread_2 (void const *arg);
+
+
osThreadDef (Thread_2, osPriorityHigh, 1, 0);
+
+
static void EX_Signal_1 (void) {
+
osThreadId thread_id;
+
osEvent evt;
+
+
thread_id = osThreadCreate (osThread(Thread_2), NULL);
+
if (thread_id == NULL) {
+
// Failed to create a thread.
+
}
+
else {
+
:
+
// wait for a signal
+
evt = osSignalWait (0x01, 100);
+
if (evt.status == osEventSignal) {
+
// handle event status
+
}
+
}
+
}
+
+
+
+
+
+ + + + diff --git a/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___signal_mgmt.js b/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___signal_mgmt.js new file mode 100644 index 0000000..825b993 --- /dev/null +++ b/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___signal_mgmt.js @@ -0,0 +1,7 @@ +var group___c_m_s_i_s___r_t_o_s___signal_mgmt = +[ + [ "osFeature_Signals", "group___c_m_s_i_s___r_t_o_s___signal_mgmt.html#ga01edde265710d883b6e237d34a6ef4a6", null ], + [ "osSignalClear", "group___c_m_s_i_s___r_t_o_s___signal_mgmt.html#ga87283a6ebc31ce9ed42baf3ea7e4eab6", null ], + [ "osSignalSet", "group___c_m_s_i_s___r_t_o_s___signal_mgmt.html#ga3de2730654589d6c3559c4b9e2825553", null ], + [ "osSignalWait", "group___c_m_s_i_s___r_t_o_s___signal_mgmt.html#ga38860acda96df47da6923348d96fc4c9", null ] +]; \ No newline at end of file diff --git a/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___status.html b/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___status.html new file mode 100644 index 0000000..1e6fcb4 --- /dev/null +++ b/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___status.html @@ -0,0 +1,198 @@ + + + + + +Status and Error Codes +CMSIS-RTOS: Status and Error Codes + + + + + + + + + + + + +
+
+ + + + + + + +
+
CMSIS-RTOS +  Version 1.02 +
+
CMSIS-RTOS API: Generic RTOS interface for Cortex-M processor-based devices.
+
+
+ +
+
    + +
+
+ + +
+
+ +
+
+
+ +
+
+ +
+
Status and Error Codes
+
+
+ +

Status and Error Codes returned by CMSIS-RTOS API functions. +More...

+ + + + +

+Enumerations

enum  osStatus {
+  osOK = 0, +
+  osEventSignal = 0x08, +
+  osEventMessage = 0x10, +
+  osEventMail = 0x20, +
+  osEventTimeout = 0x40, +
+  osErrorParameter = 0x80, +
+  osErrorResource = 0x81, +
+  osErrorTimeoutResource = 0xC1, +
+  osErrorISR = 0x82, +
+  osErrorISRRecursive = 0x83, +
+  osErrorPriority = 0x84, +
+  osErrorNoMemory = 0x85, +
+  osErrorValue = 0x86, +
+  osErrorOS = 0xFF, +
+  os_status_reserved = 0x7FFFFFFF +
+ }
 
+

Description

+

The Status and Error Codes section lists all the return values that the CMSIS-RTOS functions will return.

+

Enumeration Type Documentation

+ +
+
+ + + + +
enum osStatus
+
+
Note
MUST REMAIN UNCHANGED: osStatus shall be consistent in every CMSIS-RTOS.
+

The osStatus enumeration defines the event status and error codes that are returned by the CMSIS-RTOS functions.

+
Enumerator:
+ + + + + + + + + + + + + + + +
osOK  +

function completed; no error or event occurred.

+
osEventSignal  +

function completed; signal event occurred.

+
osEventMessage  +

function completed; message event occurred.

+
osEventMail  +

function completed; mail event occurred.

+
osEventTimeout  +

function completed; timeout occurred.

+
osErrorParameter  +

parameter error: a mandatory parameter was missing or specified an incorrect object.

+
osErrorResource  +

resource not available: a specified resource was not available.

+
osErrorTimeoutResource  +

resource not available within given time: a specified resource was not available within the timeout period.

+
osErrorISR  +

not allowed in ISR context: the function cannot be called from interrupt service routines.

+
osErrorISRRecursive  +

function called multiple times from ISR with same object.

+
osErrorPriority  +

system cannot determine priority or thread has illegal priority.

+
osErrorNoMemory  +

system is out of memory: it was impossible to allocate or reserve memory for the operation.

+
osErrorValue  +

value of a parameter is out of range.

+
osErrorOS  +

unspecified RTOS error: run-time error but no other error message fits.

+
os_status_reserved  +

prevent from enum down-size compiler optimization.

+
+
+
+ +
+
+
+
+ + + + diff --git a/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___status.js b/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___status.js new file mode 100644 index 0000000..a890636 --- /dev/null +++ b/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___status.js @@ -0,0 +1,20 @@ +var group___c_m_s_i_s___r_t_o_s___status = +[ + [ "osStatus", "group___c_m_s_i_s___r_t_o_s___status.html#gae2e091fefc4c767117727bd5aba4d99e", [ + [ "osOK", "group___c_m_s_i_s___r_t_o_s___status.html#gae2e091fefc4c767117727bd5aba4d99ea9e1c9e2550bb4de8969a935acffc968f", null ], + [ "osEventSignal", "group___c_m_s_i_s___r_t_o_s___status.html#gae2e091fefc4c767117727bd5aba4d99ea5df7e9643aa8a2f5f3a6f6ec59758518", null ], + [ "osEventMessage", "group___c_m_s_i_s___r_t_o_s___status.html#gae2e091fefc4c767117727bd5aba4d99ead604f3673359dd4ac643b16dc5a2c342", null ], + [ "osEventMail", "group___c_m_s_i_s___r_t_o_s___status.html#gae2e091fefc4c767117727bd5aba4d99ea15b12e42b42b53f35fb8a2724ad02926", null ], + [ "osEventTimeout", "group___c_m_s_i_s___r_t_o_s___status.html#gae2e091fefc4c767117727bd5aba4d99ea78f477732375c0e1fca814e369618177", null ], + [ "osErrorParameter", "group___c_m_s_i_s___r_t_o_s___status.html#gae2e091fefc4c767117727bd5aba4d99eac24adca6a5d072c9f01c32178ba0d109", null ], + [ "osErrorResource", "group___c_m_s_i_s___r_t_o_s___status.html#gae2e091fefc4c767117727bd5aba4d99ea8fc5801e8b0482bdf22ad63a77f0155d", null ], + [ "osErrorTimeoutResource", "group___c_m_s_i_s___r_t_o_s___status.html#gae2e091fefc4c767117727bd5aba4d99ea314d24a49003f09459035db0dd7c9467", null ], + [ "osErrorISR", "group___c_m_s_i_s___r_t_o_s___status.html#gae2e091fefc4c767117727bd5aba4d99ea21635bdc492d3094fe83027fa4a30e2f", null ], + [ "osErrorISRRecursive", "group___c_m_s_i_s___r_t_o_s___status.html#gae2e091fefc4c767117727bd5aba4d99eaf6552310a817452aedfcd453f2805d65", null ], + [ "osErrorPriority", "group___c_m_s_i_s___r_t_o_s___status.html#gae2e091fefc4c767117727bd5aba4d99eab7dda0ef504817659334cbfd650ae56f", null ], + [ "osErrorNoMemory", "group___c_m_s_i_s___r_t_o_s___status.html#gae2e091fefc4c767117727bd5aba4d99eaf1fac0240218e51eb30a13da2f8aae81", null ], + [ "osErrorValue", "group___c_m_s_i_s___r_t_o_s___status.html#gae2e091fefc4c767117727bd5aba4d99ea4672c8a0c0f6bb1d7981da4602e8e9ee", null ], + [ "osErrorOS", "group___c_m_s_i_s___r_t_o_s___status.html#gae2e091fefc4c767117727bd5aba4d99ea5fde24ff588ec5ab9cb8314bade26fbc", null ], + [ "os_status_reserved", "group___c_m_s_i_s___r_t_o_s___status.html#gae2e091fefc4c767117727bd5aba4d99eac7a77f5fe18a15a357790c36a4aca1b1", null ] + ] ] +]; \ No newline at end of file diff --git a/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___thread_mgmt.html b/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___thread_mgmt.html new file mode 100644 index 0000000..117ebfb --- /dev/null +++ b/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___thread_mgmt.html @@ -0,0 +1,580 @@ + + + + + +Thread Management +CMSIS-RTOS: Thread Management + + + + + + + + + + + + +
+
+ + + + + + + +
+
CMSIS-RTOS +  Version 1.02 +
+
CMSIS-RTOS API: Generic RTOS interface for Cortex-M processor-based devices.
+
+
+ +
+
    + +
+
+ + +
+
+ +
+
+
+ +
+
+ +
+
Thread Management
+
+
+ +

Define, create, and control thread functions. +More...

+ + + + + + + + +

+Macros

#define osThreadDef(name, priority, instances, stacksz)
 Create a Thread Definition with function, priority, and stack requirements.
 
#define osThread(name)   &os_thread_def_##name
 Access a Thread definition.
 
+ + + +

+Enumerations

enum  osPriority {
+  osPriorityIdle = -3, +
+  osPriorityLow = -2, +
+  osPriorityBelowNormal = -1, +
+  osPriorityNormal = 0, +
+  osPriorityAboveNormal = +1, +
+  osPriorityHigh = +2, +
+  osPriorityRealtime = +3, +
+  osPriorityError = 0x84 +
+ }
 
+ + + + + + + + + + + + + + + + + + + +

+Functions

osThreadId osThreadCreate (const osThreadDef_t *thread_def, void *argument)
 Create a thread and add it to Active Threads and set it to state READY.
 
osThreadId osThreadGetId (void)
 Return the thread ID of the current running thread.
 
osStatus osThreadTerminate (osThreadId thread_id)
 Terminate execution of a thread and remove it from Active Threads.
 
osStatus osThreadSetPriority (osThreadId thread_id, osPriority priority)
 Change priority of an active thread.
 
osPriority osThreadGetPriority (osThreadId thread_id)
 Get current priority of an active thread.
 
osStatus osThreadYield (void)
 Pass control to next thread that is in state READY.
 
+

Description

+

The Thread Management function group allows defining, creating, and controlling thread functions in the system. The function main is a special thread function that is started at system initialization and has the initial priority osPriorityNormal.

+

Threads can be in the following states:

+
    +
  • RUNNING: The thread that is currently running is in the RUNNING state. Only one thread at a time can be in this state.
  • +
  • READY: Threads which are ready to run are in the READY state. Once the RUNNING thread has terminated or is WAITING, the next READY thread with the highest priority becomes the RUNNING thread.
  • +
  • WAITING: Threads that are waiting for an event to occur are in the WAITING state.
  • +
  • INACTIVE: Threads that are not created or terminated are in the INACTIVE state. These threads typically consume no system resources.
  • +
+
+ThreadStatus.png +
+Thread State and State Transitions
+

A CMSIS-RTOS assumes that threads are scheduled as shown in the figure Thread State and State Transitions. The thread states change as follows:

+
    +
  • A thread is created using the function osThreadCreate. This puts the thread into the READY or RUNNING state (depending on the thread priority).
  • +
  • CMSIS-RTOS is pre-emptive. The active thread with the highest priority becomes the RUNNING thread provided it does not wait for any event. The initial priority of a thread is defined with the osThreadDef but may be changed during execution using the function osThreadSetPriority.
  • +
  • The RUNNING thread transfers into the WAITING state when it is waiting for an event.
  • +
  • Active threads can be terminated any time using the function osThreadTerminate. Threads can terminate also by just returning from the thread function. Threads that are terminated are in the INACTIVE state and typically do not consume any dynamic memory resources.
  • +
+

Macro Definition Documentation

+ +
+
+ + + + + + + + +
#define osThread( name)   &os_thread_def_##name
+
+

Access to the thread definition for the function osThreadCreate.

+
Parameters
+ + +
namename of the thread definition object.
+
+
+
Note
CAN BE CHANGED: The parameter to osThread shall be consistent but the macro body is implementation specific in every CMSIS-RTOS.
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#define osThreadDef( name,
 priority,
 instances,
 stacksz 
)
+
+

Define the attributes of a thread functions that can be created by the function osThreadCreate using osThread.

+
Parameters
+ + + + + +
namename of the thread function.
priorityinitial priority of the thread function.
instancesnumber of possible thread instances.
stackszstack size (in bytes) requirements for the thread function.
+
+
+
Note
CAN BE CHANGED: The parameters to osThreadDef shall be consistent but the macro body is implementation specific in every CMSIS-RTOS.
+ +
+
+

Enumeration Type Documentation

+ +
+
+ + + + +
enum osPriority
+
+
Note
MUST REMAIN UNCHANGED: osPriority shall be consistent in every CMSIS-RTOS.
+
+Cannot be called from Interrupt Service Routines.
+

The osPriority value specifies the priority for a thread. The default thread priority should be osPriorityNormal. If a Thread is active that has a higher priority than the currently executing thread, then a thread switch occurs immediately to execute the new task.

+

To prevent from a priority inversion, a CMSIS-RTOS complained OS may optionally implement a priority inheritance method. A priority inversion occurs when a high priority thread is waiting for a resource or event that is controlled by a thread with a lower priority.

+
Enumerator:
+ + + + + + + + +
osPriorityIdle  +

priority: idle (lowest)

+
osPriorityLow  +

priority: low

+
osPriorityBelowNormal  +

priority: below normal

+
osPriorityNormal  +

priority: normal (default)

+
osPriorityAboveNormal  +

priority: above normal

+
osPriorityHigh  +

priority: high

+
osPriorityRealtime  +

priority: realtime (highest)

+
osPriorityError  +

system cannot determine priority or thread has illegal priority

+
+
+
+ +
+
+

Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + +
osThreadId osThreadCreate (const osThreadDef_tthread_def,
void * argument 
)
+
+
Parameters
+ + + +
[in]thread_defthread definition referenced with osThread.
[in]argumentpointer that is passed to the thread function as start argument.
+
+
+
Returns
thread ID for reference by other functions or NULL in case of error.
+
Note
MUST REMAIN UNCHANGED: osThreadCreate shall be consistent in every CMSIS-RTOS.
+

Start a thread function by adding it to the Active Threads list and set it to state READY. The thread function receives the argument pointer as function argument when the function is started. When the priority of the created thread function is higher than the current RUNNING thread, the created thread function starts instantly and becomes the new RUNNING thread.

+
Note
Cannot be called from Interrupt Service Routines.
+

Code Example

+
#include "cmsis_os.h"
+
+
void Thread_1 (void const *arg); // function prototype for Thread_1
+
osThreadDef (Thread_1, osPriorityNormal, 1, 0); // define Thread_1
+
+
void ThreadCreate_example (void) {
+ +
+
id = osThreadCreate (osThread (Thread_1), NULL); // create the thread
+
if (id == NULL) { // handle thread creation
+
// Failed to create a thread
+
}
+
:
+
osThreadTerminate (id); // stop the thread
+
}
+
+
+
+ +
+
+ + + + + + + + +
osThreadId osThreadGetId (void )
+
+
Returns
thread ID for reference by other functions or NULL in case of error.
+
Note
MUST REMAIN UNCHANGED: osThreadGetId shall be consistent in every CMSIS-RTOS.
+

Get the thread ID of the current running thread.

+
Note
Cannot be called from Interrupt Service Routines.
+

Code Example

+
void ThreadGetId_example (void) {
+
osThreadId id; // id for the currently running thread
+
+
id = osThreadGetId ();
+
if (id == NULL) {
+
// Failed to get the id; not in a thread
+
}
+
}
+
+
+
+ +
+
+ + + + + + + + +
osPriority osThreadGetPriority (osThreadId thread_id)
+
+
Parameters
+ + +
[in]thread_idthread ID obtained by osThreadCreate or osThreadGetId.
+
+
+
Returns
current priority value of the thread function.
+
Note
MUST REMAIN UNCHANGED: osThreadGetPriority shall be consistent in every CMSIS-RTOS.
+

Get the priority of an active thread. In case of a failure the value osPriorityError is returned.

+
Note
Cannot be called from Interrupt Service Routines.
+

Code Example

+
#include "cmsis_os.h"
+
+
void Thread_1 (void const *arg) { // Thread function
+
osThreadId id; // id for the currently running thread
+
osPriority priority; // thread priority
+
+
id = osThreadGetId (); // Obtain ID of current running thread
+
+
if (id != NULL) {
+
priority = osThreadGetPriority (id);
+
}
+
else {
+
// Failed to get the id
+
}
+
}
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
osStatus osThreadSetPriority (osThreadId thread_id,
osPriority priority 
)
+
+
Parameters
+ + + +
[in]thread_idthread ID obtained by osThreadCreate or osThreadGetId.
[in]prioritynew priority value for the thread function.
+
+
+
Returns
status code that indicates the execution status of the function.
+
Note
MUST REMAIN UNCHANGED: osThreadSetPriority shall be consistent in every CMSIS-RTOS.
+

Change the priority of an active thread.

+

Status and Error Codes
+

+
    +
  • osOK: the priority of the specified thread has been successfully changed.
  • +
  • osErrorParameter: thread_id is incorrect.
  • +
  • osErrorValue: incorrect priority value.
  • +
  • osErrorResource: thread_id refers to a thread that is not an active thread.
  • +
  • osErrorISR: osThreadSetPriority cannot be called from interrupt service routines.
  • +
+
Note
Cannot be called from Interrupt Service Routines.
+

Code Example

+
#include "cmsis_os.h"
+
+
void Thread_1 (void const *arg) { // Thread function
+
osThreadId id; // id for the currently running thread
+
osPriority pr; // thread priority
+
osStatus status; // status of the executed function
+
+
:
+
id = osThreadGetId (); // Obtain ID of current running thread
+
+
if (id != NULL) {
+ +
if (status == osOK) {
+
// Thread priority changed to BelowNormal
+
}
+
else {
+
// Failed to set the priority
+
}
+
}
+
else {
+
// Failed to get the id
+
}
+
:
+
}
+
+
+
+ +
+
+ + + + + + + + +
osStatus osThreadTerminate (osThreadId thread_id)
+
+
Parameters
+ + +
[in]thread_idthread ID obtained by osThreadCreate or osThreadGetId.
+
+
+
Returns
status code that indicates the execution status of the function.
+
Note
MUST REMAIN UNCHANGED: osThreadTerminate shall be consistent in every CMSIS-RTOS.
+

Remove the thread function from the active thread list. If the thread is currently RUNNING the execution will stop.

+
Note
In case that osThreadTerminate terminates the currently running task, the function never returns and other threads that are in the READY state are started.
+

Status and Error Codes
+

+
    +
  • osOK: the specified thread has been successfully terminated.
  • +
  • osErrorParameter: thread_id is incorrect.
  • +
  • osErrorResource: thread_id refers to a thread that is not an active thread.
  • +
  • osErrorISR: osThreadTerminate cannot be called from interrupt service routines.
  • +
+
Note
Cannot be called from Interrupt Service Routines.
+

Code Example

+
#include "cmsis_os.h"
+
+
void Thread_1 (void const *arg); // function prototype for Thread_1
+
osThreadDef (Thread_1, osPriorityNormal, 1, 0); // define Thread_1
+
+
void ThreadTerminate_example (void) {
+
osStatus status;
+ +
+
id = osThreadCreate (osThread (Thread_1), NULL); // create the thread
+
:
+
status = osThreadTerminate (id); // stop the thread
+
if (status == osOK) {
+
// Thread was terminated successfully
+
}
+
else {
+
// Failed to terminate a thread
+
}
+
}
+
+
+
+ +
+
+ + + + + + + + +
osStatus osThreadYield (void )
+
+
Returns
status code that indicates the execution status of the function.
+
Note
MUST REMAIN UNCHANGED: osThreadYield shall be consistent in every CMSIS-RTOS.
+

Pass control to the next thread that is in state READY. If there is no other thread in the state READY, the current thread continues execution and no thread switching occurs.

+

Status and Error Codes
+

+
    +
  • osOK: the function has been correctly executed.
  • +
  • osErrorISR: osThreadYield cannot be called from interrupt service routines.
  • +
+
Note
Cannot be called from Interrupt Service Routines.
+

Code Example

+
#include "cmsis_os.h"
+
+
void Thread_1 (void const *arg) { // Thread function
+
osStatus status; // status of the executed function
+
:
+
while (1) {
+
status = osThreadYield(); //
+
if (status != osOK) {
+
// thread switch not occurred, not in a thread function
+
}
+
}
+
}
+
+
+
+
+
+ + + + diff --git a/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___thread_mgmt.js b/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___thread_mgmt.js new file mode 100644 index 0000000..fa5d5de --- /dev/null +++ b/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___thread_mgmt.js @@ -0,0 +1,21 @@ +var group___c_m_s_i_s___r_t_o_s___thread_mgmt = +[ + [ "osThread", "group___c_m_s_i_s___r_t_o_s___thread_mgmt.html#gaf0c7c6b5e09f8be198312144b5c9e453", null ], + [ "osThreadDef", "group___c_m_s_i_s___r_t_o_s___thread_mgmt.html#gaee93d929beb350f16e5cc7fa602e229f", null ], + [ "osPriority", "group___c_m_s_i_s___r_t_o_s___thread_mgmt.html#ga7f2b42f1983b9107775ec2a1c69a849a", [ + [ "osPriorityIdle", "group___c_m_s_i_s___r_t_o_s___thread_mgmt.html#ga7f2b42f1983b9107775ec2a1c69a849aa549e79a43ff4f8b2b31afb613f5caa81", null ], + [ "osPriorityLow", "group___c_m_s_i_s___r_t_o_s___thread_mgmt.html#ga7f2b42f1983b9107775ec2a1c69a849aa61cb822239ac8f66dfbdc7291598a3d4", null ], + [ "osPriorityBelowNormal", "group___c_m_s_i_s___r_t_o_s___thread_mgmt.html#ga7f2b42f1983b9107775ec2a1c69a849aa193b650117c209b4a203954542bcc3e6", null ], + [ "osPriorityNormal", "group___c_m_s_i_s___r_t_o_s___thread_mgmt.html#ga7f2b42f1983b9107775ec2a1c69a849aa45a2895ad30c79fb97de18cac7cc19f1", null ], + [ "osPriorityAboveNormal", "group___c_m_s_i_s___r_t_o_s___thread_mgmt.html#ga7f2b42f1983b9107775ec2a1c69a849aa17b36cd9cd38652c2bc6d4803990674b", null ], + [ "osPriorityHigh", "group___c_m_s_i_s___r_t_o_s___thread_mgmt.html#ga7f2b42f1983b9107775ec2a1c69a849aa914433934143a9ba767e59577c56e6c2", null ], + [ "osPriorityRealtime", "group___c_m_s_i_s___r_t_o_s___thread_mgmt.html#ga7f2b42f1983b9107775ec2a1c69a849aa1485dec3702434a1ec3cb74c7a17a4af", null ], + [ "osPriorityError", "group___c_m_s_i_s___r_t_o_s___thread_mgmt.html#ga7f2b42f1983b9107775ec2a1c69a849aae35f5e2f9c64ad346822521b643bdea4", null ] + ] ], + [ "osThreadCreate", "group___c_m_s_i_s___r_t_o_s___thread_mgmt.html#gac59b5713cb083702dce759c73fd90dff", null ], + [ "osThreadGetId", "group___c_m_s_i_s___r_t_o_s___thread_mgmt.html#gab1df2a28925862ef8f9cf4e1c995c5a7", null ], + [ "osThreadGetPriority", "group___c_m_s_i_s___r_t_o_s___thread_mgmt.html#ga4299d838978bc2aae5e4350754e6a4e9", null ], + [ "osThreadSetPriority", "group___c_m_s_i_s___r_t_o_s___thread_mgmt.html#ga0dfb90ccf1f6e4b54b9251b12d1cbc8b", null ], + [ "osThreadTerminate", "group___c_m_s_i_s___r_t_o_s___thread_mgmt.html#gaea135bb90eb853eff39e0800b91bbeab", null ], + [ "osThreadYield", "group___c_m_s_i_s___r_t_o_s___thread_mgmt.html#gaf13a667493c5d629a90c13e113b99233", null ] +]; \ No newline at end of file diff --git a/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___timer_mgmt.html b/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___timer_mgmt.html new file mode 100644 index 0000000..299ac4b --- /dev/null +++ b/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___timer_mgmt.html @@ -0,0 +1,498 @@ + + + + + +Timer Management +CMSIS-RTOS: Timer Management + + + + + + + + + + + + +
+
+ + + + + + + +
+
CMSIS-RTOS +  Version 1.02 +
+
CMSIS-RTOS API: Generic RTOS interface for Cortex-M processor-based devices.
+
+
+ +
+
    + +
+
+ + +
+
+ +
+
+
+ +
+
+ +
+
Timer Management
+
+
+ +

Create and control timer and timer callback functions. +More...

+ + + + + + + + +

+Macros

#define osTimerDef(name, function)
 Define a Timer object.
 
#define osTimer(name)   &os_timer_def_##name
 Access a Timer definition.
 
+ + + +

+Enumerations

enum  os_timer_type {
+  osTimerOnce = 0, +
+  osTimerPeriodic = 1 +
+ }
 
+ + + + + + + + + + + + + +

+Functions

osTimerId osTimerCreate (const osTimerDef_t *timer_def, os_timer_type type, void *argument)
 Create a timer.
 
osStatus osTimerStart (osTimerId timer_id, uint32_t millisec)
 Start or restart a timer.
 
osStatus osTimerStop (osTimerId timer_id)
 Stop the timer.
 
osStatus osTimerDelete (osTimerId timer_id)
 Delete a timer that was created by osTimerCreate.
 
+

Description

+

In addition to the Generic Wait Functions CMSIS-RTOS also supports virtual timer objects. These timer objects can trigger the execution of a function (not threads). When a timer expires, a callback function is executed to run associated code with the timer. The timer number is passed as a parameter to the callback function. Each timer can be configured as a one-shot or a periodic timer. A periodic timer repeats its operation until it is deleted or stopped. All timers can be started, restarted, or stopped.

+

Timers are handled in the thread osTimerThread. Callback functions run under control of this thread and may use other CMSIS-RTOS API calls.

+

The figure below shows the behavior of a periodic timer. For one-shot timers, the timer stops after execution of the callback function.

+
+Timer.png +
+Behavior of a Periodic Timer
+

Working with Timers

+

The following steps are required to use a timer:

+
    +
  1. Define the timers:
    osTimerDef(one_shot, start_machine); // when the timer expires, the function start_machine is called
    +
    osTimerDef(periodic, toggle_power); // when the timer expires, the function toggle_power is called
    +
    osTimerId one_shot_id, periodic_id;
    +
  2. +
  3. Instantiate and start the timers in an RTOS thread:
    one_shot_id = osTimerCreate(osTimer(one_shot), osTimerOnce, (void *)0); // creates a one-shot timer;
    +
    // (void*)0 is passed as an argument to the callback function
    +
    periodic_id = osTimerCreate(osTimer(periodic), osTimerPeriodic, (void *)5); // creates a periodic timer;
    +
    // (void*)5 is passed as an argument to the callback function
    +
    osTimerStart(one_shot_id, 500);
    +
    osTimerStart(periodic, 1500);
    +
  4. +
+

Macro Definition Documentation

+ +
+
+ + + + + + + + +
#define osTimer( name)   &os_timer_def_##name
+
+

Access to the timer definition for the function osTimerCreate.

+
Parameters
+ + +
namename of the timer object.
+
+
+
Note
CAN BE CHANGED: The parameter to osTimer shall be consistent but the macro body is implementation specific in every CMSIS-RTOS.
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
#define osTimerDef( name,
 function 
)
+
+

Define the attributes of a timer.

+
Parameters
+ + + +
namename of the timer object.
functionname of the timer call back function.
+
+
+
Note
CAN BE CHANGED: The parameter to osTimerDef shall be consistent but the macro body is implementation specific in every CMSIS-RTOS.
+ +
+
+

Enumeration Type Documentation

+ +
+
+ + + + +
enum os_timer_type
+
+
Note
MUST REMAIN UNCHANGED: os_timer_type shall be consistent in every CMSIS-RTOS. The os_timer_type specifies the a repeating (periodic) or one-shot timer for the function osTimerCreate.
+
Enumerator:
+ + +
osTimerOnce  +

one-shot timer

+
osTimerPeriodic  +

repeating timer

+
+
+
+ +
+
+

Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
osTimerId osTimerCreate (const osTimerDef_ttimer_def,
os_timer_type type,
void * argument 
)
+
+
Parameters
+ + + + +
[in]timer_deftimer object referenced with osTimer.
[in]typeosTimerOnce for one-shot or osTimerPeriodic for periodic behavior.
[in]argumentargument to the timer call back function.
+
+
+
Returns
timer ID for reference by other functions or NULL in case of error.
+
Note
MUST REMAIN UNCHANGED: osTimerCreate shall be consistent in every CMSIS-RTOS.
+

Create a one-shot or periodic timer and associate it with a callback function argument. The timer is in stopped until it is started with osTimerStart.

+
Note
Cannot be called from Interrupt Service Routines.
+

Code Example

+
#include "cmsis_os.h"
+
+
void Timer1_Callback (void const *arg); // prototypes for timer callback function
+
void Timer2_Callback (void const *arg);
+
+
osTimerDef (Timer1, Timer1_Callback); // define timers
+
osTimerDef (Timer2, Timer2_Callback);
+
+
uint32_t exec1; // argument for the timer call back function
+
uint32_t exec2; // argument for the timer call back function
+
+
void TimerCreate_example (void) {
+
osTimerId id1; // timer id
+
osTimerId id2; // timer id
+
+
// Create one-shoot timer
+
exec1 = 1;
+
id1 = osTimerCreate (osTimer(Timer1), osTimerOnce, &exec1);
+
if (id1 != NULL) {
+
// One-shoot timer created
+
}
+
+
// Create periodic timer
+
exec2 = 2;
+
id2 = osTimerCreate (osTimer(Timer2), osTimerPeriodic, &exec2);
+
if (id2 != NULL) {
+
// Periodic timer created
+
}
+
:
+
}
+
+
+
+ +
+
+ + + + + + + + +
osStatus osTimerDelete (osTimerId timer_id)
+
+
Parameters
+ + +
[in]timer_idtimer ID obtained by osTimerCreate.
+
+
+
Returns
status code that indicates the execution status of the function.
+
Note
MUST REMAIN UNCHANGED: osTimerDelete shall be consistent in every CMSIS-RTOS.
+

Delete the timer object.

+

Status and Error Codes
+

+
    +
  • osOK: the specified timer has been deleted.
  • +
  • osErrorISR: osTimerDelete cannot be called from interrupt service routines.
  • +
  • osErrorParameter: timer_id is incorrect.
  • +
+
Note
Cannot be called from Interrupt Service Routines.
+

Code Example

+
#include "cmsis_os.h"
+
+
void Timer_Callback (void const *arg); // prototype for timer callback function
+
osTimerDef (Timer, Timer_Callback); // define timer
+
+
void TimerDelete_example (void) {
+
osTimerId id; // timer id
+
osStatus status; // function return status
+
+
// Create periodic timer
+
exec = 1;
+
id = osTimerCreate (osTimer(Timer2), osTimerPeriodic, NULL);
+
osTimerStart (id, 1000UL); // start timer
+
:
+
status = osTimerDelete (id); // stop and delete timer
+
if (status != osOK) {
+
// Timer could not be deleted
+
}
+
:
+
}
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
osStatus osTimerStart (osTimerId timer_id,
uint32_t millisec 
)
+
+
Parameters
+ + + +
[in]timer_idtimer ID obtained by osTimerCreate.
[in]millisectime delay value of the timer.
+
+
+
Returns
status code that indicates the execution status of the function.
+
Note
MUST REMAIN UNCHANGED: osTimerStart shall be consistent in every CMSIS-RTOS.
+

Start or restart the timer.

+

Status and Error Codes
+

+
    +
  • osOK: the specified timer has been started or restarted.
  • +
  • osErrorISR: osTimerStart cannot be called from interrupt service routines.
  • +
  • osErrorParameter: timer_id is incorrect.
  • +
+
Note
Cannot be called from Interrupt Service Routines.
+

Code Example

+
#include "cmsis_os.h"
+
+
void Time_Callback (void const *arg) { // timer callback function
+
// arg contains &exec
+
// called every second after osTimerStart
+
}
+
+
osTimerDef (Timer, Time_Callback); // define timer
+
uint32_t exec; // argument for the timer call back function
+
+
void TimerStart_example (void) {
+
osTimerId id; // timer id
+
uint32_t timerDelay; // timer value
+
osStatus status; // function return status
+
+
// Create periodic timer
+
exec = 1;
+
id = osTimerCreate (osTimer(Timer), osTimerPeriodic, &exec);
+
if (id) {
+
timerDelay = 1000;
+
status = osTimerStart (id, timerDelay); // start timer
+
if (status != osOK) {
+
// Timer could not be started
+
}
+
}
+
:
+
}
+
+
+
+ +
+
+ + + + + + + + +
osStatus osTimerStop (osTimerId timer_id)
+
+
Parameters
+ + +
[in]timer_idtimer ID obtained by osTimerCreate.
+
+
+
Returns
status code that indicates the execution status of the function.
+
Note
MUST REMAIN UNCHANGED: osTimerStop shall be consistent in every CMSIS-RTOS.
+

Stop the timer.

+

Status and Error Codes
+

+
    +
  • osOK: the specified timer has been stopped.
  • +
  • osErrorISR: osTimerStop cannot be called from interrupt service routines.
  • +
  • osErrorParameter: timer_id is incorrect.
  • +
  • osErrorResource: the timer is not started.
  • +
+
Note
Cannot be called from Interrupt Service Routines.
+

Code Example

+
#include "cmsis_os.h"
+
+
void Timer_Callback (void const *arg); // prototype for timer callback function
+
osTimerDef (Timer, Timer_Callback); // define timer
+
+
void TimerStop_example (void) {
+
osTimerId id; // timer id
+
osStatus status; // function return status
+
+
// Create periodic timer
+
exec = 1;
+
id = osTimerCreate (osTimer(Timer2), osTimerPeriodic, NULL);
+
osTimerStart (id, 1000); // start timer
+
:
+
status = osTimerStop (id); // stop timer
+
if (status != osOK) {
+
// Timer could not be stopped
+
}
+
:
+
osTimerStart (id, 1000); // start timer again
+
:
+
}
+
+
+
+
+
+ + + + diff --git a/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___timer_mgmt.js b/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___timer_mgmt.js new file mode 100644 index 0000000..60f1ace --- /dev/null +++ b/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___timer_mgmt.js @@ -0,0 +1,13 @@ +var group___c_m_s_i_s___r_t_o_s___timer_mgmt = +[ + [ "osTimer", "group___c_m_s_i_s___r_t_o_s___timer_mgmt.html#ga1b8d670eaf964b2910fa06885e650678", null ], + [ "osTimerDef", "group___c_m_s_i_s___r_t_o_s___timer_mgmt.html#ga1c720627e08d1cc1afcad44e799ed492", null ], + [ "os_timer_type", "group___c_m_s_i_s___r_t_o_s___timer_mgmt.html#gadac860eb9e1b4b0619271e6595ed83d9", [ + [ "osTimerOnce", "group___c_m_s_i_s___r_t_o_s___timer_mgmt.html#gadac860eb9e1b4b0619271e6595ed83d9ad21712f8df5f97069c82dc9eec37b951", null ], + [ "osTimerPeriodic", "group___c_m_s_i_s___r_t_o_s___timer_mgmt.html#gadac860eb9e1b4b0619271e6595ed83d9ab9c91f9699162edb09bb7c90c11c8788", null ] + ] ], + [ "osTimerCreate", "group___c_m_s_i_s___r_t_o_s___timer_mgmt.html#gaedd312bfdca04e0b8162b666e09a1ae6", null ], + [ "osTimerDelete", "group___c_m_s_i_s___r_t_o_s___timer_mgmt.html#ga746b8043d906849bd65e3900fcb483cf", null ], + [ "osTimerStart", "group___c_m_s_i_s___r_t_o_s___timer_mgmt.html#ga27a797a401b068e2644d1125f22a07ca", null ], + [ "osTimerStop", "group___c_m_s_i_s___r_t_o_s___timer_mgmt.html#ga58f36b121a812936435cacc6e1e0e091", null ] +]; \ No newline at end of file diff --git a/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___wait.html b/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___wait.html new file mode 100644 index 0000000..c0eafec --- /dev/null +++ b/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___wait.html @@ -0,0 +1,254 @@ + + + + + +Generic Wait Functions +CMSIS-RTOS: Generic Wait Functions + + + + + + + + + + + + +
+
+ + + + + + + +
+
CMSIS-RTOS +  Version 1.02 +
+
CMSIS-RTOS API: Generic RTOS interface for Cortex-M processor-based devices.
+
+
+ +
+
    + +
+
+ + +
+
+ +
+
+
+ +
+
+ +
+
Generic Wait Functions
+
+
+ +

Wait for a time period or unspecified events. +More...

+ + + + + +

+Macros

#define osFeature_Wait   1
 osWait function: 1=available, 0=not available
 
+ + + + + + + +

+Functions

osStatus osDelay (uint32_t millisec)
 Wait for Timeout (Time Delay).
 
osEvent osWait (uint32_t millisec)
 Wait for Signal, Message, Mail, or Timeout.
 
+

Description

+

The Generic Wait function group provides means for a time delay and allow to wait for unspecified events.

+

Macro Definition Documentation

+ +
+
+ + + + +
#define osFeature_Wait   1
+
+

A CMSIS-RTOS implementation may support the generic wait function osWait.

+ + +
+
+

Function Documentation

+ +
+
+ + + + + + + + +
osStatus osDelay (uint32_t millisec)
+
+
Parameters
+ + +
[in]millisectime delay value
+
+
+
Returns
status code that indicates the execution status of the function.
+

Wait for a specified time period in millisec.

+

The millisec value specifies the number of timer ticks and is therefore an upper bound. The exact time delay depends on the actual time elapsed since the last timer tick.

+

For a value of 1, the system waits until the next timer tick occurs. That means that the actual time delay may be up to one timer tick less.

+

Status and Error Codes
+

+
    +
  • osEventTimeout: the time delay is executed.
  • +
  • osErrorISR: osDelay cannot be called from interrupt service routines.
  • +
+
Note
Cannot be called from Interrupt Service Routines.
+

Code Example

+
#include "cmsis_os.h"
+
+
void Thread_1 (void const *arg) { // Thread function
+
osStatus status; // capture the return status
+
uint32_t delayTime; // delay time in milliseconds
+
+
delayTime = 1000; // delay 1 second
+
:
+
status = osDelay (delayTime); // suspend thread execution
+
// handle error code
+
:
+
}
+
+
+
+ +
+
+ + + + + + + + +
osEvent osWait (uint32_t millisec)
+
+
Parameters
+ + +
[in]millisecTimout Value or 0 in case of no time-out
+
+
+
Returns
event that contains signal, message, or mail information or error code.
+
Note
MUST REMAIN UNCHANGED: osWait shall be consistent in every CMSIS-RTOS.
+

Wait for any event of the type Signal, Message, Mail for a specified time period in millisec. While the system waits, the thread that is calling this function is put into the state WAITING. When millisec is set to osWaitForever, the function will wait for an infinite time until an event occurs.

+

The osWait function puts a thread into the state WAITING and waits for any of the following events:

+
    +
  • A signal sent to that thread explicitly
  • +
  • A message from a message object that is registered to that thread
  • +
  • A mail from a mail object that is registered to that thread
  • +
+
Note
This function is optional and may not be provided by all CMSIS-RTOS implementations.
+

Status and Error Codes
+

+
    +
  • osEventSignal: a signal event occurred and is returned.
  • +
  • osEventMessage: a message event occurred and is returned.
  • +
  • osEventMail: a mail event occurred and is returned.
  • +
  • osEventTimeout: the time delay is executed.
  • +
  • osErrorISR: osDelay cannot be called from interrupt service routines.
  • +
+
Note
Cannot be called from Interrupt Service Routines.
+

Code Example

+
#include "cmsis_os.h"
+
+
void Thread_1 (void const *arg) { // Thread function
+
osEvent Event; // capture the event
+
uint32_t waitTime; // wait time in milliseconds
+
+
:
+
waitTime = osWaitForever; // special "wait" value
+
Event = osWait (waitTime); // wait forever and until an event occurred
+
switch (Event.status) {
+
case osEventSignal: // Signal arrived
+
: // Event.value.signals contains the signal flags
+
break;
+
+
case osEventMessage: // Message arrived
+
: // Event.value.p contains the message pointer
+
: // Event.def.message_id contains the message Id
+
break;
+
+
case osEventMail: // Mail arrived
+
: // Event.value.p contains the mail pointer
+
: // Event.def.mail_id contains the mail Id
+
break;
+
+
case osEventTimeout: // Timeout occurred
+
break;
+
+
default: // Error occurred
+
break;
+
}
+
:
+
}
+
+
+
+
+
+ + + + diff --git a/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___wait.js b/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___wait.js new file mode 100644 index 0000000..6694d9f --- /dev/null +++ b/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___wait.js @@ -0,0 +1,6 @@ +var group___c_m_s_i_s___r_t_o_s___wait = +[ + [ "osFeature_Wait", "group___c_m_s_i_s___r_t_o_s___wait.html#ga6c97d38879ae86491628f6e647639bad", null ], + [ "osDelay", "group___c_m_s_i_s___r_t_o_s___wait.html#ga02e19d5e723bfb06ba9324d625162255", null ], + [ "osWait", "group___c_m_s_i_s___r_t_o_s___wait.html#ga8470c8aaedfde524a44e22e5b2328285", null ] +]; \ No newline at end of file diff --git a/Documentation/RTOS/html/index.html b/Documentation/RTOS/html/index.html new file mode 100644 index 0000000..e9c7e27 --- /dev/null +++ b/Documentation/RTOS/html/index.html @@ -0,0 +1,148 @@ + + + + + +Overview +CMSIS-RTOS: Overview + + + + + + + + + + + + +
+
+ + + + + + + +
+
CMSIS-RTOS +  Version 1.02 +
+
CMSIS-RTOS API: Generic RTOS interface for Cortex-M processor-based devices.
+
+
+ +
+
    + +
+
+ + +
+
+ +
+
+
+ +
+
+
+
Overview
+
+
+

The CMSIS-RTOS API is a generic RTOS interface for ARM® Cortex®-M processor-based devices. CMSIS-RTOS provides a standardized API for software components that require RTOS functionality and gives therefore serious benefits to the users and the software industry.

+
    +
  • CMSIS-RTOS provides basic features that are required in many applications or technologies such as UML or Java (JVM).
  • +
  • The unified feature set of the CMSIS-RTOS API simplifies sharing of software components and reduces learning efforts.
  • +
  • Middleware components that use the CMSIS-RTOS API are RTOS agnostic. CMSIS-RTOS compliant middleware is easier to adapt.
  • +
  • Standard project templates (such as motor control) of the CMSIS-RTOS API may be shipped with freely available CMSIS-RTOS implementations.
  • +
+
Note
The CMSIS-RTOS API defines a minimum feature set. Implementations with extended features may be provided by RTOS vendors.
+
+API_Structure.png +
+CMSIS-RTOS API Structure
+

A typical CMSIS-RTOS API implementation interfaces to an existing real-time Kernel. The CMSIS-RTOS API provides the following attributes and functionalities:

+
    +
  • Function names, identifiers, and parameters are descriptive and easy to understand. The functions are powerful and flexible which reduces the number of functions exposed to the user.
  • +
  • Thread Management allows you to define, create, and control threads.
  • +
  • Interrupt Service Routines (ISR) can call some CMSIS-RTOS functions. When a CMSIS-RTOS function cannot be called from ISR context, it rejects the invocation.
  • +
  • Three different thread event types support communication between multiple threads and/or ISR:
      +
    • Signal: is a flag that may be used to indicate specific conditions to a thread. Signals can be modified in an ISR or set from other threads.
    • +
    • Message: is a 32-bit value that can be sent to a thread or an ISR. Messages are buffered in a queue. The message type and queue size is defined in a descriptor.
    • +
    • Mail: is a fixed-size memory block that can be sent to a thread or an ISR. Mails are buffered in a queue and memory allocation is provided. The mail type and queue size is defined in a descriptor.
    • +
    +
  • +
  • Mutexes and Semaphores are incorporated.
  • +
  • CPU time can be schedule with the following functionalities:
      +
    • A timeout parameter is incorporated in many CMSIS-RTOS functions to avoid system lockup. When a timeout is specified, the system waits until a resource is available or an event occurs. While waiting, other threads are scheduled.
    • +
    • The osDelay function puts a thread into the state WAITING for a specified period of time.
    • +
    • The generic osWait function waits for events that are assigned to a thread.
    • +
    • The osThreadYield provides co-operative thread switching and passes execution to another thread of the same priority.
    • +
    +
  • +
+

The CMSIS-RTOS API is designed to optionally incorporate multi-processor systems and/or access protection via the Cortex-M Memory Protection Unit (MPU).

+

In some RTOS implementations threads may execute on different processors and Mail and Message queues can therefore reside in shared memory resources.

+

The CMSIS-RTOS API encourages the software industry to evolve existing RTOS implementations. Kernel objects are defined and accessed using macros. This allows differentiation. RTOS implementations can be different and optimized in various aspects towards the Cortex-M processors. Optional features may be for example

+
    +
  • Generic wait function; i.e. with support of time intervals.
  • +
  • Support of the Cortex-M Memory Protection Unit (MPU).
  • +
  • Zero-copy mail queue.
  • +
  • Support of multi-processor systems.
  • +
  • Support of a DMA controller.
  • +
  • Deterministic context switching.
  • +
  • Round-robin context switching.
  • +
  • Deadlock avoidance, for example with priority inversion.
  • +
  • Zero interrupt latency by using the Cortex-M3/M4 instructions LDEX and STEX.
  • +
+
+

CMSIS-RTOS in ARM::CMSIS Pack

+

The following files relevant to CMSIS-RTOS are present in the ARM::CMSIS Pack directories:

+ + + + + + + +
File/Folder Content
CMSIS\Documentation\RTOS This documentation
CMSIS\RTOS\Template Header File Template: cmsis_os.h
+
+
+
+ + + + diff --git a/Documentation/RTOS/html/jquery.js b/Documentation/RTOS/html/jquery.js new file mode 100644 index 0000000..78ad0bd --- /dev/null +++ b/Documentation/RTOS/html/jquery.js @@ -0,0 +1,77 @@ +/*! jQuery v1.7.1 jquery.com | jquery.org/license */ +(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!ck[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){cl||(cl=c.createElement("iframe"),cl.frameBorder=cl.width=cl.height=0),b.appendChild(cl);if(!cm||!cl.createElement)cm=(cl.contentWindow||cl.contentDocument).document,cm.write((c.compatMode==="CSS1Compat"?"":"")+""),cm.close();d=cm.createElement(a),cm.body.appendChild(d),e=f.css(d,"display"),b.removeChild(cl)}ck[a]=e}return ck[a]}function cu(a,b){var c={};f.each(cq.concat.apply([],cq.slice(0,b)),function(){c[this]=a});return c}function ct(){cr=b}function cs(){setTimeout(ct,0);return cr=f.now()}function cj(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ci(){try{return new a.XMLHttpRequest}catch(b){}}function cc(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){if(c!=="border")for(;g=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?parseFloat(d):j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c
a",d=q.getElementsByTagName("*"),e=q.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=q.getElementsByTagName("input")[0],b={leadingWhitespace:q.firstChild.nodeType===3,tbody:!q.getElementsByTagName("tbody").length,htmlSerialize:!!q.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:q.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete q.test}catch(s){b.deleteExpando=!1}!q.addEventListener&&q.attachEvent&&q.fireEvent&&(q.attachEvent("onclick",function(){b.noCloneEvent=!1}),q.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),q.appendChild(i),k=c.createDocumentFragment(),k.appendChild(q.lastChild),b.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,k.removeChild(i),k.appendChild(q),q.innerHTML="",a.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",q.style.width="2px",q.appendChild(j),b.reliableMarginRight=(parseInt((a.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0);if(q.attachEvent)for(o in{submit:1,change:1,focusin:1})n="on"+o,p=n in q,p||(q.setAttribute(n,"return;"),p=typeof q[n]=="function"),b[o+"Bubbles"]=p;k.removeChild(q),k=g=h=j=q=i=null,f(function(){var a,d,e,g,h,i,j,k,m,n,o,r=c.getElementsByTagName("body")[0];!r||(j=1,k="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",m="visibility:hidden;border:0;",n="style='"+k+"border:5px solid #000;padding:0;'",o="
"+""+"
",a=c.createElement("div"),a.style.cssText=m+"width:0;height:0;position:static;top:0;margin-top:"+j+"px",r.insertBefore(a,r.firstChild),q=c.createElement("div"),a.appendChild(q),q.innerHTML="
t
",l=q.getElementsByTagName("td"),p=l[0].offsetHeight===0,l[0].style.display="",l[1].style.display="none",b.reliableHiddenOffsets=p&&l[0].offsetHeight===0,q.innerHTML="",q.style.width=q.style.paddingLeft="1px",f.boxModel=b.boxModel=q.offsetWidth===2,typeof q.style.zoom!="undefined"&&(q.style.display="inline",q.style.zoom=1,b.inlineBlockNeedsLayout=q.offsetWidth===2,q.style.display="",q.innerHTML="
",b.shrinkWrapBlocks=q.offsetWidth!==2),q.style.cssText=k+m,q.innerHTML=o,d=q.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,i={doesNotAddBorder:e.offsetTop!==5,doesAddBorderForTableAndCells:h.offsetTop===5},e.style.position="fixed",e.style.top="20px",i.fixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",i.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,i.doesNotIncludeMarginInBodyOffset=r.offsetTop!==j,r.removeChild(a),q=a=null,f.extend(b,i))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.nodeName.toLowerCase()]||f.valHooks[g.type];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;h=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/\bhover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")}; +f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;le&&i.push({elem:this,matches:d.slice(e)});for(j=0;j0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h0)for(h=g;h=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div
","
"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")), +f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function() +{for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1>");try{for(var c=0,d=this.length;c1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||!bc.test("<"+a.nodeName)?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"<$1>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");b===c?bh.appendChild(o):U(b).appendChild(o),o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===""&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return br.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bq,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bq.test(g)?g.replace(bq,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,b){var c,d,e;b=b.replace(bs,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b)));return c}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f===null&&g&&(e=g[b])&&(f=e),!bt.test(f)&&bu.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f||0,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),bz=bA||bB,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bD=/%20/g,bE=/\[\]$/,bF=/\r?\n/g,bG=/#.*$/,bH=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bI=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bJ=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bK=/^(?:GET|HEAD)$/,bL=/^\/\//,bM=/\?/,bN=/)<[^<]*)*<\/script>/gi,bO=/^(?:select|textarea)/i,bP=/\s+/,bQ=/([?&])_=[^&]*/,bR=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bS=f.fn.load,bT={},bU={},bV,bW,bX=["*/"]+["*"];try{bV=e.href}catch(bY){bV=c.createElement("a"),bV.href="",bV=bV.href}bW=bR.exec(bV.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bS)return bS.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
").append(c.replace(bN,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bO.test(this.nodeName)||bI.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bF,"\r\n")}}):{name:b.name,value:c.replace(bF,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b_(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b_(a,b);return a},ajaxSettings:{url:bV,isLocal:bJ.test(bW[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bX},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bZ(bT),ajaxTransport:bZ(bU),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?cb(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cc(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bH.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bG,"").replace(bL,bW[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bP),d.crossDomain==null&&(r=bR.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bW[1]&&r[2]==bW[2]&&(r[3]||(r[1]==="http:"?80:443))==(bW[3]||(bW[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),b$(bT,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bK.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bM.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bQ,"$1_="+x);d.url=y+(y===d.url?(bM.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bX+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=b$(bU,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)ca(g,a[g],c,e);return d.join("&").replace(bD,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cd=f.now(),ce=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cd++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ce.test(b.url)||e&&ce.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ce,l),b.url===j&&(e&&(k=k.replace(ce,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cf=a.ActiveXObject?function(){for(var a in ch)ch[a](0,1)}:!1,cg=0,ch;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ci()||cj()}:ci,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c) +{if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cf&&delete ch[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cg,cf&&(ch||(ch={},f(a).unload(cf)),ch[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var ck={},cl,cm,cn=/^(?:toggle|show|hide)$/,co=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cp,cq=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cr;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cu("show",3),a,b,c);for(var g=0,h=this.length;g=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cy(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cy(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,d,"padding")):this[d]():null},f.fn["outer"+c]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,d,a?"margin":"border")):this[d]():null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNumeric(j)?j:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window); +/*! + * jQuery UI 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI + */ +(function(a,b){function d(b){return!a(b).parents().andSelf().filter(function(){return a.curCSS(this,"visibility")==="hidden"||a.expr.filters.hidden(this)}).length}function c(b,c){var e=b.nodeName.toLowerCase();if("area"===e){var f=b.parentNode,g=f.name,h;if(!b.href||!g||f.nodeName.toLowerCase()!=="map")return!1;h=a("img[usemap=#"+g+"]")[0];return!!h&&d(h)}return(/input|select|textarea|button|object/.test(e)?!b.disabled:"a"==e?b.href||c:c)&&d(b)}a.ui=a.ui||{};a.ui.version||(a.extend(a.ui,{version:"1.8.18",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}}),a.fn.extend({propAttr:a.fn.prop||a.fn.attr,_focus:a.fn.focus,focus:function(b,c){return typeof b=="number"?this.each(function(){var d=this;setTimeout(function(){a(d).focus(),c&&c.call(d)},b)}):this._focus.apply(this,arguments)},scrollParent:function(){var b;a.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?b=this.parents().filter(function(){return/(relative|absolute|fixed)/.test(a.curCSS(this,"position",1))&&/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0):b=this.parents().filter(function(){return/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!b.length?a(document):b},zIndex:function(c){if(c!==b)return this.css("zIndex",c);if(this.length){var d=a(this[0]),e,f;while(d.length&&d[0]!==document){e=d.css("position");if(e==="absolute"||e==="relative"||e==="fixed"){f=parseInt(d.css("zIndex"),10);if(!isNaN(f)&&f!==0)return f}d=d.parent()}}return 0},disableSelection:function(){return this.bind((a.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),a.each(["Width","Height"],function(c,d){function h(b,c,d,f){a.each(e,function(){c-=parseFloat(a.curCSS(b,"padding"+this,!0))||0,d&&(c-=parseFloat(a.curCSS(b,"border"+this+"Width",!0))||0),f&&(c-=parseFloat(a.curCSS(b,"margin"+this,!0))||0)});return c}var e=d==="Width"?["Left","Right"]:["Top","Bottom"],f=d.toLowerCase(),g={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};a.fn["inner"+d]=function(c){if(c===b)return g["inner"+d].call(this);return this.each(function(){a(this).css(f,h(this,c)+"px")})},a.fn["outer"+d]=function(b,c){if(typeof b!="number")return g["outer"+d].call(this,b);return this.each(function(){a(this).css(f,h(this,b,!0,c)+"px")})}}),a.extend(a.expr[":"],{data:function(b,c,d){return!!a.data(b,d[3])},focusable:function(b){return c(b,!isNaN(a.attr(b,"tabindex")))},tabbable:function(b){var d=a.attr(b,"tabindex"),e=isNaN(d);return(e||d>=0)&&c(b,!e)}}),a(function(){var b=document.body,c=b.appendChild(c=document.createElement("div"));c.offsetHeight,a.extend(c.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0}),a.support.minHeight=c.offsetHeight===100,a.support.selectstart="onselectstart"in c,b.removeChild(c).style.display="none"}),a.extend(a.ui,{plugin:{add:function(b,c,d){var e=a.ui[b].prototype;for(var f in d)e.plugins[f]=e.plugins[f]||[],e.plugins[f].push([c,d[f]])},call:function(a,b,c){var d=a.plugins[b];if(!!d&&!!a.element[0].parentNode)for(var e=0;e0)return!0;b[d]=1,e=b[d]>0,b[d]=0;return e},isOverAxis:function(a,b,c){return a>b&&a=9)&&!b.button)return this._mouseUp(b);if(this._mouseStarted){this._mouseDrag(b);return b.preventDefault()}this._mouseDistanceMet(b)&&this._mouseDelayMet(b)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,b)!==!1,this._mouseStarted?this._mouseDrag(b):this._mouseUp(b));return!this._mouseStarted},_mouseUp:function(b){a(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,b.target==this._mouseDownEvent.target&&a.data(b.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(b));return!1},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(a){return this.mouseDelayMet},_mouseStart:function(a){},_mouseDrag:function(a){},_mouseStop:function(a){},_mouseCapture:function(a){return!0}})})(jQuery); +/* + * jQuery UI Resizable 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Resizables + * + * Depends: + * jquery.ui.core.js + * jquery.ui.mouse.js + * jquery.ui.widget.js + */ +(function(a,b){a.widget("ui.resizable",a.ui.mouse,{widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1e3},_create:function(){var b=this,c=this.options;this.element.addClass("ui-resizable"),a.extend(this,{_aspectRatio:!!c.aspectRatio,aspectRatio:c.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:c.helper||c.ghost||c.animate?c.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)&&(this.element.wrap(a('
').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("resizable",this.element.data("resizable")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=c.handles||(a(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se");if(this.handles.constructor==String){this.handles=="all"&&(this.handles="n,e,s,w,se,sw,ne,nw");var d=this.handles.split(",");this.handles={};for(var e=0;e
');/sw|se|ne|nw/.test(f)&&h.css({zIndex:++c.zIndex}),"se"==f&&h.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[f]=".ui-resizable-"+f,this.element.append(h)}}this._renderAxis=function(b){b=b||this.element;for(var c in this.handles){this.handles[c].constructor==String&&(this.handles[c]=a(this.handles[c],this.element).show());if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var d=a(this.handles[c],this.element),e=0;e=/sw|ne|nw|se|n|s/.test(c)?d.outerHeight():d.outerWidth();var f=["padding",/ne|nw|n/.test(c)?"Top":/se|sw|s/.test(c)?"Bottom":/^e$/.test(c)?"Right":"Left"].join("");b.css(f,e),this._proportionallyResize()}if(!a(this.handles[c]).length)continue}},this._renderAxis(this.element),this._handles=a(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover(function(){if(!b.resizing){if(this.className)var a=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);b.axis=a&&a[1]?a[1]:"se"}}),c.autoHide&&(this._handles.hide(),a(this.element).addClass("ui-resizable-autohide").hover(function(){c.disabled||(a(this).removeClass("ui-resizable-autohide"),b._handles.show())},function(){c.disabled||b.resizing||(a(this).addClass("ui-resizable-autohide"),b._handles.hide())})),this._mouseInit()},destroy:function(){this._mouseDestroy();var b=function(b){a(b).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){b(this.element);var c=this.element;c.after(this.originalElement.css({position:c.css("position"),width:c.outerWidth(),height:c.outerHeight(),top:c.css("top"),left:c.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle),b(this.originalElement);return this},_mouseCapture:function(b){var c=!1;for(var d in this.handles)a(this.handles[d])[0]==b.target&&(c=!0);return!this.options.disabled&&c},_mouseStart:function(b){var d=this.options,e=this.element.position(),f=this.element;this.resizing=!0,this.documentScroll={top:a(document).scrollTop(),left:a(document).scrollLeft()},(f.is(".ui-draggable")||/absolute/.test(f.css("position")))&&f.css({position:"absolute",top:e.top,left:e.left}),this._renderProxy();var g=c(this.helper.css("left")),h=c(this.helper.css("top"));d.containment&&(g+=a(d.containment).scrollLeft()||0,h+=a(d.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:g,top:h},this.size=this._helper?{width:f.outerWidth(),height:f.outerHeight()}:{width:f.width(),height:f.height()},this.originalSize=this._helper?{width:f.outerWidth(),height:f.outerHeight()}:{width:f.width(),height:f.height()},this.originalPosition={left:g,top:h},this.sizeDiff={width:f.outerWidth()-f.width(),height:f.outerHeight()-f.height()},this.originalMousePosition={left:b.pageX,top:b.pageY},this.aspectRatio=typeof d.aspectRatio=="number"?d.aspectRatio:this.originalSize.width/this.originalSize.height||1;var i=a(".ui-resizable-"+this.axis).css("cursor");a("body").css("cursor",i=="auto"?this.axis+"-resize":i),f.addClass("ui-resizable-resizing"),this._propagate("start",b);return!0},_mouseDrag:function(b){var c=this.helper,d=this.options,e={},f=this,g=this.originalMousePosition,h=this.axis,i=b.pageX-g.left||0,j=b.pageY-g.top||0,k=this._change[h];if(!k)return!1;var l=k.apply(this,[b,i,j]),m=a.browser.msie&&a.browser.version<7,n=this.sizeDiff;this._updateVirtualBoundaries(b.shiftKey);if(this._aspectRatio||b.shiftKey)l=this._updateRatio(l,b);l=this._respectSize(l,b),this._propagate("resize",b),c.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"}),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),this._updateCache(l),this._trigger("resize",b,this.ui());return!1},_mouseStop:function(b){this.resizing=!1;var c=this.options,d=this;if(this._helper){var e=this._proportionallyResizeElements,f=e.length&&/textarea/i.test(e[0].nodeName),g=f&&a.ui.hasScroll(e[0],"left")?0:d.sizeDiff.height,h=f?0:d.sizeDiff.width,i={width:d.helper.width()-h,height:d.helper.height()-g},j=parseInt(d.element.css("left"),10)+(d.position.left-d.originalPosition.left)||null,k=parseInt(d.element.css("top"),10)+(d.position.top-d.originalPosition.top)||null;c.animate||this.element.css(a.extend(i,{top:k,left:j})),d.helper.height(d.size.height),d.helper.width(d.size.width),this._helper&&!c.animate&&this._proportionallyResize()}a("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",b),this._helper&&this.helper.remove();return!1},_updateVirtualBoundaries:function(a){var b=this.options,c,e,f,g,h;h={minWidth:d(b.minWidth)?b.minWidth:0,maxWidth:d(b.maxWidth)?b.maxWidth:Infinity,minHeight:d(b.minHeight)?b.minHeight:0,maxHeight:d(b.maxHeight)?b.maxHeight:Infinity};if(this._aspectRatio||a)c=h.minHeight*this.aspectRatio,f=h.minWidth/this.aspectRatio,e=h.maxHeight*this.aspectRatio,g=h.maxWidth/this.aspectRatio,c>h.minWidth&&(h.minWidth=c),f>h.minHeight&&(h.minHeight=f),ea.width,k=d(a.height)&&e.minHeight&&e.minHeight>a.height;j&&(a.width=e.minWidth),k&&(a.height=e.minHeight),h&&(a.width=e.maxWidth),i&&(a.height=e.maxHeight);var l=this.originalPosition.left+this.originalSize.width,m=this.position.top+this.size.height,n=/sw|nw|w/.test(g),o=/nw|ne|n/.test(g);j&&n&&(a.left=l-e.minWidth),h&&n&&(a.left=l-e.maxWidth),k&&o&&(a.top=m-e.minHeight),i&&o&&(a.top=m-e.maxHeight);var p=!a.width&&!a.height;p&&!a.left&&a.top?a.top=null:p&&!a.top&&a.left&&(a.left=null);return a},_proportionallyResize:function(){var b=this.options;if(!!this._proportionallyResizeElements.length){var c=this.helper||this.element;for(var d=0;d');var d=a.browser.msie&&a.browser.version<7,e=d?1:0,f=d?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+f,height:this.element.outerHeight()+f,position:"absolute",left:this.elementOffset.left-e+"px",top:this.elementOffset.top-e+"px",zIndex:++c.zIndex}),this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(a,b,c){return{width:this.originalSize.width+b}},w:function(a,b,c){var d=this.options,e=this.originalSize,f=this.originalPosition;return{left:f.left+b,width:e.width-b}},n:function(a,b,c){var d=this.options,e=this.originalSize,f=this.originalPosition;return{top:f.top+c,height:e.height-c}},s:function(a,b,c){return{height:this.originalSize.height+c}},se:function(b,c,d){return a.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[b,c,d]))},sw:function(b,c,d){return a.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[b,c,d]))},ne:function(b,c,d){return a.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[b,c,d]))},nw:function(b,c,d){return a.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[b,c,d]))}},_propagate:function(b,c){a.ui.plugin.call(this,b,[c,this.ui()]),b!="resize"&&this._trigger(b,c,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),a.extend(a.ui.resizable,{version:"1.8.18"}),a.ui.plugin.add("resizable","alsoResize",{start:function(b,c){var d=a(this).data("resizable"),e=d.options,f=function(b){a(b).each(function(){var b=a(this);b.data("resizable-alsoresize",{width:parseInt(b.width(),10),height:parseInt(b.height(),10),left:parseInt(b.css("left"),10),top:parseInt(b.css("top"),10)})})};typeof e.alsoResize=="object"&&!e.alsoResize.parentNode?e.alsoResize.length?(e.alsoResize=e.alsoResize[0],f(e.alsoResize)):a.each(e.alsoResize,function(a){f(a)}):f(e.alsoResize)},resize:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.originalSize,g=d.originalPosition,h={height:d.size.height-f.height||0,width:d.size.width-f.width||0,top:d.position.top-g.top||0,left:d.position.left-g.left||0},i=function(b,d){a(b).each(function(){var b=a(this),e=a(this).data("resizable-alsoresize"),f={},g=d&&d.length?d:b.parents(c.originalElement[0]).length?["width","height"]:["width","height","top","left"];a.each(g,function(a,b){var c=(e[b]||0)+(h[b]||0);c&&c>=0&&(f[b]=c||null)}),b.css(f)})};typeof e.alsoResize=="object"&&!e.alsoResize.nodeType?a.each(e.alsoResize,function(a,b){i(a,b)}):i(e.alsoResize)},stop:function(b,c){a(this).removeData("resizable-alsoresize")}}),a.ui.plugin.add("resizable","animate",{stop:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d._proportionallyResizeElements,g=f.length&&/textarea/i.test(f[0].nodeName),h=g&&a.ui.hasScroll(f[0],"left")?0:d.sizeDiff.height,i=g?0:d.sizeDiff.width,j={width:d.size.width-i,height:d.size.height-h},k=parseInt(d.element.css("left"),10)+(d.position.left-d.originalPosition.left)||null,l=parseInt(d.element.css("top"),10)+(d.position.top-d.originalPosition.top)||null;d.element.animate(a.extend(j,l&&k?{top:l,left:k}:{}),{duration:e.animateDuration,easing:e.animateEasing,step:function(){var c={width:parseInt(d.element.css("width"),10),height:parseInt(d.element.css("height"),10),top:parseInt(d.element.css("top"),10),left:parseInt(d.element.css("left"),10)};f&&f.length&&a(f[0]).css({width:c.width,height:c.height}),d._updateCache(c),d._propagate("resize",b)}})}}),a.ui.plugin.add("resizable","containment",{start:function(b,d){var e=a(this).data("resizable"),f=e.options,g=e.element,h=f.containment,i=h instanceof a?h.get(0):/parent/.test(h)?g.parent().get(0):h;if(!!i){e.containerElement=a(i);if(/document/.test(h)||h==document)e.containerOffset={left:0,top:0},e.containerPosition={left:0,top:0},e.parentData={element:a(document),left:0,top:0,width:a(document).width(),height:a(document).height()||document.body.parentNode.scrollHeight};else{var j=a(i),k=[];a(["Top","Right","Left","Bottom"]).each(function(a,b){k[a]=c(j.css("padding"+b))}),e.containerOffset=j.offset(),e.containerPosition=j.position(),e.containerSize={height:j.innerHeight()-k[3],width:j.innerWidth()-k[1]};var l=e.containerOffset,m=e.containerSize.height,n=e.containerSize.width,o=a.ui.hasScroll(i,"left")?i.scrollWidth:n,p=a.ui.hasScroll(i)?i.scrollHeight:m;e.parentData={element:i,left:l.left,top:l.top,width:o,height:p}}}},resize:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.containerSize,g=d.containerOffset,h=d.size,i=d.position,j=d._aspectRatio||b.shiftKey,k={top:0,left:0},l=d.containerElement;l[0]!=document&&/static/.test(l.css("position"))&&(k=g),i.left<(d._helper?g.left:0)&&(d.size.width=d.size.width+(d._helper?d.position.left-g.left:d.position.left-k.left),j&&(d.size.height=d.size.width/e.aspectRatio),d.position.left=e.helper?g.left:0),i.top<(d._helper?g.top:0)&&(d.size.height=d.size.height+(d._helper?d.position.top-g.top:d.position.top),j&&(d.size.width=d.size.height*e.aspectRatio),d.position.top=d._helper?g.top:0),d.offset.left=d.parentData.left+d.position.left,d.offset.top=d.parentData.top+d.position.top;var m=Math.abs((d._helper?d.offset.left-k.left:d.offset.left-k.left)+d.sizeDiff.width),n=Math.abs((d._helper?d.offset.top-k.top:d.offset.top-g.top)+d.sizeDiff.height),o=d.containerElement.get(0)==d.element.parent().get(0),p=/relative|absolute/.test(d.containerElement.css("position"));o&&p +&&(m-=d.parentData.left),m+d.size.width>=d.parentData.width&&(d.size.width=d.parentData.width-m,j&&(d.size.height=d.size.width/d.aspectRatio)),n+d.size.height>=d.parentData.height&&(d.size.height=d.parentData.height-n,j&&(d.size.width=d.size.height*d.aspectRatio))},stop:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.position,g=d.containerOffset,h=d.containerPosition,i=d.containerElement,j=a(d.helper),k=j.offset(),l=j.outerWidth()-d.sizeDiff.width,m=j.outerHeight()-d.sizeDiff.height;d._helper&&!e.animate&&/relative/.test(i.css("position"))&&a(this).css({left:k.left-h.left-g.left,width:l,height:m}),d._helper&&!e.animate&&/static/.test(i.css("position"))&&a(this).css({left:k.left-h.left-g.left,width:l,height:m})}}),a.ui.plugin.add("resizable","ghost",{start:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.size;d.ghost=d.originalElement.clone(),d.ghost.css({opacity:.25,display:"block",position:"relative",height:f.height,width:f.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof e.ghost=="string"?e.ghost:""),d.ghost.appendTo(d.helper)},resize:function(b,c){var d=a(this).data("resizable"),e=d.options;d.ghost&&d.ghost.css({position:"relative",height:d.size.height,width:d.size.width})},stop:function(b,c){var d=a(this).data("resizable"),e=d.options;d.ghost&&d.helper&&d.helper.get(0).removeChild(d.ghost.get(0))}}),a.ui.plugin.add("resizable","grid",{resize:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.size,g=d.originalSize,h=d.originalPosition,i=d.axis,j=e._aspectRatio||b.shiftKey;e.grid=typeof e.grid=="number"?[e.grid,e.grid]:e.grid;var k=Math.round((f.width-g.width)/(e.grid[0]||1))*(e.grid[0]||1),l=Math.round((f.height-g.height)/(e.grid[1]||1))*(e.grid[1]||1);/^(se|s|e)$/.test(i)?(d.size.width=g.width+k,d.size.height=g.height+l):/^(ne)$/.test(i)?(d.size.width=g.width+k,d.size.height=g.height+l,d.position.top=h.top-l):/^(sw)$/.test(i)?(d.size.width=g.width+k,d.size.height=g.height+l,d.position.left=h.left-k):(d.size.width=g.width+k,d.size.height=g.height+l,d.position.top=h.top-l,d.position.left=h.left-k)}});var c=function(a){return parseInt(a,10)||0},d=function(a){return!isNaN(parseInt(a,10))}})(jQuery); +/* + * jQuery hashchange event - v1.3 - 7/21/2010 + * http://benalman.com/projects/jquery-hashchange-plugin/ + * + * Copyright (c) 2010 "Cowboy" Ben Alman + * Dual licensed under the MIT and GPL licenses. + * http://benalman.com/about/license/ + */ +(function($,e,b){var c="hashchange",h=document,f,g=$.event.special,i=h.documentMode,d="on"+c in e&&(i===b||i>7);function a(j){j=j||location.href;return"#"+j.replace(/^[^#]*#?(.*)$/,"$1")}$.fn[c]=function(j){return j?this.bind(c,j):this.trigger(c)};$.fn[c].delay=50;g[c]=$.extend(g[c],{setup:function(){if(d){return false}$(f.start)},teardown:function(){if(d){return false}$(f.stop)}});f=(function(){var j={},p,m=a(),k=function(q){return q},l=k,o=k;j.start=function(){p||n()};j.stop=function(){p&&clearTimeout(p);p=b};function n(){var r=a(),q=o(m);if(r!==m){l(m=r,q);$(e).trigger(c)}else{if(q!==m){location.href=location.href.replace(/#.*/,"")+q}}p=setTimeout(n,$.fn[c].delay)}$.browser.msie&&!d&&(function(){var q,r;j.start=function(){if(!q){r=$.fn[c].src;r=r&&r+a();q=$('