/* automatically generated by rust-bindgen 0.72.1 */

pub const GPIO_PIN_00: u32 = 1;
pub const GPIO_PIN_01: u32 = 2;
pub const GPIO_PIN_02: u32 = 4;
pub const GPIO_PIN_03: u32 = 8;
pub const GPIO_PIN_04: u32 = 16;
pub const GPIO_PIN_05: u32 = 32;
pub const GPIO_PIN_06: u32 = 64;
pub const GPIO_PIN_07: u32 = 128;
pub const GPIO_PIN_08: u32 = 256;
pub const GPIO_PIN_09: u32 = 512;
pub const GPIO_PIN_10: u32 = 1024;
pub const GPIO_PIN_11: u32 = 2048;
pub const GPIO_PIN_12: u32 = 4096;
pub const GPIO_PIN_13: u32 = 8192;
pub const GPIO_PIN_14: u32 = 16384;
pub const GPIO_PIN_15: u32 = 32768;
pub const GPIO_PIN_ALL: u32 = 65535;
pub const GPIO_PIN_A_ALL: u32 = 65535;
pub const GPIO_PIN_B_ALL: u32 = 65535;
pub const GPIO_PIN_C_ALL: u32 = 65535;
pub const GPIO_PIN_D_ALL: u32 = 3847;
pub const GPIO_PIN_E_ALL: u32 = 61471;
pub const GPIO_PIN_H_ALL: u32 = 7;
pub const GPIO_PORT_A: u32 = 0;
pub const GPIO_PORT_B: u32 = 1;
pub const GPIO_PORT_C: u32 = 2;
pub const GPIO_PORT_D: u32 = 3;
pub const GPIO_PORT_E: u32 = 4;
pub const GPIO_PORT_H: u32 = 5;
pub const GPIO_FUNC_0: u32 = 0;
pub const GPIO_FUNC_1: u32 = 1;
pub const GPIO_FUNC_2: u32 = 2;
pub const GPIO_FUNC_3: u32 = 3;
pub const GPIO_FUNC_4: u32 = 4;
pub const GPIO_FUNC_5: u32 = 5;
pub const GPIO_FUNC_6: u32 = 6;
pub const GPIO_FUNC_7: u32 = 7;
pub const GPIO_FUNC_8: u32 = 8;
pub const GPIO_FUNC_11: u32 = 11;
pub const GPIO_FUNC_12: u32 = 12;
pub const GPIO_FUNC_13: u32 = 13;
pub const GPIO_FUNC_14: u32 = 14;
pub const GPIO_FUNC_15: u32 = 15;
pub const GPIO_FUNC_21: u32 = 21;
pub const GPIO_FUNC_22: u32 = 22;
pub const GPIO_FUNC_32: u32 = 32;
pub const GPIO_FUNC_33: u32 = 33;
pub const GPIO_FUNC_34: u32 = 34;
pub const GPIO_FUNC_35: u32 = 35;
pub const GPIO_FUNC_36: u32 = 36;
pub const GPIO_FUNC_37: u32 = 37;
pub const GPIO_FUNC_38: u32 = 38;
pub const GPIO_FUNC_39: u32 = 39;
pub const GPIO_FUNC_40: u32 = 40;
pub const GPIO_FUNC_41: u32 = 41;
pub const GPIO_FUNC_42: u32 = 42;
pub const GPIO_FUNC_43: u32 = 43;
pub const GPIO_FUNC_44: u32 = 44;
pub const GPIO_FUNC_45: u32 = 45;
pub const GPIO_FUNC_46: u32 = 46;
pub const GPIO_FUNC_47: u32 = 47;
pub const GPIO_FUNC_48: u32 = 48;
pub const GPIO_FUNC_49: u32 = 49;
pub const GPIO_FUNC_50: u32 = 50;
pub const GPIO_FUNC_51: u32 = 51;
pub const GPIO_FUNC_52: u32 = 52;
pub const GPIO_FUNC_53: u32 = 53;
pub const GPIO_FUNC_54: u32 = 54;
pub const GPIO_FUNC_55: u32 = 55;
pub const GPIO_FUNC_56: u32 = 56;
pub const GPIO_FUNC_57: u32 = 57;
pub const GPIO_PIN_TCK: u32 = 1;
pub const GPIO_PIN_TMS: u32 = 2;
pub const GPIO_PIN_TDO: u32 = 4;
pub const GPIO_PIN_TDI: u32 = 8;
pub const GPIO_PIN_TRST: u32 = 16;
pub const GPIO_PIN_DEBUG_JTAG: u32 = 31;
pub const GPIO_PIN_SWCLK: u32 = 1;
pub const GPIO_PIN_SWDIO: u32 = 2;
pub const GPIO_PIN_SWO: u32 = 4;
pub const GPIO_PIN_DEBUG_SWD: u32 = 7;
pub const GPIO_PIN_DEBUG: u32 = 31;
pub const GPIO_RD_WAIT0: u32 = 0;
pub const GPIO_RD_WAIT1: u32 = 4096;
pub const GPIO_RD_WAIT2: u32 = 8192;
pub const GPIO_RD_WAIT3: u32 = 12288;
pub const GPIO_RD_WAIT4: u32 = 16384;
pub const GPIO_RD_WAIT5: u32 = 20480;
pub const GPIO_RD_WAIT6: u32 = 24576;
pub const GPIO_RD_WAIT7: u32 = 28672;
pub const PIN_STAT_RST: u32 = 0;
pub const PIN_STAT_SET: u32 = 1;
pub const PIN_DIR_IN: u32 = 0;
pub const PIN_DIR_OUT: u32 = 2;
pub const PIN_OUT_TYPE_CMOS: u32 = 0;
pub const PIN_OUT_TYPE_NMOS: u32 = 4;
pub const PIN_LOW_DRV: u32 = 0;
pub const PIN_MID_DRV: u32 = 16;
pub const PIN_HIGH_DRV: u32 = 32;
pub const PIN_LATCH_OFF: u32 = 0;
pub const PIN_LATCH_ON: u32 = 16384;
pub const PIN_PU_OFF: u32 = 0;
pub const PIN_PU_ON: u32 = 64;
pub const PIN_PD_OFF: u32 = 0;
pub const PIN_PD_ON: u32 = 128;
pub const PIN_IN_MOS_OFF: u32 = 0;
pub const PIN_IN_MOS_ON: u32 = 8192;
pub const PIN_INVT_OFF: u32 = 0;
pub const PIN_INVT_ON: u32 = 512;
pub const PIN_IN_TYPE_SMT: u32 = 0;
pub const PIN_IN_TYPE_CMOS: u32 = 1024;
pub const PIN_EXTINT_OFF: u32 = 0;
pub const PIN_EXTINT_ON: u32 = 4096;
pub const PIN_ATTR_DIGITAL: u32 = 0;
pub const PIN_ATTR_ANALOG: u32 = 32768;
pub const PIN_SUBFUNC_DISABLE: u32 = 0;
pub const PIN_SUBFUNC_ENABLE: u32 = 256;
pub const GPIO_REG_LOCK_KEY: u32 = 42240;
pub const GPIO_REG_UNLOCK_KEY: u32 = 42241;
pub const en_functional_state_t_DISABLE: en_functional_state_t = 0;
pub const en_functional_state_t_ENABLE: en_functional_state_t = 1;
#[doc = " @brief Functional state"]
pub type en_functional_state_t = ::core::ffi::c_uint;
#[doc = "< Pin reset"]
pub const en_pin_state_t_PIN_RESET: en_pin_state_t = 0;
#[doc = "< Pin set"]
pub const en_pin_state_t_PIN_SET: en_pin_state_t = 1;
#[doc = " @brief  GPIO Pin Set and Reset enumeration"]
pub type en_pin_state_t = ::core::ffi::c_uint;
#[doc = " @brief  GPIO Init structure definition"]
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq)]
pub struct stc_gpio_init_t {
    #[doc = "< Set pin state to High or Low, @ref GPIO_PinState_Sel for details"]
    pub u16PinState: u16,
    #[doc = "< Pin mode setting, @ref GPIO_PinDirection_Sel for details"]
    pub u16PinDir: u16,
    #[doc = "< Output type setting, @ref GPIO_PinOutType_Sel for details"]
    pub u16PinOutputType: u16,
    #[doc = "< Pin drive capacity setting, @ref GPIO_PinDrv_Sel for details"]
    pub u16PinDrv: u16,
    #[doc = "< Pin latch setting, @ref GPIO_PinLatch_Sel for details"]
    pub u16Latch: u16,
    #[doc = "< Internal pull-up resistor setting, @ref GPIO_PinPU_Sel for details"]
    pub u16PullUp: u16,
    #[doc = "< Internal pull-down register setting, @ref GPIO_PinPD_Sel for details"]
    pub u16PullDown: u16,
    #[doc = "< Input MOS always on selection, @ref GPIO_PinInputMOS_Sel for details"]
    pub u16InputMos: u16,
    #[doc = "< Pin input/output invert setting, @ref GPIO_PinInvert_Sel for details"]
    pub u16Invert: u16,
    #[doc = "< External interrupt pin setting, @ref GPIO_PinExtInt_Sel for details"]
    pub u16ExtInt: u16,
    #[doc = "< Input type setting, @ref GPIO_PinInType_Sel for details"]
    pub u16PinInputType: u16,
    #[doc = "< Digital or analog attribute setting, @ref GPIO_PinMode_Sel for details"]
    pub u16PinAttr: u16,
}
unsafe extern "C" {
    pub fn GPIO_Init(u8Port: u8, u32Pin: u32, pstcGpioInit: *const stc_gpio_init_t) -> i32;
    pub fn GPIO_DeInit();
    pub fn GPIO_StructInit(pstcGpioInit: *mut stc_gpio_init_t) -> i32;
    pub fn GPIO_SetDebugPort(u8DebugPort: u8, enNewState: en_functional_state_t);
    pub fn GPIO_SetFunc(u8Port: u8, u32Pin: u32, u16Func: u16);
    pub fn GPIO_SubFuncCmd(u8Port: u8, u32Pin: u32, enNewState: en_functional_state_t);
    pub fn GPIO_SetSubFunc(u8Func: u8);
    pub fn GPIO_SetReadWaitCycle(u16ReadWait: u16);
    pub fn GPIO_InputMOSCmd(u8Port: u8, u32Pin: u32, enNewState: en_functional_state_t);
    pub fn GPIO_OutputCmd(u8Port: u8, u32Pin: u32, enNewState: en_functional_state_t);
    pub fn GPIO_OutputLatchCmd(u8Port: u8, u32Pin: u32, enNewState: en_functional_state_t);
    pub fn GPIO_ReadInputPins(u8Port: u8, u32Pin: u32) -> en_pin_state_t;
    pub fn GPIO_ReadInputPort(u8Port: u8) -> u32;
    pub fn GPIO_ReadOutputPins(u8Port: u8, u32Pin: u32) -> en_pin_state_t;
    pub fn GPIO_ReadOutputPort(u8Port: u8) -> u32;
    pub fn GPIO_SetPins(u8Port: u8, u32Pin: u32);
    pub fn GPIO_ResetPins(u8Port: u8, u32Pin: u32);
    pub fn GPIO_WritePort(u8Port: u8, u32PortVal: u32);
    pub fn GPIO_TogglePins(u8Port: u8, u32Pin: u32);
    pub fn GPIO_ExtIntCmd(u8Port: u8, u32Pin: u32, enNewState: en_functional_state_t);
    pub fn GPIO_AnalogCmd(u8Port: u8, u32Pin: u32, enNewState: en_functional_state_t);
}
