Browse Source

Removed Pins

alice
Gregor Wüst 3 years ago
parent
commit
28707e084e
2 changed files with 25 additions and 22 deletions
  1. 4
    4
      RTC/Core/Inc/main.h
  2. 21
    18
      RTC/Core/Src/main.c

+ 4
- 4
RTC/Core/Inc/main.h View File

#define USART_TX_GPIO_Port GPIOA #define USART_TX_GPIO_Port GPIOA
#define USART_RX_Pin GPIO_PIN_3 #define USART_RX_Pin GPIO_PIN_3
#define USART_RX_GPIO_Port GPIOA #define USART_RX_GPIO_Port GPIOA
#define LD2_Pin GPIO_PIN_5
#define LD2_GPIO_Port GPIOA
//#define LD2_Pin GPIO_PIN_5
//#define LD2_GPIO_Port GPIOA
#define TMS_Pin GPIO_PIN_13 #define TMS_Pin GPIO_PIN_13
#define TMS_GPIO_Port GPIOA #define TMS_GPIO_Port GPIOA
#define TCK_Pin GPIO_PIN_14 #define TCK_Pin GPIO_PIN_14
#define TCK_GPIO_Port GPIOA #define TCK_GPIO_Port GPIOA
#define SWO_Pin GPIO_PIN_3
#define SWO_GPIO_Port GPIOB
//#define SWO_Pin GPIO_PIN_3
//#define SWO_GPIO_Port GPIOB
/* USER CODE BEGIN Private defines */ /* USER CODE BEGIN Private defines */


/* USER CODE END Private defines */ /* USER CODE END Private defines */

+ 21
- 18
RTC/Core/Src/main.c View File

HAL_Init(); HAL_Init();


/* USER CODE BEGIN Init */ /* USER CODE BEGIN Init */
//----- Init of the Motor control library
/* Set the L6208 library to use 1 device */
BSP_MotorControl_SetNbDevices(BSP_MOTOR_CONTROL_BOARD_ID_L6208, 1);
BSP_MotorControl_Init(BSP_MOTOR_CONTROL_BOARD_ID_L6208, NULL);
/* Attach the function MyFlagInterruptHandler (defined below) to the flag interrupt */
BSP_MotorControl_AttachFlagInterrupt(MyFlagInterruptHandler);
/* Attach the function MyErrorHandler (defined below) to the error Handler*/
BSP_MotorControl_AttachErrorHandler(Error_Handler);
/* Set Systick Interrupt priority highest to ensure no lock by using HAL_Delay */
HAL_NVIC_SetPriority(SysTick_IRQn, 0x0, 0x0);
/* Configure KEY Button */
BSP_PB_Init(BUTTON_KEY, BUTTON_MODE_EXTI);
/* Disable the power bridges after initialization */
BSP_MotorControl_CmdDisable(0);

/* USER CODE END Init */ /* USER CODE END Init */


/* Configure the system clock */ /* Configure the system clock */
MX_RTC_Init(); MX_RTC_Init();
/* USER CODE BEGIN 2 */ /* USER CODE BEGIN 2 */


//----- Init of the Motor control library
/* Set the L6208 library to use 1 device */
BSP_MotorControl_SetNbDevices(BSP_MOTOR_CONTROL_BOARD_ID_L6208, 1);
BSP_MotorControl_Init(BSP_MOTOR_CONTROL_BOARD_ID_L6208, NULL);
/* Attach the function MyFlagInterruptHandler (defined below) to the flag interrupt */
BSP_MotorControl_AttachFlagInterrupt(MyFlagInterruptHandler);
/* Attach the function MyErrorHandler (defined below) to the error Handler*/
BSP_MotorControl_AttachErrorHandler(Error_Handler);
/* Set Systick Interrupt priority highest to ensure no lock by using HAL_Delay */
HAL_NVIC_SetPriority(SysTick_IRQn, 0x0, 0x0);
/* Configure KEY Button */
BSP_PB_Init(BUTTON_KEY, BUTTON_MODE_EXTI);
/* Disable the power bridges after initialization */
BSP_MotorControl_CmdDisable(0);

timeAndDate sunrise, sunset, wakeUpTimeForStep, tomorrowsDate, initialDate; timeAndDate sunrise, sunset, wakeUpTimeForStep, tomorrowsDate, initialDate;
sunrise = sunset = wakeUpTimeForStep = tomorrowsDate = initialDate = (timeAndDate) {\ sunrise = sunset = wakeUpTimeForStep = tomorrowsDate = initialDate = (timeAndDate) {\
0, 0,
*/ */
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_LSI; RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_LSI;
RCC_OscInitStruct.HSIState = RCC_HSI_ON; RCC_OscInitStruct.HSIState = RCC_HSI_ON;
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
//RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
RCC_OscInitStruct.HSICalibrationValue = 16;
RCC_OscInitStruct.LSIState = RCC_LSI_ON; RCC_OscInitStruct.LSIState = RCC_LSI_ON;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI; RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI;
__HAL_RCC_GPIOB_CLK_ENABLE(); __HAL_RCC_GPIOB_CLK_ENABLE();


/*Configure GPIO pin Output Level */ /*Configure GPIO pin Output Level */
HAL_GPIO_WritePin(LD2_GPIO_Port, LD2_Pin, GPIO_PIN_RESET);
//HAL_GPIO_WritePin(LD2_GPIO_Port, LD2_Pin, GPIO_PIN_RESET);


/*Configure GPIO pin : B1_Pin */ /*Configure GPIO pin : B1_Pin */
GPIO_InitStruct.Pin = B1_Pin; GPIO_InitStruct.Pin = B1_Pin;
HAL_GPIO_Init(B1_GPIO_Port, &GPIO_InitStruct); HAL_GPIO_Init(B1_GPIO_Port, &GPIO_InitStruct);


/*Configure GPIO pin : LD2_Pin */ /*Configure GPIO pin : LD2_Pin */
GPIO_InitStruct.Pin = LD2_Pin;
//GPIO_InitStruct.Pin = LD2_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL; GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
HAL_GPIO_Init(LD2_GPIO_Port, &GPIO_InitStruct);
//HAL_GPIO_Init(LD2_GPIO_Port, &GPIO_InitStruct);


} }



Loading…
Cancel
Save