mbed-dev-f303

Committer:
abe5b02d-a2d4-4fe9-818e-c4e57c809ea4
Date:
Tue Jun 14 09:21:18 2022 +0000
Revision:
0:bdf663c61a82
lib

Who changed what in which revision?

UserRevisionLine numberNew contents of line
abe5b02d-a2d4-4fe9-818e-c4e57c809ea4 0:bdf663c61a82 1
abe5b02d-a2d4-4fe9-818e-c4e57c809ea4 0:bdf663c61a82 2 /** \addtogroup hal */
abe5b02d-a2d4-4fe9-818e-c4e57c809ea4 0:bdf663c61a82 3 /** @{*/
abe5b02d-a2d4-4fe9-818e-c4e57c809ea4 0:bdf663c61a82 4 /* mbed Microcontroller Library
abe5b02d-a2d4-4fe9-818e-c4e57c809ea4 0:bdf663c61a82 5 * Copyright (c) 2014-2015 ARM Limited
abe5b02d-a2d4-4fe9-818e-c4e57c809ea4 0:bdf663c61a82 6 *
abe5b02d-a2d4-4fe9-818e-c4e57c809ea4 0:bdf663c61a82 7 * Licensed under the Apache License, Version 2.0 (the "License");
abe5b02d-a2d4-4fe9-818e-c4e57c809ea4 0:bdf663c61a82 8 * you may not use this file except in compliance with the License.
abe5b02d-a2d4-4fe9-818e-c4e57c809ea4 0:bdf663c61a82 9 * You may obtain a copy of the License at
abe5b02d-a2d4-4fe9-818e-c4e57c809ea4 0:bdf663c61a82 10 *
abe5b02d-a2d4-4fe9-818e-c4e57c809ea4 0:bdf663c61a82 11 * http://www.apache.org/licenses/LICENSE-2.0
abe5b02d-a2d4-4fe9-818e-c4e57c809ea4 0:bdf663c61a82 12 *
abe5b02d-a2d4-4fe9-818e-c4e57c809ea4 0:bdf663c61a82 13 * Unless required by applicable law or agreed to in writing, software
abe5b02d-a2d4-4fe9-818e-c4e57c809ea4 0:bdf663c61a82 14 * distributed under the License is distributed on an "AS IS" BASIS,
abe5b02d-a2d4-4fe9-818e-c4e57c809ea4 0:bdf663c61a82 15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
abe5b02d-a2d4-4fe9-818e-c4e57c809ea4 0:bdf663c61a82 16 * See the License for the specific language governing permissions and
abe5b02d-a2d4-4fe9-818e-c4e57c809ea4 0:bdf663c61a82 17 * limitations under the License.
abe5b02d-a2d4-4fe9-818e-c4e57c809ea4 0:bdf663c61a82 18 */
abe5b02d-a2d4-4fe9-818e-c4e57c809ea4 0:bdf663c61a82 19 #ifndef MBED_DMA_API_H
abe5b02d-a2d4-4fe9-818e-c4e57c809ea4 0:bdf663c61a82 20 #define MBED_DMA_API_H
abe5b02d-a2d4-4fe9-818e-c4e57c809ea4 0:bdf663c61a82 21
abe5b02d-a2d4-4fe9-818e-c4e57c809ea4 0:bdf663c61a82 22 #include <stdint.h>
abe5b02d-a2d4-4fe9-818e-c4e57c809ea4 0:bdf663c61a82 23
abe5b02d-a2d4-4fe9-818e-c4e57c809ea4 0:bdf663c61a82 24 #define DMA_ERROR_OUT_OF_CHANNELS (-1)
abe5b02d-a2d4-4fe9-818e-c4e57c809ea4 0:bdf663c61a82 25
abe5b02d-a2d4-4fe9-818e-c4e57c809ea4 0:bdf663c61a82 26 typedef enum {
abe5b02d-a2d4-4fe9-818e-c4e57c809ea4 0:bdf663c61a82 27 DMA_USAGE_NEVER,
abe5b02d-a2d4-4fe9-818e-c4e57c809ea4 0:bdf663c61a82 28 DMA_USAGE_OPPORTUNISTIC,
abe5b02d-a2d4-4fe9-818e-c4e57c809ea4 0:bdf663c61a82 29 DMA_USAGE_ALWAYS,
abe5b02d-a2d4-4fe9-818e-c4e57c809ea4 0:bdf663c61a82 30 DMA_USAGE_TEMPORARY_ALLOCATED,
abe5b02d-a2d4-4fe9-818e-c4e57c809ea4 0:bdf663c61a82 31 DMA_USAGE_ALLOCATED
abe5b02d-a2d4-4fe9-818e-c4e57c809ea4 0:bdf663c61a82 32 } DMAUsage;
abe5b02d-a2d4-4fe9-818e-c4e57c809ea4 0:bdf663c61a82 33
abe5b02d-a2d4-4fe9-818e-c4e57c809ea4 0:bdf663c61a82 34 #ifdef __cplusplus
abe5b02d-a2d4-4fe9-818e-c4e57c809ea4 0:bdf663c61a82 35 extern "C" {
abe5b02d-a2d4-4fe9-818e-c4e57c809ea4 0:bdf663c61a82 36 #endif
abe5b02d-a2d4-4fe9-818e-c4e57c809ea4 0:bdf663c61a82 37
abe5b02d-a2d4-4fe9-818e-c4e57c809ea4 0:bdf663c61a82 38 void dma_init(void);
abe5b02d-a2d4-4fe9-818e-c4e57c809ea4 0:bdf663c61a82 39
abe5b02d-a2d4-4fe9-818e-c4e57c809ea4 0:bdf663c61a82 40 int dma_channel_allocate(uint32_t capabilities);
abe5b02d-a2d4-4fe9-818e-c4e57c809ea4 0:bdf663c61a82 41
abe5b02d-a2d4-4fe9-818e-c4e57c809ea4 0:bdf663c61a82 42 int dma_channel_free(int channelid);
abe5b02d-a2d4-4fe9-818e-c4e57c809ea4 0:bdf663c61a82 43
abe5b02d-a2d4-4fe9-818e-c4e57c809ea4 0:bdf663c61a82 44 #ifdef __cplusplus
abe5b02d-a2d4-4fe9-818e-c4e57c809ea4 0:bdf663c61a82 45 }
abe5b02d-a2d4-4fe9-818e-c4e57c809ea4 0:bdf663c61a82 46 #endif
abe5b02d-a2d4-4fe9-818e-c4e57c809ea4 0:bdf663c61a82 47
abe5b02d-a2d4-4fe9-818e-c4e57c809ea4 0:bdf663c61a82 48 #endif
abe5b02d-a2d4-4fe9-818e-c4e57c809ea4 0:bdf663c61a82 49
abe5b02d-a2d4-4fe9-818e-c4e57c809ea4 0:bdf663c61a82 50 /** @}*/
abe5b02d-a2d4-4fe9-818e-c4e57c809ea4 0:bdf663c61a82 51