EDGEAI API
DAP_core.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2025, Texas Instruments Incorporated
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the distribution.
15  *
16  * * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 
33 #ifndef ti_edgeai_DAP_core__include
34 #define ti_edgeai_DAP_core__include
35 
36 #include <stdint.h>
37 #include <stdbool.h>
38 #include <string.h>
39 
40 #include <ti/ai/edge_ai/dap/DAP.h>
41 
42 #ifdef __cplusplus
43 extern "C" {
44 #endif
45 
46 #define DAP_MAX_FRAME_SIZE_BYTES (200)
47 
48 typedef struct
49 {
51  uint8_t buffer[DAP_MAX_FRAME_SIZE_BYTES];
52 
54  size_t length;
55 
57  uint8_t index;
58 } DAP_Frame;
59 
63 typedef enum
64 {
78 
85 typedef enum
86 {
109  // reserved1 = 0x0b,
121 
126 typedef enum
127 {
157 
162 typedef enum
163 {
195 
199 typedef enum
200 {
219 } DAP_DataTypes;
220 
224 typedef struct
225 {
226  const char *name;
228  union
229  {
230  uint8_t u8;
231  uint16_t u16;
232  uint32_t u32;
233  int8_t i8;
234  int16_t i16;
235  int32_t i32;
236  float f16;
237  float f32;
238  double f64;
239  } value;
240 } DAP_Property;
241 
242 typedef struct
243 {
244  const char *info;
246 } DAP_Inference;
247 
258 
269 void DAP_serviceCommand(DAP_Handle *dapHandle, DAP_Frame *commandFrame);
270 
285 void DAP_sendError(DAP_Handle *dapHandle, DAP_CommandType command, const char errorMessage[]);
286 
300 void DAP_receiveDataCommand(DAP_Handle *dapHandle, DAP_SendDataType sendDataType, void *data, size_t dataSize);
301 
302 #ifdef __cplusplus
303 }
304 #endif
305 #endif /* ti_edgeai_DAP_core__include */
Definition: DAP_core.h:204
Definition: DAP_core.h:113
Definition: DAP_core.h:139
Definition: DAP_core.h:68
Data Types for the inferences and properties.
Definition: DAP_core.h:224
uint16_t u16
Definition: DAP_core.h:231
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:126
Definition: DAP_core.h:133
DAP_DataTypes dataFormat
Definition: DAP_core.h:245
DAP configuration.
Definition: DAP.h:156
Definition: DAP_core.h:145
Definition: DAP_core.h:216
Definition: DAP_core.h:206
Definition: DAP_core.h:108
Definition: DAP_core.h:111
Definition: DAP_core.h:165
Definition: DAP_core.h:129
Definition: DAP_core.h:173
Definition: DAP_core.h:189
Definition: DAP_core.h:98
Definition: DAP_core.h:72
Definition: DAP_core.h:208
DAP_SendDataType
Definition: DAP.h:171
uint8_t index
Definition: DAP_core.h:57
Definition: DAP_core.h:115
DAP_CommandType
DAP command types.
Definition: DAP_core.h:85
Definition: DAP_core.h:70
Definition: DAP_core.h:193
Definition: DAP_core.h:153
Definition: DAP_core.h:141
DAP_ErrorType
DAP error types.
Definition: DAP_core.h:63
DAP_ErrorType DAP_verifyFrame(DAP_Frame *frame)
Verify a frame.
int8_t i8
Definition: DAP_core.h:233
Definition: DAP_core.h:175
DAP_ResponsePayloadFixedLength
Minimum payload length of commands sent from the target to the host.
Definition: DAP_core.h:162
Definition: DAP_core.h:90
Definition: DAP_core.h:92
Definition: DAP_core.h:191
float f32
Definition: DAP_core.h:237
const char * name
Definition: DAP_core.h:226
Definition: DAP_core.h:151
double f64
Definition: DAP_core.h:238
size_t length
Definition: DAP_core.h:54
int16_t i16
Definition: DAP_core.h:234
uint8_t u8
Definition: DAP_core.h:230
#define DAP_MAX_FRAME_SIZE_BYTES
Definition: DAP_core.h:46
Definition: DAP_core.h:242
Definition: DAP_core.h:96
Definition: DAP_core.h:171
Definition: DAP_core.h:106
Definition: DAP_core.h:187
Definition: DAP_core.h:218
Definition: DAP_core.h:137
PRELIMINARY DAP for EdgeAI
Definition: DAP_core.h:104
Definition: DAP_core.h:177
Definition: DAP_core.h:210
float f16
Definition: DAP_core.h:236
Definition: DAP_core.h:155
Definition: DAP_core.h:214
Definition: DAP_core.h:48
Definition: DAP_core.h:179
Definition: DAP_core.h:167
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:235
const char * info
Definition: DAP_core.h:244
Definition: DAP_core.h:149
Definition: DAP_core.h:131
Definition: DAP_core.h:74
DAP_DataTypes dataFormat
Definition: DAP_core.h:227
Definition: DAP_core.h:102
Definition: DAP_core.h:202
Definition: DAP_core.h:212
Definition: DAP_core.h:183
Definition: DAP_core.h:100
Definition: DAP_core.h:119
Definition: DAP_core.h:117
Definition: DAP_core.h:88
Definition: DAP_core.h:66
Definition: DAP_core.h:181
Definition: DAP_core.h:169
DAP_DataTypes
Data Types for the inferences and properties.
Definition: DAP_core.h:199
Definition: DAP_core.h:143
Definition: DAP_core.h:135
uint32_t u32
Definition: DAP_core.h:232
Definition: DAP_core.h:94
Definition: DAP_core.h:76
© Copyright 1995-2026, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale