ir_decode.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*!
  2. \file ir_decode.h
  3. \brief the header file of infrared decoding
  4. */
  5. /*
  6. Copyright (C) 2017 GigaDevice
  7. 2017-06-06, V1.0.0, firmware for GD32F3x0
  8. */
  9. #ifndef IR_DECODE_H
  10. #define IR_DECODE_H
  11. #include "gd32f3x0.h"
  12. typedef enum {NO = 0, YES = !NO} status_yes_or_no;
  13. #if defined(GD32F350)
  14. #define IR_TIMER TIMER2 /*!< timer used for IR decoding */
  15. #define TIMER_PRESCALER 71 /*!< TIMER prescaler */
  16. #define IR_TIMER_CLK RCU_TIMER2 /*!< clock of the used timer */
  17. #define IR_TIMER_IRQn TIMER2_IRQn /*!< IR TIMER IRQ */
  18. #define IR_TIMER_Channel TIMER_CH_0 /*!< IR TIMER channel */
  19. #define IR_GPIO_PORT GPIOC /*!< port which IR output is connected */
  20. #define IR_GPIO_PORT_CLK RCU_GPIOC /*!< IR pin GPIO clock port */
  21. #define IR_GPIO_PIN GPIO_PIN_6 /*!< pin which IR is connected */
  22. #define IR_GPIO_SOURCE GPIO_PINSOURCE6
  23. #elif defined(GD32F330)
  24. #define IR_TIMER TIMER2 /*!< timer used for IR decoding */
  25. #define TIMER_PRESCALER 71 /*!< TIMER prescaler */
  26. #define IR_TIMER_CLK RCU_TIMER2 /*!< clock of the used timer */
  27. #define IR_TIMER_IRQn TIMER2_IRQn /*!< IR TIMER IRQ */
  28. #define IR_TIMER_Channel TIMER_CH_1 /*!< IR TIMER channel */
  29. #define IR_GPIO_PORT GPIOA /*!< port which IR output is connected */
  30. #define IR_GPIO_PORT_CLK RCU_GPIOA /*!< IR pin GPIO clock port */
  31. #define IR_GPIO_PIN GPIO_PIN_7 /*!< pin which IR is connected */
  32. #define IR_GPIO_SOURCE GPIO_PINSOURCE7
  33. #endif
  34. #endif /* IR_DECODE_H */