55 lines
1.5 KiB
C
55 lines
1.5 KiB
C
|
#ifndef HD_GPIO_H_
|
|||
|
#define HD_GPIO_H_
|
|||
|
|
|||
|
#include "ch32v30x.h"
|
|||
|
|
|||
|
/* <20><>Դ<EFBFBD><D4B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
|||
|
#define J1_PwrCtrl_GPIO_PROT GPIOE
|
|||
|
#define J1_PwrCtrl_GPIO_PIN GPIO_Pin_7
|
|||
|
#define J2_PwrCtrl_GPIO_PROT GPIOE
|
|||
|
#define J2_PwrCtrl_GPIO_PIN GPIO_Pin_8
|
|||
|
#define J3_PwrCtrl_GPIO_PROT GPIOE
|
|||
|
#define J3_PwrCtrl_GPIO_PIN GPIO_Pin_9
|
|||
|
#define J4_PwrCtrl_GPIO_PROT GPIOE
|
|||
|
#define J4_PwrCtrl_GPIO_PIN GPIO_Pin_10
|
|||
|
#define J5_PwrCtrl_GPIO_PROT GPIOE
|
|||
|
#define J5_PwrCtrl_GPIO_PIN GPIO_Pin_11
|
|||
|
#define J6_PwrCtrl_GPIO_PROT GPIOE
|
|||
|
#define J6_PwrCtrl_GPIO_PIN GPIO_Pin_12
|
|||
|
#define J7_PwrCtrl_GPIO_PROT GPIOE
|
|||
|
#define J7_PwrCtrl_GPIO_PIN GPIO_Pin_13
|
|||
|
#define J8_PwrCtrl_GPIO_PROT GPIOE
|
|||
|
#define J8_PwrCtrl_GPIO_PIN GPIO_Pin_14
|
|||
|
#define J9_PwrCtrl_GPIO_PROT GPIOE
|
|||
|
#define J9_PwrCtrl_GPIO_PIN GPIO_Pin_15
|
|||
|
|
|||
|
/* <20><>ģ<D7BF>鹩<EFBFBD><E9B9A9>ʹ<EFBFBD><CAB9><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
|||
|
#define GPIO_PwrCtrl_GPIO_PROT GPIOE
|
|||
|
#define GPIO_PwrCtrl_GPIO_PIN GPIO_Pin_3
|
|||
|
|
|||
|
/* <20><>ģ<D7BF><C4A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD> */
|
|||
|
#define GPIO_PwrKey_GPIO_PROT GPIOE
|
|||
|
#define GPIO_PwrKey_GPIO_PIN GPIO_Pin_2
|
|||
|
|
|||
|
/* ι<><CEB9><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
|||
|
#define WDI_GPIO_PROT GPIOC
|
|||
|
#define WDI_GPIO_PIN GPIO_Pin_13
|
|||
|
|
|||
|
#define GPIOTypeDef GPIO_TypeDef
|
|||
|
#define GPIOPin uint16_t
|
|||
|
|
|||
|
/* Bit_SET and Bit_RESET enumeration */
|
|||
|
typedef enum {
|
|||
|
GPIO_RESET = 0,
|
|||
|
GPIO_SET
|
|||
|
}BitOperation;
|
|||
|
|
|||
|
|
|||
|
|
|||
|
void HD_GPIO_Init(void);
|
|||
|
void HD_GPIO_Write(GPIOTypeDef *GPIOx, GPIOPin GPIO_Pin, BitOperation BitVal);
|
|||
|
uint8_t HD_InputGPIO_Read(GPIOTypeDef *GPIOx, GPIOPin GPIO_Pin);
|
|||
|
uint8_t HD_OutputGPIO_Read(GPIOTypeDef *GPIOx, GPIOPin GPIO_Pin);
|
|||
|
|
|||
|
#endif
|