CC26xx Driver Library
i2s.h File Reference
#include <stdbool.h>
#include <stdint.h>
#include "../inc/hw_types.h"
#include "../inc/hw_memmap.h"
#include "../inc/hw_ints.h"
#include "../inc/hw_i2s.h"
#include "debug.h"
#include "interrupt.h"

Data Structures

struct  I2SControlTable
 A structure that defines an audio control table. Note: Memory for this structure must be initialized by user application. See detailed description! More...
 

Macros

#define I2S_DMA_BUF_SIZE_64   0x00000040
 
#define I2S_DMA_BUF_SIZE_128   0x00000080
 
#define I2S_DMA_BUF_SIZE_256   0x00000100
 
#define I2S_EXT_WCLK   0x00000001
 
#define I2S_INT_WCLK   0x00000002
 
#define I2S_INVERT_WCLK   0x00000004
 
#define I2S_NORMAL_WCLK   0x00000000
 
#define I2S_LINE_UNUSED   0x00000000
 
#define I2S_LINE_INPUT   0x00000001
 
#define I2S_LINE_OUTPUT   0x00000002
 
#define I2S_LINE_MASK   0x00000003
 
#define I2S_CHAN0_ACT   0x00000100
 
#define I2S_CHAN1_ACT   0x00000200
 
#define I2S_CHAN2_ACT   0x00000400
 
#define I2S_CHAN3_ACT   0x00000800
 
#define I2S_CHAN4_ACT   0x00001000
 
#define I2S_CHAN5_ACT   0x00002000
 
#define I2S_CHAN6_ACT   0x00004000
 
#define I2S_CHAN7_ACT   0x00008000
 
#define I2S_MONO_MODE   0x00000100
 
#define I2S_STEREO_MODE   0x00000300
 
#define I2S_CHAN_CFG_MASK   0x0000FF00
 
#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   0x00000000
 
#define I2S_MEM_LENGTH_24   0x00000080
 
#define I2S_POS_EDGE   0x00000040
 
#define I2S_NEG_EDGE   0x00000000
 
#define I2S_DUAL_PHASE_FMT   0x00000020
 
#define I2S_SINGLE_PHASE_FMT   0x00000000
 
#define I2S_WORD_LENGTH_8   0x00000008
 
#define I2S_WORD_LENGTH_16   0x00000010
 
#define I2S_WORD_LENGTH_24   0x00000018
 
#define I2S_STMP0   0x00000001
 
#define I2S_STMP1   0x00000002
 
#define I2S_STMP_SATURATION   0x0000FFFF
 
#define I2S_INT_DMA_IN   0x00000020
 
#define I2S_INT_DMA_OUT   0x00000010
 
#define I2S_INT_TIMEOUT   0x00000008
 
#define I2S_INT_BUS_ERR   0x00000004
 
#define I2S_INT_WCLK_ERR   0x00000002
 
#define I2S_INT_PTR_ERR   0x00000001
 
#define I2S_INT_ALL   0x0000003F
 

Functions

void I2SEnable (uint32_t ui32Base)
 Enables the I2S module for operation. More...
 
static void I2SDisable (uint32_t ui32Base)
 Disables the I2S module for operation. More...
 
void I2SAudioFormatConfigure (uint32_t ui32Base, uint32_t ui32FmtCfg, uint32_t ui32BitClkDelay)
 Configures the I2S module. More...
 
void I2SChannelConfigure (uint32_t ui32Base, uint32_t ui32Chan0Cfg, uint32_t ui32Chan1Cfg)
 Setup the audio channel configuration. More...
 
static void I2SClockConfigure (uint32_t ui32Base, uint32_t ui32ClkConfig)
 Configure the I2S frame clock. More...
 
void I2SBufferConfig (uint32_t ui32Base, uint32_t ui32InBufBase, uint32_t ui32OutBufBase, uint16_t ui16DMABufSize, uint16_t ui16ChanBufSize)
 Set the input buffer pointers. More...
 
void I2SPointerUpdate (uint32_t ui32Base, bool bInput)
 Update the buffer pointers. More...
 
