Ein Roboter mit bürstenlosem Antrieb, differenzial und NRF24L01 Funk. Großflächig gebaut um ein großes Solarpanel aufzunehmen. https://gitlab.informatik.hs-fulda.de/fdai5253/roboter
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

127 lines
3.4 KiB

  1. /*
  2. Copyright (c) 2007 Stefan Engelke <mbox@stefanengelke.de>
  3. Portions Copyright (C) 2011 Greg Copeland
  4. Permission is hereby granted, free of charge, to any person
  5. obtaining a copy of this software and associated documentation
  6. files (the "Software"), to deal in the Software without
  7. restriction, including without limitation the rights to use, copy,
  8. modify, merge, publish, distribute, sublicense, and/or sell copies
  9. of the Software, and to permit persons to whom the Software is
  10. furnished to do so, subject to the following conditions:
  11. The above copyright notice and this permission notice shall be
  12. included in all copies or substantial portions of the Software.
  13. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  14. EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  15. MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  16. NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
  17. HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
  18. WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  19. OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  20. DEALINGS IN THE SOFTWARE.
  21. */
  22. /* Memory Map */
  23. #define NRF_CONFIG 0x00
  24. #define EN_AA 0x01
  25. #define EN_RXADDR 0x02
  26. #define SETUP_AW 0x03
  27. #define SETUP_RETR 0x04
  28. #define RF_CH 0x05
  29. #define RF_SETUP 0x06
  30. #define NRF_STATUS 0x07
  31. #define OBSERVE_TX 0x08
  32. #define CD 0x09
  33. #define RX_ADDR_P0 0x0A
  34. #define RX_ADDR_P1 0x0B
  35. #define RX_ADDR_P2 0x0C
  36. #define RX_ADDR_P3 0x0D
  37. #define RX_ADDR_P4 0x0E
  38. #define RX_ADDR_P5 0x0F
  39. #define TX_ADDR 0x10
  40. #define RX_PW_P0 0x11
  41. #define RX_PW_P1 0x12
  42. #define RX_PW_P2 0x13
  43. #define RX_PW_P3 0x14
  44. #define RX_PW_P4 0x15
  45. #define RX_PW_P5 0x16
  46. #define FIFO_STATUS 0x17
  47. #define DYNPD 0x1C
  48. #define FEATURE 0x1D
  49. /* Bit Mnemonics */
  50. #define MASK_RX_DR 6
  51. #define MASK_TX_DS 5
  52. #define MASK_MAX_RT 4
  53. #define EN_CRC 3
  54. #define CRCO 2
  55. #define PWR_UP 1
  56. #define PRIM_RX 0
  57. #define ENAA_P5 5
  58. #define ENAA_P4 4
  59. #define ENAA_P3 3
  60. #define ENAA_P2 2
  61. #define ENAA_P1 1
  62. #define ENAA_P0 0
  63. #define ERX_P5 5
  64. #define ERX_P4 4
  65. #define ERX_P3 3
  66. #define ERX_P2 2
  67. #define ERX_P1 1
  68. #define ERX_P0 0
  69. #define AW 0
  70. #define ARD 4
  71. #define ARC 0
  72. #define PLL_LOCK 4
  73. #define RF_DR 3
  74. #define RF_PWR 6
  75. #define RX_DR 6
  76. #define TX_DS 5
  77. #define MAX_RT 4
  78. #define RX_P_NO 1
  79. #define TX_FULL 0
  80. #define PLOS_CNT 4
  81. #define ARC_CNT 0
  82. #define TX_REUSE 6
  83. #define FIFO_FULL 5
  84. #define TX_EMPTY 4
  85. #define RX_FULL 1
  86. #define RX_EMPTY 0
  87. #define DPL_P5 5
  88. #define DPL_P4 4
  89. #define DPL_P3 3
  90. #define DPL_P2 2
  91. #define DPL_P1 1
  92. #define DPL_P0 0
  93. #define EN_DPL 2
  94. #define EN_ACK_PAY 1
  95. #define EN_DYN_ACK 0
  96. /* Instruction Mnemonics */
  97. #define R_REGISTER 0x00
  98. #define W_REGISTER 0x20
  99. #define REGISTER_MASK 0x1F
  100. #define ACTIVATE 0x50
  101. #define R_RX_PL_WID 0x60
  102. #define R_RX_PAYLOAD 0x61
  103. #define W_TX_PAYLOAD 0xA0
  104. #define W_ACK_PAYLOAD 0xA8
  105. #define FLUSH_TX 0xE1
  106. #define FLUSH_RX 0xE2
  107. #define REUSE_TX_PL 0xE3
  108. #define RF24_NOP 0xFF
  109. /* Non-P omissions */
  110. #define LNA_HCURR 0
  111. /* P model memory Map */
  112. #define RPD 0x09
  113. #define W_TX_PAYLOAD_NO_ACK 0xB0
  114. /* P model bit Mnemonics */
  115. #define RF_DR_LOW 5
  116. #define RF_DR_HIGH 3
  117. #define RF_PWR_LOW 1
  118. #define RF_PWR_HIGH 2