DGILib USER GUIDE Atmel-42771A-DGILib_User Guide-09/2016

Similar documents
AVR42789: Writing to Flash on the New tinyavr Platform Using Assembly

AT60142H/HT. Rad-Hard 512Kx8 Very Low Power CMOS SRAM ERRATA-SHEET. Active Errata List. Errata History. Abbreviations. 1.

AT03975: Getting Started with SAM L21. Descripton. Features. SMART ARM-Based Microcontroller APPLICATION NOTE

EDBG. Description. Programmers and Debuggers USER GUIDE

APPLICATION NOTE. AT6486: Using DIVAS on SAMC Microcontroller. SMART ARM-Based Microcontroller. Introduction. Features

AT09381: SAM D - Debugging Watchdog Timer Reset. Introduction. SMART ARM-based Microcontrollers APPLICATION NOTE

AT11512: SAM L Brown Out Detector (BOD) Driver. Introduction. SMART ARM-based Microcontrollers APPLICATION NOTE

AT03262: SAM D/R/L/C System Pin Multiplexer (SYSTEM PINMUX) Driver. Introduction. SMART ARM-based Microcontrollers APPLICATION NOTE

This user guide describes how to run the Atmel ATWINC3400 Bluetooth Low Energy (BLE) Provisioning demo from out-of-box conditions.

AT06467: Getting started with SAM D09/D10/D11. Features. Description. SMART ARM-based Microcontrollers APPLICATION NOTE

APPLICATION NOTE. Generating Random Secrets. ATSHA204A, ATECC108A, and ATECC508A. Description. Topics

ATECC508A Public Key Validation. Introduction. Atmel CryptoAuthentication APPLICATION NOTE

ATAES132A Firmware Development Library. Introduction. Features. Atmel CryptoAuthentication USER GUIDE

AT21CS Series Reset and Discovery. Introduction. Serial EEPROM APPLICATION NOTE

APPLICATION NOTE. 3-lead CONTACT Package Usage. ATSHA204A, ATECC108A, and ATECC508A. Introduction. 3-lead CONTACT Package

AVR134: Real Time Clock (RTC) Using the Asynchronous Timer. Features. Introduction. AVR 8-bit Microcontrollers APPLICATION NOTE

AT10942: SAM Configurable Custom Logic (CCL) Driver. Introduction. SMART ARM-based Microcontrollers APPLICATION NOTE

APPLICATION NOTE. AT05567: TC Capture on External Interrupt with the Event System on SAM D20. Preface ASF PROJECT DOCUMENTATION

USER GUIDE EDBG. Description

AVR42772: Data Logger Demo Application on XMEGA A1U Xplained Pro. Introduction. Features. AVR XMEGA Microcontrollers APPLICATION NOTE

ATECC108/ATSHA204 USER GUIDE. Atmel Firmware Library. Features. Introduction

Smart RF Device Family - Getting Started Guide. Features. Description. References ATAN0115 APPLICATION NOTE

QT3 Xplained Pro. Preface. Atmel QTouch USER GUIDE

APPLICATION NOTE. CryptoAuthentication Personalization Guide. ATSHA204A and ATECC508A. Introduction. Features

APPLICATION NOTE. AT11008: Migration from ATxmega16D4/32D4 Revision E to Revision I. Atmel AVR XMEGA. Introduction. Features

Native route discovery algorithm

SAM4 Reset Controller (RSTC)

ATtiny817 QTouch Moisture Demo User Guide. Description. Features. AVR 8-bit Microcontrollers USER GUIDE

APPLICATION NOTE. AT04470: Differences between SAM D21 Variants A, B, and L. 32-bit Microcontroller. Introduction

Ethernet1 Xplained Pro

USER GUIDE. Atmel QT6 Xplained Pro. Preface

SAMA5D2 Quad SPI (QSPI) Performance. Introduction. SMART ARM-based Microprocessor APPLICATION NOTE

AT88CK101 HARDWARE USER GUIDE. Atmel CryptoAuthentication Development Kit. Atmel CryptoAuthentication AT88CK101 Daughterboard

QT2 Xplained Pro. Preface. Atmel QTouch USER GUIDE

ATtiny104 Xplained Nano. Preface. AVR 8-bit Microcontrollers USER GUIDE

