Zephyr Project API 3.7.0-rc1
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
STP Decoder API

Data Structures

union  mipi_stp_decoder_data
 Union with data associated with a given STP opcode. More...
 
struct  mipi_stp_decoder_config
 Decoder configuration. More...
 

Macros

#define STP_DECODER_TYPE2STR(_type)
 Convert type to a string literal.
 

Typedefs

typedef void(* mipi_stp_decoder_cb) (enum mipi_stp_decoder_ctrl_type type, union mipi_stp_decoder_data data, uint64_t *ts, bool marked)
 Callback signature.
 

Enumerations

enum  mipi_stp_decoder_ctrl_type {
  STP_DATA4 = 1 , STP_DATA8 = 2 , STP_DATA16 = 4 , STP_DATA32 = 8 ,
  STP_DATA64 = 16 , STP_DECODER_NULL = 128 , STP_DECODER_MASTER , STP_DECODER_MERROR ,
  STP_DECODER_CHANNEL , STP_DECODER_VERSION , STP_DECODER_FREQ , STP_DECODER_GERROR ,
  STP_DECODER_FLAG , STP_DECODER_ASYNC , STP_DECODER_NOT_SUPPORTED
}
 STPv2 opcodes. More...
 

Functions

int mipi_stp_decoder_init (const struct mipi_stp_decoder_config *config)
 Initialize the decoder.
 
int mipi_stp_decoder_decode (const uint8_t *data, size_t len)
 Decode STPv2 stream.
 
void mipi_stp_decoder_sync_loss (void)
 Indicate synchronization loss.
 

Detailed Description

Macro Definition Documentation

◆ STP_DECODER_TYPE2STR

#define STP_DECODER_TYPE2STR (   _type)

#include <include/zephyr/debug/mipi_stp_decoder.h>

Value:
_type == STP_DATA4 ? "DATA4" : (\
_type == STP_DATA8 ? "DATA8" : (\
_type == STP_DATA16 ? "DATA16" : (\
_type == STP_DATA32 ? "DATA32" : (\
_type == STP_DATA64 ? "DATA64" : (\
_type == STP_DECODER_NULL ? "NULL" : (\
_type == STP_DECODER_MASTER ? "MASTER" : (\
_type == STP_DECODER_MERROR ? "MERROR" : (\
_type == STP_DECODER_CHANNEL ? "CHANNEL" : (\
_type == STP_DECODER_VERSION ? "VERSION" : (\
_type == STP_DECODER_FREQ ? "FREQ" : (\
_type == STP_DECODER_GERROR ? "GERROR" : (\
_type == STP_DECODER_FLAG ? "FLAG" : (\
_type == STP_DECODER_ASYNC ? "ASYNC" : (\
"Unknown"))))))))))))))
@ STP_DECODER_NULL
Definition mipi_stp_decoder.h:29
@ STP_DATA4
Definition mipi_stp_decoder.h:24
@ STP_DECODER_FLAG
Definition mipi_stp_decoder.h:36
@ STP_DECODER_FREQ
Definition mipi_stp_decoder.h:34
@ STP_DATA16
Definition mipi_stp_decoder.h:26
@ STP_DATA32
Definition mipi_stp_decoder.h:27
@ STP_DATA8
Definition mipi_stp_decoder.h:25
@ STP_DECODER_CHANNEL
Definition mipi_stp_decoder.h:32
@ STP_DATA64
Definition mipi_stp_decoder.h:28
@ STP_DECODER_ASYNC
Definition mipi_stp_decoder.h:37
@ STP_DECODER_GERROR
Definition mipi_stp_decoder.h:35
@ STP_DECODER_MERROR
Definition mipi_stp_decoder.h:31
@ STP_DECODER_MASTER
Definition mipi_stp_decoder.h:30
@ STP_DECODER_VERSION
Definition mipi_stp_decoder.h:33

Convert type to a string literal.

Parameters
_typetype
Returns
String literal.

Typedef Documentation

◆ mipi_stp_decoder_cb

typedef void(* mipi_stp_decoder_cb) (enum mipi_stp_decoder_ctrl_type type, union mipi_stp_decoder_data data, uint64_t *ts, bool marked)

#include <include/zephyr/debug/mipi_stp_decoder.h>

Callback signature.

Callback is called whenever an element from STPv2 stream is decoded.

Note
Callback is called with interrupts locked.
Parameters
typeType. See mipi_stp_decoder_ctrl_type.
dataData. Data associated with a given type.
tsTimestamp. Present if not NULL.
markedSet to true if opcode was marked.

Enumeration Type Documentation

◆ mipi_stp_decoder_ctrl_type

#include <include/zephyr/debug/mipi_stp_decoder.h>

STPv2 opcodes.

Enumerator
STP_DATA4 
STP_DATA8 
STP_DATA16 
STP_DATA32 
STP_DATA64 
STP_DECODER_NULL 
STP_DECODER_MASTER 
STP_DECODER_MERROR 
STP_DECODER_CHANNEL 
STP_DECODER_VERSION 
STP_DECODER_FREQ 
STP_DECODER_GERROR 
STP_DECODER_FLAG 
STP_DECODER_ASYNC 
STP_DECODER_NOT_SUPPORTED 

Function Documentation

◆ mipi_stp_decoder_decode()

int mipi_stp_decoder_decode ( const uint8_t data,
size_t  len 
)

#include <include/zephyr/debug/mipi_stp_decoder.h>

Decode STPv2 stream.

Function decodes the stream and calls the callback for every decoded element.

Parameters
dataData.
lenData length.
Return values
0On successful decoding.
negativeOn failure.

◆ mipi_stp_decoder_init()

int mipi_stp_decoder_init ( const struct mipi_stp_decoder_config config)

#include <include/zephyr/debug/mipi_stp_decoder.h>

Initialize the decoder.

Parameters
configConfiguration.
Return values
0On successful initialization.
negativeOn failure.

◆ mipi_stp_decoder_sync_loss()

void mipi_stp_decoder_sync_loss ( void  )

#include <include/zephyr/debug/mipi_stp_decoder.h>

Indicate synchronization loss.

If detected, then decoder starts to look for ASYNC marker and drops all data until ASYNC is found. Synchronization can be lost when there is data loss (e.g. due to overflow).