| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156 |
- /**
- ******************************************************************************
- * File Name : gpio.c
- * Description : This file provides code for the configuration
- * of all used GPIO pins.
- ******************************************************************************
- * @attention
- *
- * <h2><center>© Copyright (c) 2019 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
- *
- ******************************************************************************
- */
- /* Includes ------------------------------------------------------------------*/
- #include "gpio.h"
- /* USER CODE BEGIN 0 */
- /* USER CODE END 0 */
- /*----------------------------------------------------------------------------*/
- /* Configure GPIO */
- /*----------------------------------------------------------------------------*/
- /* USER CODE BEGIN 1 */
- /* USER CODE END 1 */
- /** Configure pins as
- * Analog
- * Input
- * Output
- * EVENT_OUT
- * EXTI
- PA9 ------> USB_OTG_FS_VBUS
- PA10 ------> USB_OTG_FS_ID
- PA11 ------> USB_OTG_FS_DM
- PA12 ------> USB_OTG_FS_DP
- */
- void MX_GPIO_Init(void)
- {
- GPIO_InitTypeDef GPIO_InitStruct = {0};
- /* GPIO Ports Clock Enable */
- __HAL_RCC_GPIOC_CLK_ENABLE();
- __HAL_RCC_GPIOH_CLK_ENABLE();
- __HAL_RCC_GPIOA_CLK_ENABLE();
- __HAL_RCC_GPIOB_CLK_ENABLE();
- __HAL_RCC_GPIOD_CLK_ENABLE();
- /*Configure GPIO pin Output Level */
- HAL_GPIO_WritePin(GPIOC, Relais1_Pin|wc_Pin|D1_Pin|D0_Pin
- |E_Pin|R_W_Pin|Peristatique_Pin|Osmolateur_Pin, GPIO_PIN_RESET);
- /*Configure GPIO pin Output Level */
- HAL_GPIO_WritePin(GPIOA, MFP_Pin|RS_Pin|Remonter_Pin, GPIO_PIN_RESET);
- /*Configure GPIO pin Output Level */
- HAL_GPIO_WritePin(GPIOB, D5_Pin|D4_Pin|D3_Pin|D2_Pin
- |Ecumeur_Pin|Relais2_Pin|D7_Pin|D6_Pin, GPIO_PIN_RESET);
- /*Configure GPIO pin Output Level */
- HAL_GPIO_WritePin(Chauffage_GPIO_Port, Chauffage_Pin, GPIO_PIN_RESET);
- /*Configure GPIO pins : PCPin PCPin PCPin PCPin
- PCPin PCPin PCPin PCPin */
- GPIO_InitStruct.Pin = Relais1_Pin|wc_Pin|D1_Pin|D0_Pin
- |E_Pin|R_W_Pin|Peristatique_Pin|Osmolateur_Pin;
- GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
- GPIO_InitStruct.Pull = GPIO_NOPULL;
- GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
- HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
- /*Configure GPIO pin : PtPin */
- GPIO_InitStruct.Pin = Reserve_Haut_Pin;
- GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING;
- GPIO_InitStruct.Pull = GPIO_NOPULL;
- HAL_GPIO_Init(Reserve_Haut_GPIO_Port, &GPIO_InitStruct);
- /*Configure GPIO pins : PAPin PAPin */
- GPIO_InitStruct.Pin = Technique_Bas_Pin|Cuve_Haut_Pin;
- GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING;
- GPIO_InitStruct.Pull = GPIO_NOPULL;
- HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
- /*Configure GPIO pins : PAPin PAPin PAPin */
- GPIO_InitStruct.Pin = MFP_Pin|RS_Pin|Remonter_Pin;
- GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
- GPIO_InitStruct.Pull = GPIO_NOPULL;
- GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
- HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
- /*Configure GPIO pins : PCPin PCPin PCPin */
- GPIO_InitStruct.Pin = Left_Pin|UP_Pin|RAH_Pin;
- GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
- GPIO_InitStruct.Pull = GPIO_NOPULL;
- HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
- /*Configure GPIO pins : PBPin PBPin */
- GPIO_InitStruct.Pin = Right_Pin|Select_Pin;
- GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
- GPIO_InitStruct.Pull = GPIO_NOPULL;
- HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
- /*Configure GPIO pins : PBPin PBPin PBPin PBPin
- PBPin PBPin PBPin PBPin */
- GPIO_InitStruct.Pin = D5_Pin|D4_Pin|D3_Pin|D2_Pin
- |Ecumeur_Pin|Relais2_Pin|D7_Pin|D6_Pin;
- GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
- GPIO_InitStruct.Pull = GPIO_NOPULL;
- GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
- HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
- /*Configure GPIO pin : PA9 */
- GPIO_InitStruct.Pin = GPIO_PIN_9;
- GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
- GPIO_InitStruct.Pull = GPIO_NOPULL;
- HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
- /*Configure GPIO pins : PA10 PA11 PA12 */
- GPIO_InitStruct.Pin = GPIO_PIN_10|GPIO_PIN_11|GPIO_PIN_12;
- GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
- GPIO_InitStruct.Pull = GPIO_NOPULL;
- GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
- GPIO_InitStruct.Alternate = GPIO_AF10_OTG_FS;
- HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
- /*Configure GPIO pin : PtPin */
- GPIO_InitStruct.Pin = Chauffage_Pin;
- GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
- GPIO_InitStruct.Pull = GPIO_NOPULL;
- GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
- HAL_GPIO_Init(Chauffage_GPIO_Port, &GPIO_InitStruct);
- /* EXTI interrupt init*/
- HAL_NVIC_SetPriority(EXTI1_IRQn, 5, 0);
- HAL_NVIC_EnableIRQ(EXTI1_IRQn);
- HAL_NVIC_SetPriority(EXTI2_IRQn, 5, 0);
- HAL_NVIC_EnableIRQ(EXTI2_IRQn);
- HAL_NVIC_SetPriority(EXTI15_10_IRQn, 5, 0);
- HAL_NVIC_EnableIRQ(EXTI15_10_IRQn);
- }
- /* USER CODE BEGIN 2 */
- /* USER CODE END 2 */
- /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|