Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STM32H7 BDMA driver #1115

Merged
merged 4 commits into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/modm/platform/dac/stm32/dac_dma.hpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ public:
* @param circularMode DMA circular mode setting
* @param priority DMA transfer priority
*/
static void configure(const void* data, size_t dataSize, DmaBase::CircularMode circularMode,
DmaBase::Priority priority = DmaBase::Priority::Medium);
static void configure(const void* data, size_t dataSize, DmaChannel::CircularMode circularMode,
DmaChannel::Priority priority = DmaChannel::Priority::Medium);

/**
* Set data to transfer
Expand Down
20 changes: 10 additions & 10 deletions src/modm/platform/dac/stm32/dac_dma_impl.hpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -107,26 +107,26 @@ bool

template<typename DmaChannel>
void
{{ channel }}::configure(const void* data, size_t dataLength, DmaBase::CircularMode circularMode,
DmaBase::Priority priority)
{{ channel }}::configure(const void* data, size_t dataLength, DmaChannel::CircularMode circularMode,
DmaChannel::Priority priority)
{
%% if target.family in ["f2", "f4", "f7"]
using RequestMapping = typename DmaChannel::RequestMapping<Peripheral::Dac{{ id }}, DmaBase::Signal::Dac{{ channel_id }}>;
using RequestMapping = typename DmaChannel::RequestMapping<Peripheral::Dac{{ id }}, DmaChannel::Signal::Dac{{ channel_id }}>;
%% else
using RequestMapping = typename DmaChannel::RequestMapping<Peripheral::Dac{{ id }}, DmaBase::Signal::Ch{{ channel_id }}>;
using RequestMapping = typename DmaChannel::RequestMapping<Peripheral::Dac{{ id }}, DmaChannel::Signal::Ch{{ channel_id }}>;
%% endif
constexpr auto request = RequestMapping::Request;

DmaChannel::configure(
DmaBase::DataTransferDirection::MemoryToPeripheral,
DmaBase::MemoryDataSize::HalfWord,
DmaChannel::DataTransferDirection::MemoryToPeripheral,
DmaChannel::MemoryDataSize::HalfWord,
%% if target.family in ["f0", "f2", "f3", "f4", "f7", "h7"]
DmaBase::PeripheralDataSize::HalfWord,
DmaChannel::PeripheralDataSize::HalfWord,
%% else
DmaBase::PeripheralDataSize::Word,
DmaChannel::PeripheralDataSize::Word,
%% endif
DmaBase::MemoryIncrementMode::Increment,
DmaBase::PeripheralIncrementMode::Fixed,
DmaChannel::MemoryIncrementMode::Increment,
DmaChannel::PeripheralIncrementMode::Fixed,
priority,
circularMode
);
Expand Down
34 changes: 34 additions & 0 deletions src/modm/platform/dma/stm32-bdma/bdma.cpp.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* Copyright (c) 2023, Christopher Durand
*
* This file is part of the modm project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
// ----------------------------------------------------------------------------

%% if instance == ""
#include "bdma.hpp"
%% else
#include "bdma_{{ instance }}.hpp"
%% endif

%% if instance == "1"
MODM_ISR(BDMA1)
{
using modm::platform::Bdma1;
%% for channel in range(0, channel_count)
Bdma1::Channel{{ channel }}::interruptHandler();
%% endfor
}
%% else
%% for channel in range(0, channel_count)
MODM_ISR(BDMA{{ instance }}_Channel{{ channel }})
{
using modm::platform::Bdma{{ instance }};
Bdma{{ instance }}::Channel{{ channel }}::interruptHandler();
}
%% endfor
%% endif
Loading
Loading