my fork
inc/hal_types.h@4:987b201ec4b1, 2015-04-08 (annotated)
- Committer:
- filartrix
- Date:
- Wed Apr 08 14:17:20 2015 +0000
- Revision:
- 4:987b201ec4b1
first
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
filartrix | 4:987b201ec4b1 | 1 | /******************** (C) COPYRIGHT 2012 STMicroelectronics ******************** |
filartrix | 4:987b201ec4b1 | 2 | * File Name : hal_types.h |
filartrix | 4:987b201ec4b1 | 3 | * Author : AMS - HEA&RF BU |
filartrix | 4:987b201ec4b1 | 4 | * Version : V1.0.0 |
filartrix | 4:987b201ec4b1 | 5 | * Date : 19-July-2012 |
filartrix | 4:987b201ec4b1 | 6 | * Description : This header file defines the basic data types used by the |
filartrix | 4:987b201ec4b1 | 7 | * BLE stack. |
filartrix | 4:987b201ec4b1 | 8 | ******************************************************************************** |
filartrix | 4:987b201ec4b1 | 9 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS |
filartrix | 4:987b201ec4b1 | 10 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. |
filartrix | 4:987b201ec4b1 | 11 | * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, |
filartrix | 4:987b201ec4b1 | 12 | * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE |
filartrix | 4:987b201ec4b1 | 13 | * CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING |
filartrix | 4:987b201ec4b1 | 14 | * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. |
filartrix | 4:987b201ec4b1 | 15 | *******************************************************************************/ |
filartrix | 4:987b201ec4b1 | 16 | #ifndef __HAL_TYPES_H__ |
filartrix | 4:987b201ec4b1 | 17 | #define __HAL_TYPES_H__ |
filartrix | 4:987b201ec4b1 | 18 | |
filartrix | 4:987b201ec4b1 | 19 | #include <stdint.h> |
filartrix | 4:987b201ec4b1 | 20 | |
filartrix | 4:987b201ec4b1 | 21 | #ifndef NULL |
filartrix | 4:987b201ec4b1 | 22 | #define NULL ((void *)0) |
filartrix | 4:987b201ec4b1 | 23 | #endif |
filartrix | 4:987b201ec4b1 | 24 | |
filartrix | 4:987b201ec4b1 | 25 | #ifndef __LITTLE_ENDIAN |
filartrix | 4:987b201ec4b1 | 26 | #define __LITTLE_ENDIAN 0 |
filartrix | 4:987b201ec4b1 | 27 | #define __BIG_ENDIAN 1 |
filartrix | 4:987b201ec4b1 | 28 | #endif |
filartrix | 4:987b201ec4b1 | 29 | |
filartrix | 4:987b201ec4b1 | 30 | /* Byte order conversions */ |
filartrix | 4:987b201ec4b1 | 31 | #if __BYTE_ORDER == __LITTLE_ENDIAN |
filartrix | 4:987b201ec4b1 | 32 | #define htobs(d) (d) |
filartrix | 4:987b201ec4b1 | 33 | #define htobl(d) (d) |
filartrix | 4:987b201ec4b1 | 34 | #define btohs(d) (d) |
filartrix | 4:987b201ec4b1 | 35 | #define btohl(d) (d) |
filartrix | 4:987b201ec4b1 | 36 | #elif __BYTE_ORDER == __BIG_ENDIAN |
filartrix | 4:987b201ec4b1 | 37 | #define htobs(d) (d<<8|d>>8) |
filartrix | 4:987b201ec4b1 | 38 | #define htobl(d) (d<<24|((d<<8)&0x00ff0000)|((d>>8)&0x0000ff00)|((d>>24)&0x000000ff)) |
filartrix | 4:987b201ec4b1 | 39 | #define btohs(d) (d<<8|d>>8) |
filartrix | 4:987b201ec4b1 | 40 | #define btohl(d) (d<<24|((d<<8)&0x00ff0000)|((d>>8)&0x0000ff00)|((d>>24)&0x000000ff)) |
filartrix | 4:987b201ec4b1 | 41 | #else |
filartrix | 4:987b201ec4b1 | 42 | #error "Unknown byte order" |
filartrix | 4:987b201ec4b1 | 43 | #endif |
filartrix | 4:987b201ec4b1 | 44 | |
filartrix | 4:987b201ec4b1 | 45 | typedef uint8_t BOOL; |
filartrix | 4:987b201ec4b1 | 46 | |
filartrix | 4:987b201ec4b1 | 47 | #ifndef TRUE |
filartrix | 4:987b201ec4b1 | 48 | #define TRUE (1) |
filartrix | 4:987b201ec4b1 | 49 | #endif |
filartrix | 4:987b201ec4b1 | 50 | |
filartrix | 4:987b201ec4b1 | 51 | #ifndef FALSE |
filartrix | 4:987b201ec4b1 | 52 | #define FALSE (0) |
filartrix | 4:987b201ec4b1 | 53 | #endif |
filartrix | 4:987b201ec4b1 | 54 | |
filartrix | 4:987b201ec4b1 | 55 | |
filartrix | 4:987b201ec4b1 | 56 | |
filartrix | 4:987b201ec4b1 | 57 | #endif /* __HAL_TYPES_H__ */ |
filartrix | 4:987b201ec4b1 | 58 | |
filartrix | 4:987b201ec4b1 | 59 |