|
| 1 | +/* mbed Microcontroller Library |
| 2 | + * Copyright (c) 2016-2023 STMicroelectronics |
| 3 | + * SPDX-License-Identifier: Apache-2.0 |
| 4 | + * |
| 5 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | + * you may not use this file except in compliance with the License. |
| 7 | + * You may obtain a copy of the License at |
| 8 | + * |
| 9 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | + * |
| 11 | + * Unless required by applicable law or agreed to in writing, software |
| 12 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | + * See the License for the specific language governing permissions and |
| 15 | + * limitations under the License. |
| 16 | + */ |
| 17 | + |
| 18 | +#ifndef MBED_OS_STM_DMA_INFO_H |
| 19 | +#define MBED_OS_STM_DMA_INFO_H |
| 20 | + |
| 21 | +#include "cmsis.h" |
| 22 | +#include "stm_dma_utils.h" |
| 23 | + |
| 24 | +// See STM32F1 reference manual Tables 78 and 79. |
| 25 | + |
| 26 | +/// Mapping from SPI index to DMA link info for Tx |
| 27 | +static const DMALinkInfo SPITxDMALinks[] = { |
| 28 | + {1, 3}, // SPI1 Tx is DMA1 Channel 3 |
| 29 | + {1, 5}, // SPI2 Tx is DMA1 Channel 5 |
| 30 | + {2, 2}, // SPI3 Tx is DMA2 Channel 2 |
| 31 | +}; |
| 32 | + |
| 33 | +/// Mapping from SPI index to DMA link info for Rx |
| 34 | +static const DMALinkInfo SPIRxDMALinks[] = { |
| 35 | + {1, 2}, // SPI1 Rx is DMA1 Channel 2 |
| 36 | + {1, 4}, // SPI2 Rx is DMA1 Channel 4 |
| 37 | + {2, 1}, // SPI3 Rx is DMA2 Channel 1 |
| 38 | +}; |
| 39 | + |
| 40 | +#endif //MBED_OS_STM_DMA_INFO_H |
0 commit comments