Maxim Integrated / MaximBLE

Dependents:   BLE_Thermometer MAXWSNENV_demo

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers wsf_os_int.h Source File

wsf_os_int.h

Go to the documentation of this file.
00001 /*************************************************************************************************/
00002 /*!
00003  *  \file   wsf_os_int.h
00004  *        
00005  *  \brief  Software foundation OS platform-specific interface file.
00006  *
00007  *          $Date: 2012-10-01 13:53:07 -0700 (Mon, 01 Oct 2012) $
00008  *          $Revision: 357 $
00009  *  
00010  *  Copyright (c) 2009-2016 ARM Limited. All rights reserved.
00011  *
00012  *  SPDX-License-Identifier: LicenseRef-PBL
00013  *
00014  *  Licensed under the Permissive Binary License, Version 1.0 (the "License"); you may not use
00015  *  this file except in compliance with the License.  You may obtain a copy of the License at
00016  *
00017  *  https://www.mbed.com/licenses/PBL-1.0
00018  *
00019  *  See the License for the specific language governing permissions and limitations under the License.
00020  */
00021 /*************************************************************************************************/
00022 #ifndef WSF_OS_INT_H
00023 #define WSF_OS_INT_H
00024 
00025 #ifdef __cplusplus
00026 extern "C" {
00027 #endif
00028 
00029 /**************************************************************************************************
00030   Macros
00031 **************************************************************************************************/
00032 
00033 /* Task events */
00034 #define WSF_MSG_QUEUE_EVENT   0x01        /* Message queued for event handler */
00035 #define WSF_TIMER_EVENT       0x02        /* Timer expired for event handler */
00036 #define WSF_HANDLER_EVENT     0x04        /* Event set for event handler */
00037 
00038 /* Derive task from handler ID */
00039 #define WSF_TASK_FROM_ID(handlerID)       (((handlerID) >> 4) & 0x0F)
00040 
00041 /* Derive handler from handler ID */
00042 #define WSF_HANDLER_FROM_ID(handlerID)    ((handlerID) & 0x0F)
00043 
00044 /**************************************************************************************************
00045   Data Types
00046 **************************************************************************************************/
00047 
00048 /* Event handler ID data type */
00049 typedef uint8_t  wsfHandlerId_t;
00050 
00051 /* Event handler event mask data type */
00052 typedef uint8_t  wsfEventMask_t;
00053 
00054 /* Task ID data type */
00055 typedef wsfHandlerId_t  wsfTaskId_t;
00056 
00057 /* Task event mask data type */
00058 typedef uint8_t wsfTaskEvent_t;
00059 
00060 /**************************************************************************************************
00061   Function Declarations
00062 **************************************************************************************************/
00063 
00064 /*************************************************************************************************/
00065 /*!
00066  *  \fn     wsfOsReadyToSleep
00067  *        
00068  *  \brief  Check if WSF is ready to sleep.
00069  *
00070  *  \param  None.
00071  *
00072  *  \return Return TRUE if there are no pending WSF task events set, FALSE otherwise.
00073  */
00074 /*************************************************************************************************/
00075 bool_t wsfOsReadyToSleep(void);
00076 
00077 /*************************************************************************************************/
00078 /*!
00079  *  \fn     wsfOsDispatcher
00080  *        
00081  *  \brief  Event dispatched.  Designed to be called repeatedly from infinite loop.
00082  *
00083  *  \param  None.
00084  *
00085  *  \return None.
00086  */
00087 /*************************************************************************************************/
00088 void wsfOsDispatcher(void);
00089 
00090 /*************************************************************************************************/
00091 /*!
00092  *  \fn     WsfOsShutdown
00093  *        
00094  *  \brief  Shutdown OS.
00095  *
00096  *  \return None.
00097  */
00098 /*************************************************************************************************/
00099 void WsfOsShutdown(void);
00100 
00101 #ifdef __cplusplus
00102 };
00103 #endif
00104 
00105 #endif /* WSF_OS_INT_H */