HW layer for the Nucleo board, it only work with old BLE_API

Dependents:   Hello_BLE F446RE-BLE

Fork of X_NUCLEO_IDB0XA1 by ST

Committer:
leonardoaraujosantos
Date:
Tue Nov 03 23:10:27 2015 +0000
Revision:
129:57997390c086
Parent:
70:d20d30f59b1c
Changing pin D13

Who changed what in which revision?

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