n5_starterkit.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. /**
  2. * This software is subject to the ANT+ Shared Source License
  3. * www.thisisant.com/swlicenses
  4. * Copyright (c) Garmin Canada Inc. 2015
  5. * All rights reserved.
  6. *
  7. * Redistribution and use in source and binary forms, with or
  8. * without modification, are permitted provided that the following
  9. * conditions are met:
  10. *
  11. * 1) Redistributions of source code must retain the above
  12. * copyright notice, this list of conditions and the following
  13. * disclaimer.
  14. *
  15. * 2) Redistributions in binary form must reproduce the above
  16. * copyright notice, this list of conditions and the following
  17. * disclaimer in the documentation and/or other materials
  18. * provided with the distribution.
  19. *
  20. * 3) Neither the name of Garmin nor the names of its
  21. * contributors may be used to endorse or promote products
  22. * derived from this software without specific prior
  23. * written permission.
  24. *
  25. * The following actions are prohibited:
  26. *
  27. * 1) Redistribution of source code containing the ANT+ Network
  28. * Key. The ANT+ Network Key is available to ANT+ Adopters.
  29. * Please refer to http://thisisant.com to become an ANT+
  30. * Adopter and access the key.
  31. *
  32. * 2) Reverse engineering, decompilation, and/or disassembly of
  33. * software provided in binary form under this license.
  34. *
  35. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
  36. * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
  37. * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  38. * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE HEREBY
  39. * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
  40. * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  41. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES(INCLUDING,
  42. * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  43. * SERVICES; DAMAGE TO ANY DEVICE, LOSS OF USE, DATA, OR
  44. * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  45. * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  46. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
  47. * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
  48. * OF THE POSSIBILITY OF SUCH DAMAGE. SOME STATES DO NOT ALLOW
  49. * THE EXCLUSION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THE
  50. * ABOVE LIMITATIONS MAY NOT APPLY TO YOU.
  51. *
  52. */
  53. #ifndef N5STARTERKIT_H
  54. #define N5STARTERKIT_H
  55. #include "nrf_gpio.h"
  56. #ifdef __cplusplus
  57. extern "C" {
  58. #endif
  59. // LEDs definitions for N5DK1
  60. #define LEDS_NUMBER 4
  61. // IO board active low leds
  62. // N5DK1 does not define LED_START or LED_STOP since the LEDS are not on sequential pins
  63. #define LED_A 8 //LED A on N5 Starter Kit IO Board
  64. #define LED_B 3 //LED B on N5 Starter Kit IO Board
  65. #define LED_C 15 //LED C on N5 Starter Kit IO Board
  66. #define LED_D 30 //LED D on N5 Starter Kit IO Board
  67. #define LEDS_ACTIVE_STATE 0
  68. #define LEDS_LIST { LED_A, LED_B, LED_C, LED_D }
  69. #define LEDS_INV_MASK LEDS_MASK
  70. #define BSP_LED_0 LED_A
  71. #define BSP_LED_1 LED_B
  72. #define BSP_LED_2 LED_C
  73. #define BSP_LED_3 LED_D
  74. #define BUTTONS_NUMBER 4
  75. // IO board pull-up buttons
  76. #define BUTTON_A 23 //BUTTON A on N5 Starter Kit IO Board
  77. #define BUTTON_B 2 //BUTTON B on N5 Starter Kit IO Board
  78. #define BUTTON_C 12 //BUTTON C on N5 Starter Kit IO Board
  79. #define BUTTON_D 11 //BUTTON D on N5 Starter Kit IO Board
  80. #define BUTTON_PULL NRF_GPIO_PIN_PULLUP
  81. #define BUTTONS_ACTIVE_STATE 0
  82. #define BSP_BUTTON_0 BUTTON_A
  83. #define BSP_BUTTON_1 BUTTON_B
  84. #define BSP_BUTTON_2 BUTTON_C
  85. #define BSP_BUTTON_3 BUTTON_D
  86. #define BUTTONS_LIST { BUTTON_A, BUTTON_B, BUTTON_C, BUTTON_D }
  87. // Battery board pull-up switches
  88. #define SWITCH_1 5 // Switch 1 on N5 Starter Kit Battery Board
  89. #define SWITCH_2 0 // Switch 2 on N5 Starter Kit Battery Board
  90. #define SWITCH_3 6 // Switch 3 on N5 Starter Kit Battery Board
  91. #define SWITCH_4 24 // Switch 4 on N5 Starter Kit Battery Board
  92. #define SWITCH_5 9 // Switch 5 on N5 Starter Kit Battery Board
  93. #define SWITCH_PULL NRF_GPIO_PIN_PULLUP
  94. #define SWITCHES_NUMBER 5
  95. #define BSP_SWITCH_0 SWITCH_1
  96. #define BSP_SWITCH_1 SWITCH_2
  97. #define BSP_SWITCH_2 SWITCH_3
  98. #define BSP_SWITCH_3 SWITCH_4
  99. #define BSP_SWITCH_4 SWITCH_5
  100. #define SWITCHES_MASK 0x01000261
  101. // N5DK1 does not have UART peripheral. Dummy defines for compilation.
  102. #define RX_PIN_NUMBER UART_PIN_DISCONNECTED
  103. #define TX_PIN_NUMBER UART_PIN_DISCONNECTED
  104. #define CTS_PIN_NUMBER UART_PIN_DISCONNECTED
  105. #define RTS_PIN_NUMBER UART_PIN_DISCONNECTED
  106. #ifdef __cplusplus
  107. }
  108. #endif
  109. #endif