#ifndef __HW_GPIO_H__
#define __HW_GPIO_H__

#include "stdint.h"
#include "stm32f10x.h"

typedef void( GpioIrqHandler )( void );

extern uint8_t gpio_test;  //ÓÃÓÚ¼ÇÂ¼GPIO²âÊÔ


/*!
 * GPIO IRQ handler function prototype
 */
IRQn_Type MSP_GetIRQn( uint16_t gpioPin );

void GpioInit( void );

void GpioDeInit( void );

void GpioWrite( GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin,  uint32_t value );

uint32_t GpioRead( GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin );

uint8_t GpioGetBitPos( uint16_t GPIO_Pin );

void GpioSetIrq( GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin, uint32_t prio,  GpioIrqHandler *irqHandler );

void GpioLaunchIrqHandler( uint16_t GPIO_Pin );


void GpioSetIrq_all();


#endif // __HW_GPIO_H__
