Andrea Sortino / X_NUCLEO_IDB0XA1

Dependents:   BLE_GENERALE

Fork of X_NUCLEO_IDB0XA1 by ST

Committer:
Wolfgang Betz
Date:
Tue Oct 06 14:25:08 2015 +0200
Revision:
130:770ce14d3d15
Include mbed-classic version

Derived from
- repo (on Codex): gitolite@codex.cro.st.com:x-nucleodev/X-NUCLEO-IKC01A1-MBED.git
- branch: ble_wb
- SHA1 ID: 5ccc73e35868169e42132c0d1c056f908a6d70c0

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Wolfgang Betz 130:770ce14d3d15 1 /******************** (C) COPYRIGHT 2012 STMicroelectronics ********************
Wolfgang Betz 130:770ce14d3d15 2 * File Name : osal.h
Wolfgang Betz 130:770ce14d3d15 3 * Author : AMS - HEA&RF BU
Wolfgang Betz 130:770ce14d3d15 4 * Version : V1.0.0
Wolfgang Betz 130:770ce14d3d15 5 * Date : 19-July-2012
Wolfgang Betz 130:770ce14d3d15 6 * Description : This header file defines the OS abstraction layer used by
Wolfgang Betz 130:770ce14d3d15 7 * the BLE stack. OSAL defines the set of functions
Wolfgang Betz 130:770ce14d3d15 8 * which needs to be ported to target operating system and
Wolfgang Betz 130:770ce14d3d15 9 * target platform.
Wolfgang Betz 130:770ce14d3d15 10 ********************************************************************************
Wolfgang Betz 130:770ce14d3d15 11 * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
Wolfgang Betz 130:770ce14d3d15 12 * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
Wolfgang Betz 130:770ce14d3d15 13 * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT,
Wolfgang Betz 130:770ce14d3d15 14 * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE
Wolfgang Betz 130:770ce14d3d15 15 * CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING
Wolfgang Betz 130:770ce14d3d15 16 * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
Wolfgang Betz 130:770ce14d3d15 17 *******************************************************************************/
Wolfgang Betz 130:770ce14d3d15 18
Wolfgang Betz 130:770ce14d3d15 19 #ifndef __OSAL_H__
Wolfgang Betz 130:770ce14d3d15 20 #define __OSAL_H__
Wolfgang Betz 130:770ce14d3d15 21
Wolfgang Betz 130:770ce14d3d15 22 /******************************************************************************
Wolfgang Betz 130:770ce14d3d15 23 * Includes
Wolfgang Betz 130:770ce14d3d15 24 *****************************************************************************/
Wolfgang Betz 130:770ce14d3d15 25 #include <hal_types.h>
Wolfgang Betz 130:770ce14d3d15 26 #ifdef __ICCARM__
Wolfgang Betz 130:770ce14d3d15 27 #include <intrinsics.h>
Wolfgang Betz 130:770ce14d3d15 28 #endif
Wolfgang Betz 130:770ce14d3d15 29
Wolfgang Betz 130:770ce14d3d15 30 /******************************************************************************
Wolfgang Betz 130:770ce14d3d15 31 * Macros
Wolfgang Betz 130:770ce14d3d15 32 *****************************************************************************/
Wolfgang Betz 130:770ce14d3d15 33
Wolfgang Betz 130:770ce14d3d15 34
Wolfgang Betz 130:770ce14d3d15 35 /******************************************************************************
Wolfgang Betz 130:770ce14d3d15 36 * Function Prototypes
Wolfgang Betz 130:770ce14d3d15 37 *****************************************************************************/
Wolfgang Betz 130:770ce14d3d15 38
Wolfgang Betz 130:770ce14d3d15 39 /**
Wolfgang Betz 130:770ce14d3d15 40 * This function copies size number of bytes from a
Wolfgang Betz 130:770ce14d3d15 41 * memory location pointed by src to a destination
Wolfgang Betz 130:770ce14d3d15 42 * memory location pointed by dest
Wolfgang Betz 130:770ce14d3d15 43 *
Wolfgang Betz 130:770ce14d3d15 44 * @param[in] dest Destination address
Wolfgang Betz 130:770ce14d3d15 45 * @param[in] src Source address
Wolfgang Betz 130:770ce14d3d15 46 * @param[in] size size in the bytes
Wolfgang Betz 130:770ce14d3d15 47 *
Wolfgang Betz 130:770ce14d3d15 48 * @return Address of the destination
Wolfgang Betz 130:770ce14d3d15 49 */
Wolfgang Betz 130:770ce14d3d15 50
Wolfgang Betz 130:770ce14d3d15 51 extern void* Osal_MemCpy(void *dest,const void *src, unsigned int size);
Wolfgang Betz 130:770ce14d3d15 52
Wolfgang Betz 130:770ce14d3d15 53
Wolfgang Betz 130:770ce14d3d15 54 /**
Wolfgang Betz 130:770ce14d3d15 55 * This function sets first number of bytes, specified
Wolfgang Betz 130:770ce14d3d15 56 * by size, to the destination memory pointed by ptr
Wolfgang Betz 130:770ce14d3d15 57 * to the specified value
Wolfgang Betz 130:770ce14d3d15 58 *
Wolfgang Betz 130:770ce14d3d15 59 * @param[in] ptr Destination address
Wolfgang Betz 130:770ce14d3d15 60 * @param[in] value Value to be set
Wolfgang Betz 130:770ce14d3d15 61 * @param[in] size Size in the bytes
Wolfgang Betz 130:770ce14d3d15 62 *
Wolfgang Betz 130:770ce14d3d15 63 * @return Address of the destination
Wolfgang Betz 130:770ce14d3d15 64 */
Wolfgang Betz 130:770ce14d3d15 65
Wolfgang Betz 130:770ce14d3d15 66 extern void* Osal_MemSet(void *ptr, int value, unsigned int size);
Wolfgang Betz 130:770ce14d3d15 67
Wolfgang Betz 130:770ce14d3d15 68 /**
Wolfgang Betz 130:770ce14d3d15 69 * Osal_Get_Cur_Time
Wolfgang Betz 130:770ce14d3d15 70 *
Wolfgang Betz 130:770ce14d3d15 71 * returns the current time in milliseconds
Wolfgang Betz 130:770ce14d3d15 72 */
Wolfgang Betz 130:770ce14d3d15 73 /**
Wolfgang Betz 130:770ce14d3d15 74 * Returns the number of ticks (1 tick = 1 millisecond)
Wolfgang Betz 130:770ce14d3d15 75 *
Wolfgang Betz 130:770ce14d3d15 76 * @return Time in milliseconds
Wolfgang Betz 130:770ce14d3d15 77 */
Wolfgang Betz 130:770ce14d3d15 78 uint32_t Osal_Get_Cur_Time(void);
Wolfgang Betz 130:770ce14d3d15 79
Wolfgang Betz 130:770ce14d3d15 80
Wolfgang Betz 130:770ce14d3d15 81 #endif /* __OSAL_H__ */