The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.
Dependents: hello SerialTestv11 SerialTestv12 Sierpinski ... more
mbed 2
This is the mbed 2 library. If you'd like to learn about Mbed OS please see the mbed-os docs.
TARGET_EFM32LG_STK3600/TARGET_Silicon_Labs/TARGET_EFM32/dma_api_HAL.h@100:cbbeb26dbd92, 2015-05-27 (annotated)
- Committer:
- Kojto
- Date:
- Wed May 27 08:07:35 2015 +0100
- Revision:
- 100:cbbeb26dbd92
- Parent:
- 98:8ab26030e058
- Child:
- 108:34e6b704fe68
Release 100 of the mbed library
Changes:
- new target: DISCOF334C8
- API: Ticker/Timer bugfix with constness
- Silabs: RTC, PWM, Serial clocks bufixes
- Renesas: i2c bugfix
- Maxim: 326000 - pin definitions for v2, spi freq fix
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Kojto | 98:8ab26030e058 | 1 | /* mbed Microcontroller Library |
Kojto | 98:8ab26030e058 | 2 | * Copyright (c) 2006-2013 ARM Limited |
Kojto | 98:8ab26030e058 | 3 | * |
Kojto | 98:8ab26030e058 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
Kojto | 98:8ab26030e058 | 5 | * you may not use this file except in compliance with the License. |
Kojto | 98:8ab26030e058 | 6 | * You may obtain a copy of the License at |
Kojto | 98:8ab26030e058 | 7 | * |
Kojto | 98:8ab26030e058 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
Kojto | 98:8ab26030e058 | 9 | * |
Kojto | 98:8ab26030e058 | 10 | * Unless required by applicable law or agreed to in writing, software |
Kojto | 98:8ab26030e058 | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
Kojto | 98:8ab26030e058 | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
Kojto | 98:8ab26030e058 | 13 | * See the License for the specific language governing permissions and |
Kojto | 98:8ab26030e058 | 14 | * limitations under the License. |
Kojto | 98:8ab26030e058 | 15 | */ |
Kojto | 98:8ab26030e058 | 16 | #ifndef MBED_DMA_API_HAL_H |
Kojto | 98:8ab26030e058 | 17 | #define MBED_DMA_API_HAL_H |
Kojto | 98:8ab26030e058 | 18 | |
Kojto | 98:8ab26030e058 | 19 | #include <stdint.h> |
Kojto | 98:8ab26030e058 | 20 | #include "dma_api.h" |
Kojto | 98:8ab26030e058 | 21 | #include "em_dma.h" |
Kojto | 98:8ab26030e058 | 22 | |
Kojto | 98:8ab26030e058 | 23 | #ifdef __cplusplus |
Kojto | 98:8ab26030e058 | 24 | extern "C" { |
Kojto | 98:8ab26030e058 | 25 | #endif |
Kojto | 98:8ab26030e058 | 26 | |
Kojto | 98:8ab26030e058 | 27 | /* Purpose of this file: extend dma_api.h to include EFM-specific DMA attributes */ |
Kojto | 98:8ab26030e058 | 28 | |
Kojto | 98:8ab26030e058 | 29 | #define DMA_CAP_2DCOPY (1 << 0) |
Kojto | 98:8ab26030e058 | 30 | #define DMA_CAP_NONE (0 << 0) |
Kojto | 98:8ab26030e058 | 31 | |
Kojto | 98:8ab26030e058 | 32 | #if ( DMA_CHAN_COUNT <= 4 ) |
Kojto | 98:8ab26030e058 | 33 | #define DMACTRL_CH_CNT 4 |
Kojto | 98:8ab26030e058 | 34 | #define DMACTRL_ALIGNMENT 256 |
Kojto | 98:8ab26030e058 | 35 | |
Kojto | 98:8ab26030e058 | 36 | #elif ( ( DMA_CHAN_COUNT > 4 ) && ( DMA_CHAN_COUNT <= 8 ) ) |
Kojto | 98:8ab26030e058 | 37 | #define DMACTRL_CH_CNT 8 |
Kojto | 98:8ab26030e058 | 38 | #define DMACTRL_ALIGNMENT 256 |
Kojto | 98:8ab26030e058 | 39 | |
Kojto | 98:8ab26030e058 | 40 | #elif ( ( DMA_CHAN_COUNT > 8 ) && ( DMA_CHAN_COUNT <= 16 ) ) |
Kojto | 98:8ab26030e058 | 41 | #define DMACTRL_CH_CNT 16 |
Kojto | 98:8ab26030e058 | 42 | #define DMACTRL_ALIGNMENT 512 |
Kojto | 98:8ab26030e058 | 43 | |
Kojto | 98:8ab26030e058 | 44 | #else |
Kojto | 98:8ab26030e058 | 45 | #error "Unsupported DMA channel count (dma_api.c)." |
Kojto | 98:8ab26030e058 | 46 | #endif |
Kojto | 98:8ab26030e058 | 47 | |
Kojto | 98:8ab26030e058 | 48 | typedef struct { |
Kojto | 100:cbbeb26dbd92 | 49 | DMAUsage dmaUsageState; |
Kojto | 100:cbbeb26dbd92 | 50 | int dmaChannel; |
Kojto | 100:cbbeb26dbd92 | 51 | DMA_CB_TypeDef dmaCallback; |
Kojto | 98:8ab26030e058 | 52 | } DMA_OPTIONS_t; |
Kojto | 98:8ab26030e058 | 53 | |
Kojto | 98:8ab26030e058 | 54 | typedef void (*DMACallback)(void); |
Kojto | 98:8ab26030e058 | 55 | |
Kojto | 98:8ab26030e058 | 56 | extern DMA_DESCRIPTOR_TypeDef dmaControlBlock[]; |
Kojto | 98:8ab26030e058 | 57 | |
Kojto | 98:8ab26030e058 | 58 | #ifdef __cplusplus |
Kojto | 98:8ab26030e058 | 59 | } |
Kojto | 98:8ab26030e058 | 60 | #endif |
Kojto | 98:8ab26030e058 | 61 | |
Kojto | 98:8ab26030e058 | 62 | #endif |