MTB CAT5 Peripheral driver library
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages

General Description

Functions

cy_en_tdm_status_t Cy_AudioTDM_Init (TDM_STRUCT_Type *base, cy_stc_tdm_config_t const *config)
 
void Cy_AudioTDM_DeInit (TDM_STRUCT_Type *base)
 
__STATIC_INLINE void Cy_AudioTDM_EnableTx (TDM_TX_STRUCT_Type *base)
 Starts an I2S/TDM transmission. More...
 
__STATIC_INLINE void Cy_AudioTDM_DisableTx (TDM_TX_STRUCT_Type *base)
 Stops an I2S/TDM transmission. More...
 
__STATIC_INLINE void Cy_AudioTDM_EnableRx (TDM_RX_STRUCT_Type *base)
 Starts an I2S/TDM transmission. More...
 
__STATIC_INLINE void Cy_AudioTDM_DisableRx (TDM_RX_STRUCT_Type *base)
 Stops an I2S/TDM transmission. More...
 
__STATIC_INLINE void Cy_AudioTDM_WriteTxData (TDM_TX_STRUCT_Type *base, uint32_t data)
 Writes data to the TX FIFO. More...
 
__STATIC_INLINE void Cy_AudioTDM_FreezeTxFifo (TDM_TX_STRUCT_Type *base)
 Freezes the TX FIFO. More...
 
__STATIC_INLINE void Cy_AudioTDM_UnfreezeTxFifo (TDM_TX_STRUCT_Type *base)
 Unfreezes the TX FIFO. More...
 
__STATIC_INLINE void Cy_AudioTDM_MuteTxFifo (TDM_TX_STRUCT_Type *base)
 Mutes the TX FIFO. More...
 
__STATIC_INLINE void Cy_AudioTDM_ActivateTx (TDM_TX_STRUCT_Type *base)
 Activate/start the TX FIFO. More...
 
__STATIC_INLINE void Cy_AudioTDM_DeActivateTx (TDM_TX_STRUCT_Type *base)
 Stop the TX FIFO. More...
 
__STATIC_INLINE void Cy_AudioTDM_ReplayTxFifo (TDM_TX_STRUCT_Type *base)
 Replay functionality (used when FREEZE is '1' or in case of a FIFO underflow event). More...
 
__STATIC_INLINE uint8_t Cy_AudioTDM_GetNumInTxFifo (TDM_TX_STRUCT_Type *base)
 Gets the number of used words in the TX FIFO., Number of used/occupied entries in the TX FIFO. More...
 
__STATIC_INLINE uint8_t Cy_AudioTDM_GetTxReadPointer (TDM_TX_STRUCT_Type *base)
 Get the TX FIFO Read Pointer. More...
 
__STATIC_INLINE uint8_t Cy_AudioTDM_GetTxWritePointer (TDM_TX_STRUCT_Type *base)
 Get the TX FIFO Write Pointer. More...
 
__STATIC_INLINE void Cy_AudioTDM_EnableTxTestMode (TDM_TX_STRUCT_Type *base)
 Enables the test mode. More...
 
__STATIC_INLINE void Cy_AudioTDM_DisableTxTestMode (TDM_TX_STRUCT_Type *base)
 Disables Test mode. More...
 
__STATIC_INLINE uint32_t Cy_AudioTDM_ReadRxData (TDM_RX_STRUCT_Type *base)
 Read Rx data from the Rx FIFO. More...
 
__STATIC_INLINE void Cy_AudioTDM_FreezeRxFifo (TDM_RX_STRUCT_Type *base)
 Freeze RX FIFO. More...
 
__STATIC_INLINE void Cy_AudioTDM_UnfreezeRxFifo (TDM_RX_STRUCT_Type *base)
 UnFreeze Rx FIFO. More...
 
__STATIC_INLINE void Cy_AudioTDM_ActivateRx (TDM_RX_STRUCT_Type *base)
 Start Rx FIFO. More...
 
__STATIC_INLINE void Cy_AudioTDM_DeActivateRx (TDM_RX_STRUCT_Type *base)
 Stop Rx FIFO. More...
 
__STATIC_INLINE uint32_t Cy_AudioTDM_ReadSilentRXFifo (TDM_RX_STRUCT_Type *base)
 When the RX FIFO is empty, a read from this register returns "0". More...
 
