RT-Thread RTOS 1.2.0
An open source embedded real-time operating system
载入中...
搜索中...
未找到
dma.h 文件参考
#include <rtthread.h>
#include <drivers/ofw.h>
#include <drivers/misc.h>
#include <drivers/core/dm.h>
#include <mmu.h>
#include <mm_page.h>
#include <bitmap.h>
+ dma.h 的引用(Include)关系图:

浏览该文件的源代码.

结构体

struct  rt_dma_slave_config
 
struct  rt_dma_slave_transfer
 
struct  rt_dma_controller
 
struct  rt_dma_controller_ops
 
struct  rt_dma_chan
 
struct  rt_dma_pool
 
struct  rt_dma_map_ops
 

宏定义

#define RT_DMA_F_LINEAR   RT_BIT(0)
 
#define RT_DMA_F_32BITS   RT_BIT(1)
 
#define RT_DMA_F_NOCACHE   RT_BIT(2)
 
#define RT_DMA_F_DEVICE   RT_BIT(3)
 
#define RT_DMA_F_NOMAP   RT_BIT(4)
 
#define RT_DMA_PAGE_SIZE   ARCH_PAGE_SIZE
 

枚举

enum  rt_dma_transfer_direction {
  RT_DMA_MEM_TO_MEM , RT_DMA_MEM_TO_DEV , RT_DMA_DEV_TO_MEM , RT_DMA_DEV_TO_DEV ,
  RT_DMA_DIR_MAX
}
 
enum  rt_dma_slave_buswidth {
  RT_DMA_SLAVE_BUSWIDTH_UNDEFINED = 0 , RT_DMA_SLAVE_BUSWIDTH_1_BYTE = 1 , RT_DMA_SLAVE_BUSWIDTH_2_BYTES = 2 , RT_DMA_SLAVE_BUSWIDTH_3_BYTES = 3 ,
  RT_DMA_SLAVE_BUSWIDTH_4_BYTES = 4 , RT_DMA_SLAVE_BUSWIDTH_8_BYTES = 8 , RT_DMA_SLAVE_BUSWIDTH_16_BYTES = 16 , RT_DMA_SLAVE_BUSWIDTH_32_BYTES = 32 ,
  RT_DMA_SLAVE_BUSWIDTH_64_BYTES = 64 , RT_DMA_SLAVE_BUSWIDTH_128_BYTES = 128 , RT_DMA_SLAVE_BUSWIDTH_BYTES_MAX
}
 

函数

rt_inline void rt_dma_controller_add_direction (struct rt_dma_controller *ctrl, enum rt_dma_transfer_direction dir)
 
rt_err_t rt_dma_controller_register (struct rt_dma_controller *ctrl)
 
rt_err_t rt_dma_controller_unregister (struct rt_dma_controller *ctrl)
 
rt_err_t rt_dma_chan_start (struct rt_dma_chan *chan)
 
rt_err_t rt_dma_chan_stop (struct rt_dma_chan *chan)
 
rt_err_t rt_dma_chan_config (struct rt_dma_chan *chan, struct rt_dma_slave_config *conf)
 
rt_err_t rt_dma_chan_done (struct rt_dma_chan *chan, rt_size_t size)
 
rt_err_t rt_dma_prep_memcpy (struct rt_dma_chan *chan, struct rt_dma_slave_transfer *transfer)
 
rt_err_t rt_dma_prep_cyclic (struct rt_dma_chan *chan, struct rt_dma_slave_transfer *transfer)
 
rt_err_t rt_dma_prep_single (struct rt_dma_chan *chan, struct rt_dma_slave_transfer *transfer)
 
struct rt_dma_chanrt_dma_chan_request (struct rt_device *dev, const char *name)
 
rt_err_t rt_dma_chan_release (struct rt_dma_chan *chan)
 
void * rt_dma_alloc (struct rt_device *dev, rt_size_t size, rt_ubase_t *dma_handle, rt_ubase_t flags)
 
void rt_dma_free (struct rt_device *dev, rt_size_t size, void *cpu_addr, rt_ubase_t dma_handle, rt_ubase_t flags)
 
rt_inline void * rt_dma_alloc_coherent (struct rt_device *dev, rt_size_t size, rt_ubase_t *dma_handle)
 
rt_inline void rt_dma_free_coherent (struct rt_device *dev, rt_size_t size, void *cpu_addr, rt_ubase_t dma_handle)
 
rt_err_t rt_dma_sync_out_data (struct rt_device *dev, void *data, rt_size_t size, rt_ubase_t *dma_handle, rt_ubase_t flags)
 
rt_err_t rt_dma_sync_in_data (struct rt_device *dev, void *out_data, rt_size_t size, rt_ubase_t dma_handle, rt_ubase_t flags)
 
