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