board_gpi.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. #ifndef _BOARD_GPI_H_
  2. #define _BOARD_GPI_H_
  3. /*********************************************************************
  4. * INCLUDES
  5. */
  6. //#include "common.h"
  7. /*********************************************************************
  8. * DEFINITIONS
  9. */
  10. #include "nrf_gpio.h"
  11. #define LEDS_NUMBER 4
  12. #define LED_START 17
  13. #define LED_1 17
  14. #define LED_2 18
  15. #define LED_3 19
  16. #define LED_4 20
  17. #define LED_STOP 20
  18. //#define CTRL_LED_EN 9
  19. //#define CTRL_BUZZER_EN 10
  20. #if 1
  21. #define CTRL_LED_EN 7
  22. #define CTRL_BUZZER_EN 11
  23. #define CTRL_MIC_EN 12
  24. #define CTRL_SPEAKER_EN 13
  25. #endif
  26. #if 0
  27. #define CTRL_LED_EN 5
  28. #define CTRL_BUZZER_EN 7
  29. #define CTRL_MIC_EN 12
  30. #define CTRL_SPEAKER_EN 13
  31. #endif
  32. #define APP_TIMER_PRESCALER 0 // Value of the RTC1 PRESCALER register.
  33. #define APP_TIMER_MAX_TIMERS 1 // Maximum number of simultaneously created timers.
  34. #define APP_TIMER_OP_QUEUE_SIZE 2 // Size of timer operation queues.
  35. #define BUTTON_DEBOUNCE_DELAY 50 // Delay from a GPIOTE event until a button is reported as pushed.
  36. #define APP_GPIOTE_MAX_USERS 1 // Maximum number of users of the GPIOTE handler.
  37. #define ADVERTISING_LED BSP_BOARD_LED_0 /**< Is on when device is advertising. */
  38. #define CONNECTED_LED BSP_BOARD_LED_1 /**< Is on when device has connected. */
  39. #define LEDBUTTON_LED BSP_BOARD_LED_2 /**< LED to be toggled with the help of the LED Button Service. */
  40. #define LEDBUTTON_BUTTON BSP_BUTTON_0 /**< Button that will trigger the notification event with the LED Button Service */
  41. #define BUTTON_DETECTION_DELAY APP_TIMER_TICKS(50) /**< Delay from a GPIOTE event until a button is reported as pushed (in number of timer ticks). */
  42. #define KEY_IRQ_ON 0
  43. #define KEY_IRQ_OFF 1
  44. #define KEY_LEFT_VALUE 0x01 // Break value
  45. #define KEY_RIGHT_VALUE 0x02
  46. #define KEY_LEFT_IO 26 // Left button
  47. #define KEY_RIGHT_IO 28 // right click
  48. #ifndef IRQ_DEBOUNCE_TIMEOUT
  49. #define IRQ_DEBOUNCE_TIMEOUT APP_TIMER_TICKS(20) // Timeout time (20ms)
  50. #endif
  51. /*********************************************************************
  52. * API FUNCTIONS
  53. */
  54. void ParkOutputsOff(void);
  55. void ParkOutputsOn(void);
  56. void PKLedOn(void);
  57. void PKLedOff(void);
  58. void PKBuzzerOn(void);
  59. void PKBuzzerOff(void);
  60. void PKMicOn(void);
  61. void PKMicOff(void);
  62. void PKSpeakerOn(void);
  63. void PKSpeakerOff(void);
  64. void ParkOutputTest();
  65. extern const uint8_t m_board_led_list[];
  66. #endif /* _BOARD_GPI_H_ */