libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
dma_common_csel.h
Go to the documentation of this file.
1/** @addtogroup dma_defines
2*/
3/*
4 * This file is part of the libopencm3 project.
5 *
6 * This library is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public License
17 * along with this library. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20/* THIS FILE SHOULD NOT BE INCLUDED DIRECTLY, BUT ONLY VIA DMA.H
21The order of header inclusion is important. dma.h includes the device
22specific memorymap.h header before including this header file.*/
23
24/**@{*/
25
26/** @cond */
27#ifdef LIBOPENCM3_DMA_H
28/** @endcond */
29#pragma once
30
31
32/* DMA channel selection register (DMAx_CSELR) */
33#define DMA_CSELR(dma_base) MMIO32((dma_base) + 0xA8)
34#define DMA1_CSELR DMA_CSELR(DMA1)
35#define DMA2_CSELR DMA_CSELR(DMA2)
36
37/* --- DMA_CSELR values -------------------------------------------- */
38
39#define DMA_CSELR_CxS_SHIFT(channel) (4 * ((channel) - 1))
40#define DMA_CSELR_CxS_MASK (0x0f)
41
42/* --- Function prototypes ------------------------------------------------- */
43
45
46void dma_set_channel_request(uint32_t dma, uint8_t channel, uint8_t request);
47
49
50/** @cond */
51#else
52#warning "dma_common_csel.h should not be included explicitly, only via dma.h"
53#endif
54/** @endcond */
55
56/**@}*/
#define END_DECLS
Definition: common.h:34
#define BEGIN_DECLS
Definition: common.h:33
void dma_set_channel_request(uint32_t dma, uint8_t channel, uint8_t request)
DMA Channel Set Request Selection.