led.h 302 B

123456789101112131415161718
  1. #ifndef __LED_H
  2. #define __LED_H
  3. #include "stm32f10x.h"
  4. /* the macro definition to trigger the led on or off
  5. * 1 - off
  6. - 0 - on
  7. */
  8. #define ON 0
  9. #define OFF 1
  10. #define LED(port, pin, a) if (a) \
  11. GPIO_SetBits(port, pin);\
  12. else \
  13. GPIO_ResetBits(port, pin)
  14. #endif /* __LED_H */