EDGEAI API
DAP_core.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2025-2026, Texas Instruments Incorporated
3  *
4  * All rights reserved not granted herein.
5  * Limited License.
6  *
7  * Texas Instruments Incorporated grants a world-wide, royalty-free,
8  * non-exclusive license under copyrights and patents it now or hereafter
9  * owns or controls to make, have made, use, import, offer to sell and sell
10  * ("Utilize") this software subject to the terms herein. With respect to the
11  * foregoing patent license, such license is granted solely to the extent that
12  * any such patent is necessary to Utilize the software alone. The patent
13  * license shall not apply to any combinations which include this software,
14  * other than combinations with devices manufactured by or for TI ("TI
15  * Devices"). No hardware patent is licensed hereunder.
16  *
17  * Redistributions must preserve existing copyright notices and reproduce
18  * this license (including the above copyright notice and the disclaimer and
19  * (if applicable) source code license limitations below) in the documentation
20  * and/or other materials provided with the distribution.
21  *
22  * Redistribution and use in binary form, without modification, are permitted
23  * provided that the following conditions are met:
24  *
25  * * No reverse engineering, decompilation, or disassembly of this software
26  * is permitted with respect to any software provided in binary form.
27  * * Any redistribution and use are licensed by TI for use only with TI Devices.
28  * * Nothing shall obligate TI to provide you with source code for the software
29  * licensed and provided to you in object code.
30  *
31  * If software source code is provided to you, modification and redistribution
32  * of the source code are permitted provided that the following conditions are
33  * met:
34  *
35  * * Any redistribution and use of the source code, including any resulting
36  * derivative works, are licensed by TI for use only with TI Devices.
37  * * Any redistribution and use of any object code compiled from the source
38  * code and any resulting derivative works, are licensed by TI for use
39  * only with TI Devices.
40  *
41  * Neither the name of Texas Instruments Incorporated nor the names of its
42  * suppliers may be used to endorse or promote products derived from this
43  * software without specific prior written permission.
44  *
45  * DISCLAIMER.
46  *
47  * THIS SOFTWARE IS PROVIDED BY TI AND TI'S LICENSORS "AS IS" AND ANY EXPRESS
48  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
49  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
50  * IN NO EVENT SHALL TI AND TI'S LICENSORS BE LIABLE FOR ANY DIRECT, INDIRECT,
51  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
52  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
53  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
54  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
55  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
56  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
57  */
58 
59 #ifndef ti_edgeai_DAP_core__include
60 #define ti_edgeai_DAP_core__include
61 
62 #include <stdint.h>
63 #include <stdbool.h>
64 #include <string.h>
65 
66 #include <ti/ai/edge_ai/dap/DAP.h>
67 
68 #ifdef __cplusplus
69 extern "C" {
70 #endif
71 
72 #define DAP_MAX_FRAME_SIZE_BYTES (1024)
73 
74 typedef struct
75 {
77  uint8_t buffer[DAP_MAX_FRAME_SIZE_BYTES];
78 
80  size_t length;
81 
83  uint16_t index;
84 } DAP_Frame;
85 
89 typedef enum
90 {
103 } DAP_ErrorType;
104 
111 typedef enum
112 {
135  // reserved1 = 0x0b,
147 
152 typedef enum
153 {
183 
188 typedef enum
189 {
221 
225 typedef enum
226 {
245 } DAP_DataTypes;
246 
250 typedef struct
251 {
252  const char *name;
254  union
255  {
256  uint8_t u8;
257  uint16_t u16;
258  uint32_t u32;
259  int8_t i8;
260  int16_t i16;
261  int32_t i32;
262  float f16;
263  float f32;
264  double f64;
265  } value;
266 } DAP_Property;
267 
268 typedef struct
269 {
270  const char *info;
272 } DAP_Inference;
273 
284 
295 void DAP_serviceCommand(DAP_Handle *dapHandle, DAP_Frame *commandFrame);
296 
311 void DAP_sendError(DAP_Handle *dapHandle, DAP_CommandType command, const char errorMessage[]);
312 
326 void DAP_receiveDataCommand(DAP_Handle *dapHandle, DAP_SendDataType sendDataType, void *data, size_t dataSize);
327 
328 #ifdef __cplusplus
329 }
330 #endif
331 #endif /* ti_edgeai_DAP_core__include */
Definition: DAP_core.h:230
Definition: DAP_core.h:139
Definition: DAP_core.h:165
Definition: DAP_core.h:94
Data Types for the inferences and properties.
Definition: DAP_core.h:250
uint16_t u16
Definition: DAP_core.h:257
void DAP_sendError(DAP_Handle *dapHandle, DAP_CommandType command, const char errorMessage[])
Send error to host.
DAP_CommandPayloadFixedLength
Minimum payload length of commands sent from the host to the target.
Definition: DAP_core.h:152
Definition: DAP_core.h:159
DAP_DataTypes dataFormat
Definition: DAP_core.h:271
DAP configuration.
Definition: DAP.h:182
Definition: DAP_core.h:171
Definition: DAP_core.h:242
Definition: DAP_core.h:232
Definition: DAP_core.h:134
Definition: DAP_core.h:137
Definition: DAP_core.h:191
Definition: DAP_core.h:155
Definition: DAP_core.h:199
Definition: DAP_core.h:215
Definition: DAP_core.h:124
Definition: DAP_core.h:98
Definition: DAP_core.h:234
DAP_SendDataType
Definition: DAP.h:197
Definition: DAP_core.h:141
DAP_CommandType
DAP command types.
Definition: DAP_core.h:111
Definition: DAP_core.h:96
Definition: DAP_core.h:219
Definition: DAP_core.h:179
Definition: DAP_core.h:167
DAP_ErrorType
DAP error types.
Definition: DAP_core.h:89
DAP_ErrorType DAP_verifyFrame(DAP_Frame *frame)
Verify a frame.
int8_t i8
Definition: DAP_core.h:259
Definition: DAP_core.h:201
DAP_ResponsePayloadFixedLength
Minimum payload length of commands sent from the target to the host.
Definition: DAP_core.h:188
Definition: DAP_core.h:116
Definition: DAP_core.h:118
Definition: DAP_core.h:217
float f32
Definition: DAP_core.h:263
const char * name
Definition: DAP_core.h:252
Definition: DAP_core.h:177
double f64
Definition: DAP_core.h:264
size_t length
Definition: DAP_core.h:80
int16_t i16
Definition: DAP_core.h:260
uint8_t u8
Definition: DAP_core.h:256
#define DAP_MAX_FRAME_SIZE_BYTES
Definition: DAP_core.h:72
Definition: DAP_core.h:268
Definition: DAP_core.h:122
Definition: DAP_core.h:197
Definition: DAP_core.h:132
Definition: DAP_core.h:213
Definition: DAP_core.h:244
Definition: DAP_core.h:163
PRELIMINARY DAP for EdgeAI
Definition: DAP_core.h:130
Definition: DAP_core.h:203
Definition: DAP_core.h:236
float f16
Definition: DAP_core.h:262
Definition: DAP_core.h:181
Definition: DAP_core.h:240
Definition: DAP_core.h:74
Definition: DAP_core.h:205
Definition: DAP_core.h:193
uint16_t index
Definition: DAP_core.h:83
void DAP_serviceCommand(DAP_Handle *dapHandle, DAP_Frame *commandFrame)
Service a command sent by the host.
void DAP_receiveDataCommand(DAP_Handle *dapHandle, DAP_SendDataType sendDataType, void *data, size_t dataSize)
Send data to host.
int32_t i32
Definition: DAP_core.h:261
const char * info
Definition: DAP_core.h:270
Definition: DAP_core.h:175
Definition: DAP_core.h:157
Definition: DAP_core.h:100
DAP_DataTypes dataFormat
Definition: DAP_core.h:253
Definition: DAP_core.h:128
Definition: DAP_core.h:228
Definition: DAP_core.h:238
Definition: DAP_core.h:209
Definition: DAP_core.h:126
Definition: DAP_core.h:145
Definition: DAP_core.h:143
Definition: DAP_core.h:114
Definition: DAP_core.h:92
Definition: DAP_core.h:207
Definition: DAP_core.h:195
DAP_DataTypes
Data Types for the inferences and properties.
Definition: DAP_core.h:225
Definition: DAP_core.h:169
Definition: DAP_core.h:161
uint32_t u32
Definition: DAP_core.h:258
Definition: DAP_core.h:120
Definition: DAP_core.h:102
© Copyright 1995-2026, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale