RTE_Device.h 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. #ifndef __RTE_DEVICE_H
  2. #define __RTE_DEVICE_H
  3. #include "ec616.h"
  4. /* Peripheral IO Mode Select, Must Configure First !!!
  5. Note, when receiver works in DMA_MODE, interrupt is also enabled to transfer tailing bytes.
  6. */
  7. #define POLLING_MODE 0x1
  8. #define DMA_MODE 0x2
  9. #define IRQ_MODE 0x3
  10. #define UNILOG_MODE 0x4
  11. #define RTE_UART0_TX_IO_MODE UNILOG_MODE
  12. #define RTE_UART0_RX_IO_MODE DMA_MODE
  13. #define RTE_UART1_TX_IO_MODE POLLING_MODE
  14. #define RTE_UART1_RX_IO_MODE DMA_MODE
  15. #define RTE_UART2_TX_IO_MODE POLLING_MODE
  16. #define RTE_UART2_RX_IO_MODE DMA_MODE
  17. #define RTE_SPI0_IO_MODE POLLING_MODE
  18. #define RTE_SPI1_IO_MODE POLLING_MODE
  19. #define I2C0_INIT_MODE POLLING_MODE
  20. #define I2C1_INIT_MODE POLLING_MODE
  21. // I2C0 (Inter-integrated Circuit Interface) [Driver_I2C0]
  22. // Configuration settings for Driver_I2C0 in component ::Drivers:I2C
  23. #define RTE_I2C0 1
  24. // { PAD_PIN25}, // 0 : gpio10 / 1 : I2C0 SCL
  25. // { PAD_PIN26}, // 0 : gpio8 / 1 : I2C0 SDA
  26. #define RTE_I2C0_SCL_BIT 25
  27. #define RTE_I2C0_SCL_FUNC PAD_MuxAlt1
  28. #define RTE_I2C0_SDA_BIT 26
  29. #define RTE_I2C0_SDA_FUNC PAD_MuxAlt1
  30. // DMA
  31. // Tx
  32. // Channel <0=>0 <1=>1 <2=>2 <3=>3 <4=>4 <5=>5 <6=>6 <7=>7
  33. #define RTE_I2C0_DMA_TX_EN 0
  34. #define RTE_I2C0_DMA_TX_REQID DMA_RequestI2C0TX
  35. // Rx
  36. // Channel <0=>0 <1=>1 <2=>2 <3=>3 <4=>4 <5=>5 <6=>6 <7=>7
  37. #define RTE_I2C0_DMA_RX_EN 0
  38. #define RTE_I2C0_DMA_RX_REQID DMA_RequestI2C0RX
  39. // I2C1 (Inter-integrated Circuit Interface) [Driver_I2C1]
  40. // Configuration settings for Driver_I2C1 in component ::Drivers:I2C
  41. #define RTE_I2C1 0
  42. // { PAD_PIN27}, // 0 : gpio17 / 1 : I2C1 SCL
  43. // { PAD_PIN28}, // 0 : gpio9 / 1 : I2C1 SDA
  44. #define RTE_I2C1_SCL_BIT 27
  45. #define RTE_I2C1_SCL_FUNC PAD_MuxAlt1
  46. #define RTE_I2C1_SDA_BIT 28
  47. #define RTE_I2C1_SDA_FUNC PAD_MuxAlt1
  48. // DMA
  49. // Tx
  50. // Channel <0=>0 <1=>1 <2=>2 <3=>3 <4=>4 <5=>5 <6=>6 <7=>7
  51. #define RTE_I2C1_DMA_TX_EN 1
  52. #define RTE_I2C1_DMA_TX_REQID DMA_RequestI2C1TX
  53. // Rx
  54. // Channel <0=>0 <1=>1 <2=>2 <3=>3 <4=>4 <5=>5 <6=>6 <7=>7
  55. #define RTE_I2C1_DMA_RX_EN 1
  56. #define RTE_I2C1_DMA_RX_REQID DMA_RequestI2C1RX
  57. // UART0 (Universal asynchronous receiver transmitter) [Driver_USART0]
  58. // Configuration settings for Driver_USART0 in component ::Drivers:USART
  59. #define RTE_UART0 1
  60. #define RTE_UART0_CTS_PIN_EN 0
  61. #define RTE_UART0_RTS_PIN_EN 0
  62. #if 1
  63. // { PAD_PIN23}, // 0 : gpio14 / 1 : UART1 RXD / 2 :SPI0_MISO /3 : UART0_RXD
  64. // { PAD_PIN24}, // 0 : gpio15 / 1 : UART1 TXD / 2: SPI0_SCLK /3 : UART0_TXD
  65. #define RTE_UART0_RX_BIT 23
  66. #define RTE_UART0_RX_FUNC PAD_MuxAlt3
  67. #define RTE_UART0_TX_BIT 24
  68. #define RTE_UART0_TX_FUNC PAD_MuxAlt3
  69. #else
  70. // { PAD_PIN13}, // 0 : gpio2 / 1 : UART0 RTSn / 3 : SPI1 SSn
  71. // { PAD_PIN14}, // 0 : gpio3 / 1 : UART0 CTSn / 3 : SPI1 MOSI
  72. // { PAD_PIN15}, // 0 : gpio4 / 1 : UART0 RXD / 3 : SPI1 MISO
  73. // { PAD_PIN16}, // 0 : gpio5 / 1 : UART0 TXD / 3 : SPI1 SCLK
  74. #define RTE_UART0_RTS_BIT 13
  75. #define RTE_UART0_RTS_FUNC PAD_MuxAlt1
  76. #define RTE_UART0_CTS_BIT 14
  77. #define RTE_UART0_CTS_FUNC PAD_MuxAlt1
  78. #define RTE_UART0_RX_BIT 15
  79. #define RTE_UART0_RX_FUNC PAD_MuxAlt1
  80. #define RTE_UART0_TX_BIT 16
  81. #define RTE_UART0_TX_FUNC PAD_MuxAlt1
  82. #endif
  83. // DMA
  84. // Tx
  85. // Channel <0=>0 <1=>1 <2=>2 <3=>3 <4=>4 <5=>5 <6=>6 <7=>7
  86. #define RTE_UART0_DMA_TX_REQID DMA_RequestUSART0TX
  87. // Rx
  88. // Channel <0=>0 <1=>1 <2=>2 <3=>3 <4=>4 <5=>5 <6=>6 <7=>7
  89. #define RTE_UART0_DMA_RX_REQID DMA_RequestUSART0RX
  90. // UART1 (Universal asynchronous receiver transmitter) [Driver_USART1]
  91. // Configuration settings for Driver_USART1 in component ::Drivers:USART
  92. #define RTE_UART1 1
  93. #define RTE_UART1_CTS_PIN_EN 0
  94. #define RTE_UART1_RTS_PIN_EN 0
  95. // { PAD_PIN17}, // 0 : gpio6 / 3 : UART1 RTS
  96. // { PAD_PIN18}, // 0 : gpio7 / 3 : UART1 CTS
  97. // { PAD_PIN19}, // 0 : gpio13 / 3 : UART1 RXD
  98. // { PAD_PIN20}, // 0 : gpio12 / 3 : UART1 TXD
  99. #define RTE_UART1_RTS_BIT 17
  100. #define RTE_UART1_RTS_FUNC PAD_MuxAlt3
  101. #define RTE_UART1_CTS_BIT 18
  102. #define RTE_UART1_CTS_FUNC PAD_MuxAlt3
  103. #define RTE_UART1_RX_BIT 19
  104. #define RTE_UART1_RX_FUNC PAD_MuxAlt3
  105. #define RTE_UART1_TX_BIT 20
  106. #define RTE_UART1_TX_FUNC PAD_MuxAlt3
  107. // DMA
  108. // Tx
  109. // Channel <0=>0 <1=>1 <2=>2 <3=>3 <4=>4 <5=>5 <6=>6 <7=>7
  110. #define RTE_UART1_DMA_TX_REQID DMA_RequestUSART1TX
  111. // Rx
  112. // Channel <0=>0 <1=>1 <2=>2 <3=>3 <4=>4 <5=>5 <6=>6 <7=>7
  113. #define RTE_UART1_DMA_RX_REQID DMA_RequestUSART1RX
  114. // UART2 (Universal asynchronous receiver transmitter) [Driver_USART2]
  115. // Configuration settings for Driver_USART2 in component ::Drivers:USART
  116. #define RTE_UART2 1
  117. #define RTE_UART2_CTS_PIN_EN 0
  118. #define RTE_UART2_RTS_PIN_EN 0
  119. // { PAD_PIN29}, // 0 : gpio18 / 1 : UART2 RXD
  120. // { PAD_PIN30}, // 0 : gpio19 / 1 : UART2 TXD
  121. #define RTE_UART2_RX_BIT 29
  122. #define RTE_UART2_RX_FUNC PAD_MuxAlt1
  123. #define RTE_UART2_TX_BIT 30
  124. #define RTE_UART2_TX_FUNC PAD_MuxAlt1
  125. // DMA
  126. // Tx
  127. // Channel <0=>0 <1=>1 <2=>2 <3=>3 <4=>4 <5=>5 <6=>6 <7=>7
  128. #define RTE_UART2_DMA_TX_REQID DMA_RequestUSART2TX
  129. // Rx
  130. // Channel <0=>0 <1=>1 <2=>2 <3=>3 <4=>4 <5=>5 <6=>6 <7=>7
  131. #define RTE_UART2_DMA_RX_REQID DMA_RequestUSART2RX
  132. // SPI0 (Serial Peripheral Interface) [Driver_SPI0]
  133. // Configuration settings for Driver_SPI0 in component ::Drivers:SPI
  134. #define RTE_SPI0 0
  135. // { PAD_PIN21}, // 0 : gpio16 / 1 : UART1 RTS / 2 : SPI0 SSn
  136. // { PAD_PIN22}, // 0 : gpio11 / 1 : UART1 CTS / 2 : SPI0 MOSI
  137. // { PAD_PIN23}, // 0 : gpio14 / 1 : UART1 RXD / 2 : SPI0 MISO
  138. // { PAD_PIN24}, // 0 : gpio15 / 1 : UART1 TXD / 2 : SPI0 SCLK
  139. #define RTE_SPI0_SSN_BIT 21
  140. #define RTE_SPI0_SSN_FUNC PAD_MuxAlt2
  141. #define RTE_SPI0_MOSI_BIT 22
  142. #define RTE_SPI0_MOSI_FUNC PAD_MuxAlt2
  143. #define RTE_SPI0_MISO_BIT 23
  144. #define RTE_SPI0_MISO_FUNC PAD_MuxAlt2
  145. #define RTE_SPI0_SCLK_BIT 24
  146. #define RTE_SPI0_SCLK_FUNC PAD_MuxAlt2
  147. #define RTE_SPI0_SSN_GPIO_INSTANCE 1
  148. #define RTE_SPI0_SSN_GPIO_INDEX 0
  149. // DMA
  150. // Tx
  151. // Channel <0=>0 <1=>1 <2=>2 <3=>3 <4=>4 <5=>5 <6=>6 <7=>7
  152. #define RTE_SPI0_DMA_TX_REQID DMA_RequestSPI0TX
  153. // Rx
  154. // Channel <0=>0 <1=>1 <2=>2 <3=>3 <4=>4 <5=>5 <6=>6 <7=>7
  155. #define RTE_SPI0_DMA_RX_REQID DMA_RequestSPI0RX
  156. // SPI1 (Serial Peripheral Interface) [Driver_SPI1]
  157. // Configuration settings for Driver_SPI1 in component ::Drivers:SPI
  158. #define RTE_SPI1 1
  159. // { PAD_PIN13}, // 0 : gpio2 / 1 : UART0 RTSn / 3 : SPI1 SSn
  160. // { PAD_PIN14}, // 0 : gpio3 / 1 : UART0 CTSn / 3 : SPI1 MOSI
  161. // { PAD_PIN15}, // 0 : gpio4 / 1 : UART0 RXD / 3 : SPI1 MISO
  162. // { PAD_PIN16}, // 0 : gpio5 / 1 : UART0 TXD / 3 : SPI1 SCLK
  163. #define RTE_SPI1_SSN_BIT 13
  164. #define RTE_SPI1_SSN_FUNC PAD_MuxAlt3
  165. #define RTE_SPI1_MOSI_BIT 14
  166. #define RTE_SPI1_MOSI_FUNC PAD_MuxAlt3
  167. #define RTE_SPI1_MISO_BIT 15
  168. #define RTE_SPI1_MISO_FUNC PAD_MuxAlt3
  169. #define RTE_SPI1_SCLK_BIT 16
  170. #define RTE_SPI1_SCLK_FUNC PAD_MuxAlt3
  171. #define RTE_SPI1_SSN_GPIO_INSTANCE 0
  172. #define RTE_SPI1_SSN_GPIO_INDEX 2
  173. // DMA
  174. // Tx
  175. // Channel <0=>0 <1=>1 <2=>2 <3=>3 <4=>4 <5=>5 <6=>6 <7=>7
  176. #define RTE_SPI1_DMA_TX_REQID DMA_RequestSPI1TX
  177. // Rx
  178. // Channel <0=>0 <1=>1 <2=>2 <3=>3 <4=>4 <5=>5 <6=>6 <7=>7
  179. #define RTE_SPI1_DMA_RX_REQID DMA_RequestSPI1RX
  180. // PWM0 Controller [Driver_PWM0]
  181. // Configuration settings for Driver_PWM0 in component ::Drivers:PWM
  182. #define RTE_PWM 1
  183. #define EFUSE_INIT_MODE POLLING_MODE
  184. #define FLASH_BARE_RW_MODE 1
  185. #endif /* __RTE_DEVICE_H */