CC3200 Peripheral Driver Library User's Guide  1.2.0
I2S_api

Functions

void I2SEnable (unsigned long ulBase, unsigned long ulMode)
 
void I2SDisable (unsigned long ulBase)
 
void I2SDataPut (unsigned long ulBase, unsigned long ulDataLine, unsigned long ulData)
 
long I2SDataPutNonBlocking (unsigned long ulBase, unsigned long ulDataLine, unsigned long ulData)
 
void I2SDataGet (unsigned long ulBase, unsigned long ulDataLine, unsigned long *pulData)
 
long I2SDataGetNonBlocking (unsigned long ulBase, unsigned long ulDataLine, unsigned long *pulData)
 
void I2SConfigSetExpClk (unsigned long ulBase, unsigned long ulI2SClk, unsigned long ulBitClk, unsigned long ulConfig)
 
void I2STxFIFOEnable (unsigned long ulBase, unsigned long ulTxLevel, unsigned long ulWordsPerTransfer)
 
void I2STxFIFODisable (unsigned long ulBase)
 
void I2SRxFIFOEnable (unsigned long ulBase, unsigned long ulRxLevel, unsigned long ulWordsPerTransfer)
 
void I2SRxFIFODisable (unsigned long ulBase)
 
unsigned long I2STxFIFOStatusGet (unsigned long ulBase)
 
unsigned long I2SRxFIFOStatusGet (unsigned long ulBase)
 
void I2SSerializerConfig (unsigned long ulBase, unsigned long ulDataLine, unsigned long ulSerMode, unsigned long ulInActState)
 
void I2SIntEnable (unsigned long ulBase, unsigned long ulIntFlags)
 
void I2SIntDisable (unsigned long ulBase, unsigned long ulIntFlags)
 
unsigned long I2SIntStatus (unsigned long ulBase)
 
void I2SIntClear (unsigned long ulBase, unsigned long ulStatFlags)
 
void I2SIntRegister (unsigned long ulBase, void(*pfnHandler)(void))
 
void I2SIntUnregister (unsigned long ulBase)
 
void I2STxActiveSlotSet (unsigned long ulBase, unsigned long ulActSlot)
 
void I2SRxActiveSlotSet (unsigned long ulBase, unsigned long ulActSlot)
 

Detailed Description

Function Documentation

void I2SConfigSetExpClk ( unsigned long  ulBase,
unsigned long  ulI2SClk,
unsigned long  ulBitClk,
unsigned long  ulConfig 
)

Sets the configuration of the I2S module.

Parameters
ulBaseis the base address of the I2S module.
ulI2SClkis the rate of the clock supplied to the I2S module.
ulBitClkis the desired bit rate.
ulConfigis the data format.

This function configures the I2S for operation in the specified data format. The bit rate is provided in the ulBitClk parameter and the data format in the ulConfig parameter.

The ulConfig parameter is the logical OR of three values: the slot size the data read/write port select, Master or Slave mode

Follwoing selects the Master-Slave mode -I2S_MODE_MASTER -I2S_MODE_SLAVE

Following selects the slot size: -I2S_SLOT_SIZE_24 -I2S_SLOT_SIZE_16

Following selects the data read/write port: -I2S_PORT_DMA -I2S_PORT_CPU

Returns
None.
void I2SDataGet ( unsigned long  ulBase,
unsigned long  ulDataLine,
unsigned long *  pulData 
)

Waits for data from the specified data line.

Parameters
ulBaseis the base address of the I2S module.
ulDataLineis one of the valid data lines.
pulDatais pointer to receive data variable.

This function gets data from the receive register for the specified data line. If there are no data available, this function waits until a receive before returning.

Returns
None.
long I2SDataGetNonBlocking ( unsigned long  ulBase,
unsigned long  ulDataLine,
unsigned long *  pulData 
)

Receives data from the specified data line.

Parameters
ulBaseis the base address of the I2S module.
ulDataLineis one of the valid data lines.
pulDatais pointer to receive data variable.

This function gets data from the receive register for the specified data line.

Returns
Returns 0 on success, -1 otherwise.
void I2SDataPut ( unsigned long  ulBase,
unsigned long  ulDataLine,
unsigned long  ulData 
)

Waits to send data over the specified data line

Parameters
ulBaseis the base address of the I2S module.
ulDataLineis one of the valid data lines.
ulDatais the data to be transmitted.

This function sends the ucData to the transmit register for the specified data line. If there is no space available, this function waits until there is space available before returning.

Returns
None.
long I2SDataPutNonBlocking ( unsigned long  ulBase,
unsigned long  ulDataLine,
unsigned long  ulData 
)

