
#define DEBUG 

#include <stdio.h>
#include <string.h>
#include "py32f0xx_ll_rcc.h"
#include "py32f0xx_ll_bus.h"
#include "py32f0xx_ll_system.h"
#include "py32f0xx_ll_exti.h"
#include "py32f0xx_ll_cortex.h"
#include "py32f0xx_ll_utils.h"
#include "py32f0xx_ll_pwr.h"
#include "py32f0xx_ll_dma.h"
#include "py32f0xx_ll_gpio.h"
#include "py32f0xx_ll_tim.h"
#include "py32f0xx_ll_lptim.h"
#include "py32f0xx_ll_IWDG.h"

#include "py32f002xx_ll_Start_Kit.h"

#define  u8 uint8_t  
#define u16 uint16_t  
#define u32 uint32_t  

#include "MYPY32DRV.h"
#include "main.h"
#include "RF.h"






///-------------------------------------------------------------------


#define pA_in_(x)   (READ_REG(GPIOA->IDR)&(1<<x))
#define pB_in_(x)   (READ_REG(GPIOB->IDR)&(1<<x))



//¡¢¡¢------------------------------------------------------------
#define GPIOA_INPUT		(1<<1|1<<5)		
#define GPIOA_OUTPUT_L	(1<<0)	

#define p_shut		GPIOA,(1<<0)
#define p_rf_in		pA_in_(1)
#define p_key2		pA_in_(5)

#define GPIOB_INPUT		(1<<0|1<<2)		
#define GPIOB_OUTPUT	(0xff-GPIOB_INPUT)		

#define GPIOF_INPUT		(1<<4)		
#define GPIOF_OUTPUT	(7-GPIOF_INPUT)


#define p_led1		GPIOB,1<<6
#define p_rf_tx		GPIOB,1<<1
#define p_led2		GPIOB,1<<3




#define WDTC() LL_IWDG_ReloadCounter(IWDG);

