aboutsummaryrefslogtreecommitdiff
path: root/stmhal/dma.h
diff options
context:
space:
mode:
authorDamien George2015-06-10 13:06:48 +0100
committerDamien George2015-06-10 14:01:44 +0100
commit3d30d605f5286774edb7669f3958628e5c656048 (patch)
tree29a1e5b6a8a1bb21c09cb8a6d7fa2b3147da03d3 /stmhal/dma.h
parent7ed58cb66379f4d87e3e8fbb68baada19048ac18 (diff)
stmhal: Factor out DMA initialisation code from spi.c.
This is so that the DMA can be shared by multiple peripherals.
Diffstat (limited to 'stmhal/dma.h')
-rw-r--r--stmhal/dma.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/stmhal/dma.h b/stmhal/dma.h
new file mode 100644
index 000000000..fc651ff15
--- /dev/null
+++ b/stmhal/dma.h
@@ -0,0 +1,29 @@
+/*
+ * This file is part of the Micro Python project, http://micropython.org/
+ *
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2015 Damien P. George
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+void dma_init(DMA_HandleTypeDef *dma, DMA_Stream_TypeDef *dma_stream, uint32_t dma_channel, uint32_t direction, void *data);
+void dma_deinit(DMA_HandleTypeDef *dma);
+void dma_invalidate_channel(DMA_Stream_TypeDef *dma_stream, uint32_t dma_channel);