APPLICATION NOTE. Atmel QT4 Xplained Pro User Guide ATAN0114. Preface

APPLICATION NOTE. How to Securely Switch Atmel s LIN Transceiver ATA6662/ATA6662C to Sleep Mode ATA6662/ATA6662C. Concerning Atmel ATA6662

USER GUIDE. ATWINC1500 Xplained Pro. Preface

APPLICATION NOTE. Scope. Reference Documents. Software Ethernet Bridge on SAMA5D3/D4. Atmel SMART SAMA5D3/D4 Series

Hardware Prerequisites Atmel Xplained Pro Evaluation Kit Atmel WINC1500 extension USB Micro Cable (TypeA / MicroB)

APPLICATION NOTE. Atmel AT03261: SAM D20 System Interrupt Driver (SYSTEM INTERRUPT) SAM D20 System Interrupt Driver (SYSTEM INTERRUPT)

AT07942: SAM4L Asynchronous Timer (AST) Driver. Introduction. SMART ARM-based Microcontrollers APPLICATION NOTE

USER GUIDE. Atmel Segment LCD1 Xplained Pro. Preface

Atmel AVR1619: XMEGA-B1 Xplained Demonstration. 8-bit Atmel Microcontrollers. Application Note. Features. 1 Introduction

USER GUIDE. ZigBit USB Stick User Guide. Introduction

SMART ARM-based Microcontrollers ATSAMD21E16LMOTOR USER GUIDE

APPLICATION NOTE. Atmel AT03304: SAM D20 I 2 C Slave Bootloader SAM D20. Description. Features

APPLICATION NOTE. AT03324: Atmel REB212BSMA-EK Quick Start Guide. Atmel MCU Wireless. Introduction

APPLICATION NOTE. Atmel AVR3009: Driving QTouch Device with I 2 C Interface. Atmel QTouch. Introduction

APPLICATION NOTE. Atmel AT03160: Migrating Bootloader from ATxmega128A1 to other Atmel XMEGA Devices. Atmel AVR XMEGA. Features.

APPLICATION NOTE. Atmel AT02260: Driving AT42QT1085. Atmel QTouch. Features. Description

Atmel LF-RFID Kit Comparison Chart. Application Note. Atmel LF-RFID Kit Comparison Chart. 1. Description

AVR1315: Accessing the XMEGA EEPROM. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

APPLICATION NOTE. Atmel AVR1638: XMEGA RTC Calibration. 8-bit Atmel Microcontrollers. Features. Introduction

OLED display with pixels resolution Ambient light sensor CPU load Analog filter Quadrature Encoder with push button Digital I/O

64K (8K x 8) Battery-Voltage Parallel EEPROM with Page Write and Software Data Protection AT28BV64B

USER GUIDE. Atmel QT1 Xplained Pro. Preface

AT88RF04C. CryptoRF EEPROM Memory 13.56MHz, 4 Kilobits SUMMARY DATASHEET. Features

USER GUIDE. Atmel OLED1 Xplained Pro. Preface

AT03664: Getting Started with FreeRTOS on SAM D20/D21/R21/L21/L22. Introduction. Features. SMART ARM-based Microcontrollers APPLICATION NOTE

Atmel QT600 Quick Start Guide Touch Solutions

AT88SC3216CRF. CryptoRF EEPROM Memory 13.56MHz, 32 Kilobits SUMMARY DATASHEET. Features

USER GUIDE. Atmel maxtouch Xplained Pro. Preface

APPLICATION NOTE. Atmel AT01080: XMEGA E Schematic Checklist. Atmel AVR XMEGA E. Features. Introduction

RELEASE NOTES. GNU Toolchain for Atmel ARM Embedded Processors. Introduction

USER GUIDE. Wireless Production Test Reference Protocol Specification Document. Atmel MCU Wireless. Description

I/O1 Xplained Pro. Preface. Atmel MCUs USER GUIDE

APPLICATION NOTE. Atmel AVR536: Migration from ATmega644 to ATmega644A. 8-bit Atmel Microcontrollers. Introduction

APPLICATION NOTE. Atmel AVR057: Internal RC Oscillator Calibration for ATtiny4/5/9/10/20/40. 8-bit Atmel Microcontrollers. Features.

