const uint16_t *s; uint8_t *d; uint16_t left_input; uint16_t right_input; /* (set up s to point to the 16-bit source data) */ /* (set up d to point to the 24-bit destination buffer) */ while(d < e) /* as long as you're within the buffer limit... */ { left_input = *s++; /* read a 16-bit word */ right_input = *s++; /* read another 16-bit word */ *d++ = left_input >> 8; /* write highbyte as Most Significant Byte */ *d++ = left_input; /* write lowbyte as mid-byte */ *d++ = left_input >> 8; /* 8-bit extend by duplicating highbyte as the Least Significant Byte */ /* you may need to insert a zero-byte here */ *d++ = right_input >> 8; /* write highbyte as Most Significant Byte */ *d++ = right_input; /* write lowbyte as mid-byte */ *d++ = right_input >> 8; /* 8-bit extend by duplicating highbyte as the Least Significant Byte */ /* you may need to insert a zero-byte here */ } |
mono = (left + right) >> 1; |
Hi, is the idea here using the dma in M2P(memory to peripherial) mode to send the wave data which is in the LLI construct pointing to two buffers towards the i2s_txfifo, and leave it to the interface for sending this data towards the uda1380? Thanks i am having a little trouble with synchornising the timing.
How sure are you of the solution you proposed(any practical experience or is it all theory a good no less), how is the dma transfer size to be determined ?