CC27xxDriverLibrary
i2s.h File Reference
#include <stdbool.h>
#include <stdint.h>
#include "../inc/hw_types.h"
#include "../inc/hw_ints.h"
#include "../inc/hw_memmap.h"
#include "../inc/hw_i2s.h"
#include "debug.h"
#include "interrupt.h"
Include dependency graph for i2s.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define I2S_SD0_DIS   I2S_AIFDIRCFG_AD0_DIS
 SD0 is disabled. More...
 
#define I2S_SD0_IN   I2S_AIFDIRCFG_AD0_IN
 SD0 is an input. More...
 
#define I2S_SD0_OUT   I2S_AIFDIRCFG_AD0_OUT
 SD0 is an output. More...
 
#define I2S_SD1_DIS   I2S_AIFDIRCFG_AD1_DIS
 SD1 is disabled. More...
 
#define I2S_SD1_IN   I2S_AIFDIRCFG_AD1_IN
 SD1 is an input. More...
 
#define I2S_SD1_OUT   I2S_AIFDIRCFG_AD1_OUT
 SD1 is an output. More...
 
#define I2S_CHAN0_MASK   0x00000001
 
#define I2S_CHAN1_MASK   0x00000002
 
#define I2S_CHAN2_MASK   0x00000004
 
#define I2S_CHAN3_MASK   0x00000008
 
#define I2S_CHAN4_MASK   0x00000010
 
#define I2S_CHAN5_MASK   0x00000020
 
#define I2S_CHAN6_MASK   0x00000040
 
#define I2S_CHAN7_MASK   0x00000080
 
#define I2S_MEM_LENGTH_16   I2S_FMTCFG_MEMLEN32_DIS
 16 bit size of word in memory More...
 
#define I2S_MEM_LENGTH_32   I2S_FMTCFG_MEMLEN32_EN
 24 bit size of word in memory More...
 
#define I2S_POS_EDGE   I2S_FMTCFG_SMPLEDGE_POSEDGE
 Sample on positive edge. More...
 
#define I2S_NEG_EDGE   I2S_FMTCFG_SMPLEDGE_NEGEDGE
 Sample on negative edge. More...
 
#define I2S_STMP_SATURATION   0x0000FFFF
 The saturation value used when calculating the sample stamp. More...
 
#define I2S_INT_XCNT_CAPTURE   I2S_IRQFLAGS_XCNTCAPT
 MCUCLK Capture. More...
 
#define I2S_INT_DMA_IN   I2S_IRQFLAGS_DMAIN
 DMA output buffer full interrupt. More...
 
#define I2S_INT_DMA_OUT   I2S_IRQFLAGS_DMAOUT
 DMA input buffer empty interrupt. More...
 
#define I2S_INT_TIMEOUT   I2S_IRQFLAGS_WCLKTIMEOUT
 Word Clock Timeout. More...
 
#define I2S_INT_BUS_ERR   I2S_IRQFLAGS_BUSERR
 DMA Bus error. More...
 
#define I2S_INT_WCLK_ERR   I2S_IRQFLAGS_WCLKERR
 Word Clock error. More...
 
#define I2S_INT_PTR_ERR   I2S_IRQFLAGS_PTRERR
 Data pointer error (DMA data was not updated in time) More...
 
#define I2S_INT_ALL
 All interrupts. More...
 

Functions

__STATIC_INLINE void I2SEnableInt (uint32_t base, uint32_t intFlags)
 Enables individual I2S interrupt sources. More...
 
__STATIC_INLINE void I2SDisableInt (uint32_t base, uint32_t intFlags)
 Disables individual I2S interrupt sources. More...
 
__STATIC_INLINE uint32_t I2SIntStatus (uint32_t base, bool masked)
 Gets the current interrupt status. More...
 
__STATIC_INLINE void I2SClearInt (uint32_t base, uint32_t intFlags)
 Clears I2S interrupt sources. More...
 
__STATIC_INLINE void I2SEnableSampleStamp (uint32_t base)
 Enable the Sample Stamp generator. More...
 
__STATIC_INLINE void I2SDisableSampleStamp (uint32_t base)
 Disable the Sample Stamp generator. More...
 
uint32_t I2SGetSampleStamp (uint32_t base, uint32_t channel)
 Get the current value of a sample stamp counter. More...
 
__STATIC_INLINE void I2SStart (uint32_t base, uint16_t dmaLength)
 Starts the I2S. More...
 
__STATIC_INLINE void I2SStop (uint32_t base)
 Stops the I2S module for operation. More...
 
__STATIC_INLINE void I2SConfigureFormat (uint32_t base, uint8_t dataDelay, uint32_t memoryLength, uint32_t samplingEdge, bool dualPhase, uint8_t bitsPerSample)
 Configure the serial format of the I2S module. More...
 
__STATIC_INLINE void I2SConfigureFrame (uint32_t base, uint8_t sd0Usage, uint8_t sd0Channels, uint8_t sd1Usage, uint8_t sd1Channels)
 Setup the two interfaces SD0 and SD1 (also called AD0 and AD1). More...
 
__STATIC_INLINE void I2SConfigureClocks (uint32_t base, bool isController, bool invertWclk, bool dualPhase, uint32_t cclkDiv, uint32_t wclkDiv, uint32_t bclkDiv)
 Configure the I2S clocks (CCLK, WCLK and BCLK). More...
 
__STATIC_INLINE void I2SEnableControllerClocks (uint32_t base)
 Enable the I2S controller clocks (CCLK, WCLK and BCLK). More...
 
__STATIC_INLINE void I2SDisableControllerClocks (uint32_t base)
 Disable the I2S controller clocks (CCLK, WCLK and BCLK). More...
 
__STATIC_INLINE void I2SSetInPointer (uint32_t base, uint32_t nextPointer)
 Set the next input buffer pointer. More...
 
__STATIC_INLINE void I2SSetOutPointer (uint32_t base, uint32_t nextPointer)
 Set the next output buffer pointer. More...
 
__STATIC_INLINE uint32_t I2SGetInPointerNext (uint32_t base)
 Get value of the next input pointer. More...
 
__STATIC_INLINE uint32_t I2SGetOutPointerNext (uint32_t base)
 Get value of the next output pointer. More...
 
__STATIC_INLINE uint32_t I2SGetInPointer (uint32_t base)
 Get value of the current input pointer. More...
 
__STATIC_INLINE uint32_t I2SGetOutPointer (uint32_t base)
 Get value of the current output pointer. More...
 
__STATIC_INLINE void I2SConfigureInSampleStampTrigger (uint32_t base, uint16_t trigValue)
 Configure the input sample stamp trigger. More...
 
__STATIC_INLINE void I2SConfigureOutSampleStampTrigger (uint32_t base, uint16_t trigValue)
 Configure the output sample stamp trigger. More...
 
__STATIC_INLINE void I2SConfigureWclkCounterPeriod (uint32_t base, uint16_t period)
 Configure the WCLK counter period. More...
 
__STATIC_INLINE void I2SConfigureWclkCounter (uint32_t base, int16_t value)
 Confiugre the WCLK counter value. More...
 
__STATIC_INLINE void I2SResetWclkCounter (uint32_t base)
 Reset the WCLK count. More...