mirror of
https://github.com/micropython/micropython.git
synced 2026-01-05 03:30:14 +01:00
mimxrt: Restructure nxp_sdk to match official mcux-sdk.
The official mcux-sdk follows a slightly different structure to the current nxp_sdk submodule, with many drivers moved to a common location. To ease updating the newer versions of the SDK and/or add new families the nxp_sdk submodule has been updated to follow the structure of mcux-sdk, just trimmed down to families used here to considerably reduce the size. Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
This commit is contained in:
@@ -35,8 +35,14 @@
|
||||
#include "fsl_iomuxc.h"
|
||||
#include "fsl_dmamux.h"
|
||||
#include "fsl_edma.h"
|
||||
#include "fsl_common.h"
|
||||
#include "fsl_sai.h"
|
||||
|
||||
#ifndef FSL_FEATURE_SAI_FIFO_COUNTn
|
||||
// Back-compat with mcux-sdk 2.11
|
||||
#define FSL_FEATURE_SAI_FIFO_COUNTn(x) FSL_FEATURE_SAI_FIFO_COUNT
|
||||
#endif
|
||||
|
||||
// Notes on this port's specific implementation of I2S:
|
||||
// - the DMA callback is used to implement the asynchronous background operations, for non-blocking mode
|
||||
// - all 3 Modes of operation are implemented using the peripheral drivers in the NXP MCUXpresso SDK
|
||||
@@ -538,14 +544,14 @@ static bool i2s_init(machine_i2s_obj_t *self) {
|
||||
EDMA_PrepareTransfer(&transferConfig,
|
||||
self->dma_buffer_dcache_aligned, bytes_per_sample,
|
||||
(void *)destAddr, bytes_per_sample,
|
||||
(FSL_FEATURE_SAI_FIFO_COUNT - saiConfig.fifo.fifoWatermark) * bytes_per_sample,
|
||||
(FSL_FEATURE_SAI_FIFO_COUNTn(self->i2s_inst) - saiConfig.fifo.fifoWatermark) * bytes_per_sample,
|
||||
SIZEOF_DMA_BUFFER_IN_BYTES, kEDMA_MemoryToPeripheral);
|
||||
} else { // RX
|
||||
uint32_t srcAddr = SAI_RxGetDataRegisterAddress(self->i2s_inst, SAI_CHANNEL_0);
|
||||
EDMA_PrepareTransfer(&transferConfig,
|
||||
(void *)srcAddr, bytes_per_sample,
|
||||
self->dma_buffer_dcache_aligned, bytes_per_sample,
|
||||
(FSL_FEATURE_SAI_FIFO_COUNT - saiConfig.fifo.fifoWatermark) * bytes_per_sample,
|
||||
(FSL_FEATURE_SAI_FIFO_COUNTn(self->i2s_inst) - saiConfig.fifo.fifoWatermark) * bytes_per_sample,
|
||||
SIZEOF_DMA_BUFFER_IN_BYTES, kEDMA_PeripheralToMemory);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user