__STATIC_INLINE uint8_t Cy_AudioTDM_GetNumInRxFifo (TDM_RX_STRUCT_Type *base)
 Reads RX FIFO status. More...
 
__STATIC_INLINE uint8_t Cy_AudioTDM_GetRxReadPointer (TDM_RX_STRUCT_Type *base)
 Reads RX FIFO Read Pointer RX FIFO read pointer: FIFO location from which a data is read. More...
 
__STATIC_INLINE uint8_t Cy_AudioTDM_GetRxWritePointer (TDM_RX_STRUCT_Type *base)
 Reads RX FIFO Write Pointer RX FIFO write pointer: FIFO location at which a new data is written by the hardware. More...
 
__STATIC_INLINE void Cy_AudioTDM_EnableRxTestMode (TDM_RX_STRUCT_Type *base)
 Enables Test mode (intended to be used with (master transmitter, slave receiver) configuration). More...
 
__STATIC_INLINE void Cy_AudioTDM_DisableRxTestMode (TDM_RX_STRUCT_Type *base)
 Disable RX test mode. More...
 
__STATIC_INLINE void Cy_AudioTDM_ClearTxInterrupt (TDM_TX_STRUCT_Type *base, uint32_t interrupt)
 Clear TX interrupt. More...
 
__STATIC_INLINE void Cy_AudioTDM_SetTxInterrupt (TDM_TX_STRUCT_Type *base, uint32_t interrupt)
 Set the Tx Interrupt. More...
 
__STATIC_INLINE uint32_t Cy_AudioTDM_GetTxInterruptMask (TDM_TX_STRUCT_Type *base)
 Get TX interrupt Mask. More...
 
__STATIC_INLINE void Cy_AudioTDM_SetTxInterruptMask (TDM_TX_STRUCT_Type *base, uint32_t interrupt)
 Set TX interrupt Mask. More...
 
__STATIC_INLINE uint32_t Cy_AudioTDM_GetTxInterruptStatusMasked (TDM_TX_STRUCT_Type *base)
 Reflects a bitwise AND between the INTR_TX and INTR_TX_MASK registers. More...
 
__STATIC_INLINE void Cy_AudioTDM_SetTxTriggerInterruptMask (TDM_TX_STRUCT_Type *base)
 Sets TX interrupt Mask. More...
 
__STATIC_INLINE void Cy_AudioTDM_ClearTxTriggerInterruptMask (TDM_TX_STRUCT_Type *base)
 Clears TX interrupt Mask. More...
 
__STATIC_INLINE void Cy_AudioTDM_ClearRxInterrupt (TDM_RX_STRUCT_Type *base, uint32_t interrupt)
 Clears RX interrupt. More...
 
__STATIC_INLINE void Cy_AudioTDM_SetRxInterrupt (TDM_RX_STRUCT_Type *base, uint32_t interrupt)
 Sets RX interrupt. More...
 
__STATIC_INLINE uint32_t Cy_AudioTDM_GetRxInterruptMask (TDM_RX_STRUCT_Type *base)
 Returns RX interrupt Mask. More...
 
__STATIC_INLINE void Cy_AudioTDM_SetRxInterruptMask (TDM_RX_STRUCT_Type *base, uint32_t interrupt)
 Sets RX interrupt Mask. More...
 
__STATIC_INLINE uint32_t Cy_AudioTDM_GetRxInterruptStatusMasked (TDM_RX_STRUCT_Type *base)
 Returns a bitwise AND between the INTR_RX and INTR_RX_MASK registers. More...
 
__STATIC_INLINE void Cy_AudioTDM_SetRxTriggerInterruptMask (TDM_RX_STRUCT_Type *base)
 Sets Rx Interrupt Mask. More...
 
__STATIC_INLINE void Cy_AudioTDM_ClearRxTriggerInterruptMask (TDM_RX_STRUCT_Type *base)
 Clear RX interrupt Mask. More...
 

Function Documentation

__STATIC_INLINE void Cy_AudioTDM_EnableTx ( TDM_TX_STRUCT_Type *  base)

Starts an I2S/TDM transmission.

Interrupt enabling (by the Cy_AudioTDM_SetTxInterrupt) is required after this function call, in case if any I2S/TDM interrupts are used in the application.

Precondition
Cy_AudioTDM_Init() must be called before.
Parameters
baseThe pointer to the I2S/TDM instance address.
Function Usage
__STATIC_INLINE void Cy_AudioTDM_DisableTx ( TDM_TX_STRUCT_Type *  base)

