Fork of ble-x-nucleo-idb0xa1 with changes required by BleStarMbed

Dependents:   ble-star-mbed

Committer:
lorevee
Date:
Tue Feb 20 11:07:16 2018 +0000
Revision:
0:ac0b0725c6fa
Initial commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
lorevee 0:ac0b0725c6fa 1 /**
lorevee 0:ac0b0725c6fa 2 ******************************************************************************
lorevee 0:ac0b0725c6fa 3 * @file ble_osal.c
lorevee 0:ac0b0725c6fa 4 * @author AMS - HEA&RF BU / CL
lorevee 0:ac0b0725c6fa 5 * @version V1.0.0
lorevee 0:ac0b0725c6fa 6 * @date 04-July-2014
lorevee 0:ac0b0725c6fa 7 * @brief Implementation of OS abstraction layer functions used by the
lorevee 0:ac0b0725c6fa 8 * library.
lorevee 0:ac0b0725c6fa 9 ******************************************************************************
lorevee 0:ac0b0725c6fa 10 * @attention
lorevee 0:ac0b0725c6fa 11 *
lorevee 0:ac0b0725c6fa 12 * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
lorevee 0:ac0b0725c6fa 13 *
lorevee 0:ac0b0725c6fa 14 * Redistribution and use in source and binary forms, with or without modification,
lorevee 0:ac0b0725c6fa 15 * are permitted provided that the following conditions are met:
lorevee 0:ac0b0725c6fa 16 * 1. Redistributions of source code must retain the above copyright notice,
lorevee 0:ac0b0725c6fa 17 * this list of conditions and the following disclaimer.
lorevee 0:ac0b0725c6fa 18 * 2. Redistributions in binary form must reproduce the above copyright notice,
lorevee 0:ac0b0725c6fa 19 * this list of conditions and the following disclaimer in the documentation
lorevee 0:ac0b0725c6fa 20 * and/or other materials provided with the distribution.
lorevee 0:ac0b0725c6fa 21 * 3. Neither the name of STMicroelectronics nor the names of its contributors
lorevee 0:ac0b0725c6fa 22 * may be used to endorse or promote products derived from this software
lorevee 0:ac0b0725c6fa 23 * without specific prior written permission.
lorevee 0:ac0b0725c6fa 24 *
lorevee 0:ac0b0725c6fa 25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
lorevee 0:ac0b0725c6fa 26 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
lorevee 0:ac0b0725c6fa 27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
lorevee 0:ac0b0725c6fa 28 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
lorevee 0:ac0b0725c6fa 29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
lorevee 0:ac0b0725c6fa 30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
lorevee 0:ac0b0725c6fa 31 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
lorevee 0:ac0b0725c6fa 32 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
lorevee 0:ac0b0725c6fa 33 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
lorevee 0:ac0b0725c6fa 34 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
lorevee 0:ac0b0725c6fa 35 *
lorevee 0:ac0b0725c6fa 36 ******************************************************************************
lorevee 0:ac0b0725c6fa 37 */
lorevee 0:ac0b0725c6fa 38
lorevee 0:ac0b0725c6fa 39 /* Includes ------------------------------------------------------------------*/
lorevee 0:ac0b0725c6fa 40 #include <string.h>
lorevee 0:ac0b0725c6fa 41 #include <ble_osal.h>
lorevee 0:ac0b0725c6fa 42
lorevee 0:ac0b0725c6fa 43 /**
lorevee 0:ac0b0725c6fa 44 * @brief Osal_MemCpy
lorevee 0:ac0b0725c6fa 45 * @param dest: Pointer to the destination buffer
lorevee 0:ac0b0725c6fa 46 * @param src : Pointer to the source buffer
lorevee 0:ac0b0725c6fa 47 * @param size: Number of bytes to copy from the source to the destination
lorevee 0:ac0b0725c6fa 48 * buffer
lorevee 0:ac0b0725c6fa 49 * @retval Pointer to the destination buffer
lorevee 0:ac0b0725c6fa 50 */
lorevee 0:ac0b0725c6fa 51 void* Osal_MemCpy(void *dest, const void *src, unsigned int size)
lorevee 0:ac0b0725c6fa 52 {
lorevee 0:ac0b0725c6fa 53 return(memcpy(dest,src,size));
lorevee 0:ac0b0725c6fa 54 }
lorevee 0:ac0b0725c6fa 55
lorevee 0:ac0b0725c6fa 56 /**
lorevee 0:ac0b0725c6fa 57 * @brief Osal_MemSet
lorevee 0:ac0b0725c6fa 58 * @param ptr : Pointer to block of memory to fill
lorevee 0:ac0b0725c6fa 59 * @param value: Value to assign to each byte of the memory block
lorevee 0:ac0b0725c6fa 60 * @param size : Number of bytes to be set to "value"
lorevee 0:ac0b0725c6fa 61 * @retval Pointer to the filled block of memory
lorevee 0:ac0b0725c6fa 62 */
lorevee 0:ac0b0725c6fa 63 void* Osal_MemSet(void *ptr, int value, unsigned int size)
lorevee 0:ac0b0725c6fa 64 {
lorevee 0:ac0b0725c6fa 65 return(memset(ptr,value,size));
lorevee 0:ac0b0725c6fa 66 }
lorevee 0:ac0b0725c6fa 67
lorevee 0:ac0b0725c6fa 68 /******************************************************************************
lorevee 0:ac0b0725c6fa 69 * local Functions
lorevee 0:ac0b0725c6fa 70 *****************************************************************************/
lorevee 0:ac0b0725c6fa 71
lorevee 0:ac0b0725c6fa 72 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/