Application Note Using the ATV750, ATV750B, and ATF750C Erasable Programmable Logic Device Introduction 1.1 Device Names and Pin/Node Assignments

AVR1518: XMEGA-A1 Xplained Training - XMEGA Clock System. 8-bit Atmel Microcontrollers. Application Note. Prerequisites.

MySonicWall Secure Upgrade Plus

APPLICATION NOTE. Atmel AVR116: Wear Leveling on DataFlash. 32-bit Atmel Microcontrollers. Features. Description. Wear leveling

ATZB-SAMR21-XPRO. Preface. SmartConnect USER GUIDE

USER GUIDE. AT08578: SAM D20 QTouch Robustness Demo. Atmel QTouch. Description. Features

APPLICATION NOTE. AT07216: SAM G55 Schematic Checklist. Atmel SMART SAM G55. Introduction

AT697E. Application Note. Checking AT697E Code for Occurrence of LDF/FPOPd Instructions Sequence with a dependency on an Odd-Numbered Register

Atmel AT697F. Rad-Hard 32-bit SPARC v8 Processor ERRATA SHEET. Active Errata List

Atmel and the use of Verilator to create uc Device Models

AVR4018: Inertial Two (ATAVRSBIN2) Hardware User's Guide. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

AVR1503: Xplain training - XMEGA Programmable Multi Interrupt Controller 8-bit Microcontrollers Application Note Prerequisites

Atmel AVR32847: Migration from/to the UC3L0 64/32/16 from/to the UC3L0 256/ bit Atmel Microcontrollers. Application Note.

AVR1303: Use and configuration of IR communication module. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

AVR32752: Using the AVR32 UC3 Static Memory Controller. 32-bit Microcontrollers. Application Note. Features. 1 Introduction

One Identity Quick Connect Express

a clock signal and a bi-directional data signal (SCL, SDA)

SAM4L Asynchronous Timer (AST)

APPLICATION NOTE. AT06863: SAM4L Peripheral Event Controller (PEVC) SAM4L Peripheral Event Controller (PEVC) ASF PROGRAMMERS MANUAL

APPLICATION NOTE. Atmel AT03782: Using Low Power Modes in SAM4N Microcontroller. Atmel 32-bit Microcontroller. Features.

AVR1922: Xplain Board Controller Firmware 8-bit Microcontrollers Application Note Features 1 Introduction

Section 5 SERCOM. Tasks SPI. In this section you will learn:

SonicWall Mobile Connect for Chrome OS

Atmel ATtiny1634 MCU Atmel ATA SBC LIN transceiver with integrated voltage regulator Touch. Three Atmel QTouch buttons One Atmel QTouch slider

SonicWall Secure Mobile Access

SAM4L Liquid Crystal Display (LCDCA)

LBAT90USB162 Atmel. LBAT90USB162 Development Board User s Manual

AVR532: Migration from ATmega48/88/168 to ATmega48A/88A/168A. 8-bit Microcontrollers. Application Note. 1 Introduction

AVR1501: Xplain training XMEGA Timer/Counter 8-bit Microcontrollers Application Note Prerequisites 1 Introduction

SBAT90USB162 Atmel. SBAT90USB162 Development Board User s Manual

AT02667: XMEGA-E5 Xplained Hardware User's Guide. Features. Description. AVR XMEGA Microcontrollers APPLICATION NOTE

Transcription:

DGILib USER GUIDE

Table of Contents 1. Description...3 2. API...4 2.1. Discovery...4 2.1.1. initialize_status_change_notification... 4 2.1.2. uninitialize_status_change_notification... 4 2.1.3. register_for_device_status_change_notifications...4 2.1.4. unregister_for_device_status_change_notifications...5 2.1.5. discover... 5 2.1.6. get_device_count...5 2.1.7. get_device_name... 5 2.1.8. get_device_serial...5 2.1.9. is_msd_mode... 6 2.1.10. set_mode... 6 2.2. Housekeeping...6 2.2.1. connect... 6 2.2.2. disconnect...6 2.2.3. connection_status...7 2.2.4. get_major_version... 7 2.2.5. get_minor_version... 7 2.2.6. get_build_number... 7 2.2.7. get_fw_version...7 2.2.8. start_polling... 8 2.2.9. stop_polling...8 2.2.10. target_reset...8 2.3. Interface Communication...8 2.3.1. interface_list...8 2.3.2. interface_enable... 9 2.3.3. interface_disable...9 2.3.4. interface_get_configuration... 9 2.3.5. interface_set_configuration...10 2.3.6. interface_clear_buffer... 10 2.3.7. interface_read_data...10 2.3.8. interface_write_data...11 2.4. Auxiliary... 11 2.4.1. Power...11 3. Revision History...16 2

