LCOV - code coverage report
Current view: top level - zephyr/debug/coresight - cs_trace_defmt.h Coverage Total Hit
Test: new.info Lines: 83.3 % 6 5
Test Date: 2025-09-05 16:43:28

            Line data    Source code
       1            0 : /*
       2              :  * Copyright (c) 2024 Nordic Semiconductor ASA.
       3              :  *
       4              :  * SPDX-License-Identifier: Apache-2.0
       5              :  */
       6              : 
       7              : #ifndef ZEPHYR_INCLUDE_DEBUG_CORESIGHT_CS_TRACE_DEFMT_H__
       8              : #define ZEPHYR_INCLUDE_DEBUG_CORESIGHT_CS_TRACE_DEFMT_H__
       9              : 
      10              : #include <zephyr/kernel.h>
      11              : #ifdef __cplusplus
      12              : extern "C" {
      13              : #endif
      14              : 
      15              : /**
      16              :  * @defgroup coresight_apis Coresight APIs
      17              :  * @ingroup debug
      18              :  * @{
      19              :  * @}
      20              :  * @defgroup cs_trace_defmt Coresight Trace Deformatter
      21              :  * @ingroup coresight_apis
      22              :  * @{
      23              :  */
      24              : 
      25              : /** @brief Callback signature.
      26              :  *
      27              :  * @param id    Stream ID.
      28              :  * @param data  Data.
      29              :  * @param len   Data length.
      30              :  */
      31            1 : typedef void (*cs_trace_defmt_cb)(uint32_t id, const uint8_t *data, size_t len);
      32              : 
      33              : /** @brief Size of trace deformatter frame size in 32 bit words. */
      34            1 : #define CORESIGHT_TRACE_FRAME_SIZE32 4
      35              : 
      36              : /** @brief Size of trace deformatter frame size in bytes. */
      37            1 : #define CORESIGHT_TRACE_FRAME_SIZE (CORESIGHT_TRACE_FRAME_SIZE32 * sizeof(uint32_t))
      38              : 
      39              : /** @brief Initialize Coresight Trace Deformatter.
      40              :  *
      41              :  * @param cb Callback.
      42              :  */
      43            1 : int cs_trace_defmt_init(cs_trace_defmt_cb cb);
      44              : 
      45              : /** @brief Decode data from the stream.
      46              :  *
      47              :  * Trace formatter puts data in the 16 byte long blocks.
      48              :  *
      49              :  * Callback is called with decoded data.
      50              :  *
      51              :  * @param data  Data.
      52              :  * @param len   Data length. Must equal 16.
      53              :  *
      54              :  * @retval 0            On successful deformatting.
      55              :  * @retval -EINVAL      If wrong length is provided.
      56              :  */
      57            1 : int cs_trace_defmt_process(const uint8_t *data, size_t len);
      58              : 
      59              : /** @} */
      60              : 
      61              : #ifdef __cplusplus
      62              : }
      63              : #endif
      64              : 
      65              : #endif /* ZEPHYR_INCLUDE_DEBUG_CORESIGHT_CS_TRACE_DEFMT_H__ */
        

Generated by: LCOV version 2.0-1