Hi @CarbonTony ,
Answer your questions:
1] Yes sorry I have set up with SAI, So this is working as I2C or I2S. With the cofig tools it appears to
be setting up as I2S [ for Audio ] As mentioned in my previous post I DO NOT want audio in, Just audio out.
If you don't want audio in, just audio out, it is very easy, just use this code:
SDK_2_10_0_EVK-MIMXRT1010\boards\evkmimxrt1010\driver_examples\sai\edma_transfer
2] As above, I just want Audio Out, so can I just use the Config Tools settings for SAI and ignore the codec settings etc ?
Yes, if you don't want to use the codec, just don't configure it is OK, then the SAI code is the same, you can use the oscillator or logic analyzer to check the SAI bus, it is the same.
3] Thanks that make sense, but the example code is for music output, it does not use the input,
I am a little confusing now, you say you need sai output, then you need input again.
If you need input, you can refer to :
SDK_2_10_0_EVK-MIMXRT1010\boards\evkmimxrt1010\driver_examples\sai\edma_record_playback
You can consider:
input is SAI RX, output is SAI TX.
If you don't want codec, just don't add the codec code, then check the SAI bus directly, as I have tested two code which is using different board communicate through the SAI directly, use the SAI RX and SAI TX directly, it works without the codec.
4] I still don't understand why it is an 8bit array, when the SAI has been setup for 16bit transfers
AT_NONCACHEABLE_SECTON_ALIGN(static uint8_t buffer[BUFFER_NUM * BUFFER_SIZE], 4);
8bit is used to put the music data, as some tool will generate the 8bit array. you can see the music is also 8bit, then it will copy the music array to the buffer, then send to the SAI DMA to play it. If you need other size buffer, you also can use it.
The EDMASAI example still uses the input codec.
Is there an SDK command that transmits a buffer direct to the SAI interface ?
As I told you, if you don't need codec, just comment the following code:
if (CODEC_Init(&codecHandle, &boardCodecConfig) != kStatus_Success)
{
assert(false);
}
if (CODEC_SetVolume(&codecHandle, kCODEC_PlayChannelHeadphoneLeft | kCODEC_PlayChannelHeadphoneRight,
DEMO_CODEC_VOLUME) != kStatus_Success)
{
assert(false);
}
I have a question about the SAI peripheral config tool [ almost not documentation available ! ]
When I select Interrupt as an option [ as opposed to EDMA ] doe this mean the transfer is initiated by
the interrupt call back, or does it mean a successful transfer generates an interrupt ?
If you use interrupt and register callback, then after successful, it will generate the itnerrupt and call the callback.
Wish it helps you!
If you still have questions about it, please kindly let me know.
Kerry