esp_rom_lldesc.h 1.3 KB

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