/** ****************************************************************************** * @file main.c * @author MCU Application Team * @brief Main program body ****************************************************************************** * @attention * *

© Copyright (c) 2023 Puya Semiconductor Co. * All rights reserved.

* * This software component is licensed by Puya under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** * @attention * *

© Copyright (c) 2016 STMicroelectronics. * All rights reserved.

* * This software component is licensed by ST under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** */ /* Includes ------------------------------------------------------------------*/ #include "main.h" #include "py32f403xx_ll_Start_Kit.h" /* Private define ------------------------------------------------------------*/ #define BUFFER_SIZE 32 /* Private variables ---------------------------------------------------------*/ uint32_t aSRC_Const_Buffer[BUFFER_SIZE]; /* Data transmission source buffer */ uint32_t aDST_Buffer[BUFFER_SIZE]; /* Data transmission destination buffer */ __IO uint32_t transferCompleteDetected=0; /* When the transmission is completed, this position 1 */ __IO uint32_t transferErrorDetected=0; /* When a transmission error occurs, this position 1 */ __IO uint32_t transferFailedDetected=0; /* When there is an error in transmitting data, this position 1 */ /* Private user code ---------------------------------------------------------*/ /* Private macro -------------------------------------------------------------*/ /* Private function prototypes -----------------------------------------------*/ static void APP_SystemClockConfig(void); static void APP_DmaConfig(void); /** * @brief Main program. * @param None * @retval int */ int main(void) { /* Enable SYSCFG and PWR clock */ LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_SYSCFG); LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_PWR); /* 3 bits for pre-emption priority, 0 bits for subpriority */ NVIC_SetPriorityGrouping(NVIC_PRIORITYGROUP_3); /* Configure system clock */ APP_SystemClockConfig(); /* Initialize LED */ BSP_LED_Init(LED_GREEN); /* Initialize data for DMA source buffer */ for(uint8_t i=0; i