rt_inline rt_bool_t rt_dma_device_is_coherent (struct rt_device *dev)
 
rt_inline void rt_dma_device_set_ops (struct rt_device *dev, const struct rt_dma_map_ops *ops)
 
struct rt_dma_poolrt_dma_pool_install (rt_region_t *region)
 
rt_err_t rt_dma_pool_extract (rt_region_t *region_list, rt_size_t list_len, rt_size_t cma_size, rt_size_t coherent_pool_size)
 

宏定义说明

◆ RT_DMA_F_LINEAR

#define RT_DMA_F_LINEAR   RT_BIT(0)

在文件 dma.h186 行定义.

◆ RT_DMA_F_32BITS

#define RT_DMA_F_32BITS   RT_BIT(1)

在文件 dma.h187 行定义.

◆ RT_DMA_F_NOCACHE

#define RT_DMA_F_NOCACHE   RT_BIT(2)

在文件 dma.h188 行定义.

◆ RT_DMA_F_DEVICE

#define RT_DMA_F_DEVICE   RT_BIT(3)

在文件 dma.h189 行定义.

◆ RT_DMA_F_NOMAP

#define RT_DMA_F_NOMAP   RT_BIT(4)

在文件 dma.h190 行定义.

◆ RT_DMA_PAGE_SIZE

#define RT_DMA_PAGE_SIZE   ARCH_PAGE_SIZE

在文件 dma.h192 行定义.

枚举类型说明

◆ rt_dma_transfer_direction

枚举值
RT_DMA_MEM_TO_MEM 
RT_DMA_MEM_TO_DEV 
RT_DMA_DEV_TO_MEM 
RT_DMA_DEV_TO_DEV 
RT_DMA_DIR_MAX 

在文件 dma.h26 行定义.

27{
32
34};
@ RT_DMA_DEV_TO_DEV
定义 dma.h:31
@ RT_DMA_DEV_TO_MEM
定义 dma.h:30
@ RT_DMA_MEM_TO_MEM
定义 dma.h:28
@ RT_DMA_DIR_MAX
定义 dma.h:33
@ RT_DMA_MEM_TO_DEV
定义 dma.h:29

◆ rt_dma_slave_buswidth

枚举值
RT_DMA_SLAVE_BUSWIDTH_UNDEFINED 
RT_DMA_SLAVE_BUSWIDTH_1_BYTE 
RT_DMA_SLAVE_BUSWIDTH_2_BYTES 
RT_DMA_SLAVE_BUSWIDTH_3_BYTES 
RT_DMA_SLAVE_BUSWIDTH_4_BYTES 
RT_DMA_SLAVE_BUSWIDTH_8_BYTES 
RT_DMA_SLAVE_BUSWIDTH_16_BYTES 16 
RT_DMA_SLAVE_BUSWIDTH_32_BYTES 32 
RT_DMA_SLAVE_BUSWIDTH_64_BYTES 64 
RT_DMA_SLAVE_BUSWIDTH_128_BYTES 128 
RT_DMA_SLAVE_BUSWIDTH_BYTES_MAX  

在文件 dma.h36 行定义.

37{
48
50};
@ RT_DMA_SLAVE_BUSWIDTH_2_BYTES
定义 dma.h:40
@ RT_DMA_SLAVE_BUSWIDTH_64_BYTES
定义 dma.h:46
@ RT_DMA_SLAVE_BUSWIDTH_UNDEFINED
定义 dma.h:38
@ RT_DMA_SLAVE_BUSWIDTH_BYTES_MAX
定义 dma.h:49
@ RT_DMA_SLAVE_BUSWIDTH_32_BYTES
定义 dma.h:45
@ RT_DMA_SLAVE_BUSWIDTH_8_BYTES
定义 dma.h:43
@ RT_DMA_SLAVE_BUSWIDTH_1_BYTE
定义 dma.h:39
@ RT_DMA_SLAVE_BUSWIDTH_3_BYTES
定义 dma.h:41
@ RT_DMA_SLAVE_BUSWIDTH_4_BYTES
定义 dma.h:42
@ RT_DMA_SLAVE_BUSWIDTH_128_BYTES
定义 dma.h:47
@ RT_DMA_SLAVE_BUSWIDTH_16_BYTES
定义 dma.h:44

函数说明

◆ rt_dma_controller_add_direction()

rt_inline void rt_dma_controller_add_direction ( struct rt_dma_controller * ctrl,
enum rt_dma_transfer_direction dir )

在文件 dma.h158 行定义.

160{
161 RT_ASSERT(ctrl != RT_NULL);
163
164 rt_bitmap_set_bit(ctrl->dir_cap, dir);
165}
#define RT_ASSERT(EX)
#define RT_NULL

引用了 RT_ASSERT, RT_DMA_DIR_MAX , 以及 RT_NULL.

