![]() |
![]() |
|
EDGEAI API
|
PRELIMINARY DAP for EdgeAI
PRELIMINARY DAP interface
WARNING These APIs are PRELIMINARY, and subject to change in the next few months.
To use the DAP, include this header file in the application as follows:
The Device Agent Protocol (DAP) is a serial communication protocol using packets that facilitates interaction between Edge AI Studio (the host) and TI Microcontrollers (the target devices). This protocol is specifically designed to support edge AI applications.
Communication follows a controller-responder model where the host initiates all transfers or commands, and the target device must acknowledge each command with a response. Depending on the command type, the target may send additional responses.
Application execution is controlled by the host through a variety of commands. The application can be configured to operate in one of four distinct pipeline modes, as specified in the DAP_PipelineMode enumeration.
Configuration details specific to each pipeline mode are maintained in the DAP_PipelineConfiguration structure. To retrieve this configuration information, the DAP_getPipelineConfiguration() function can be utilized.
Depending on the active operation mode, the host may request various types of data from the target device. The readiness for data streaming can be determined using the DAP_isReadyToStartStreaming function. When streaming is available, data transmission is performed via the DAP_sendData() function. The DAP_SendDataType enumeration defines the supported data types for transmission.
This protocol operates in duplex mode, enabling simultaneous transmission and reception of data packets. The implementation achieves this capability by separating functionality into dedicated RX (receiving) and TX (transmitting) tasks.
The RX task is in charge of receiving the packets, decoding them and constructing the response packet. The response packet is then posted in a message queue shared with the TX task.
The TX task is in charge of reading packets from the message queue and sending them over to the host through the transport layer.
The transport layer utilizes a serial communication protocol, with its backend implementation located in the ti/ai/edge_ai/dap/core/DAP_core.h file.
To use the DAP the application calls the following APIs:
This file contains data from the application, to be modified by the user.
#include <stdint.h>#include <stdbool.h>#include <ti/drivers/UART2.h>#include <ti/drivers/dpl/MessageQueueP.h>

Go to the source code of this file.
Data Structures | |
| struct | DAP_PipelineConfiguration |
| DAP pipeline configuration. More... | |
| struct | DAP_Handle |
| DAP configuration. More... | |
Enumerations | |
| enum | DAP_PipelineMode { DAP_PIPELINE_MODE_UNINITIALIZED = 0x00, DAP_PIPELINE_MODE_DATA_ACQUISITION = 0x01, DAP_PIPELINE_MODE_SENSOR_INFERENCING = 0x02, DAP_PIPELINE_MODE_HOST_INFERENCING = 0x03, DAP_PIPELINE_MODE_LOOPBACK = 0x04 } |
| DAP pipeline modes. More... | |
| enum | DAP_SendDataType { DAP_SEND_DATA_TYPE_SENSOR_SIGNAL = 0x01, DAP_SEND_DATA_TYPE_INFERENCING_SIGNAL = 0x03, DAP_SEND_DATA_TYPE_INFERENCING_RESULT = 0x04, DAP_SEND_DATA_TYPE_INFERENCING_VALUE = 0x05, DAP_SEND_DATA_TYPE_INFERENCING_LOG = 0x06 } |
Functions | |
| float | DAP_swapEndianness (float value) |
| Swap Endianess value to support the endianess format expected by EdgeAI Studio. More... | |
| void | DAP_init (void) |
| Initialize the DAP. More... | |
| void | DAP_open (void) |
| Open the DAP. More... | |
| DAP_PipelineConfiguration | DAP_getPipelineConfiguration (void) |
| Get Pipeline Configuration. More... | |
| uint32_t | DAP_getSamplesToSend (void) |
| Get samples to send. More... | |
| uint32_t | DAP_getSamplingFrequency (void) |
| Get samplign frequency. More... | |
| bool | DAP_isReadyToStartStreaming (void) |
| Check if the DAP is ready for data streaming. More... | |
| void | DAP_sendData (DAP_SendDataType sendDataType, void *data, size_t dataSize) |
| Send Data to host. More... | |
| enum DAP_PipelineMode |
DAP pipeline modes.
This enum defines the modes of operation for the application inferencing pipeline.
| enum DAP_SendDataType |
| float DAP_swapEndianness | ( | float | value | ) |
Swap Endianess value to support the endianess format expected by EdgeAI Studio.
| [in] | value | Scalar float value to be modified. |
| void DAP_init | ( | void | ) |
Initialize the DAP.
| void DAP_open | ( | void | ) |
Open the DAP.
Initialize the serial protocol, the message queue, and the RX and TX tasks.
| DAP_PipelineConfiguration DAP_getPipelineConfiguration | ( | void | ) |
Get Pipeline Configuration.
| uint32_t DAP_getSamplesToSend | ( | void | ) |
Get samples to send.
| uint32_t DAP_getSamplingFrequency | ( | void | ) |
Get samplign frequency.
| bool DAP_isReadyToStartStreaming | ( | void | ) |
Check if the DAP is ready for data streaming.
| void DAP_sendData | ( | DAP_SendDataType | sendDataType, |
| void * | data, | ||
| size_t | dataSize | ||
| ) |
Send Data to host.
| [in] | sendDataType | Type of the data sent |
| [in] | data | pointer to a buffer with the data |
| [in] | dataSize | size of the data buffer in bytes |