Stops an I2S/TDM transmission.

Precondition
TX interrupt disabling (by the Cy_AudioTDM_SetTxInterrupt) is required prior to this function call, in case any TX I2S/TDM interrupts are used.
Parameters
baseThe pointer to the I2S/TDM instance address.
Function Usage
__STATIC_INLINE void Cy_AudioTDM_EnableRx ( TDM_RX_STRUCT_Type *  base)

Starts an I2S/TDM transmission.

Interrupt enabling (by the Cy_AudioTDM_SetRxInterrupt) is required after this function call, in case if any I2S/TDM interrupts are used in the application.

Precondition
Cy_AudioTDM_Init() must be called before.
Parameters
baseThe pointer to the I2S/TDM instance address.
Function Usage
__STATIC_INLINE void Cy_AudioTDM_DisableRx ( TDM_RX_STRUCT_Type *  base)

Stops an I2S/TDM transmission.

Precondition
TX interrupt disabling (by the Cy_AudioTDM_SetRxInterrupt) is required prior to this function call, in case any TX I2S/TDM interrupts are used.
Parameters
baseThe pointer to the I2S/TDM instance address.
Function Usage
__STATIC_INLINE void Cy_AudioTDM_WriteTxData ( TDM_TX_STRUCT_Type *  base,
uint32_t  data 
)

Writes data to the TX FIFO.

Increases the TX FIFO level.

Parameters
baseThe pointer to the I2S/TDM instance address.
dataData to be written to the TX FIFO.
Function Usage
__STATIC_INLINE void Cy_AudioTDM_FreezeTxFifo ( TDM_TX_STRUCT_Type *  base)

Freezes the TX FIFO.

This function is for debug purposes. HW uses a constant PCM data value of "0" or the previous channel PCM data is replayed. Freeze does not advance the FIFO read pointer (the FIFO data is not used).

Parameters
baseThe pointer to the I2S/TDM instance address.
Function Usage
__STATIC_INLINE void Cy_AudioTDM_UnfreezeTxFifo ( TDM_TX_STRUCT_Type *  base)

Unfreezes the TX FIFO.

This function is for debug purposes. HW uses TX FIFO data and advances the FIFO read pointer.

Parameters
baseThe pointer to the I2S/TDM instance address.
Function Usage
__STATIC_INLINE void Cy_AudioTDM_MuteTxFifo ( TDM_TX_STRUCT_Type *  base)

Mutes the TX FIFO.

HW uses a constant PCM data value of "0". Mute does advance the FIFO read pointer.

Parameters
baseThe pointer to the I2S/TDM instance address.
Function Usage
__STATIC_INLINE void Cy_AudioTDM_ActivateTx ( TDM_TX_STRUCT_Type *  base)

Activate/start the TX FIFO.

This will set the transmitter state to on.

Parameters
baseThe pointer to the I2S/TDM instance address.
Function Usage
__STATIC_INLINE void Cy_AudioTDM_DeActivateTx ( TDM_TX_STRUCT_Type *  base)

Stop the TX FIFO.

This will set the transmitter state to off.

Parameters
baseThe pointer to the I2S/TDM instance address.
Function Usage
__STATIC_INLINE void Cy_AudioTDM_ReplayTxFifo ( TDM_TX_STRUCT_Type *  base)

Replay functionality (used when FREEZE is '1' or in case of a FIFO underflow event).

HW uses the previous PCM data value.

Parameters
baseThe pointer to the I2S/TDM instance address.
__STATIC_INLINE uint8_t Cy_AudioTDM_GetNumInTxFifo ( TDM_TX_STRUCT_Type *  base)

Gets the number of used words in the TX FIFO., Number of used/occupied entries in the TX FIFO.

The field value is in the range [0, 128]. When "0", the FIFO is empty. When "128", the FIFO is full.

Parameters
baseThe pointer to the I2S/TDM instance address.
Returns
The current number of used words in the TX FIFO.
Function Usage
__STATIC_INLINE uint8_t Cy_AudioTDM_GetTxReadPointer ( TDM_TX_STRUCT_Type *  base)

Get the TX FIFO Read Pointer.

TX FIFO read pointer: FIFO location from which a data is read. This functionality is intended for debugging purposes.

