Skyward boardcore
Loading...
Searching...
No Matches
DMADefs.cpp
Go to the documentation of this file.
1/* Copyright (c) 2025 Skyward Experimental Rocketry
2 * Author: Fabrizio Monti
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a copy
5 * of this software and associated documentation files (the "Software"), to deal
6 * in the Software without restriction, including without limitation the rights
7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 * copies of the Software, and to permit persons to whom the Software is
9 * furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 * THE SOFTWARE.
21 */
22
23#include "DMADefs.h"
24
25// Include board mappings
26#if defined(STM32F407xx)
28
29#elif defined(STM32F429xx)
31
32#elif defined(STM32F767xx)
34
35#else
36#warning \
37 "DMA: mapping not supported for this board! An empty mapping will be used, acquireStreamForPeripheral() will not work!"
38namespace Boardcore
39{
40namespace DMADefs
41{
42const std::multimap<Peripherals, std::pair<DMAStreamId, Channel> >
43 mapPeripherals = {};
44} // namespace DMADefs
45} // namespace Boardcore
46
47#endif
48
49// Check that at most 1 board is defined
50#if defined(STM32F407xx) + defined(STM32F429xx) + defined(STM32F767xx) > 1
51#error "DMA: Multiple boards defined. Only one must be defined"
52#endif
53
54namespace Boardcore
55{
56
57namespace DMADefs
58{
59
60const IRQn_Type irqNumberMapping[] = {
61 DMA1_Stream0_IRQn, DMA1_Stream1_IRQn, DMA1_Stream2_IRQn, DMA1_Stream3_IRQn,
62 DMA1_Stream4_IRQn, DMA1_Stream5_IRQn, DMA1_Stream6_IRQn, DMA1_Stream7_IRQn,
63 DMA2_Stream0_IRQn, DMA2_Stream1_IRQn, DMA2_Stream2_IRQn, DMA2_Stream3_IRQn,
64 DMA2_Stream4_IRQn, DMA2_Stream5_IRQn, DMA2_Stream6_IRQn, DMA2_Stream7_IRQn,
65};
66
67} // namespace DMADefs
68
69} // namespace Boardcore
const IRQn_Type irqNumberMapping[]
Mapping between DMAStreamId and the corresponding irq number. This is needed because irq number value...
Definition DMADefs.cpp:60
const std::multimap< Peripherals, std::pair< DMAStreamId, Channel > > mapPeripherals
Maps the peripherals to the dma streams (and the corresponding channel) that are connected with.
This file includes all the types the logdecoder script will decode.