久久精品国产精品国产一区,少妇扒开毛毛自慰喷水,国产精品无码电影在线观看 ,久久天天躁夜夜躁狠狠85麻豆

思澈科技軟件開發(fā)工具包  2.20
EXTDMA

EXTDMA 在HCPU, 用于內(nèi)存-內(nèi)存之間數(shù)據(jù)的高效率搬運(yùn)工作(特別是與PSRAM相關(guān)的數(shù)據(jù)搬運(yùn), 比DMA內(nèi)存-內(nèi)存的傳輸更高效),并且在搬運(yùn)的同時(shí)可實(shí)時(shí)進(jìn)行圖像的有損壓縮(54x不支持)。

主要特性

  • 源地址和目標(biāo)地址均為4字節(jié)訪問, 且地址均需要4字節(jié)對(duì)齊, 長(zhǎng)度也要4字節(jié)對(duì)齊
  • 源地址和目標(biāo)地址獨(dú)立支持BURST訪問(BURST1/4/8/16),并支持地址自動(dòng)遞增
  • 單次配置最大傳輸單元數(shù)為2^20-1,每單元為4字節(jié)傳輸,即單次最大傳輸4M bytes
  • 支持3種事件標(biāo)志-傳輸完成,過半傳輸,傳輸出錯(cuò)
  • 可配置為圖像壓縮模式,支持RGB565/RGB888/ARGB8888格式輸入

各種顏色格式下的壓縮檔位對(duì)應(yīng)壓縮率(共10檔)

  • rgb565 {1.33, 1.47, 1.6, 1.73, 1.87, 1.93, 2, 2.13, 2.26, 2.4}
  • rgb888 {2, 2.2, 2.4, 2.6, 2.8, 2.9, 3, 3.2, 3.4, 3.6}
  • argb8888 {2.67, 2.93, 3.2, 3.47, 3.73, 3.86, 4.0, 4.27, 4.53, 4.8}

使用EXTDMA示例1

將0x20000000地址上100x100大小的RGB888圖片壓縮并搬運(yùn)到0x60000000,壓縮檔位1(即2倍)

static volatile HAL_StatusTypeDef endflag;
static EXT_DMA_HandleTypeDef DMA_Handle = {0};
void EXTDMA_IRQHandler(void)
{
/* enter interrupt */
rt_interrupt_enter();
HAL_EXT_DMA_IRQHandler(&DMA_Handle);
/* leave interrupt */
rt_interrupt_leave();
}
static void dma_done_cb()
{
endflag = HAL_OK;
}
static void dma_err_cb()
{
endflag = HAL_ERROR;
}
void main(void)
{
uint32_t len;
/*Data copy config */
DMA_Handle.Init.SrcInc = HAL_EXT_DMA_SRC_INC | HAL_EXT_DMA_SRC_BURST16; //Source address auto-increment and burst 16
DMA_Handle.Init.DstInc = HAL_EXT_DMA_DST_INC | HAL_EXT_DMA_DST_BURST16; //Dest address auto-increment and burst 16
/*Compression config */
DMA_Handle.Init.cmpr_en = true;
if(DMA_Handle.Init.cmpr_en)
{
DMA_Handle.Init.src_format = EXTDMA_CMPRCR_SRCFMT_RGB888;
DMA_Handle.Init.cmpr_rate = 1;
DMA_Handle.Init.col_num = 100;
DMA_Handle.Init.row_num = 100;
}
len = DMA_Handle.Init.col_num * DMA_Handle.Init.row_num * get_byte_per_pixel(DMA_Handle.Init.src_format) / 4;
res = HAL_EXT_DMA_Init(&DMA_Handle);
/* NVIC configuration for EXTDMA transfer complete interrupt */
HAL_NVIC_SetPriority(EXTDMA_IRQn, 0, 0);
HAL_NVIC_EnableIRQ(EXTDMA_IRQn);
HAL_EXT_DMA_Start_IT(&DMA_Handle, 0x20000000, 0x60000000, len);
}
__EXT_DMA_HandleTypeDef::Init
EDMA_InitTypeDef Init
Definition: bf0_hal_ext_dma.h:135
EDMA_InitTypeDef::SrcInc
uint32_t SrcInc
Definition: bf0_hal_ext_dma.h:81
len
uint16_t len
Definition: bf0_ble_ancs.h:226
HAL_EXT_DMA_XFER_CPLT_CB_ID
@ HAL_EXT_DMA_XFER_CPLT_CB_ID
Definition: bf0_hal_ext_dma.h:121
HAL_EXT_DMA_XFER_ERROR_CB_ID
@ HAL_EXT_DMA_XFER_ERROR_CB_ID
Definition: bf0_hal_ext_dma.h:123
HAL_EXT_DMA_Start_IT
HAL_StatusTypeDef HAL_EXT_DMA_Start_IT(EXT_DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t Counts)
Start the DMA Transfer with interrupt enabled.
HAL_EXT_DMA_Init
HAL_StatusTypeDef HAL_EXT_DMA_Init(EXT_DMA_HandleTypeDef *hdma)
Initialize the DMA according to the specified parameters in the DMA_InitTypeDef and initialize the as...
HAL_OK
@ HAL_OK
Definition: bf0_hal_def.h:75
HAL_EXT_DMA_SRC_BURST16
#define HAL_EXT_DMA_SRC_BURST16
Definition: bf0_hal_ext_dma.h:198
__EXT_DMA_HandleTypeDef
EXT_DMA handle Structure definition.
Definition: bf0_hal_ext_dma.h:132
HAL_ERROR
@ HAL_ERROR
Definition: bf0_hal_def.h:76
EDMA_InitTypeDef::cmpr_en
bool cmpr_en
Definition: bf0_hal_ext_dma.h:87
EDMA_InitTypeDef::src_format
uint32_t src_format
Definition: bf0_hal_ext_dma.h:91
HAL_NVIC_SetPriority
void HAL_NVIC_SetPriority(IRQn_Type IRQn, uint32_t PreemptPriority, uint32_t SubPriority)
Set the priority of an interrupt.
HAL_StatusTypeDef
HAL_StatusTypeDef
HAL Status structures definition.
Definition: bf0_hal_def.h:74
EDMA_InitTypeDef::row_num
uint16_t row_num
Definition: bf0_hal_ext_dma.h:90
HAL_NVIC_EnableIRQ
void HAL_NVIC_EnableIRQ(IRQn_Type IRQn)
Enable a device specific interrupt in the NVIC interrupt controller.
EDMA_InitTypeDef::cmpr_rate
uint8_t cmpr_rate
Definition: bf0_hal_ext_dma.h:88
HAL_EXT_DMA_RegisterCallback
HAL_StatusTypeDef HAL_EXT_DMA_RegisterCallback(EXT_DMA_HandleTypeDef *hdma, HAL_EXT_DMA_CallbackIDTypeDef CallbackID, void(*pCallback)(EXT_DMA_HandleTypeDef *_hdma))
Register callbacks.
HAL_EXT_DMA_IRQHandler
void HAL_EXT_DMA_IRQHandler(EXT_DMA_HandleTypeDef *hdma)
Handle DMA interrupt request.
EDMA_InitTypeDef::DstInc
uint32_t DstInc
Definition: bf0_hal_ext_dma.h:84
HAL_EXT_DMA_SRC_INC
#define HAL_EXT_DMA_SRC_INC
Definition: bf0_hal_ext_dma.h:200
EDMA_InitTypeDef::col_num
uint16_t col_num
Definition: bf0_hal_ext_dma.h:89