src/ssx/occhw/occhw_async_ocb.c
/// Reset an OCB circular PUSH (read) queue
///
/// This API is normally used during initialization, and assumes that all of
/// the parameters are valid.  It resets and reprograms the hardware
/// associated with an OCB circular buffer to be consistent with the queue
/// engine, base address, length and interrupt protocol.  The queue is enabled
/// and its interrupts are disabled.  Any data in the queue will be silently
/// lost.
///
/// Note that this API \e does \e not put the OCB channel into circular mode -
/// the communication method is controlled by the communication partner.
///
/// The function of this routine is to write a new value into the OCB Stream
/// Push Control/Status register, which as a side effect resets the circular
/// buffer. The base register is also set up.
Reset an OCB circular PUSH (read) queue
This API is normally used during initialization, and assumes that all of
the parameters are valid.  It resets and reprograms the hardware
associated with an OCB circular buffer to be consistent with the queue
engine, base address, length and interrupt protocol.  The queue is enabled
and its interrupts are disabled.  Any data in the queue will be silently
lost.

Note that this API \e does \e not put the OCB channel into circular mode
the communication method is controlled by the communication partner.

The function of this routine is to write a new value into the OCB Stream
Push Control/Status register, which as a side effect resets the circular
buffer. The base register is also set up.
Reset an OCB circular PUSH ( read ) queue This API is normally used during initialization and assumes that all of the parameters are valid . It resets and reprograms the hardware associated with an OCB circular buffer to be consistent with the queue engine base address length and interrupt protocol . The queue is enabled and its interrupts are disabled . Any data in the queue will be silently lost . Note that this API \ e does \ e not put the OCB channel into circular mode the communication method is controlled by the communication partner . The function of this routine is to write a new value into the OCB Stream Push Control / Status register which as a side effect resets the circular buffer . The base register is also set up .
void
ocb_read_engine_reset(OcbQueue* queue, size_t cq_length, int protocol)
{
    ocb_ocbshcsn_t cs;
    ssx_irq_disable(queue->irq);
    queue->cq_length = cq_length;
    cs.value = 0;
    out32(G_ocb_ocbsxcsn[queue->engine], cs.value);
    out32(G_ocb_ocbsxbrn[queue->engine], (uint32_t)(queue->cq_base));
    if (protocol == OCB_INTERRUPT_PROTOCOL_LAZY)
    {
        cs.fields.push_intr_action = OCB_INTR_ACTION_FULL;
    }
    else
    {
        cs.fields.push_intr_action = OCB_INTR_ACTION_NOT_EMPTY;
    }
    cs.fields.push_length = cq_length - 1;
    cs.fields.push_enable = 1;
    out32(G_ocb_ocbsxcsn[queue->engine], cs.value);
}
void ocb_read_engine_reset ( OcbQueue * queue , size_t cq_length , int protocol ) { ocb_ocbshcsn_t cs ; ssx_irq_disable ( queue -> irq ) ; queue -> cq_length = cq_length ; cs . value = 0 ; out32 ( G_ocb_ocbsxcsn [ queue -> engine ] , cs . value ) ; out32 ( G_ocb_ocbsxbrn [ queue -> engine ] , ( uint32_t ) ( queue -> cq_base ) ) ; if ( protocol == OCB_INTERRUPT_PROTOCOL_LAZY ) { cs . fields . push_intr_action = OCB_INTR_ACTION_FULL ; } else { cs . fields . push_intr_action = OCB_INTR_ACTION_NOT_EMPTY ; } cs . fields . push_length = cq_length - 1 ; cs . fields . push_enable = 1 ; out32 ( G_ocb_ocbsxcsn [ queue -> engine ] , cs . value ) ; }
Reset an OCB circular PUSH (read) queue
This API is normally used during initialization, and assumes that all of
the parameters are valid.
Reset an OCB circular PUSH ( read ) queue This API is normally used during initialization and assumes that all of the parameters are valid .
// Disable interrupts and disable and clear the queue.  The queue length // field is updated (for informational purposes). Interrupts will be // re-enabled when requests are made for the queue. // Reinitialize the data buffer base address register // Reprogram and reenable/reset the queue