49 #define I2SEnable NOROM_I2SEnable
50 #undef I2SAudioFormatConfigure
51 #define I2SAudioFormatConfigure NOROM_I2SAudioFormatConfigure
52 #undef I2SChannelConfigure
53 #define I2SChannelConfigure NOROM_I2SChannelConfigure
54 #undef I2SBufferConfig
55 #define I2SBufferConfig NOROM_I2SBufferConfig
56 #undef I2SPointerUpdate
57 #define I2SPointerUpdate NOROM_I2SPointerUpdate
59 #define I2SPointerSet NOROM_I2SPointerSet
60 #undef I2SSampleStampConfigure
61 #define I2SSampleStampConfigure NOROM_I2SSampleStampConfigure
62 #undef I2SSampleStampGet
63 #define I2SSampleStampGet NOROM_I2SSampleStampGet
84 ASSERT(I2SBaseValid(ui32Base));
89 if(!(g_pControlTable))
115 uint32_t ui32BitClkDelay)
120 ASSERT(I2SBaseValid(ui32Base));
121 ASSERT(ui32BitClkDelay <= 255);
141 uint32_t ui32Chan1Cfg, uint32_t ui32Chan2Cfg)
144 uint32_t ui32OutChan;
145 uint32_t ui32ChanMask;
150 ASSERT(I2SBaseValid(ui32Base));
183 if(ui32ChanMask & 0x1)
198 if(ui32ChanMask & 0x1)
210 if(ui32Chan1Cfg & I2S_LINE_INPUT)
214 if(ui32ChanMask & 0x1)
224 else if(ui32Chan1Cfg & I2S_LINE_OUTPUT)
228 if(ui32ChanMask & 0x1)
240 if(ui32Chan2Cfg & I2S_LINE_INPUT)
244 if(ui32ChanMask & 0x1)
254 else if(ui32Chan2Cfg & I2S_LINE_OUTPUT)
258 if(ui32ChanMask & 0x1)
269 g_pControlTable->
ui8InChan = (uint8_t)ui32InChan;
270 g_pControlTable->
ui8OutChan = (uint8_t)ui32OutChan;
280 uint32_t ui32OutBufBase, uint16_t ui16DMABufSize,
281 uint16_t ui16ChanBufSize)
286 ASSERT(I2SBaseValid(ui32Base));
287 ASSERT(ui16DMABufSize > 0);
309 ASSERT(I2SBaseValid(ui32Base));
332 uint32_t ui32NextPtr;
337 ASSERT(I2SBaseValid(ui32Base));
344 ui32NextPtr = (g_pControlTable->
ui8InChan *
375 uint32_t ui32Trigger;
380 ASSERT(I2SBaseValid(ui32Base));
383 ui32Trigger = (ui32Trigger + 2) % g_pControlTable->
ui16ChBufSize;
411 uint32_t ui32FrameClkCnt;
412 uint32_t ui32SysClkCnt;
413 uint32_t ui32PeriodSysClkCnt;
414 uint32_t ui32SampleStamp;
434 ui32SampleStamp = (ui32SysClkCnt << 16) / ui32PeriodSysClkCnt;
437 ui32SampleStamp |= (ui32FrameClkCnt << 16);
439 return (ui32SampleStamp);
void I2SSampleStampConfigure(uint32_t ui32Base, bool bInput, bool bOutput)
Configure the sample stamp generator.
void I2SPointerSet(uint32_t ui32Base, bool bInput, void *pNextPointer)
Set the buffer pointers.
void I2SBufferConfig(uint32_t ui32Base, uint32_t ui32InBufBase, uint32_t ui32OutBufBase, uint16_t ui16DMABufSize, uint16_t ui16ChanBufSize)
Set the input buffer pointers.
#define I2S_CHAN_CFG_MASK
uint16_t ui16DMABufSize
Size of DMA buffer in number of samples.
#define I2S_MEM_LENGTH_24
uint32_t ui32InOffset
Value of the current input pointer offset.
uint32_t I2SSampleStampGet(uint32_t ui32Base, uint32_t ui32Channel)
Get the current value of a sample stamp counter.
uint32_t ui32OutOffset
Value of the current output pointer offset.
uint32_t ui32OutBase
Base address of the output buffer.
void I2SPointerUpdate(uint32_t ui32Base, bool bInput)
Update the buffer pointers.
uint16_t ui16MemLen
Length of the audio words stored in memory.
A structure that defines an audio control table. Note: Memory for this structure must be initialized ...
uint8_t ui8InChan
Input Channel.
void I2SEnable(uint32_t ui32Base)
Enables the I2S module for operation.
uint32_t ui32InBase
Base address of the input buffer.
void I2SAudioFormatConfigure(uint32_t ui32Base, uint32_t ui32FmtCfg, uint32_t ui32BitClkDelay)
Configures the I2S module.
uint8_t ui8OutChan
Output Channel.
#define I2S_STMP_SATURATION
void I2SChannelConfigure(uint32_t ui32Base, uint32_t ui32Chan0Cfg, uint32_t ui32Chan1Cfg, uint32_t ui32Chan2Cfg)
Setup the audio channel configuration.
I2SControlTable * g_pControlTable
uint16_t ui16ChBufSize
Size of Channel buffer.