sc8-gat-stand/gat_stand_fw/user/periph/port_pwr.h

47 lines
671 B
C
Raw Normal View History

/*
* port_pwr.h
*
* Created on: Oct 16, 2024
* Author: true
*/
#ifndef USER_PERIPH_PORT_PWR_H_
#define USER_PERIPH_PORT_PWR_H_
#include <ch32v20x.h>
// GAT port enable pin
#define GAT_EN_PORT GPIOA
#define GAT_EN_PIN GPIO_Pin_3
// overcurrent detect pin, active low
#define GAT_OC_PORT GPIOA
#define GAT_OC_PIN GPIO_Pin_4
#define USB2_EN_PORT GPIOB
#define USB2_EN_PIN GPIO_Pin_4
void port_pwr_init();
uint8_t gat_oc_state();
void gat_on();
void gat_off();
void gat_toggle();
uint8_t gat_pwr_state();
void usb2_on();
void usb2_off();
void usb2_toggle();
uint8_t usb2_pwr_state();
#endif /* USER_PERIPH_PORT_PWR_H_ */