![]() |
SyterKit 0.4.0.x
SyterKit is a bare-metal framework
|
#include <io.h>#include <stdarg.h>#include <stdbool.h>#include <stddef.h>#include <stdint.h>#include <types.h>#include <common.h>#include <log.h>#include <reg-dma.h>#include <sys-clk.h>

Go to the source code of this file.
Classes | |
| struct | sunxi_dma_desc_t |
| struct | sunxi_dma_channel_config_t |
| struct | sunxi_dma_set_t |
| struct | sunxi_dma_irq_handler_t |
| struct | sunxi_dma_channel_reg_t |
| struct | sunxi_dma_reg_t |
| struct | sunxi_dma_source_t |
| struct | sunxi_dma_t |
Macros | |
| #define | DMA_DEFAULT_CLK_RST_OFFSET (16) |
| #define | DMA_DEFAULT_CLK_GATE_OFFSET (0) |
Functions | |
| void | sunxi_dma_init (sunxi_dma_t *dma) |
| Initialize the DMA subsystem. | |
| void | sunxi_dma_exit (sunxi_dma_t *dma) |
| Clean up and exit the DMA subsystem. | |
| uint32_t | sunxi_dma_request (uint32_t dmatype) |
| Request a DMA channel of the specified type. | |
| uint32_t | sunxi_dma_request_from_last (uint32_t dmatype) |
| Request a DMA channel from the last allocated channel of the specified type. | |
| int | sunxi_dma_release (uint32_t dma_fd) |
| Release a previously requested DMA channel. | |
| int | sunxi_dma_setting (uint32_t dma_fd, sunxi_dma_set_t *cfg) |
| Configure the settings of a DMA channel. | |
| int | sunxi_dma_start (uint32_t dma_fd, uint32_t saddr, uint32_t daddr, uint32_t bytes) |
| Start a DMA transfer. | |
| int | sunxi_dma_stop (uint32_t dma_fd) |
| Stop a currently running DMA transfer. | |
| int | sunxi_dma_querystatus (uint32_t dma_fd) |
| Query the status of a DMA transfer. | |
| int | sunxi_dma_install_int (uint32_t dma_fd, void *p) |
| Installs an interrupt handler for the DMA. | |
| int | sunxi_dma_enable_int (uint32_t dma_fd) |
| Enables interrupts for the specified DMA. | |
| int | sunxi_dma_disable_int (uint32_t dma_fd) |
| Disables interrupts for the specified DMA. | |
| int | sunxi_dma_free_int (uint32_t dma_fd) |
| Frees the interrupt resources for the specified DMA. | |
| int | sunxi_dma_test (uint32_t *src_addr, uint32_t *dst_addr, uint32_t len) |
| Perform a test DMA transfer between the specified source and destination addresses. | |
| #define DMA_DEFAULT_CLK_GATE_OFFSET (0) |
| #define DMA_DEFAULT_CLK_RST_OFFSET (16) |
| int sunxi_dma_disable_int | ( | uint32_t | dma_fd | ) |
Disables interrupts for the specified DMA.
This function disables the interrupt generation for the specified DMA device, stopping it from signaling interrupts for completed or erroneous DMA operations.
| dma_fd | File descriptor for the DMA device. |
Disables interrupts for the specified DMA.
Disables interrupts for a specific DMA channel.
| dma_fd | Handle to the DMA channel |
| int sunxi_dma_enable_int | ( | uint32_t | dma_fd | ) |
Enables interrupts for the specified DMA.
This function enables the interrupt generation for the specified DMA device, allowing it to signal when DMA operations are complete or have encountered errors.
| dma_fd | File descriptor for the DMA device. |
Enables interrupts for the specified DMA.
Enables interrupts for a specific DMA channel, specifically package end interrupts.
| dma_fd | Handle to the DMA channel |
| void sunxi_dma_exit | ( | sunxi_dma_t * | dma | ) |
Clean up and exit the DMA subsystem.
Clean up and exit the DMA subsystem.
Releases all DMA channels, disables interrupts, and shuts down the DMA controller.
| dma | Pointer to DMA configuration structure |
| int sunxi_dma_free_int | ( | uint32_t | dma_fd | ) |
Frees the interrupt resources for the specified DMA.
This function releases any resources associated with the DMA interrupt handler that was previously installed. It should be called when the DMA is no longer in use.
| dma_fd | File descriptor for the DMA device. |
Frees the interrupt resources for the specified DMA.
Releases the interrupt handler associated with a DMA channel and clears pending interrupts.
| dma_fd | Handle to the DMA channel |
| void sunxi_dma_init | ( | sunxi_dma_t * | dma | ) |
Initialize the DMA subsystem.
Initialize the DMA subsystem.
Initializes the DMA controller by setting up registers, clearing interrupts, configuring auto clock gating, and initializing channel structures.
| dma | Pointer to DMA configuration structure containing base addresses and settings |
| int sunxi_dma_install_int | ( | uint32_t | dma_fd, |
| void * | p | ||
| ) |
Installs an interrupt handler for the DMA.
This function installs a DMA interrupt handler to manage DMA transfer completion or error events.
| dma_fd | File descriptor for the DMA device. |
| p | Pointer to the data structure that holds the interrupt handler context or configuration. |
Installs an interrupt handler for the DMA.
Sets up an interrupt handler for a DMA channel and clears any pending interrupts.
| dma_fd | Handle to the DMA channel |
| p | User data to associate with the interrupt handler |
| int sunxi_dma_querystatus | ( | uint32_t | dma_fd | ) |
Query the status of a DMA transfer.
| hdma | The DMA channel number to query status for. |
Query the status of a DMA transfer.
Checks whether a DMA transfer is still in progress on the specified channel.
| dma_fd | Handle to the DMA channel to query |
| int sunxi_dma_release | ( | uint32_t | dma_fd | ) |
Release a previously requested DMA channel.
| hdma | The DMA channel number to release. |
Release a previously requested DMA channel.
Releases a previously requested DMA channel, disabling its interrupts.
| dma_fd | Handle to the DMA channel to release |
Request a DMA channel of the specified type.
| dmatype | The type of DMA channel to request. |
Request a DMA channel of the specified type.
Searches for an available DMA channel starting from channel 0.
| dmatype | Type of DMA channel to request (currently unused) |
Request a DMA channel from the last allocated channel of the specified type.
| dmatype | The type of DMA channel to request. |
Request a DMA channel from the last allocated channel of the specified type.
Searches for an available DMA channel starting from the highest-numbered channel.
| dmatype | Type of DMA channel to request (currently unused) |
| int sunxi_dma_setting | ( | uint32_t | dma_fd, |
| sunxi_dma_set_t * | cfg | ||
| ) |
Configure the settings of a DMA channel.
| hdma | The DMA channel number to configure. |
| cfg | Pointer to the DMA configuration structure. |
Configure the settings of a DMA channel.
Sets up a DMA channel with specified configuration parameters like loop mode, wait cycles, and data block size.
| dma_fd | Handle to the DMA channel to configure |
| cfg | Pointer to configuration structure containing DMA settings |
Start a DMA transfer.
| hdma | The DMA channel number to start the transfer on. |
| saddr | Source address of the data to transfer. |
| daddr | Destination address to transfer the data to. |
| bytes | Number of bytes to transfer. |
Initiates a DMA data transfer from source to destination address with specified size.
| dma_fd | Handle to the DMA channel to use |
| saddr | Source address for the DMA transfer |
| daddr | Destination address for the DMA transfer |
| bytes | Number of bytes to transfer |
| int sunxi_dma_stop | ( | uint32_t | dma_fd | ) |
Stop a currently running DMA transfer.
| hdma | The DMA channel number to stop the transfer on. |
Stop a currently running DMA transfer.
Halts an ongoing DMA transfer on the specified channel.
| dma_fd | Handle to the DMA channel to stop |
Perform a test DMA transfer between the specified source and destination addresses.
| src_addr | Pointer to the source address. |
| dst_addr | Pointer to the destination address. |
Perform a test DMA transfer between the specified source and destination addresses.
Performs a DMA transfer test between two memory regions, verifies data integrity, and reports transfer performance.
| src_addr | Source memory address for test transfer |
| dst_addr | Destination memory address for test transfer |
| len | Length of data to transfer in bytes |