1. Description DGILib is a Dynamic-Link Library (DLL) to help software applications communicate with Data Gateway Interface (DGI) devices. See the Data Gateway Interface user guide for further details. DGILib handles the low-level USB communication and adds a level of buffering for minimizing the chance of overflows. The library helps parse data streams of high complexity. The timestamp interface is parsed and split into separate buffers for each data source. The power interface is optionally parsed and calibrated using an auxiliary API. 3

2. API The API functions are separated into four groups: Discovery Housekeeping Interface Communication Auxiliary Used to discover available devices and get information about them. Provides version information, connection, and session control. Handles communication with the various interfaces of DGI. Extended functionality with interface-specifc usage. 2.1. Discovery 2.1.1. initialize_status_change_notification Initializes the system necessary for using the status change notification callback mechanisms. A handle will be created to keep track of the registered callbacks. This function must always be called before registering and unregistering notification callbacks. void initialize_status_change_notification(uint32_t* handlep) handlep Pointer to a variable that will hold the handle 2.1.2. uninitialize_status_change_notification Uninitializes the status change notification callback mechanisms. This function must be called when shutting down to clean up memory allocations. void uninitialize_status_change_notification(uint32_t handle) handle Handle to uninitialize 2.1.3. register_for_device_status_change_notifications Registers provided function pointer with the device status change mechanism. Whenever there is a change (device connected or disconnected) the callback will be executed. Note that it is not allowed to connect to a device in the context of the callback function. The callback function has the following definition: typedef void (*DeviceStatusChangedCallBack)(char* device_name, char* device_serial, BOOL connected) void register_for_device_status_change_notifications(uint32_t handle, DeviceStatusChangedCallBack devicestatuschangedcallback) handle devicestatuschangedcallback Handle to change notification mechanisms Function pointer that will be called when the devices change 4

2.1.4. unregister_for_device_status_change_notifications Unregisters previously registered function pointer from the device status change mechanism. void unregister_for_device_status_change_notifications(uint32_t handle, DeviceStatusChangedCallBack devicestatuschangedcallback) handle devicestatuschangedcallback Handle to change notification mechanisms Function pointer that will be removed 2.1.5. discover Triggers a scan to find available devices in the system. The result will be immediately available through the get_device_count, get_device_name and get_device_serial functions. void discover(void) 2.1.6. get_device_count Returns the number of devices detected. int get_device_count(void) 2.1.7. get_device_name Gets the name of a detected device. int get_device_name(int index, char* name) index Index of device ranges from 0 to get_device_count - 1 name Pointer to buffer where name of device can be stored. 100 or more bytes must be allocated 2.1.8. get_device_serial Gets the serial number of a detected device. int get_device_serial(int index, char* sn) index Index of device ranges from 0 to get_device_count - 1 5

sn Pointer to buffer where the serial number of the device can be stored. 100 or more bytes must be allocated. This is used when connecting to a device. 2.1.9. is_msd_mode EDBG devices can be set to a mass storage mode where the DGI is unavailable. In such cases the device is still detected by DGILib, but it won't be possible to directly connect to it. This command is used to check if the device is in such a mode. A non-zero return value indicates that the mode must be changed by set_mode before proceeding. int is_msd_mode(char* sn) sn Serial number of the device to check 2.1.10. set_mode This function is used to temporarily set the EDBG to a specified mode. int set_mode(char* sn, int nmbed) sn nmbed Serial number of the device to set 0 - Set to mbed mode. 1 - Set to DGI mode. 2.2. Housekeeping 2.2.1. connect Opens a connection to the specified device. This function must be called prior to any function requiring the connection handle. int connect(char* sn, uint32_t* _p) sn _p Buffer holding the serial number of the device to open a connection to Pointer to a variable that will hold the handle of the connection 2.2.2. disconnect Closes the specified connection. 6