void I2SPointerSet (uint32_t ui32Base, bool bInput, void *pNextPointer)
 Set a buffer pointer (input or output) directly. More...
 
static void I2SIntRegister (uint32_t ui32Base, void(*pfnHandler)(void))
 Registers an interrupt handler for an I2S interrupt in the dynamic interrupt table. More...
 
static void I2SIntUnregister (uint32_t ui32Base)
 Unregisters an interrupt handler for a I2S interrupt in the dynamic interrupt table. More...
 
void I2SSampleStampConfigure (uint32_t ui32Base, bool bInput, bool bOutput)
 Configure the sample stamp generator. More...
 
static void I2SIntEnable (uint32_t ui32Base, uint32_t ui32IntFlags)
 Enables individual I2S interrupt sources. More...
 
static void I2SIntDisable (uint32_t ui32Base, uint32_t ui32IntFlags)
 Disables individual I2S interrupt sources. More...
 
static uint32_t I2SIntStatus (uint32_t ui32Base, bool bMasked)
 Gets the current interrupt status. More...
 
static void I2SIntClear (uint32_t ui32Base, uint32_t ui32IntFlags)
 Clears I2S interrupt sources. More...
 
static void I2SSampleStampEnable (uint32_t ui32Base)
 Enable the Sample Stamp generator. More...
 
static void I2SSampleStampDisable (uint32_t ui32Base)
 Disable the Sample Stamp generator. More...
 
uint32_t I2SSampleStampGet (uint32_t ui32Base, uint32_t ui32Channel)
 Get the current value of a sample stamp counter. More...
 
static void I2SStart (uint32_t ui32Base, uint8_t ui8FixDMALength)
 Starts the I2S. More...
 
static void I2SStop (uint32_t ui32Base)
 Stops the I2S module for operation. More...
 
static void I2SFormatConfigure (uint32_t ui32Base, uint8_t ui8iDataDelay, uint8_t ui8iMemory24Bits, uint8_t ui8iSamplingEdge, bool boolDualPhase, uint8_t ui8BitsPerSample, uint16_t ui16transmissionDelay)
 Configure the serial format of the I2S module. More...
 
static void I2SFrameConfigure (uint32_t ui32Base, uint8_t ui8StatusAD0, uint8_t ui8ChanAD0, uint8_t ui8StatusAD1, uint8_t ui8ChanAD1)
 Setup the two interfaces SD0 and SD1 (also called AD0 and AD1). More...
 
static void I2SWclkConfigure (uint32_t ui32Base, bool boolMaster, bool boolWCLKInvert)
 Configure the I2S frame clock (also called WCLK or WS). More...
 
static void I2SInPointerSet (uint32_t ui32Base, uint32_t ui32NextPointer)
 Set the input buffer pointer. More...
 
static void I2SOutPointerSet (uint32_t ui32Base, uint32_t ui32NextPointer)
 Set the output buffer pointer. More...
 
static uint32_t I2SInPointerNextGet (uint32_t ui32Base)
 Get value stored in PTR NEXT IN register. More...
 
static uint32_t I2SOutPointerNextGet (uint32_t ui32Base)
 Get value stored in PTR NEXT OUT register. More...
 
static uint32_t I2SInPointerGet (uint32_t ui32Base)
 Get value stored in PTR IN register. More...
 
static uint32_t I2SOutPointerGet (uint32_t ui32Base)
 Get value stored in PTR OUT register. More...
 
static void I2SSampleStampInConfigure (uint32_t ui32Base, uint16_t ui16TrigValue)
 Configure the IN sample stamp generator. More...
 
static void I2SSampleStampOutConfigure (uint32_t ui32Base, uint16_t ui16TrigValue)
 Configure the OUT sample stamp generator. More...
 
static void I2SWclkCounterConfigure (uint32_t ui32Base, int16_t i16Value)
 Add the specified value to the WCLK count. More...
 
static void I2SWclkCounterReset (uint32_t ui32Base)
 Reset the WCLK count. More...
 

Variables

I2SControlTableg_pControlTable