Sends data over the specified data line

Parameters
ulBaseis the base address of the I2S module.
ulDataLineis one of the valid data lines.
ulDatais the data to be transmitted.

This function writes the ucData to the transmit register for the specified data line. This function does not block, so if there is no space available, then -1 is returned, and the application must retry the function later.

Returns
Returns 0 on success, -1 otherwise.
void I2SDisable ( unsigned long  ulBase)

Disables transmit and/or receive.

Parameters
ulBaseis the base address of the I2S module.

This function disables transmit and/or receive from I2S module.

Returns
None.
void I2SEnable ( unsigned long  ulBase,
unsigned long  ulMode 
)

Enables transmit and/or receive.

Parameters
ulBaseis the base address of the I2S module.
ulModeis one of the valid modes.

This function enables the I2S module in specified mode. The parameter ulMode should be one of the following

-I2S_MODE_TX_ONLY -I2S_MODE_TX_RX_SYNC

Returns
None.
void I2SIntClear ( unsigned long  ulBase,
unsigned long  ulStatFlags 
)

Clears I2S interrupt sources.

Parameters
ulBaseis the base address of the I2S module.
ulStatFlagsis a bit mask of the interrupt sources to be cleared.

The specified I2S interrupt sources are cleared, so that they no longer assert. This function must be called in the interrupt handler to keep the interrupt from being recognized again immediately upon exit.

The ulIntFlags parameter is the logical OR of any of the value describe in I2SIntStatus().

Returns
None.
void I2SIntDisable ( unsigned long  ulBase,
unsigned long  ulIntFlags 
)

Disables individual I2S interrupt sources.

Parameters
ulBaseis the base address of the I2S module.
ulIntFlagsis the bit mask of the interrupt sources to be disabled.

This function disables the indicated I2S interrupt sources. Only the sources that are enabled can be reflected to the processor interrupt; disabled sources have no effect on the processor.

The ulIntFlags parameter has the same definition as the ulIntFlags parameter to I2SIntEnable().

Returns
None.
void I2SIntEnable ( unsigned long  ulBase,
unsigned long  ulIntFlags 
)

Enables individual I2S interrupt sources.

Parameters
ulBaseis the base address of the I2S module.
ulIntFlagsis the bit mask of the interrupt sources to be enabled.

This function enables the indicated I2S interrupt sources. Only the sources that are enabled can be reflected to the processor interrupt; disabled sources have no effect on the processor.

The ulIntFlags parameter is the logical OR of any of the following:

-I2S_INT_XUNDRN -I2S_INT_XSYNCERR -I2S_INT_XLAST -I2S_INT_XDATA -I2S_INT_XSTAFRM -I2S_INT_XDMA -I2S_INT_ROVRN -I2S_INT_RSYNCERR -I2S_INT_RLAST -I2S_INT_RDATA -I2S_INT_RSTAFRM -I2S_INT_RDMA

Returns
None.
void I2SIntRegister ( unsigned long  ulBase,
void(*)(void)  pfnHandler 
)

Registers an interrupt handler for a I2S interrupt.

Parameters
ulBaseis the base address of the I2S module.
pfnHandleris a pointer to the function to be called when the I2S interrupt occurs.

This function does the actual registering of the interrupt handler. This function enables the global interrupt in the interrupt controller; specific I2S interrupts must be enabled via I2SIntEnable(). It is the interrupt handler's responsibility to clear the interrupt source.

See also
IntRegister() for important information about registering interrupt handlers.
Returns
None.
unsigned long I2SIntStatus ( unsigned long  ulBase)

Gets the current interrupt status.

Parameters
ulBaseis the base address of the I2S module.

This function returns the raw interrupt status for I2S enumerated as a bit field of values: -I2S_STS_XERR -I2S_STS_XDMAERR -I2S_STS_XSTAFRM -I2S_STS_XDATA -I2S_STS_XLAST -I2S_STS_XSYNCERR -I2S_STS_XUNDRN -I2S_STS_XDMA -I2S_STS_RERR -I2S_STS_RDMAERR -I2S_STS_RSTAFRM -I2S_STS_RDATA -I2S_STS_RLAST -I2S_STS_RSYNCERR -I2S_STS_ROVERN -I2S_STS_RDMA

Returns
Returns the current interrupt status, enumerated as a bit field of values described above.
void I2SIntUnregister ( unsigned long  ulBase)

Unregisters an interrupt handler for a I2S interrupt.

Parameters
ulBaseis the base address of the I2S module.