int disconnect(uint32_t ) Handle of the connection 2.2.3. connection_status Verifies that the specified connection is still open. int connection_status(uint32_t* ) Handle of the connection 2.2.4. get_major_version int get_major_version(void) 2.2.5. get_minor_version int get_minor_version(void) 2.2.6. get_build_number Returns the build number of DGILib. If not supported, returns 0. int get_build_number(void) 2.2.7. get_fw_version Gets the firmware version of the DGI device connected. Note that this is the version of the DGI device, and not the tool. int get_fw_version(uint32_t, unsigned char* major, unsigned char* minor) Handle of the connection 7

major minor Pointer to a variable where the major version will be stored Pointer to a variable where the minor version will be stored 2.2.8. start_polling This function will start the polling system and start acquisition on enabled interfaces. It is possible to enable/disable interfaces both before and after the polling has been started. However, no data will be transferred until the polling is started. int start_polling(uint32_t ) Handle of the connection 2.2.9. stop_polling This function will stop the polling system and stop acquisition on all interfaces. int stop_polling(uint32_t ) Handle of the connection 2.2.10. target_reset This function is used to control the state of the reset line connected to the target, if available. int target_reset(uint32_t, bool hold_reset) hold_reset Handle of the connection True will assert reset, false will release it 2.3. Interface Communication 2.3.1. interface_list Queries the connected DGI device for available interfaces. Refer to the DGI documentation to resolve the ID. int interface_list(uint32_t, unsigned char* interfaces, unsigned char* count) 8

interfaces Buffer to hold the ID of the available interfaces. Should be able to hold minimum 10 elements, but a larger count should be used to be future proof. count Pointer to a variable that will be set to the number of interfaces registered in buffer. 2.3.2. interface_enable Enables the specified interface. Note that no data acquisition will begin until a session has been started. int interface_enable(uint32_t, int interface_id, bool timestamp) interface_id The ID of the interface to enable timestamp Setting this to true will make the interface use timestamping. Consult the DGI documentation for details on the timestamping option. 2.3.3. interface_disable Disables the specified interface. int interface_disable(uint32_t, int interface_id) interface_id The ID of the interface to enable 2.3.4. interface_get_configuration Gets the configuration associated with the specified interface. Consult the DGI documentation for details. int interface_get_configuration(uint32_t, int interface_id, unsigned int* config_id, unsigned int* config_value, unsigned int* config_cnt) interface_id config_id config_value The ID of the interface Buffer that will hold the ID field for the configuration item Buffer that will hold the value field for the configuration item 9

config_cnt Pointer to variable that will hold the count of stored configuration items 2.3.5. interface_set_configuration Sets the given configuration fields for the specified interface. Consult the DGI documentation for details. int interface_set_configuration(uint32_t, int interface_id, unsigned int* config_id, unsigned int* config_value, unsigned int config_cnt) interface_id config_id config_value config_cnt The ID of the interface Buffer that holds the ID field for the configuration items to set Buffer that holds the value field for the configuration items to set Number of items to set 2.3.6. interface_clear_buffer Clears the data in the buffers for the specified interface. int interface_clear_buffer(uint32_t, int interface_id) interface_id The ID of the interface 2.3.7. interface_read_data Reads the data received on the specified interface. This should be called regularly to avoid overflows in the system. DGILib can buffer 10Msamples. int interface_read_data(uint32_t, int interface_id, unsigned char* buffer, unsigned long long* timestamp, int* length, unsigned int* ovf_index, unsigned int* ovf_length, unsigned int* ovf_entry_count) interface_id buffer timestamp The ID of the interface Buffer that will hold the received data. The buffer must have allocated 10M elements. If timestamp is enabled for the interface, the buffer that will hold the received data. The buffer must have allocated 10M elements. Otherwise send 0. 10