◆ rt_dma_controller_register()

rt_err_t rt_dma_controller_register ( struct rt_dma_controller * ctrl)

◆ rt_dma_controller_unregister()

rt_err_t rt_dma_controller_unregister ( struct rt_dma_controller * ctrl)

◆ rt_dma_chan_start()

rt_err_t rt_dma_chan_start ( struct rt_dma_chan * chan)

◆ rt_dma_chan_stop()

rt_err_t rt_dma_chan_stop ( struct rt_dma_chan * chan)

◆ rt_dma_chan_config()

rt_err_t rt_dma_chan_config ( struct rt_dma_chan * chan,
struct rt_dma_slave_config * conf )

◆ rt_dma_chan_done()

rt_err_t rt_dma_chan_done ( struct rt_dma_chan * chan,
rt_size_t size )

◆ rt_dma_prep_memcpy()

rt_err_t rt_dma_prep_memcpy ( struct rt_dma_chan * chan,
struct rt_dma_slave_transfer * transfer )

◆ rt_dma_prep_cyclic()

rt_err_t rt_dma_prep_cyclic ( struct rt_dma_chan * chan,
struct rt_dma_slave_transfer * transfer )

◆ rt_dma_prep_single()

rt_err_t rt_dma_prep_single ( struct rt_dma_chan * chan,
struct rt_dma_slave_transfer * transfer )

◆ rt_dma_chan_request()

struct rt_dma_chan * rt_dma_chan_request ( struct rt_device * dev,
const char * name )

◆ rt_dma_chan_release()

rt_err_t rt_dma_chan_release ( struct rt_dma_chan * chan)

◆ rt_dma_alloc()

void * rt_dma_alloc ( struct rt_device * dev,
rt_size_t size,
rt_ubase_t * dma_handle,
rt_ubase_t flags )
+ 这是这个函数的调用关系图:

◆ rt_dma_free()

void rt_dma_free ( struct rt_device * dev,
rt_size_t size,
void * cpu_addr,
rt_ubase_t dma_handle,
rt_ubase_t flags )
+ 这是这个函数的调用关系图:

◆ rt_dma_alloc_coherent()

rt_inline void * rt_dma_alloc_coherent ( struct rt_device * dev,
rt_size_t size,
rt_ubase_t * dma_handle )

在文件 dma.h200 行定义.

202{
203 return rt_dma_alloc(dev, size, dma_handle,
205}
#define RT_DMA_F_LINEAR
定义 dma.h:186
void * rt_dma_alloc(struct rt_device *dev, rt_size_t size, rt_ubase_t *dma_handle, rt_ubase_t flags)
#define RT_DMA_F_NOCACHE
定义 dma.h:188

引用了 rt_dma_alloc(), RT_DMA_F_LINEAR , 以及 RT_DMA_F_NOCACHE.

+ 函数调用图:

◆ rt_dma_free_coherent()

rt_inline void rt_dma_free_coherent ( struct rt_device * dev,
rt_size_t size,
void * cpu_addr,
rt_ubase_t dma_handle )

在文件 dma.h207 行定义.

209{
210 rt_dma_free(dev, size, cpu_addr, dma_handle,
212}
void rt_dma_free(struct rt_device *dev, rt_size_t size, void *cpu_addr, rt_ubase_t dma_handle, rt_ubase_t flags)

引用了 RT_DMA_F_LINEAR, RT_DMA_F_NOCACHE , 以及 rt_dma_free().

+ 函数调用图:

◆ rt_dma_sync_out_data()

rt_err_t rt_dma_sync_out_data ( struct rt_device * dev,
void * data,
rt_size_t size,
rt_ubase_t * dma_handle,
rt_ubase_t flags )

◆ rt_dma_sync_in_data()

rt_err_t rt_dma_sync_in_data ( struct rt_device * dev,
void * out_data,
rt_size_t size,
rt_ubase_t dma_handle,
rt_ubase_t flags )

◆ rt_dma_device_is_coherent()

rt_inline rt_bool_t rt_dma_device_is_coherent ( struct rt_device * dev)

在文件 dma.h219 行定义.

220{
221 return rt_dm_dev_prop_read_bool(dev, "dma-coherent");
222}

◆ rt_dma_device_set_ops()

rt_inline void rt_dma_device_set_ops ( struct rt_device * dev,
const struct rt_dma_map_ops * ops )

在文件 dma.h224 行定义.

226{
227 dev->dma_ops = ops;
228}

◆ rt_dma_pool_install()

struct rt_dma_pool * rt_dma_pool_install ( rt_region_t * region)

◆ rt_dma_pool_extract()

rt_err_t rt_dma_pool_extract ( rt_region_t * region_list,
rt_size_t list_len,
rt_size_t cma_size,
rt_size_t coherent_pool_size )