This function does the actual unregistering of the interrupt handler. It clears the handler to be called when a I2S interrupt occurs. This function also masks off the interrupt in the interrupt controller so that the interrupt handler no longer is called.

See also
IntRegister() for important information about registering interrupt handlers.
Returns
None.
void I2SRxActiveSlotSet ( unsigned long  ulBase,
unsigned long  ulActSlot 
)

Set the active slots for Receiver

Parameters
ulBaseis the base address of the I2S module.
ulActSlotis the bit-mask of activ slots

This function sets the active slots for the receiver. By default both the slots are active. The parameter ulActSlot is logical OR follwoing values: -I2S_ACT_SLOT_EVEN -I2S_ACT_SLOT_ODD

Returns
None.
void I2SRxFIFODisable ( unsigned long  ulBase)

Disables receive FIFO.

Parameters
ulBaseis the base address of the I2S module.

This function disables the I2S receive FIFO.

Returns
None.
void I2SRxFIFOEnable ( unsigned long  ulBase,
unsigned long  ulRxLevel,
unsigned long  ulWordsPerTransfer 
)

Configure and enable receive FIFO.

Parameters
ulBaseis the base address of the I2S module.
ulRxLevelis the receive FIFO DMA request level.
ulWordsPerTransferis the nuber of words transferred from the FIFO.

This function configures and enable I2S receive FIFO.

The parameter ulRxLevel sets the level at which receive DMA requests are generated. This should be non-zero integer multiple of number of serializers enabled as receivers.

The parameter ulWordsPerTransfer sets the number of words that are transferred to the receive FIFO from the data line(s). This value must equal the number of serializers used as receivers.

Returns
None.
unsigned long I2SRxFIFOStatusGet ( unsigned long  ulBase)

Get the receive FIFO status.

Parameters
ulBaseis the base address of the I2S module.

This function gets the number of 32-bit words currently in the receive FIFO.

Returns
Returns receive FIFO status.
void I2SSerializerConfig ( unsigned long  ulBase,
unsigned long  ulDataLine,
unsigned long  ulSerMode,
unsigned long  ulInActState 
)

Configure the serializer in specified mode.

Parameters
ulBaseis the base address of the I2S module.
ulDataLineis the data line (serilizer) to be configured.
ulSerModeis the required serializer mode.
ulInActStatesets the inactive state of the data line.

This function configure and enable the serializer associated with the given data line in specified mode.

The paramenter ulDataLine selects to data line to be configured and can be one of the following: -I2S_DATA_LINE_0 -I2S_DATA_LINE_1

The parameter ulSerMode can be one of the following: -I2S_SER_MODE_TX -I2S_SER_MODE_RX -I2S_SER_MODE_DISABLE

The parameter ulInActState can be one of the following -I2S_INACT_TRI_STATE -I2S_INACT_LOW_LEVEL -I2S_INACT_LOW_HIGH

Returns
Returns receive FIFO status.
void I2STxActiveSlotSet ( unsigned long  ulBase,
unsigned long  ulActSlot 
)

Set the active slots for Trasmitter

Parameters
ulBaseis the base address of the I2S module.
ulActSlotis the bit-mask of activ slots

This function sets the active slots for the transmitter. By default both the slots are active. The parameter ulActSlot is logical OR follwoing values: -I2S_ACT_SLOT_EVEN -I2S_ACT_SLOT_ODD

Returns
None.
void I2STxFIFODisable ( unsigned long  ulBase)

Disables transmit FIFO.

Parameters
ulBaseis the base address of the I2S module.

This function disables the I2S transmit FIFO.

Returns
None.
void I2STxFIFOEnable ( unsigned long  ulBase,
unsigned long  ulTxLevel,
unsigned long  ulWordsPerTransfer 
)

Configure and enable transmit FIFO.

Parameters
ulBaseis the base address of the I2S module.
ulTxLevelis the transmit FIFO DMA request level.
ulWordsPerTransferis the nuber of words transferred from the FIFO.

This function configures and enable I2S transmit FIFO.

The parameter ulTxLevel sets the level at which transmit DMA requests are generated. This should be non-zero integer multiple of number of serializers enabled as transmitters

The parameter ulWordsPerTransfer sets the number of words that are transferred from the transmit FIFO to the data line(s). This value must equal the number of serializers used as transmitters.

Returns
None.
unsigned long I2STxFIFOStatusGet ( unsigned long  ulBase)

Get the transmit FIFO status.

Parameters
ulBaseis the base address of the I2S module.

This function gets the number of 32-bit words currently in the transmit FIFO.

Returns
Returns transmit FIFO status.