| BlueNRG-1 HAL drivers APIs

- Main Page
- Classes
- Files

- File List
- File Members

hal_types.h
Go to the documentation of this file.
1
21 #ifndef __HAL_TYPES_H__
22 #define __HAL_TYPES_H__
23
24 #include <stdint.h>
25
27 #define TRUE 1
28 #define FALSE 0
29
31 typedef enum {RESET = 0, SET} FlagStatus, ITStatus;
33 #define IS_FLAGSTATUS(STATE) (((STATE) == RESET) || ((STATE) == SET))
34 #define IS_ITSTATUS(STATE) IS_FLAGSTATUS(STATE)
35
37 typedef enum {DISABLE = 0, ENABLE} FunctionalState;
39 #define IS_FUNCTIONAL_STATE(STATE) (((STATE) == DISABLE) || ((STATE) == ENABLE))
40
41 typedef enum {SUCCESS = 0, ERROR} ErrorStatus;
43 #define IS_ERROR_STATE(STATE) (((STATE) == SUCCESS) || ((STATE) == ERROR))
44
45
47 #define HOST_TO_LE_16(buf, val) ( ((buf)[0] = (uint8_t) (val) ) , \
48 ((buf)[1] = (uint8_t) (val>>8) ) )
49
51 #define LE_TO_HOST_32(ptr) (uint32_t) ( ((uint32_t) \
52 *((uint8_t *)ptr)) | \
53 ((uint32_t) \
54 *((uint8_t *)ptr + 1) << 8) | \
55 ((uint32_t) \
56 *((uint8_t *)ptr + 2) << 16) | \
57 ((uint32_t) \
58 *((uint8_t *)ptr + 3) << 24) )
59
61 #define HOST_TO_LE_32(buf, val) ( ((buf)[0] = (uint8_t) (val) ) , \
62 ((buf)[1] = (uint8_t) (val>>8) ) , \
63 ((buf)[2] = (uint8_t) (val>>16) ) , \
64 ((buf)[3] = (uint8_t) (val>>24) ) )
65
67 typedef uint8_t BOOL;
68
69
70 #endif /* __HAL_TYPES_H__ */
ITStatus
enum FlagStatus ITStatus
ENABLE
Definition: hal_types.h:37
RESET
Definition: hal_types.h:31
FlagStatus
FlagStatus
RESET,SET definition.
Definition: hal_types.h:31
ErrorStatus
ErrorStatus
Definition: hal_types.h:41
SUCCESS
Definition: hal_types.h:41
FunctionalState
FunctionalState
DISABLE, ENABLE definition.
Definition: hal_types.h:37
ERROR
Definition: hal_types.h:41
BOOL
uint8_t BOOL
Booelan definition.
Definition: hal_types.h:67
SET
Definition: hal_types.h:31
DISABLE
Definition: hal_types.h:37