1
0

n5_starterkit.h 4.9 KB

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