My fork of X_NUCLEO_IDB0XA1

Fork of X_NUCLEO_IDB0XA1 by ST

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers ble_osal.h Source File

ble_osal.h

00001 /******************** (C) COPYRIGHT 2012 STMicroelectronics ********************
00002 * File Name          : ble_osal.h
00003 * Author             : AMS - HEA&RF BU
00004 * Version            : V1.0.0
00005 * Date               : 19-July-2012
00006 * Description        : This header file defines the OS abstraction layer used by
00007 *                      the BLE stack. OSAL defines the set of functions
00008 *                      which needs to be ported to target operating system and
00009 *                      target platform.
00010 ********************************************************************************
00011 * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
00012 * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
00013 * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT,
00014 * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE
00015 * CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING
00016 * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
00017 *******************************************************************************/
00018 
00019 #ifndef __OSAL_H__
00020 #define __OSAL_H__
00021 
00022 /******************************************************************************
00023  * Includes
00024  *****************************************************************************/
00025 #include <ble_hal_types.h>
00026 #ifdef __ICCARM__
00027 #include <intrinsics.h>
00028 #endif
00029 
00030 /******************************************************************************
00031  * Macros
00032  *****************************************************************************/
00033 
00034 
00035 /******************************************************************************
00036  * Function Prototypes
00037  *****************************************************************************/
00038 
00039 /**
00040  * This function copies size number of bytes from a 
00041  * memory location pointed by src to a destination 
00042  * memory location pointed by dest
00043  * 
00044  * @param[in] dest Destination address
00045  * @param[in] src  Source address
00046  * @param[in] size size in the bytes  
00047  * 
00048  * @return  Address of the destination
00049  */
00050  
00051 extern void* Osal_MemCpy(void *dest,const void *src, unsigned int size);
00052 
00053 
00054 /**
00055  * This function sets first number of bytes, specified
00056  * by size, to the destination memory pointed by ptr 
00057  * to the specified value
00058  * 
00059  * @param[in] ptr    Destination address
00060  * @param[in] value  Value to be set
00061  * @param[in] size   Size in the bytes  
00062  * 
00063  * @return  Address of the destination
00064  */
00065  
00066 extern void* Osal_MemSet(void *ptr, int value, unsigned int size);
00067 
00068 /**
00069  * Osal_Get_Cur_Time
00070  * 
00071  * returns the current time in milliseconds
00072  */
00073 /**
00074  * Returns the number of ticks (1 tick = 1 millisecond)
00075  * 
00076  * @return  Time in milliseconds
00077  */
00078 uint32_t Osal_Get_Cur_Time(void);
00079 
00080 
00081 #endif /* __OSAL_H__ */