dma_api.h 1.1 KB

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