d52_starterkit.h 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. /**
  2. * This software is subject to the ANT+ Shared Source License
  3. * www.thisisant.com/swlicenses
  4. * Copyright (c) Garmin Canada Inc. 2016
  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 D52STARTERKIT_H
  54. #define D52STARTERKIT_H
  55. #include "nrf_gpio.h"
  56. #ifdef __cplusplus
  57. extern "C" {
  58. #endif
  59. // LEDs definitions for D52DK1
  60. #define LEDS_NUMBER 4
  61. // IO board active low leds
  62. // D52DK1 does not define LED_START or LED_STOP since the LEDS are not on sequential pins
  63. #define LED_A 24 //LED A on D52 Starter Kit IO Board
  64. #define LED_B 31 //LED B on D52 Starter Kit IO Board
  65. #define LED_C 17 //LED C on D52 Starter Kit IO Board
  66. #define LED_D 20 //LED D on D52 Starter Kit IO Board
  67. #define LEDS_ACTIVE_STATE 0
  68. #define LEDS_LIST { LED_A, LED_B, LED_C, LED_D }
  69. #define BSP_LED_0 LED_A
  70. #define BSP_LED_1 LED_B
  71. #define BSP_LED_2 LED_C
  72. #define BSP_LED_3 LED_D
  73. #define LEDS_INV_MASK LEDS_MASK
  74. #define BUTTONS_NUMBER 4
  75. // IO board pull-up buttons
  76. #define BUTTON_A 6 //BUTTON A on D52 Starter Kit IO Board
  77. #define BUTTON_B 7 //BUTTON B on D52 Starter Kit IO Board
  78. #define BUTTON_C 16 //BUTTON C on D52 Starter Kit IO Board
  79. #define BUTTON_D 19 //BUTTON D on D52 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 12 // Switch 1 on D52 Starter Kit Battery Board
  89. #define SWITCH_2 8 // Switch 2 on D52 Starter Kit Battery Board
  90. #define SWITCH_3 15 // Switch 3 on D52 Starter Kit Battery Board
  91. #define SWITCH_4 11 // Switch 4 on D52 Starter Kit Battery Board
  92. #define SWITCH_5 14 // Switch 5 on D52 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 BSP_SWITCH_0_MASK (1<<BSP_SWITCH_0)
  101. #define BSP_SWITCH_1_MASK (1<<BSP_SWITCH_1)
  102. #define BSP_SWITCH_2_MASK (1<<BSP_SWITCH_2)
  103. #define BSP_SWITCH_3_MASK (1<<BSP_SWITCH_3)
  104. #define BSP_SWITCH_4_MASK (1<<BSP_SWITCH_4)
  105. #define SWITCHES_MASK (BSP_SWITCH_0_MASK | BSP_SWITCH_1_MASK | BSP_SWITCH_2_MASK | BSP_SWITCH_3_MASK | BSP_SWITCH_4_MASK)
  106. // D52DK1 does not have UART peripheral. Dummy defines for compilation.
  107. #define RX_PIN_NUMBER UART_PIN_DISCONNECTED
  108. #define TX_PIN_NUMBER UART_PIN_DISCONNECTED
  109. #define CTS_PIN_NUMBER UART_PIN_DISCONNECTED
  110. #define RTS_PIN_NUMBER UART_PIN_DISCONNECTED
  111. // serialization CONNECTIVITY board
  112. #define SER_CON_RX_PIN 22 // UART RX pin number.
  113. #define SER_CON_TX_PIN 23 // UART TX pin number.
  114. #define SER_CON_CTS_PIN 25 // UART Clear To Send pin number. Not used if HWFC is set to false.
  115. #define SER_CON_RTS_PIN 2 // UART Request To Send pin number. Not used if HWFC is set to false.
  116. // serialization APPLICATION board - temp. setup for running serialized MEMU tests
  117. #define SER_APP_RX_PIN 23 // UART RX pin number.
  118. #define SER_APP_TX_PIN 22 // UART TX pin number.
  119. #define SER_APP_CTS_PIN 2 // UART Clear To Send pin number.
  120. #define SER_APP_RTS_PIN 25 // UART Request To Send pin number.
  121. #define SER_CONN_CHIP_RESET_PIN 11 // Pin used to reset connectivity chip
  122. #ifdef __cplusplus
  123. }
  124. #endif
  125. #endif