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