length Pointer to a variable that will hold the count of elements received ovf_index Reserved. Set to 0. ovf_length Reserved. Set to 0. ovf_entry_count Reserved. Set to 0. Could be set to a pointer to a variable that can be used as an indicator of overflows. Overflow would be indicated by non-zero value. 2.3.8. interface_write_data Writes data to the specified interface. A maximum of 255 elements can be written each time. An error return code will be given if data hasn't been written yet. An error will be returned if the interface is still in the process of writing data. Wait a while and try again. The function get_connection_status can be used to verify if there is an error condition. int interface_write_data(uint32_t, int interface_id, unsigned char* buffer, int* length) interface_id buffer length The ID of the interface Buffer that will hold the received data. The buffer must have allocated 10M elements. Pointer to a variable that will hold the count of elements received 2.4. Auxiliary 2.4.1. Power The power interface (as found on some EDBG kits and Power Debugger) uses a protocol stream and calibration scheme that can be tricky to get right. The data rates are also relatively high and the calibration procedure could cause issues if not handled efficiently. Therefore some auxiliary functions to help with this have been made to perform parsing and calibration. 2.4.1.1. auxiliary_power_initialize Initializes the power parser. int auxiliary_power_initialize(uint32_t* _p, uint32_t ) _p Pointer to variable that will hold the handle to the power parser 2.4.1.2. auxiliary_power_uninitialize Uninitializes the power parser. 11

int auxiliary_power_uninitialize(uint32_t ) 2.4.1.3. auxiliary_power_register_buffer_pointers Registers a set of pointers to be used for storing the calibrated power data. The buffers can then be locked by auxiliary_power_lock_data_for_reading, and the data directly read from the specified buffers. Zero-pointers can be specified to get the buffers allocated within DGILib. This requires the data to be fetched using auxiliary_power_copy_data. int auxiliary_power_register_buffer_pointers(uint32_t, float* buffer, double* timestamp, size_t* count, size_t max_count, int channel, int type) buffer timestamp count max_count channel Buffer that will hold the samples. Set to 0 for automatically allocated. Buffer that will hold the timestamp for the samples. Set to 0 for automatically allocated. Pointer to a variable that will hold the count of samples. Set to 0 for automatically allocated. Number of samples that can fit into the specified buffers. Or size of automatically allocated buffers. Power channel for this buffer: A = 0, B = 1 (Power Debugger specific) type Type of power data: Current = 0, Voltage = 1, Range = 2 2.4.1.4. auxiliary_power_unregister_buffer_pointers Unregisters the pointers for the specified power channel. int auxiliary_power_unregister_buffer_pointers(uint32_t, int channel, int type) channel Power channel for this buffer: A = 0, B = 1 (Power Debugger specific) type Type of power data: Current = 0, Voltage = 1, Range = 2 2.4.1.5. auxiliary_power_calibration_is_valid Checks the status of the stored calibration. Returns true if the calibration is valid, false otherwise. Unity gain and offset will be used. bool auxiliary_power_calibration_is_valid(uint32_t ) 12

2.4.1.6. auxiliary_power_trigger_calibration Triggers a calibration of the specified type. This can take some time, so use auxiliary_power_get_status to check for completion. int auxiliary_power_trigger_calibration(uint32_t, int type) type Type of calibration to trigger. See the DGI documentation for details. 2.4.1.7. auxiliary_power_get_calibration Gets the raw calibration read from the tool. int auxiliary_power_get_calibration(uint32_t, uint8_t* data, size_t length) data length Buffer that will hold the read raw calibration data Number of raw calibration bytes to fetch. See the DGI documentation for number of bytes. 2.4.1.8. auxiliary_power_get_circuit_type Gets the type of power circuit. int auxiliary_power_get_circuit_type(uint32_t, int* circuit) circuit Pointer to a variable that will hold the circuit type: OLD_XAM = 0x00, XAM = 0x10, PAM = 0x11, UNKNOWN = 0xFF 2.4.1.9. auxiliary_power_get_status Gets the status of the power parser. Return codes IDLE = 0x00 RUNNING = 0x01 DONE = 0x02 13

