no-OS
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
stm32_gpdma.c File Reference

Implementation of STM32 GPDMA functionality. More...

#include "stm32_dma.h"
#include "no_os_error.h"
#include "no_os_alloc.h"
#include "stm32_irq.h"
Include dependency graph for stm32_gpdma.c:

Classes

struct  stm32_dma_ch_priv_data
 

Functions

int stm32_gpdma_config_xfer (struct no_os_dma_ch *channel, struct no_os_dma_xfer_desc *xfer)
 Configure a General Purpose DMA channel for a transfer.
 
int stm32_gpdma_init (struct no_os_dma_desc **desc, struct no_os_dma_init_param *param)
 Initialize a General Purpose DMA controller.
 
int stm32_gpdma_xfer_start (struct no_os_dma_desc *desc, struct no_os_dma_ch *chan)
 Start a General Purpose DMA transfer for a specific channel.
 
int stm32_gpdma_xfer_abort (struct no_os_dma_desc *desc, struct no_os_dma_ch *chan)
 Disable a General Purpose DMA channel.
 
int stm32_gpdma_remove (struct no_os_dma_desc *desc)
 Free the resources allocated for a General Purpose DMA descriptor.
 

Variables

const struct no_os_dma_platform_ops stm32_gpdma_ops
 stm32 platform specific General Purpose DMA platform ops structure
 

Detailed Description

Implementation of STM32 GPDMA functionality.

Author
Swaroop P Kukkillaya (swaro.nosp@m.op.k.nosp@m.ukkil.nosp@m.laya.nosp@m.@anal.nosp@m.og.c.nosp@m.om)

Copyright 2025(c) Analog Devices, Inc.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of Analog Devices, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES, INC. “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Function Documentation

◆ stm32_gpdma_config_xfer()

int stm32_gpdma_config_xfer ( struct no_os_dma_ch * channel,
struct no_os_dma_xfer_desc * xfer )

Configure a General Purpose DMA channel for a transfer.

Parameters
channel- The GPDMA channel descriptor.
xfer- Descriptor for the transfer.
Returns
0 in case of success, negative error codes otherwise

◆ stm32_gpdma_init()

int stm32_gpdma_init ( struct no_os_dma_desc ** desc,
struct no_os_dma_init_param * param )

Initialize a General Purpose DMA controller.

Parameters
desc- Descriptor to be initialized.
param- Initialization parameter for the decriptor.
Returns
0 in case of success -ENOMEM if there is not enough free memory

◆ stm32_gpdma_remove()

int stm32_gpdma_remove ( struct no_os_dma_desc * desc)

Free the resources allocated for a General Purpose DMA descriptor.

Parameters
desc- Descriptor to be freed.
Returns
0 in case of success, negative error code otherwise

◆ stm32_gpdma_xfer_abort()

int stm32_gpdma_xfer_abort ( struct no_os_dma_desc * desc,
struct no_os_dma_ch * chan )

Disable a General Purpose DMA channel.

Parameters
desc- Descriptor for the GPDMA controller.
chan- The GPDMA Channel
Returns
0 in case of success, negative error codes otherwise

◆ stm32_gpdma_xfer_start()

int stm32_gpdma_xfer_start ( struct no_os_dma_desc * desc,
struct no_os_dma_ch * chan )

Start a General Purpose DMA transfer for a specific channel.

Parameters
desc- Descriptor for the GPDMA controller.
chan- The GPDMA Channel
Returns
0 in case of success, negative error codes otherwise

Variable Documentation

◆ stm32_gpdma_ops

const struct no_os_dma_platform_ops stm32_gpdma_ops
Initial value:
= {
.dma_init = stm32_gpdma_init,
.dma_config_xfer = stm32_gpdma_config_xfer,
.dma_xfer_start = stm32_gpdma_xfer_start,
.dma_xfer_abort = stm32_gpdma_xfer_abort,
.dma_remove = stm32_gpdma_remove
}
int stm32_gpdma_config_xfer(struct no_os_dma_ch *channel, struct no_os_dma_xfer_desc *xfer)
Configure a General Purpose DMA channel for a transfer.
Definition stm32_gpdma.c:262
int stm32_gpdma_init(struct no_os_dma_desc **desc, struct no_os_dma_init_param *param)
Initialize a General Purpose DMA controller.
Definition stm32_gpdma.c:334
int stm32_gpdma_remove(struct no_os_dma_desc *desc)
Free the resources allocated for a General Purpose DMA descriptor.
Definition stm32_gpdma.c:464
int stm32_gpdma_xfer_abort(struct no_os_dma_desc *desc, struct no_os_dma_ch *chan)
Disable a General Purpose DMA channel.
Definition stm32_gpdma.c:440
int stm32_gpdma_xfer_start(struct no_os_dma_desc *desc, struct no_os_dma_ch *chan)
Start a General Purpose DMA transfer for a specific channel.
Definition stm32_gpdma.c:396

stm32 platform specific General Purpose DMA platform ops structure