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_SAMD21G18A/TARGET_Atmel/TARGET_SAM_CortexM0P/sercom_dma.h@147:a97add6d7e64, 2017-07-19 (annotated)
- Committer:
- Kojto
- Date:
- Wed Jul 19 16:46:19 2017 +0100
- Revision:
- 147:a97add6d7e64
- Parent:
- 114:252557024ec3
Release 147 of the mbed library.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Kojto | 111:4336505e4b1c | 1 | /* mbed Microcontroller Library |
Kojto | 111:4336505e4b1c | 2 | * Copyright (c) 2006-2015 ARM Limited |
Kojto | 111:4336505e4b1c | 3 | * |
Kojto | 111:4336505e4b1c | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
Kojto | 111:4336505e4b1c | 5 | * you may not use this file except in compliance with the License. |
Kojto | 111:4336505e4b1c | 6 | * You may obtain a copy of the License at |
Kojto | 111:4336505e4b1c | 7 | * |
Kojto | 111:4336505e4b1c | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
Kojto | 111:4336505e4b1c | 9 | * |
Kojto | 111:4336505e4b1c | 10 | * Unless required by applicable law or agreed to in writing, software |
Kojto | 111:4336505e4b1c | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
Kojto | 111:4336505e4b1c | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
Kojto | 111:4336505e4b1c | 13 | * See the License for the specific language governing permissions and |
Kojto | 111:4336505e4b1c | 14 | * limitations under the License. |
Kojto | 111:4336505e4b1c | 15 | */ |
Kojto | 111:4336505e4b1c | 16 | |
Kojto | 111:4336505e4b1c | 17 | #ifndef _SERCOM_DMA_H |
Kojto | 111:4336505e4b1c | 18 | #define _SERCOM_DMA_H |
Kojto | 111:4336505e4b1c | 19 | |
Kojto | 111:4336505e4b1c | 20 | #ifdef __cplusplus |
Kojto | 111:4336505e4b1c | 21 | extern "C" { |
Kojto | 111:4336505e4b1c | 22 | #endif |
Kojto | 111:4336505e4b1c | 23 | |
Kojto | 111:4336505e4b1c | 24 | #include <compiler.h> |
Kojto | 111:4336505e4b1c | 25 | #include "dma.h" |
Kojto | 111:4336505e4b1c | 26 | |
Kojto | 111:4336505e4b1c | 27 | |
Kojto | 111:4336505e4b1c | 28 | struct sercom_dma { |
Kojto | 111:4336505e4b1c | 29 | uint8_t tx_channel_id; |
Kojto | 111:4336505e4b1c | 30 | uint8_t rx_channel_id; |
Kojto | 111:4336505e4b1c | 31 | enum dma_status_flags tx_status; |
Kojto | 111:4336505e4b1c | 32 | enum dma_status_flags rx_status; |
Kojto | 111:4336505e4b1c | 33 | }; |
Kojto | 111:4336505e4b1c | 34 | |
Kojto | 111:4336505e4b1c | 35 | /** Allocate a channel for TX |
Kojto | 111:4336505e4b1c | 36 | * |
Kojto | 111:4336505e4b1c | 37 | * @param[in] sercom_index index of sercom instance |
Kojto | 111:4336505e4b1c | 38 | * @param[out] tx_id pointer to channel id |
Kojto | 111:4336505e4b1c | 39 | * @return allocated channel id |
Kojto | 111:4336505e4b1c | 40 | */ |
Kojto | 111:4336505e4b1c | 41 | uint8_t sercom_setup_tx_channel(uint8_t sercom_index, uint8_t *tx_id); |
Kojto | 111:4336505e4b1c | 42 | |
Kojto | 111:4336505e4b1c | 43 | /** Allocate a channel for RX |
Kojto | 111:4336505e4b1c | 44 | * |
Kojto | 111:4336505e4b1c | 45 | * @param[in] sercom_index index of sercom instance |
Kojto | 111:4336505e4b1c | 46 | * @param[out] rx_id pointer to channel id |
Kojto | 111:4336505e4b1c | 47 | * @return allocated channel id |
Kojto | 111:4336505e4b1c | 48 | */ |
Kojto | 111:4336505e4b1c | 49 | uint8_t sercom_setup_rx_channel(uint8_t sercom_index, uint8_t *rx_id); |
Kojto | 111:4336505e4b1c | 50 | |
Kojto | 111:4336505e4b1c | 51 | /** Release DMA channels if allocated |
Kojto | 111:4336505e4b1c | 52 | * |
Kojto | 111:4336505e4b1c | 53 | * @param[in] sercom_index index of sercom instance |
Kojto | 111:4336505e4b1c | 54 | * @return void |
Kojto | 111:4336505e4b1c | 55 | */ |
Kojto | 111:4336505e4b1c | 56 | void sercom_release_channel(uint8_t sercom_index); |
Kojto | 111:4336505e4b1c | 57 | |
Kojto | 111:4336505e4b1c | 58 | #ifdef __cplusplus |
Kojto | 111:4336505e4b1c | 59 | } |
Kojto | 111:4336505e4b1c | 60 | #endif |
Kojto | 111:4336505e4b1c | 61 | |
Kojto | 114:252557024ec3 | 62 | #endif /* _SERCOM_DMA_H */ |