RTEMS 7.0-rc1
Loading...
Searching...
No Matches
raspberrypi-dma.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-2-Clause */
2
11/*
12 * Copyright (C) 2025 Shaunak Datar
13 *
14 * Redistribution and use in source and binary forms, with or without
15 * modification, are permitted provided that the following conditions
16 * are met:
17 * 1. Redistributions of source code must retain the above copyright
18 * notice, this list of conditions and the following disclaimer.
19 * 2. Redistributions in binary form must reproduce the above copyright
20 * notice, this list of conditions and the following disclaimer in the
21 * documentation and/or other materials provided with the distribution.
22 *
23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
27 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
31 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33 * POSSIBILITY OF SUCH DAMAGE.
34 */
35#ifndef LIBBSP_AARCH64_RASPBERRYPI_DMA_H
36#define LIBBSP_AARCH64_RASPBERRYPI_DMA_H
37
38#include <bsp/raspberrypi.h>
39#include <bsp/rpi-gpio.h>
40#include <bsp/utility.h>
41#include <rtems/malloc.h>
42#include <rtems/rtems/cache.h>
44#include <rtems/score/cpu.h>
45#include <stdlib.h>
46#include <string.h>
47
48#ifdef __cplusplus
49extern "C" {
50#endif
54typedef enum {
55 DMA_CHANNEL_0,
56 DMA_CHANNEL_1,
57 DMA_CHANNEL_2,
58 DMA_CHANNEL_3,
59 DMA_CHANNEL_4,
60 DMA_CHANNEL_5,
61 DMA_CHANNEL_6,
62 DMA_LITE_CHANNEL_7,
63 DMA_LITE_CHANNEL_8,
64 DMA_LITE_CHANNEL_9,
65 DMA_LITE_CHANNEL_10,
66 DMA4_CHANNEL_11,
67 DMA4_CHANNEL_12,
68 DMA4_CHANNEL_13,
69 DMA4_CHANNEL_14,
82
97
123 rpi_dma_channel channel,
124 void *source_address,
125 void *destination_address,
126 uint32_t transfer_length
127);
128
129#ifdef __cplusplus
130}
131#endif
132
133#endif /* LIBBSP_AARCH64_RASPBERRYPI_DMA_H */
This header file provides basic definitions used by the API and the implementation.
This header file defines the Cache Manager API.
rtems_status_code
This enumeration provides status codes for directives of the Classic API.
Definition: status.h:85
This header file provides utility macros for BSPs.
This header file defines interfaces to support and use dynamic memory allocation.
rtems_status_code rpi_dma_mem_to_mem_init(rpi_dma_channel channel, void *source_address, void *destination_address, uint32_t transfer_length)
Initialize a memcpy-style DMA transfer from source_address to destination_address of transfer_length ...
Definition: raspberrypi-dma.c:233
rpi_dma_channel
DMA channel identifiers for BCM2711 (0–6 full, 7–10 lite, 11–14 DMA4).
Definition: raspberrypi-dma.h:54
rtems_status_code rpi_dma_wait(rpi_dma_channel channel)
Block until the current DMA transfer on channel completes.
Definition: raspberrypi-dma.c:221
rtems_status_code rpi_dma_start_transfer(rpi_dma_channel channel)
Start a previously initialized DMA transfer on channel.
Definition: raspberrypi-dma.c:208