Async Transfer

| Async Transfer

Typedefs
Function Pointers
Async Transfer Utility Library

## General Description

## Typedefs
typedef uint32_t(* | mtb_async_transfer_get_num_fifo_t) (void *inst_ref)
| Function pointer for returning the number of elements that can be read from the FIFO in case of rx or that can be written to the FIFO in case of tx. More...
typedef void(* | mtb_async_transfer_set_fifo_level_t) (void *inst_ref, uint32_t level)
| Function pointer to set the fifo level for triggering an interrupt when the number of elements in the FIFO exceeds(for RX) or drops below (for TX) `level` number of elements. More...
typedef void(* | mtb_async_transfer_set_enabled_t) (void *inst_ref, bool enable)
| Function pointer for enabling/disabling an RX or TX FIFO level interrupt event. More...
typedef uint32_t(* | mtb_async_transfer_get_len_t) (void *inst_ref)
| Function pointer for getting the RX/TX transfer length, i.e the number of elements recommended by the interface to tranmsit or receive over the peripheral in a single transfer. More...
typedef cy_rslt_t(* | mtb_async_transfer_dma_set_addr_t) (void *dma_ref, void *addr)
| Function pointer to set an address associated with a DMA transfer. More...
typedef cy_rslt_t(* | mtb_async_transfer_dma_set_len_t) (void *dma_ref, size_t len)
| Function pointer to set the length for a DMA transfer. More...
typedef void(* | mtb_async_transfer_event_callback_t) (void *callback_arg, mtb_async_transfer_direction_t direction)
| Async transfer callback function type. More...
typedef uint32_t(* | mtb_async_transfer_enter_critical_section_t) (void)
| Function pointer to disable interrupts and returns a value indicating whether the interrupts were previously enabled. More...
typedef void(* | mtb_async_transfer_exit_critical_section_t) (uint32_t irq_status)
| Function pointer to re-enables the interrupts if they were enabled before mtb_async_transfer_enter_critical_section_t was called. More...

## Typedef Documentation

## ◆ mtb_async_transfer_get_num_fifo_t

typedef uint32_t(* mtb_async_transfer_get_num_fifo_t) (void *inst_ref)

Function pointer for returning the number of elements that can be read from the FIFO in case of rx or that can be written to the FIFO in case of tx.

Parameters

  [in] | inst_ref | Pointer to the peripheral instance base address

Returns
  the number of elements that can be read in case of RX or write in case of TX

## ◆ mtb_async_transfer_set_fifo_level_t

typedef void(* mtb_async_transfer_set_fifo_level_t) (void *inst_ref, uint32_t level)

Function pointer to set the fifo level for triggering an interrupt when the number of elements in the FIFO exceeds(for RX) or drops below (for TX) `level` number of elements.

Parameters

  [in] | inst_ref | Pointer to the peripheral instance base address
  [in] | level | FIFO level to set.

## ◆ mtb_async_transfer_set_enabled_t

typedef void(* mtb_async_transfer_set_enabled_t) (void *inst_ref, bool enable)

Function pointer for enabling/disabling an RX or TX FIFO level interrupt event.

Parameters

  [in] | inst_ref | Pointer to the peripheral instance base address
  [in] | enable | true to enable the interrupt. false to disable the interrupt

## ◆ mtb_async_transfer_get_len_t

typedef uint32_t(* mtb_async_transfer_get_len_t) (void *inst_ref)

Function pointer for getting the RX/TX transfer length, i.e the number of elements recommended by the interface to tranmsit or receive over the peripheral in a single transfer.

In case of TX, this could be half of the FIFO width In case of RX, this could be half of the FIFO width or receive flow control level if the underlying communication peripheral specifies that, for e.g. in case of UART, rx transfer length could be UART RTS FIFO level if flow control is enabled

Parameters

  [in] | inst_ref | Pointer to the peripheral instance base address

return the RX/TX transfer length

## ◆ mtb_async_transfer_dma_set_addr_t

typedef cy_rslt_t(* mtb_async_transfer_dma_set_addr_t) (void *dma_ref, void *addr)

Function pointer to set an address associated with a DMA transfer.

Parameters

  [in] | dma_ref | Pointer to the dma instance address
  [in] | addr | Address associated with the DMA transfer

## ◆ mtb_async_transfer_dma_set_len_t

typedef cy_rslt_t(* mtb_async_transfer_dma_set_len_t) (void *dma_ref, size_t len)

Function pointer to set the length for a DMA transfer.

Parameters

  [in] | dma_ref | Pointer to the dma instance address
  [in] | len | Number of bytes to read or write

## ◆ mtb_async_transfer_event_callback_t

typedef void(* mtb_async_transfer_event_callback_t) (void *callback_arg, mtb_async_transfer_direction_t direction)

Async transfer callback function type.

Parameters

  [in] | callback_arg | The argument pointer specified when the callback was registered via mtb_async_transfer_register_callback
  [in] | direction | The direction (read or write) in which the transfer completed. This is a flags enum; both directions may be set at once

## ◆ mtb_async_transfer_enter_critical_section_t

typedef uint32_t(* mtb_async_transfer_enter_critical_section_t) (void)

Function pointer to disable interrupts and returns a value indicating whether the interrupts were previously enabled.

Returns the current interrupt status

## ◆ mtb_async_transfer_exit_critical_section_t

typedef void(* mtb_async_transfer_exit_critical_section_t) (uint32_t irq_status)

Function pointer to re-enables the interrupts if they were enabled before mtb_async_transfer_enter_critical_section_t was called.

Parameters

  [in] | irq_status | The saved interrupts status returned by the mtb_async_transfer_enter_critical_section_t