Parameters
baseThe pointer to the I2S/TDM instance address.
Function Usage
__STATIC_INLINE uint8_t Cy_AudioTDM_GetTxWritePointer ( TDM_TX_STRUCT_Type *  base)

Get the TX FIFO Write Pointer.

TX FIFO write pointer: FIFO location at which a new data is written by the hardware. This functionality is intended for debugging purposes.

Parameters
baseThe pointer to the I2S/TDM instance address.
Function Usage
__STATIC_INLINE void Cy_AudioTDM_EnableTxTestMode ( TDM_TX_STRUCT_Type *  base)

Enables the test mode.

Used for debugging purposes only. Tx and Rx test modes cannot be enabled simultaneously.

Parameters
baseThe pointer to the I2S/TDM instance address.
__STATIC_INLINE void Cy_AudioTDM_DisableTxTestMode ( TDM_TX_STRUCT_Type *  base)

Disables Test mode.

Parameters
baseThe pointer to the I2S/TDM instance address.
__STATIC_INLINE uint32_t Cy_AudioTDM_ReadRxData ( TDM_RX_STRUCT_Type *  base)

Read Rx data from the Rx FIFO.

Data (PCM sample) read from the RX FIFO. Reading removes the data from the RX FIFO. Reading from an empty RX FIFO activates FIFO_UNDERFLOW interrupt.

Parameters
baseThe pointer to the I2S/TDM instance address.
Function Usage
__STATIC_INLINE void Cy_AudioTDM_FreezeRxFifo ( TDM_RX_STRUCT_Type *  base)

Freeze RX FIFO.

HW writes from the RX FIFO have no effect: freeze will not advance the FIFO write pointer. This functionality is intended for debugging purposes.

Parameters
baseThe pointer to the I2S/TDM instance address.
Function Usage
__STATIC_INLINE void Cy_AudioTDM_UnfreezeRxFifo ( TDM_RX_STRUCT_Type *  base)

UnFreeze Rx FIFO.

HW writes to the RX FIFO and advances the FIFO write pointer.

Parameters
baseThe pointer to the I2S/TDM instance address.
Function Usage
__STATIC_INLINE void Cy_AudioTDM_ActivateRx ( TDM_RX_STRUCT_Type *  base)

Start Rx FIFO.

Sets Receiver state to on.

Parameters
baseThe pointer to the I2S/TDM instance address.
Function Usage
__STATIC_INLINE void Cy_AudioTDM_DeActivateRx ( TDM_RX_STRUCT_Type *  base)

Stop Rx FIFO.

Sets Receiver state to off.

Parameters
baseThe pointer to the I2S/TDM instance address.
Function Usage
__STATIC_INLINE uint32_t Cy_AudioTDM_ReadSilentRXFifo ( TDM_RX_STRUCT_Type *  base)

When the RX FIFO is empty, a read from this register returns "0".

Parameters
baseThe pointer to the I2S/TDM instance address.
Function Usage
__STATIC_INLINE uint8_t Cy_AudioTDM_GetNumInRxFifo ( TDM_RX_STRUCT_Type *  base)

Reads RX FIFO status.

Number of used/occupied entries in the RX FIFO. The field value is in the range [0, 128]. When "0", the FIFO is empty. When "128", the FIFO is full.

Parameters
baseThe pointer to the I2S/TDM instance address.
Function Usage
__STATIC_INLINE uint8_t Cy_AudioTDM_GetRxReadPointer ( TDM_RX_STRUCT_Type *  base)

Reads RX FIFO Read Pointer RX FIFO read pointer: FIFO location from which a data is read.

This functionality is intended for debugging purposes.

Parameters
baseThe pointer to the I2S/TDM instance address.
Returns
The current RX Read pointer value.
Function Usage
__STATIC_INLINE uint8_t Cy_AudioTDM_GetRxWritePointer ( TDM_RX_STRUCT_Type *  base)

Reads RX FIFO Write Pointer RX FIFO write pointer: FIFO location at which a new data is written by the hardware.

This functionality is intended for debugging purposes.

Parameters
baseThe pointer to the I2S/TDM instance address.
Returns
The current RX Write pointer value.
Function Usage
__STATIC_INLINE void Cy_AudioTDM_EnableRxTestMode ( TDM_RX_STRUCT_Type *  base)

Enables Test mode (intended to be used with (master transmitter, slave receiver) configuration).

