diff --git a/cube/Core/Inc/main.h b/cube/Core/Inc/main.h index 44c7a27..c50aab3 100644 --- a/cube/Core/Inc/main.h +++ b/cube/Core/Inc/main.h @@ -74,6 +74,8 @@ void Error_Handler(void); #define LED_Red_GPIO_Port GPIOE #define Frontend_In_Pin GPIO_PIN_1 #define Frontend_In_GPIO_Port GPIOA +#define Debug_Signal_Pin GPIO_PIN_10 +#define Debug_Signal_GPIO_Port GPIOB #define Debug_TX_Pin GPIO_PIN_10 #define Debug_TX_GPIO_Port GPIOC #define Debug_RX_Pin GPIO_PIN_11 diff --git a/cube/Core/Src/gpio.c b/cube/Core/Src/gpio.c index 95cbec2..0b19048 100644 --- a/cube/Core/Src/gpio.c +++ b/cube/Core/Src/gpio.c @@ -52,6 +52,9 @@ void MX_GPIO_Init(void) /*Configure GPIO pin Output Level */ HAL_GPIO_WritePin(GPIOE, Loop_Enable_Pin|Loop_Disable_Pin|LED_Green_Pin|LED_Red_Pin, GPIO_PIN_RESET); + /*Configure GPIO pin Output Level */ + HAL_GPIO_WritePin(Debug_Signal_GPIO_Port, Debug_Signal_Pin, GPIO_PIN_RESET); + /*Configure GPIO pin Output Level */ HAL_GPIO_WritePin(Frontend_Out_GPIO_Port, Frontend_Out_Pin, GPIO_PIN_RESET); @@ -68,6 +71,13 @@ void MX_GPIO_Init(void) GPIO_InitStruct.Pull = GPIO_PULLUP; HAL_GPIO_Init(Loop_Status_GPIO_Port, &GPIO_InitStruct); + /*Configure GPIO pin : PtPin */ + GPIO_InitStruct.Pin = Debug_Signal_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + HAL_GPIO_Init(Debug_Signal_GPIO_Port, &GPIO_InitStruct); + /*Configure GPIO pin : PtPin */ GPIO_InitStruct.Pin = Frontend_Out_Pin; GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; diff --git a/cube/Makefile b/cube/Makefile index 849ccc8..9e94d1a 100644 --- a/cube/Makefile +++ b/cube/Makefile @@ -1,6 +1,6 @@ # Processed by ../tools/insertMyCode.sh ########################################################################################################################## -# File automatically-generated by tool: [projectgenerator] version: [3.10.0-B14] date: [Sat Oct 31 20:50:19 CET 2020] +# File automatically-generated by tool: [projectgenerator] version: [3.10.0-B14] date: [Sat Oct 31 23:17:35 CET 2020] ########################################################################################################################## # ------------------------------------------------ diff --git a/cube/Makefile-bak b/cube/Makefile-bak index 456fe4a..f3df54a 100644 --- a/cube/Makefile-bak +++ b/cube/Makefile-bak @@ -1,5 +1,5 @@ ########################################################################################################################## -# File automatically-generated by tool: [projectgenerator] version: [3.10.0-B14] date: [Sat Oct 31 20:50:19 CET 2020] +# File automatically-generated by tool: [projectgenerator] version: [3.10.0-B14] date: [Sat Oct 31 23:17:35 CET 2020] ########################################################################################################################## # ------------------------------------------------ diff --git a/cube/User/Src/frontend.c b/cube/User/Src/frontend.c index 019289f..34ed6f4 100644 --- a/cube/User/Src/frontend.c +++ b/cube/User/Src/frontend.c @@ -44,6 +44,7 @@ void frontendDisable() { } void frontendAdcCallback(ADC_HandleTypeDef* hadc) { - uint16_t rawValue = HAL_ADC_GetValue(hadc); + // uint16_t rawValue = HAL_ADC_GetValue(hadc); + HAL_GPIO_TogglePin(Debug_Signal_GPIO_Port, Debug_Signal_Pin); } diff --git a/cube/User/Src/main2.c b/cube/User/Src/main2.c index 7411278..719f669 100644 --- a/cube/User/Src/main2.c +++ b/cube/User/Src/main2.c @@ -62,4 +62,5 @@ void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef* hadc) { if (hadc == &frontendAdc) { frontendAdcCallback(hadc); } + } diff --git a/cube/cube.ioc b/cube/cube.ioc index 984fb16..bd3bcdb 100644 --- a/cube/cube.ioc +++ b/cube/cube.ioc @@ -24,27 +24,28 @@ Mcu.Name=STM32F103V(C-D-E)Tx Mcu.Package=LQFP100 Mcu.Pin0=PE2 Mcu.Pin1=PE3 -Mcu.Pin10=PB15 -Mcu.Pin11=PA13 -Mcu.Pin12=PA14 -Mcu.Pin13=PC10 -Mcu.Pin14=PC11 -Mcu.Pin15=PC12 -Mcu.Pin16=PD1 -Mcu.Pin17=PD2 -Mcu.Pin18=PB3 -Mcu.Pin19=PB4 +Mcu.Pin10=PB14 +Mcu.Pin11=PB15 +Mcu.Pin12=PA13 +Mcu.Pin13=PA14 +Mcu.Pin14=PC10 +Mcu.Pin15=PC11 +Mcu.Pin16=PC12 +Mcu.Pin17=PD1 +Mcu.Pin18=PD2 +Mcu.Pin19=PB3 Mcu.Pin2=PE4 -Mcu.Pin20=PB5 -Mcu.Pin21=VP_SYS_VS_Systick +Mcu.Pin20=PB4 +Mcu.Pin21=PB5 +Mcu.Pin22=VP_SYS_VS_Systick Mcu.Pin3=PE5 Mcu.Pin4=PE6 Mcu.Pin5=OSC_IN Mcu.Pin6=OSC_OUT Mcu.Pin7=PA1 -Mcu.Pin8=PB13 -Mcu.Pin9=PB14 -Mcu.PinsNb=22 +Mcu.Pin8=PB10 +Mcu.Pin9=PB13 +Mcu.PinsNb=23 Mcu.ThirdPartyNb=0 Mcu.UserConstants=debugUart,huart4;mbusUart,huart5;frontendAdc,hadc1 Mcu.UserName=STM32F103VCTx @@ -76,6 +77,10 @@ PA13.Mode=Serial_Wire PA13.Signal=SYS_JTMS-SWDIO PA14.Mode=Serial_Wire PA14.Signal=SYS_JTCK-SWCLK +PB10.GPIOParameters=GPIO_Label +PB10.GPIO_Label=Debug_Signal +PB10.Locked=true +PB10.Signal=GPIO_Output PB13.Mode=Full_Duplex_Master PB13.Signal=SPI2_SCK PB14.Mode=Full_Duplex_Master