TI BLE5-Stack API Documentation  2.01.03.00
rtls_ctrl.h
Go to the documentation of this file.
1 /******************************************************************************
2 
3  @file rtls_ctrl.h
4 
5  @brief This file contains internal defines and macros used by rtls_ctrl.c
6 
7  Group: WCS, BTS
8  $Target Device: DEVICES $
9 
10  ******************************************************************************
11  $License: BSD3 2018 $
12  ******************************************************************************
13  $Release Name: PACKAGE NAME $
14  $Release Date: PACKAGE RELEASE DATE $
15  *****************************************************************************/
16 
26 #ifndef RTLS_CTRL_H_
27 #define RTLS_CTRL_H_
28 
29 #ifdef __cplusplus
30 extern "C"
31 {
32 #endif
33 
34 /*********************************************************************
35  * INCLUDES
36  */
37 #ifdef USE_ICALL
38 #include "icall.h"
39 #endif
40 
41 // for BLE_LOG
42 #include "bcomdef.h"
43 #ifdef RTLS_PASSIVE
44 #include "uble.h"
45 #else
46 #include "osal.h"
47 #endif
48 
49 /*********************************************************************
50 * EXTERNAL VARIABLES
51 */
52 
53 /*********************************************************************
54  * CONSTANTS
55  */
56 
57 // RTLS Task configuration
58 #define RTLS_CTRL_TASK_PRIORITY 2
59 #define RTLS_CTRL_TASK_STACK_SIZE 752
60 
61 #define RTLS_QUEUE_EVT UTIL_QUEUE_EVENT_ID
62 
63 #define RTLS_CTRL_ALL_EVENTS (RTLS_QUEUE_EVT)
64 
65 
66 #define RTLS_CMD_IDENTIFY 0x00
67 #define RTLS_CMD_RESERVED 0x01
68 #define RTLS_CMD_CONN_PARAMS 0x02
69 #define RTLS_CMD_CONNECT 0x03
70 #define RTLS_CMD_SCAN 0x04
71 #define RTLS_CMD_SCAN_STOP 0x05
72 #define RTLS_CMD_RESERVED1 0x06
73 #define RTLS_CMD_RESERVED2 0x07
74 #define RTLS_CMD_RESERVED3 0x08
75 #define RTLS_CMD_RESERVED4 0x09
76 #define RTLS_CMD_RESERVED5 0x10
77 #define RTLS_CMD_RESERVED6 0x11
78 #define RTLS_CMD_RESERVED7 0x12
79 #define RTLS_CMD_AOA_SET_PARAMS 0x13
80 #define RTLS_CMD_AOA_ENABLE 0x14
81 #define RTLS_CMD_RESET_DEVICE 0x20
82 #define RTLS_CMD_TERMINATE_LINK 0x22
83 #define RTLS_CMD_AOA_RESULT_ANGLE 0x23
84 #define RTLS_CMD_AOA_RESULT_RAW 0x24
85 #define RTLS_CMD_AOA_RESULT_PAIR_ANGLES 0x25
86 #define RTLS_CMD_RESERVED8 0x26
87 #define RTLS_CMD_CONN_INFO 0x27
88 #define RTLS_CMD_SET_RTLS_PARAM 0x28
89 #define RTLS_CMD_GET_RTLS_PARAM 0x29
90 #define RTLS_CMD_RESERVED9 0x30
91 #define RTLS_CMD_RESERVED10 0x31
92 #define RTLS_CMD_GET_ACTIVE_CONN_INFO 0x32
93 
94 #define RTLS_CMD_BLE_LOG_STRINGS_MAX 0x32
95 extern char *rtlsCmd_BleLogStrings[];
96 
97 // RTLS async event
98 #define RTLS_EVT_ASSERT 0x80
99 #define RTLS_EVT_ERROR 0x81
100 #define RTLS_EVT_DEBUG 0x82
101 #define RTLS_EVT_CONN_INFO 0x83
102 
103 // RTLS param types for RTLS_CMD_SET_RTLS_PARAM command
104 #define RTLS_PARAM_CONNECTION_INTERVAL 0x01
105 #define RTLS_PARAM_2 0x02
106 #define RTLS_PARAM_3 0x03
107 
108 /*********************************************************************
109  * MACROS
110  */
111 #ifdef USE_ICALL
112 #define RTLSUTIL_MALLOC(pAlloc, size) { \
114  pAlloc = ICall_malloc(size); \
115  }
116 #define RTLSUTIL_FREE(pMsg) { \
118  ICall_free(pMsg); \
119  pMsg = NULL; \
120  }
121 #else
122 #define RTLSUTIL_MALLOC(pAlloc, size) { \
124  volatile uint32_t keyHwi; \
125  volatile uint32_t keySwi; \
126  keyHwi = Hwi_disable(); \
127  keySwi = Swi_disable(); \
128  pAlloc = malloc(size); \
129  Swi_restore(keySwi); \
130  Hwi_restore(keyHwi); \
131  }
132 #define RTLSUTIL_FREE(pFree) { \
134  volatile uint32_t keyHwi; \
135  volatile uint32_t keySwi; \
136  keyHwi = Hwi_disable(); \
137  keySwi = Swi_disable(); \
138  free(pFree); \
139  pFree = NULL; \
140  Swi_restore(keySwi); \
141  Hwi_restore(keyHwi); \
142  }
143 #endif
144 /*********************************************************************
145  * TYPEDEFS
146  */
147 
148 /*********************************************************************
149  * API FUNCTIONS
150  */
151 
160 void* RTLSCtrl_malloc(uint32_t sz);
161 
162 /*********************************************************************
163 *********************************************************************/
164 
165 #ifdef __cplusplus
166 }
167 #endif
168 
169 #endif /* RTLS_CTRL_H_ */
170 
This API allows the software components in the Z-Stack to be written independently of the specifics o...
This file contains configuration, initialization, and parameter management of Micro BLE Stack...
void * RTLSCtrl_malloc(uint32_t sz)
This function will allocate memory, if we were unable to allocate we will report to RTLS Host...
Type definitions and macros for BLE stack.
ICall layer interface.
© Copyright 1995-2020, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale