166 lines
6.7 KiB
C
166 lines
6.7 KiB
C
/**
|
||
******************************************************************************
|
||
* @file gpio.h
|
||
* @brief This file contains all the function prototypes for
|
||
* the gpio.c file
|
||
******************************************************************************
|
||
* @attention
|
||
*
|
||
* <h2><center>© Copyright (c) 2025 STMicroelectronics.
|
||
* All rights reserved.</center></h2>
|
||
*
|
||
* 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
|
||
*
|
||
******************************************************************************
|
||
*/
|
||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||
#ifndef __GPIO_H__
|
||
#define __GPIO_H__
|
||
|
||
#ifdef __cplusplus
|
||
extern "C" {
|
||
#endif
|
||
|
||
/* Includes ------------------------------------------------------------------*/
|
||
#include "main.h"
|
||
|
||
/* USER CODE BEGIN Includes */
|
||
|
||
/* USER CODE END Includes */
|
||
|
||
/* USER CODE BEGIN Private defines */
|
||
#define IN_01_Pin GPIO_PIN_3
|
||
#define IN_01_GPIO_Port GPIOA
|
||
#define IN_02_Pin GPIO_PIN_2
|
||
#define IN_02_GPIO_Port GPIOA
|
||
#define IN_03_Pin GPIO_PIN_1
|
||
#define IN_03_GPIO_Port GPIOA
|
||
#define IN_04_Pin GPIO_PIN_0
|
||
#define IN_04_GPIO_Port GPIOA
|
||
#define IN_05_Pin GPIO_PIN_15
|
||
#define IN_05_GPIO_Port GPIOC
|
||
#define IN_06_Pin GPIO_PIN_13
|
||
#define IN_06_GPIO_Port GPIOC
|
||
#define IN_07_Pin GPIO_PIN_15
|
||
#define IN_07_GPIO_Port GPIOB
|
||
#define IN_08_Pin GPIO_PIN_14
|
||
#define IN_08_GPIO_Port GPIOB
|
||
#define IN_09_Pin GPIO_PIN_13
|
||
#define IN_09_GPIO_Port GPIOB
|
||
#define IN_10_Pin GPIO_PIN_12
|
||
#define IN_10_GPIO_Port GPIOB
|
||
#define IN_11_Pin GPIO_PIN_1
|
||
#define IN_11_GPIO_Port GPIOB
|
||
#define IN_12_Pin GPIO_PIN_0
|
||
#define IN_12_GPIO_Port GPIOB
|
||
#define IN_13_Pin GPIO_PIN_5
|
||
#define IN_13_GPIO_Port GPIOA
|
||
#define IN_14_Pin GPIO_PIN_4
|
||
#define IN_14_GPIO_Port GPIOA
|
||
|
||
#define J0_Pin GPIO_PIN_6
|
||
#define J0_GPIO_Port GPIOA
|
||
#define J1_Pin GPIO_PIN_7
|
||
#define J1_GPIO_Port GPIOA
|
||
#define J2_Pin GPIO_PIN_4
|
||
#define J2_GPIO_Port GPIOC
|
||
#define J3_Pin GPIO_PIN_5
|
||
#define J3_GPIO_Port GPIOC
|
||
#define Jselect_Pin GPIO_PIN_14
|
||
#define Jselect_GPIO_Port GPIOC
|
||
|
||
#define LED0_Pin GPIO_PIN_5
|
||
#define LED0_GPIO_Port GPIOB
|
||
#define LED1_Pin GPIO_PIN_6
|
||
#define LED1_GPIO_Port GPIOB
|
||
#define LED2_Pin GPIO_PIN_2
|
||
#define LED2_GPIO_Port GPIOC
|
||
#define LED3_Pin GPIO_PIN_3
|
||
#define LED3_GPIO_Port GPIOC
|
||
|
||
#define PVT4_Pin GPIO_PIN_6
|
||
#define PVT4_GPIO_Port GPIOC
|
||
#define PVT3_Pin GPIO_PIN_7
|
||
#define PVT3_GPIO_Port GPIOC
|
||
#define PVT2_Pin GPIO_PIN_8
|
||
#define PVT2_GPIO_Port GPIOC
|
||
#define PVT1_Pin GPIO_PIN_9
|
||
#define PVT1_GPIO_Port GPIOC
|
||
|
||
#define BOOT1_Pin GPIO_PIN_2
|
||
#define BOOT1_GPIO_Port GPIOB
|
||
|
||
#define LED_0_OFF HAL_GPIO_WritePin(LED0_GPIO_Port, LED0_Pin, GPIO_PIN_SET) //Set or clear the selected data port bit
|
||
#define LED_0_ON HAL_GPIO_WritePin(LED0_GPIO_Port, LED0_Pin, GPIO_PIN_RESET) //??? ?????? ?? ??????????
|
||
#define LED_0_TGL HAL_GPIO_TogglePin(LED0_GPIO_Port, LED0_Pin)
|
||
|
||
#define LED_1_OFF HAL_GPIO_WritePin(LED1_GPIO_Port, LED1_Pin, GPIO_PIN_SET) //Set or clear the selected data port bit
|
||
#define LED_1_ON HAL_GPIO_WritePin(LED1_GPIO_Port, LED1_Pin, GPIO_PIN_RESET) //??? ?????? ?? ??????????
|
||
#define LED_1_TGL HAL_GPIO_TogglePin(LED1_GPIO_Port, LED1_Pin)
|
||
|
||
#define LED_2_ON HAL_GPIO_WritePin(LED2_GPIO_Port, LED2_Pin, GPIO_PIN_SET) //Set or clear the selected data port bit
|
||
#define LED_2_OFF HAL_GPIO_WritePin(LED2_GPIO_Port, LED2_Pin, GPIO_PIN_RESET) //??? ?????? ?? ??????????
|
||
#define LED_2_TGL HAL_GPIO_TogglePin(LED2_GPIO_Port, LED2_Pin)
|
||
|
||
#define LED_3_ON HAL_GPIO_WritePin(LED3_GPIO_Port, LED3_Pin, GPIO_PIN_SET) //Set or clear the selected data port bit
|
||
#define LED_3_OFF HAL_GPIO_WritePin(LED3_GPIO_Port, LED3_Pin, GPIO_PIN_RESET) //??? ?????? ?? ??????????
|
||
#define LED_3_TGL HAL_GPIO_TogglePin(LED3_GPIO_Port, LED3_Pin)
|
||
|
||
#define Pvt1_ON HAL_GPIO_WritePin(PVT1_GPIO_Port, PVT1_Pin, GPIO_PIN_SET) //Set or clear the selected data port bit
|
||
#define Pvt1_OFF HAL_GPIO_WritePin(PVT1_GPIO_Port, PVT1_Pin, GPIO_PIN_RESET) //??? ?????? ?? ??????????
|
||
#define Pvt1_TGL HAL_GPIO_TogglePin(PVT1_GPIO_Port, PVT1_Pin)
|
||
|
||
#define Pvt2_ON HAL_GPIO_WritePin(PVT2_GPIO_Port, PVT2_Pin, GPIO_PIN_SET) //set - ????????????? ???, reset - ??????? ???
|
||
#define Pvt2_OFF HAL_GPIO_WritePin(PVT2_GPIO_Port, PVT2_Pin, GPIO_PIN_RESET) //????? ??????? ? main.h ??????? ?????? ?????????????
|
||
#define Pvt2_TGL HAL_GPIO_TogglePin(PVT2_GPIO_Port, PVT2_Pin)
|
||
|
||
#define Pvt3_ON HAL_GPIO_WritePin(PVT3_GPIO_Port, PVT3_Pin, GPIO_PIN_SET)
|
||
#define Pvt3_OFF HAL_GPIO_WritePin(PVT3_GPIO_Port, PVT3_Pin, GPIO_PIN_RESET)
|
||
#define Pvt3_TGL HAL_GPIO_TogglePin(PVT3_GPIO_Port, PVT3_Pin)
|
||
|
||
#define Pvt4_ON HAL_GPIO_WritePin(PVT4_GPIO_Port, PVT4_Pin, GPIO_PIN_SET)
|
||
#define Pvt4_OFF HAL_GPIO_WritePin(PVT4_GPIO_Port, PVT4_Pin, GPIO_PIN_RESET)
|
||
#define Pvt4_TGL HAL_GPIO_TogglePin(PVT4_GPIO_Port, PVT4_Pin)
|
||
|
||
#define IN_01 HAL_GPIO_ReadPin(IN_01_GPIO_Port, IN_01_Pin) // ???????? ??1 (??????? ???????????? ???????????)
|
||
#define IN_02 HAL_GPIO_ReadPin(IN_02_GPIO_Port, IN_02_Pin) // ???????? ??2 (??????? ???????????? ?????????)
|
||
#define IN_03 HAL_GPIO_ReadPin(IN_03_GPIO_Port, IN_03_Pin) // ???????? ??3 (??????? ??. ??????, ???? ?????????, ????)
|
||
#define IN_04 HAL_GPIO_ReadPin(IN_04_GPIO_Port, IN_04_Pin) // ???????? ??4 (??????? ???????? ???? ? ?????????? +)
|
||
#define IN_05 HAL_GPIO_ReadPin(IN_05_GPIO_Port, IN_05_Pin) // ???????? ??5 (??????? ???????? ???? ? ?????????? <20>)
|
||
#define IN_06 HAL_GPIO_ReadPin(IN_06_GPIO_Port, IN_06_Pin) // ???????? ??6 (??????? ?????????)
|
||
#define IN_07 HAL_GPIO_ReadPin(IN_07_GPIO_Port, IN_07_Pin) // ???????? 3? ??????? 380 ?
|
||
|
||
#define IN_08 HAL_GPIO_ReadPin(IN_08_GPIO_Port, IN_08_Pin) // ????? ??????????
|
||
#define IN_09 HAL_GPIO_ReadPin(IN_09_GPIO_Port, IN_09_Pin) // ?????? ??????????
|
||
#define IN_10 HAL_GPIO_ReadPin(IN_10_GPIO_Port, IN_10_Pin) // ?????? ? ???? 24 ?
|
||
|
||
#define IN_11 HAL_GPIO_ReadPin(IN_11_GPIO_Port, IN_11_Pin) // ???????? ??????? ???
|
||
#define IN_12 HAL_GPIO_ReadPin(IN_12_GPIO_Port, IN_12_Pin) // ??????
|
||
#define IN_13 HAL_GPIO_ReadPin(IN_13_GPIO_Port, IN_13_Pin) // ??????
|
||
#define IN_14 HAL_GPIO_ReadPin(IN_14_GPIO_Port, IN_14_Pin) // ???????? ??????? ???
|
||
|
||
#define J0 HAL_GPIO_ReadPin(J0_GPIO_Port, J0_Pin) //Read the specified input port pin
|
||
#define J1 HAL_GPIO_ReadPin(J1_GPIO_Port, J1_Pin)
|
||
#define J2 HAL_GPIO_ReadPin(J2_GPIO_Port, J2_Pin)
|
||
#define J3 HAL_GPIO_ReadPin(J3_GPIO_Port, J3_Pin)
|
||
|
||
#define Jselect HAL_GPIO_ReadPin(Jselect_GPIO_Port, Jselect_Pin)
|
||
|
||
/* USER CODE END Private defines */
|
||
|
||
void MX_GPIO_Init(void);
|
||
|
||
/* USER CODE BEGIN Prototypes */
|
||
|
||
/* USER CODE END Prototypes */
|
||
|
||
#ifdef __cplusplus
|
||
}
|
||
#endif
|
||
#endif /*__ GPIO_H__ */
|
||
|
||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|