TI BLE5-Stack API Documentation  2.01.01.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 #else
40 #define HAL_ASSERT_CAUSE_OUT_OF_MEMORY 0x04
41 #endif
42 
43 /*********************************************************************
44 * EXTERNAL VARIABLES
45 */
46 
47 /*********************************************************************
48  * CONSTANTS
49  */
50 
51 // RTLS Task configuration
52 #define RTLS_CTRL_TASK_PRIORITY 2
53 #define RTLS_CTRL_TASK_STACK_SIZE 752
54 
55 #define RTLS_QUEUE_EVT UTIL_QUEUE_EVENT_ID
56 
57 #define RTLS_CTRL_ALL_EVENTS (RTLS_QUEUE_EVT)
58 
59 
60 #define RTLS_CMD_IDENTIFY 0x00
61 #define RTLS_CMD_RESERVED 0x01
62 #define RTLS_CMD_CONN_PARAMS 0x02
63 #define RTLS_CMD_CONNECT 0x03
64 #define RTLS_CMD_SCAN 0x04
65 #define RTLS_CMD_SCAN_STOP 0x05
66 #define RTLS_CMD_TOF_RESULT_DIST 0x06
67 #define RTLS_CMD_TOF_RESULT_STAT 0x07
68 #define RTLS_CMD_TOF_RESULT_RAW 0x08
69 #define RTLS_CMD_TOF_SET_SEC_SEED 0x09
70 #define RTLS_CMD_TOF_GET_SEC_SEED 0x10
71 #define RTLS_CMD_TOF_SET_PARAMS 0x11
72 #define RTLS_CMD_TOF_ENABLE 0x12
73 #define RTLS_CMD_AOA_SET_PARAMS 0x13
74 #define RTLS_CMD_AOA_ENABLE 0x14
75 #define RTLS_CMD_RESET_DEVICE 0x20
76 #define RTLS_CMD_TERMINATE_LINK 0x22
77 #define RTLS_CMD_AOA_RESULT_ANGLE 0x23
78 #define RTLS_CMD_AOA_RESULT_RAW 0x24
79 #define RTLS_CMD_AOA_RESULT_PAIR_ANGLES 0x25
80 #define RTLS_CMD_TOF_CALIBRATE 0x26
81 #define RTLS_CMD_CONN_INFO 0x27
82 #define RTLS_CMD_SET_RTLS_PARAM 0x28
83 #define RTLS_CMD_GET_RTLS_PARAM 0x29
84 #define RTLS_CMD_TOF_CALIB_NV_READ 0x30
85 #define RTLS_CMD_TOF_SWITCH_ROLE 0x31
86 #define RTLS_CMD_GET_ACTIVE_CONN_INFO 0x32
87 
88 // RTLS async event
89 #define RTLS_EVT_ASSERT 0x80
90 #define RTLS_EVT_ERROR 0x81
91 #define RTLS_EVT_DEBUG 0x82
92 #define RTLS_EVT_CONN_INFO 0x83
93 
94 // RTLS param types for RTLS_CMD_SET_RTLS_PARAM command
95 #define RTLS_PARAM_CONNECTION_INTERVAL 0x01
96 #define RTLS_PARAM_2 0x02
97 #define RTLS_PARAM_3 0x03
98 
99 /*********************************************************************
100  * MACROS
101  */
102 #ifdef USE_ICALL
103 #define RTLSUTIL_MALLOC(pAlloc, size) { \
105  pAlloc = ICall_malloc(size); \
106  }
107 #define RTLSUTIL_FREE(pMsg) { \
109  ICall_free(pMsg); \
110  pMsg = NULL; \
111  }
112 #else
113 #define RTLSUTIL_MALLOC(pAlloc, size) { \
115  volatile uint32_t keyHwi; \
116  volatile uint32_t keySwi; \
117  keyHwi = Hwi_disable(); \
118  keySwi = Swi_disable(); \
119  pAlloc = malloc(size); \
120  Swi_restore(keySwi); \
121  Hwi_restore(keyHwi); \
122  }
123 #define RTLSUTIL_FREE(pFree) { \
125  volatile uint32_t keyHwi; \
126  volatile uint32_t keySwi; \
127  keyHwi = Hwi_disable(); \
128  keySwi = Swi_disable(); \
129  free(pFree); \
130  pFree = NULL; \
131  Swi_restore(keySwi); \
132  Hwi_restore(keyHwi); \
133  }
134 #endif
135 /*********************************************************************
136  * TYPEDEFS
137  */
138 
139 /*********************************************************************
140  * API FUNCTIONS
141  */
142 
151 void* RTLSCtrl_malloc(uint32_t sz);
152 
153 /*********************************************************************
154 *********************************************************************/
155 
156 #ifdef __cplusplus
157 }
158 #endif
159 
160 #endif /* RTLS_CTRL_H_ */
161 
void * RTLSCtrl_malloc(uint32_t sz)
This function will allocate memory, if we were unable to allocate we will report to RTLS Host...
ICall layer interface.
© Copyright 1995-2019, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale