1 /***************************************************************************** 2 * @file osal.h 3 * @author MCD Application Team 4 * @brief This header file defines the OS abstraction layer used by 5 * the BLE stack. OSAL defines the set of functions which needs to be 6 * ported to target operating system and target platform. 7 * Actually, only memset, memcpy and memcmp wrappers are defined. 8 ***************************************************************************** 9 * @attention 10 * 11 * <h2><center>© Copyright (c) 2019 STMicroelectronics. 12 * All rights reserved.</center></h2> 13 * 14 * This software component is licensed by ST under Ultimate Liberty license 15 * SLA0044, the "License"; You may not use this file except in compliance with 16 * the License. You may obtain a copy of the License at: 17 * www.st.com/SLA0044 18 * 19 ****************************************************************************** 20 */ 21 22 #ifndef OSAL_H__ 23 #define OSAL_H__ 24 25 26 /** 27 * This function copies size number of bytes from a 28 * memory location pointed by src to a destination 29 * memory location pointed by dest 30 * 31 * @param[in] dest Destination address 32 * @param[in] src Source address 33 * @param[in] size size in the bytes 34 * 35 * @return Address of the destination 36 */ 37 38 extern void* Osal_MemCpy( void *dest, const void *src, unsigned int size ); 39 40 /** 41 * This function sets first number of bytes, specified 42 * by size, to the destination memory pointed by ptr 43 * to the specified value 44 * 45 * @param[in] ptr Destination address 46 * @param[in] value Value to be set 47 * @param[in] size Size in the bytes 48 * 49 * @return Address of the destination 50 */ 51 52 extern void* Osal_MemSet( void *ptr, int value, unsigned int size ); 53 54 /** 55 * This function compares n bytes of two regions of memory 56 * 57 * @param[in] s1 First buffer to compare. 58 * @param[in] s2 Second buffer to compare. 59 * @param[in] size Number of bytes to compare. 60 * 61 * @return 0 if the two buffers are equal, 1 otherwise 62 */ 63 extern int Osal_MemCmp( const void *s1, const void *s2, unsigned int size ); 64 65 66 #endif /* OSAL_H__ */ 67