7#ifndef ZEPHYR_INCLUDE_DEBUG_MIPI_STP_DECODER_H__ 
    8#define ZEPHYR_INCLUDE_DEBUG_MIPI_STP_DECODER_H__ 
   46#define STP_DECODER_TYPE2STR(_type) \ 
   47        _type == STP_DATA4 ? "DATA4" : (\ 
   48        _type == STP_DATA8 ? "DATA8" : (\ 
   49        _type == STP_DATA16 ? "DATA16" : (\ 
   50        _type == STP_DATA32 ? "DATA32" : (\ 
   51        _type == STP_DATA64 ? "DATA64" : (\ 
   52        _type == STP_DECODER_NULL ? "NULL" : (\ 
   53        _type == STP_DECODER_MAJOR ? "MAJOR" : (\ 
   54        _type == STP_DECODER_MERROR ? "MERROR" : (\ 
   55        _type == STP_DECODER_CHANNEL ? "CHANNEL" : (\ 
   56        _type == STP_DECODER_VERSION ? "VERSION" : (\ 
   57        _type == STP_DECODER_FREQ ? "FREQ" : (\ 
   58        _type == STP_DECODER_GERROR ? "GERROR" : (\ 
   59        _type == STP_DECODER_FLAG ? "FLAG" : (\ 
   60        _type == STP_DECODER_ASYNC ? "ASYNC" : (\ 
   61        "Unknown")))))))))))))) 
 
void mipi_stp_decoder_sync_loss(void)
Indicate synchronization loss.
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.
mipi_stp_decoder_ctrl_type
STPv2 opcodes.
Definition mipi_stp_decoder.h:23
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.
Definition mipi_stp_decoder.h:95
@ 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_DECODER_MAJOR
Definition mipi_stp_decoder.h:30
@ 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_NOT_SUPPORTED
Definition mipi_stp_decoder.h:38
@ STP_DECODER_GERROR
Definition mipi_stp_decoder.h:35
@ STP_DECODER_MERROR
Definition mipi_stp_decoder.h:31
@ STP_DECODER_VERSION
Definition mipi_stp_decoder.h:33
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__UINT64_TYPE__ uint64_t
Definition stdint.h:91
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
__UINT16_TYPE__ uint16_t
Definition stdint.h:89
Decoder configuration.
Definition mipi_stp_decoder.h:100
mipi_stp_decoder_cb cb
Callback.
Definition mipi_stp_decoder.h:105
bool start_out_of_sync
Indicates that decoder start in out of sync state.
Definition mipi_stp_decoder.h:102
Union with data associated with a given STP opcode.
Definition mipi_stp_decoder.h:64
uint64_t data
Data.
Definition mipi_stp_decoder.h:81
uint64_t freq
Frequency.
Definition mipi_stp_decoder.h:69
uint16_t id
ID - used for major and channel.
Definition mipi_stp_decoder.h:66
uint32_t ver
Version.
Definition mipi_stp_decoder.h:72
uint32_t dummy
Dummy.
Definition mipi_stp_decoder.h:78
uint32_t err
Error code.
Definition mipi_stp_decoder.h:75