单片机解密STM32N647摄像头IMX335资料
- 单片机解密static void DMA_Config(void)
- {
- /*## -1- Enable DMA1 clock #################################################*/
- __HAL_RCC_DMA1_CLK_ENABLE();
- /*##-2- Select the DMA functional Parameters ###############################*/
- DmaHandle.Init.Direction = DMA_MEMORY_TO_PERIPH ; /* M2M transfer mode */
- DmaHandle.Init.PeriphInc = DMA_PINC_DISABLE; /* Peripheral increment mode Enable */
- //DmaHandle.Init.PeriphInc = DMA_PINC_DISABLE;
- DmaHandle.Init.MemInc = DMA_MINC_ENABLE; /* Memory increment mode Enable */
- //DmaHandle.Init.MemInc = DMA_MINC_DISABLE;
- // DmaHandle.Init.PeriphDataAlignment = DMA_PDATAALIGN_WORD; /* Peripheral data alignment : Word */
- // DmaHandle.Init.MemDataAlignment = DMA_MDATAALIGN_WORD; /* memory data alignment : Word */
- // DmaHandle.Init.PeriphDataAlignment = DMA_PDATAALIGN_HALFWORD; /* Peripheral data alignment : Word */
- //
- // DmaHandle.Init.MemDataAlignment = DMA_MDATAALIGN_HALFWORD; /* memory data alignment : Word */
- DmaHandle.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE ; /* Peripheral data alignment : Word */
- DmaHandle.Init.MemDataAlignment = DMA_PDATAALIGN_BYTE ; /* memory data alignment : Word */
- DmaHandle.Init.Mode = DMA_NORMAL; /* Normal DMA mode */
- DmaHandle.Init.Priority = DMA_PRIORITY_HIGH; /* priority level : high */
- /*##-3- Select the DMA instance to be used for the transfer : DMA1_Channel1 #*/
- DmaHandle.Instance = DMA_INSTANCE;
- /*##-4- Initialize the DMA channel ##########################################*/
- if (HAL_DMA_Init(&DmaHandle) != HAL_OK)
- {
- /* Initialization Error */
- Error_Handler();
- }
-
- /*##-5- Select Callbacks functions called after Transfer complete and Transfer error */
- HAL_DMA_RegisterCallback(&DmaHandle, HAL_DMA_XFER_CPLT_CB_ID, TransferComplete);
- HAL_DMA_RegisterCallback(&DmaHandle, HAL_DMA_XFER_ERROR_CB_ID, TransferError);
- /*##-6- Configure NVIC for DMA transfer complete/error interrupts ##########*/
- /* Set Interrupt Group Priority */
- HAL_NVIC_SetPriority(DMA_INSTANCE_IRQ, 0, 0);
- /* Enable the DMA STREAM global Interrupt */
- HAL_NVIC_EnableIRQ(DMA_INSTANCE_IRQ);
- /*##-7- Start the DMA transfer using the interrupt mode ####################*/
- /* Configure the source, destination and buffer size DMA fields and Start DMA Channel transfer */
- /* Enable All the DMA interrupts */
- if (HAL_DMA_Start_IT(&DmaHandle, (uint32_t)&aSRC_Const_Buffer, (uint32_t)aDST_Buffer, 4) != HAL_OK)
- {
- /* Transfer Error */
- Error_Handler();
- }
- }

芯片解密