takashi kadono / Mbed OS Nucleo_446

Dependencies:   ssd1331

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers cmsis_os2.h Source File

cmsis_os2.h

00001 /*
00002  * Copyright (c) , Arm Limited and affiliates.
00003  * SPDX-License-Identifier: Apache-2.0
00004  *
00005  * Licensed under the Apache License, Version 2.0 (the "License");
00006  * you may not use this file except in compliance with the License.
00007  * You may obtain a copy of the License at
00008  *
00009  *     http://www.apache.org/licenses/LICENSE-2.0
00010  *
00011  * Unless required by applicable law or agreed to in writing, software
00012  * distributed under the License is distributed on an "AS IS" BASIS,
00013  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  * See the License for the specific language governing permissions and
00015  * limitations under the License.
00016  */
00017 
00018 #ifndef __CMSIS_OS2_H__
00019 #define __CMSIS_OS2_H__
00020 
00021 #include <inttypes.h>
00022 
00023 //If conflicts, then remove these, copied from cmsis_os.h
00024 typedef int32_t                  osStatus;
00025 
00026 #define osOK 0
00027 
00028 
00029 
00030 //These are from cmsis_os2.h
00031 typedef void *osSemaphoreId_t;
00032 
00033 typedef struct {
00034     const char                   *name;   ///< name of the semaphore
00035     uint32_t                 attr_bits;   ///< attribute bits
00036     void                      *cb_mem;    ///< memory for control block
00037     uint32_t                   cb_size;   ///< size of provided memory for control block
00038 } osSemaphoreAttr_t;
00039 
00040 //Thread
00041 typedef enum {
00042     osPriorityNormal        = 24       ///< Priority: normal
00043 } osPriority_t;
00044 
00045 typedef void *osThreadId_t;
00046 
00047 typedef void *osEventFlagsId_t;
00048 
00049 /// Attributes structure for thread.
00050 typedef struct {
00051 } osThreadAttr_t;
00052 
00053 #define osWaitForever         0xFFFFFFFFU ///< Wait forever timeout value.
00054  
00055 // Flags options (\ref osThreadFlagsWait and \ref osEventFlagsWait).
00056 #define osFlagsWaitAny        0x00000000U ///< Wait for any flag (default).
00057 #define osFlagsWaitAll        0x00000001U ///< Wait for all flags.
00058 #define osFlagsNoClear        0x00000002U ///< Do not clear flags which have been specified to wait for.
00059  
00060 // Flags errors (returned by osThreadFlagsXxxx and osEventFlagsXxxx).
00061 #define osFlagsError          0x80000000U ///< Error indicator.
00062 #define osFlagsErrorUnknown   0xFFFFFFFFU ///< osError (-1).
00063 #define osFlagsErrorTimeout   0xFFFFFFFEU ///< osErrorTimeout (-2).
00064 #define osFlagsErrorResource  0xFFFFFFFDU ///< osErrorResource (-3).
00065 #define osFlagsErrorParameter 0xFFFFFFFCU ///< osErrorParameter (-4).
00066 #define osFlagsErrorISR       0xFFFFFFFAU ///< osErrorISR (-6).
00067  
00068 // Thread attributes (attr_bits in \ref osThreadAttr_t).
00069 #define osThreadDetached      0x00000000U ///< Thread created in detached mode (default)
00070 #define osThreadJoinable      0x00000001U ///< Thread created in joinable mode
00071  
00072 // Mutex attributes (attr_bits in \ref osMutexAttr_t).
00073 #define osMutexRecursive      0x00000001U ///< Recursive mutex.
00074 #define osMutexPrioInherit    0x00000002U ///< Priority inherit protocol.
00075 #define osMutexRobust         0x00000008U ///< Robust mutex.
00076 
00077 
00078 #endif