CALIBRATING = 0x03 INIT_FAILED = 0x10 OVERFLOWED = 0x11 USB_DISCONNECTED = 0x12 CALIBRATION_FAILED = 0x20 int auxiliary_power_get_status(uint32_t ) 2.4.1.10. auxiliary_power_start Starts parsing of power data. The power and power sync interfaces are enabled automatically, but note that it is necessary to start the polling separately. This only starts the parser that consumes data from the DGILib buffer. int auxiliary_power_start(uint32_t, int mode, int parameter) mode Sets the mode of capture. 0 - continuous capturing which requires the user to periodically consume the data. 1 - oneshot capturing that captures data until the buffer has been read once, has been filled or the time from the first received sample in seconds equals the specified parameter. parameter Mode specific 2.4.1.11. auxiliary_power_stop Stops parsing of power data. int auxiliary_power_stop(uint32_t ) 2.4.1.12. auxiliary_power_lock_data_for_reading Blocks the parsing thread from accessing all the buffers. This must be called before the user application code accesses the buffers, or a call to auxiliary_power_copy_data is made. Afterwards auxiliary_power_free_data must be called. Minimize the amount of time between locking and freeing to avoid buffer overflows. 14

int auxiliary_power_lock_data_for_reading(uint32_t ) 2.4.1.13. auxiliary_power_copy_data Copies parsed power data into the specified buffer. Remember to lock the buffers first. If the count parameter is the same as max_count there is probably more data to be read. Do another read to get the remaining data. int auxiliary_power_copy_data(uint32_t, float* buffer, double* timestamp, size_t* count, size_t max_count, int channel, int type) buffer timestamp count max_count channel Buffer that will hold the data Buffer that will hold the timestamps Pointer to a variable that will hold the count of elements copied Maximum number of elements that the buffer can hold Power channel for this buffer: A = 0, B = 1 (Power Debugger specific) type Type of power data: Current = 0, Voltage = 1, Range = 2 2.4.1.14. auxiliary_power_free_data Clears the power data buffers and allows the power parser to continue. int auxiliary_power_free_data(uint32_t ) 15

3. Revision History Doc Rev. Date Comments 42771A 09/2016 Initial document release. 16

Atmel Corporation 1600 Technology Drive, San Jose, CA 95110 USA T: (+1)(408) 441.0311 F: (+1)(408) 436.4200 www.atmel.com 2016 Atmel Corporation. / Rev.: Atmel, Atmel logo and combinations thereof, Enabling Unlimited Possibilities, and others are registered trademarks or trademarks of Atmel Corporation in U.S. and other countries. ARM, ARM Connected logo and others are the registered trademarks or trademarks of ARM Ltd. Other terms and product names may be trademarks of others. DISCLAIMER: The information in this document is provided in connection with Atmel products. No license, express or implied, by estoppel or otherwise, to any intellectual property right is granted by this document or in connection with the sale of Atmel products. EXCEPT AS SET FORTH IN THE ATMEL TERMS AND CONDITIONS OF SALES LOCATED ON THE ATMEL WEBSITE, ATMEL ASSUMES NO LIABILITY WHATSOEVER AND DISCLAIMS ANY EXPRESS, IMPLIED OR STATUTORY WARRANTY RELATING TO ITS PRODUCTS INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, CONSEQUENTIAL, PUNITIVE, SPECIAL OR INCIDENTAL DAMAGES (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS AND PROFITS, BUSINESS INTERRUPTION, OR LOSS OF INFORMATION) ARISING OUT OF THE USE OR INABILITY TO USE THIS DOCUMENT, EVEN IF ATMEL HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Atmel makes no representations or warranties with respect to the accuracy or completeness of the contents of this document and reserves the right to make changes to specifications and products descriptions at any time without notice. Atmel does not make any commitment to update the information contained herein. Unless specifically provided otherwise, Atmel products are not suitable for, and shall not be used in, automotive applications. Atmel products are not intended, authorized, or warranted for use as components in applications intended to support or sustain life. SAFETY-CRITICAL, MILITARY, AND AUTOMOTIVE APPLICATIONS DISCLAIMER: Atmel products are not designed for and will not be used in connection with any applications where the failure of such products would reasonably be expected to result in significant personal injury or death ( Safety-Critical Applications ) without an Atmel officer's specific written consent. Safety-Critical Applications include, without limitation, life support devices and systems, equipment or systems for the operation of nuclear facilities and weapons systems. Atmel products are not designed nor intended for use in military or aerospace applications or environments unless specifically designated by Atmel as military-grade. Atmel products are not designed nor intended for use in automotive applications unless specifically designated by Atmel as automotive-grade.