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