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.

150 lines
4.0 KiB

7 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. /*
  2. * Copyright (C) 2015 Texas Instruments Incorporated - http://www.ti.com/
  3. *
  4. *
  5. * Redistribution and use in source and binary forms, with or without
  6. * modification, are permitted provided that the following conditions
  7. * are met:
  8. *
  9. * * Redistributions of source code must retain the above copyright
  10. * notice, this list of conditions and the following disclaimer.
  11. *
  12. * * Redistributions in binary form must reproduce the above copyright
  13. * notice, this list of conditions and the following disclaimer in the
  14. * documentation and/or other materials provided with the
  15. * distribution.
  16. *
  17. * * Neither the name of Texas Instruments Incorporated nor the names of
  18. * its contributors may be used to endorse or promote products derived
  19. * from this software without specific prior written permission.
  20. *
  21. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  22. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  23. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  24. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  25. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  26. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  27. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  28. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  29. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  30. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  31. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  32. */
  33. #ifndef _PRU_CTRL_H_
  34. #define _PRU_CTRL_H_
  35. /* PRU CTRL register set */
  36. typedef struct {
  37. /* PRU_CTRL_CTRL register bit field */
  38. union {
  39. volatile uint32_t CTRL;
  40. volatile struct {
  41. uint32_t SOFT_RST_N : 1; // 0
  42. uint32_t ENABLE : 1; // 1
  43. uint32_t SLEEPING : 1; // 2
  44. uint32_t COUNTER_ENABLE : 1; // 3
  45. uint32_t rsvd4 : 4; // 7:4
  46. uint32_t SINGLE_STEP : 1; // 8
  47. uint32_t rsvd9 : 6; // 14:9
  48. uint32_t RUNSTATE : 1; // 15
  49. uint32_t PCOUNTER_RST_VAL : 16; // 31:16
  50. } CTRL_bit;
  51. }; // 0x0
  52. /* PRU_CTRL_STS register bit field */
  53. union {
  54. volatile uint32_t STS;
  55. volatile struct {
  56. uint32_t PCOUNTER : 16; // 15:0
  57. uint32_t rsvd16 : 16; // 31:16
  58. } STS_bit;
  59. }; // 0x4
  60. /* PRU_CTRL_WAKEUP_EN register bit field */
  61. union {
  62. volatile uint32_t WAKEUP_EN;
  63. volatile struct {
  64. uint32_t BITWISE_ENABLES : 32; // 31:0
  65. } WAKEUP_EN_bit;
  66. }; // 0x8
  67. /* PRU_CTRL_CYCLE register bit field */
  68. union {
  69. volatile uint32_t CYCLE;
  70. volatile struct {
  71. uint32_t CYCLECOUNT : 32; // 31:0
  72. } CYCLE_bit;
  73. }; // 0xc
  74. /* PRU_CTRL_STALL register bit field */
  75. union {
  76. volatile uint32_t STALL;
  77. volatile struct {
  78. uint32_t STALLCOUNT : 32; // 31:0
  79. } STALL_bit;
  80. }; // 0x10
  81. uint8_t rsvd14[12]; // 0x14 - 0x1f
  82. /* PRU_CTRL_CTBIR0 register bit field */
  83. union {
  84. volatile uint32_t CTBIR0;
  85. volatile struct {
  86. uint32_t C24_BLK_INDEX : 8; // 7:0
  87. uint32_t rsvd8 : 8; // 15:8
  88. uint32_t C25_BLK_INDEX : 8; // 23:16
  89. uint32_t rsvd24 : 8; // 31:24
  90. } CTBIR0_bit;
  91. }; // 0x20
  92. /* PRU_CTRL_CTBIR1 register bit field */
  93. union {
  94. volatile uint32_t CTBIR1;
  95. volatile struct {
  96. uint32_t C26_BLK_INDEX : 8; // 7:0
  97. uint32_t rsvd8 : 8; // 15:8
  98. uint32_t C27_BLK_INDEX : 8; // 23:16
  99. uint32_t rsvd24 : 8; // 31:24
  100. } CTBIR1_bit;
  101. }; // 0x24
  102. /* PRU_CTRL_CTPPR0 register bit field */
  103. union {
  104. volatile uint32_t CTPPR0;
  105. volatile struct {
  106. uint32_t C28_POINTER : 16; // 15:0
  107. uint32_t C29_POINTER : 16; // 31:16
  108. } CTPPR0_bit;
  109. }; // 0x28
  110. /* PRU_CTRL_CTPPR1 register bit field */
  111. union {
  112. volatile uint32_t CTPPR1;
  113. volatile struct {
  114. uint32_t C30_POINTER : 16; // 15:0
  115. uint32_t C31_POINTER : 16; // 31:16
  116. } CTPPR1_bit;
  117. }; // 0x2c
  118. } pruCtrl;
  119. #define PRU0_CTRL_ADDR ((void *)0x22000)
  120. #define PRU1_CTRL_ADDR ((void *)0x24000)
  121. /* Definition of control register structures. */
  122. //#define PRU0_CTRL (*((volatile pruCtrl*)PRU0_CTRL_ADDR))
  123. //#define PRU1_CTRL (*((volatile pruCtrl*)PRU1_CTRL_ADDR))
  124. #endif /* _PRU_CTRL_H_ */