1 /* 2 * SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 #pragma once 8 9 #include <stdint.h> 10 #include "sys/queue.h" 11 12 #ifdef __cplusplus 13 extern "C" { 14 #endif 15 16 /* 17 * SLC2 DMA Desc struct, aka lldesc_t 18 * 19 * -------------------------------------------------------------- 20 * | own | EoF | sub_sof | 5'b0 | length [11:0] | size [11:0] | 21 * -------------------------------------------------------------- 22 * | buf_ptr [31:0] | 23 * -------------------------------------------------------------- 24 * | next_desc_ptr [31:0] | 25 * -------------------------------------------------------------- 26 */ 27 28 /* this bitfield is start from the LSB!!! */ 29 typedef struct lldesc_s { 30 volatile uint32_t size : 12, 31 length: 12, 32 offset: 5, /* h/w reserved 5bit, s/w use it as offset in buffer */ 33 sosf : 1, /* start of sub-frame */ 34 eof : 1, /* end of frame */ 35 owner : 1; /* hw or sw */ 36 volatile const uint8_t *buf; /* point to buffer data */ 37 union { 38 volatile uint32_t empty; 39 STAILQ_ENTRY(lldesc_s) qe; /* pointing to the next desc */ 40 }; 41 } lldesc_t; 42 43 #ifdef __cplusplus 44 } 45 #endif 46