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