Both TX and RX should not be set in Test mode simultaneously.

Parameters
baseThe pointer to the I2S/TDM instance address.
__STATIC_INLINE void Cy_AudioTDM_DisableRxTestMode ( TDM_RX_STRUCT_Type *  base)

Disable RX test mode.

Parameters
baseThe pointer to the I2S/TDM instance address.
__STATIC_INLINE void Cy_AudioTDM_ClearTxInterrupt ( TDM_TX_STRUCT_Type *  base,
uint32_t  interrupt 
)

Clear TX interrupt.

Parameters
baseThe pointer to the I2S/TDM instance address.
interruptinterrupt
Function Usage
__STATIC_INLINE void Cy_AudioTDM_SetTxInterrupt ( TDM_TX_STRUCT_Type *  base,
uint32_t  interrupt 
)

Set the Tx Interrupt.

Parameters
baseThe pointer to the I2S/TDM instance address.
interruptinterrupts to set.
Function Usage
__STATIC_INLINE uint32_t Cy_AudioTDM_GetTxInterruptMask ( TDM_TX_STRUCT_Type *  base)

Get TX interrupt Mask.

Parameters
baseThe pointer to the I2S/TDM instance address.
Function Usage
__STATIC_INLINE void Cy_AudioTDM_SetTxInterruptMask ( TDM_TX_STRUCT_Type *  base,
uint32_t  interrupt 
)

Set TX interrupt Mask.

Parameters
baseThe pointer to the I2S/TDM instance address.
interruptinterrupt
Function Usage
__STATIC_INLINE uint32_t Cy_AudioTDM_GetTxInterruptStatusMasked ( TDM_TX_STRUCT_Type *  base)

Reflects a bitwise AND between the INTR_TX and INTR_TX_MASK registers.

Parameters
baseThe pointer to the I2S/TDM instance address.
__STATIC_INLINE void Cy_AudioTDM_SetTxTriggerInterruptMask ( TDM_TX_STRUCT_Type *  base)

Sets TX interrupt Mask.

Parameters
baseThe pointer to the I2S/TDM instance address.
__STATIC_INLINE void Cy_AudioTDM_ClearTxTriggerInterruptMask ( TDM_TX_STRUCT_Type *  base)

Clears TX interrupt Mask.

Parameters
baseThe pointer to the I2S/TDM instance address.
__STATIC_INLINE void Cy_AudioTDM_ClearRxInterrupt ( TDM_RX_STRUCT_Type *  base,
uint32_t  interrupt 
)

Clears RX interrupt.

Parameters
baseThe pointer to the I2S/TDM instance address.
interruptinterrupt
Function Usage
__STATIC_INLINE void Cy_AudioTDM_SetRxInterrupt ( TDM_RX_STRUCT_Type *  base,
uint32_t  interrupt 
)

Sets RX interrupt.

Parameters
baseThe pointer to the I2S/TDM instance address.
interruptinterrupt
Function Usage
__STATIC_INLINE uint32_t Cy_AudioTDM_GetRxInterruptMask ( TDM_RX_STRUCT_Type *  base)

Returns RX interrupt Mask.

Parameters
baseThe pointer to the I2S/TDM instance address.
Function Usage
__STATIC_INLINE void Cy_AudioTDM_SetRxInterruptMask ( TDM_RX_STRUCT_Type *  base,
uint32_t  interrupt 
)

Sets RX interrupt Mask.

Parameters
baseThe pointer to the I2S/TDM instance address.
interruptinterrupt
Function Usage
__STATIC_INLINE uint32_t Cy_AudioTDM_GetRxInterruptStatusMasked ( TDM_RX_STRUCT_Type *  base)

Returns a bitwise AND between the INTR_RX and INTR_RX_MASK registers.

Parameters
baseThe pointer to the I2S/TDM instance address.
Returns
The interrupt bit mask(s).
__STATIC_INLINE void Cy_AudioTDM_SetRxTriggerInterruptMask ( TDM_RX_STRUCT_Type *  base)

Sets Rx Interrupt Mask.

Parameters
baseThe pointer to the I2S/TDM instance address.
__STATIC_INLINE void Cy_AudioTDM_ClearRxTriggerInterruptMask ( TDM_RX_STRUCT_Type *  base)

Clear RX interrupt Mask.

Parameters
baseThe pointer to the I2S/TDM instance address.