FreeRTOS port on GAP8/RISC-V
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
gap8/pmsis/include/pmsis/implem/drivers/udma/udma_core/udma_util.h File Reference

Data Structures

struct  pi_udma_fifo_t
 

Functions

static void pi_udma_fifo_init (pi_udma_fifo_t *fifo)
 Initialize UDMA fifo. More...
 
static int32_t pi_udma_fifo_hw_buffer_empty (pi_udma_fifo_t *fifo)
 Get free HW slot ID. More...
 
static void pi_udma_fifo_hw_fifo_task_enqueue (pi_udma_fifo_t *fifo, pi_task_t *task, uint8_t hw_buff_idx)
 Enqueue a task in HW buffer. More...
 
static pi_task_tpi_udma_fifo_hw_fifo_task_pop (pi_udma_fifo_t *fifo)
 Pop a task from HW buffer. More...
 
static pi_task_tpi_udma_fifo_hw_fifo_current_task_get (pi_udma_fifo_t *fifo, uint8_t hw_buff_idx)
 Get current task in HW buffer. More...
 
static void pi_udma_fifo_sw_fifo_task_enqueue (pi_udma_fifo_t *fifo, pi_task_t *task)
 Enqueue a task in SW fifo. More...
 
static pi_task_tpi_udma_fifo_sw_fifo_task_pop (pi_udma_fifo_t *fifo)
 Pop a task from SW fifo. More...
 
static void pi_udma_fifo_buffer_set (struct pi_task *task, uint32_t *buff, uint32_t *size, uint32_t max_size)
 Compute UDMA register values. More...
 

Function Documentation

static void pi_udma_fifo_buffer_set ( struct pi_task *  task,
uint32_t *  buff,
uint32_t *  size,
uint32_t  max_size 
)
inlinestatic
Parameters
taskCurrent transfer(struct pi_task).
buffPointer to L2 buffer address.
sizePointer to size of buffer.
max_sizeMax size supported by UDMA.

References max_size.

Referenced by __pi_octospi_2d_copy_exec(), __pi_uart_copy_exec(), and __pi_uart_handler().

static int32_t pi_udma_fifo_hw_buffer_empty ( pi_udma_fifo_t fifo)
inlinestatic

This function returns ID of first free UDMA HW slot.

Parameters
fifoPointer to UDMA fifo struct.
Return values
-1No free slot.
slot_idID of free slot.

References pi_udma_fifo_t::hw_buffer.

Referenced by __pi_octospi_2d_copy(), __pi_octospi_irq_handler(), __pi_uart_copy(), and __pi_uart_handler().

static pi_task_t* pi_udma_fifo_hw_fifo_current_task_get ( pi_udma_fifo_t fifo,
uint8_t  hw_buff_idx 
)
inlinestatic
Parameters
fifoPointer to UDMA fifo struct.
hw_buff_idxHW slot ID.
Return values
TaskPointer to current struct pi_task.
NULLIf HW buffer is empty.

References pi_udma_fifo_t::hw_buffer.

Referenced by __pi_uart_handler().

static void pi_udma_fifo_hw_fifo_task_enqueue ( pi_udma_fifo_t fifo,
pi_task_t task,
uint8_t  hw_buff_idx 
)
inlinestatic
Parameters
fifoPointer to UDMA fifo struct.
taskPointer to task to enqueue.
hw_buff_idxHW slot ID.

References disable_irq(), pi_udma_fifo_t::hw_buffer, and restore_irq().

Referenced by __pi_octospi_2d_copy_exec(), __pi_uart_copy_exec(), and __pi_uart_handler().

static pi_task_t* pi_udma_fifo_hw_fifo_task_pop ( pi_udma_fifo_t fifo)
inlinestatic
Parameters
fifoPointer to UDMA fifo struct.
Return values
TaskPointer to current struct pi_task.
NULLIf HW buffers are empty.

References pi_udma_fifo_t::hw_buffer.

Referenced by __pi_octospi_irq_handler(), __pi_uart_handler(), __pi_uart_rx_abort(), __pi_uart_rx_timeout_abort(), __pi_uart_tx_abort(), and __pi_uart_tx_timeout_abort().

static void pi_udma_fifo_init ( pi_udma_fifo_t fifo)
inlinestatic

struct pi_task data field array desc : data[0] = l2_buffer data[1] = size data[2] = channel

Parameters
fifoPointer to UDMA fifo struct.

References pi_udma_fifo_t::fifo_head, pi_udma_fifo_t::fifo_tail, and pi_udma_fifo_t::hw_buffer.

Referenced by __pi_octospi_open(), and __pi_uart_open().

static void pi_udma_fifo_sw_fifo_task_enqueue ( pi_udma_fifo_t fifo,
pi_task_t task 
)
inlinestatic
Parameters
fifoPointer to UDMA fifo struct.
taskPointer to task to enqueue.

References disable_irq(), pi_udma_fifo_t::fifo_head, pi_udma_fifo_t::fifo_tail, pi_task_t::next, and restore_irq().

Referenced by __pi_octospi_2d_copy(), and __pi_uart_copy().

static pi_task_t* pi_udma_fifo_sw_fifo_task_pop ( pi_udma_fifo_t fifo)
inlinestatic
Parameters
fifoPointer to UDMA fifo struct.
Return values
TaskPointer to first struct pi_task from SW fifo.
NULLIf SW fifo is empty.

References pi_udma_fifo_t::fifo_head, and pi_task_t::next.

Referenced by __pi_octospi_irq_handler(), and __pi_uart_handler().