peripherals.c 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. /***********************************************************************************************************************
  2. * This file was generated by the MCUXpresso Config Tools. Any manual edits made to this file
  3. * will be overwritten if the respective MCUXpresso Config Tools is used to update this file.
  4. **********************************************************************************************************************/
  5. /* clang-format off */
  6. /* TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
  7. !!GlobalInfo
  8. product: Peripherals v7.0
  9. processor: MIMXRT1062xxxxA
  10. package_id: MIMXRT1062DVL6A
  11. mcu_data: ksdk2_0
  12. processor_version: 7.0.1
  13. board: MIMXRT1060-EVK
  14. functionalGroups:
  15. - name: BOARD_InitPeripherals
  16. UUID: 607724de-b460-4106-989c-87eb75034b95
  17. called_from_default_init: true
  18. selectedCore: core0
  19. * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/
  20. /* TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
  21. component:
  22. - type: 'system'
  23. - type_id: 'system_54b53072540eeeb8f8e9343e71f28176'
  24. - global_system_definitions: []
  25. * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/
  26. /* TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
  27. component:
  28. - type: 'msg'
  29. - type_id: 'msg_6e2baaf3b97dbeef01c0043275f9a0e7'
  30. - global_messages: []
  31. * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/
  32. /* clang-format on */
  33. /***********************************************************************************************************************
  34. * Included files
  35. **********************************************************************************************************************/
  36. #include "peripherals.h"
  37. /***********************************************************************************************************************
  38. * BOARD_InitPeripherals functional group
  39. **********************************************************************************************************************/
  40. /***********************************************************************************************************************
  41. * LPUART1 initialization code
  42. **********************************************************************************************************************/
  43. /* clang-format off */
  44. /* TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
  45. instance:
  46. - name: 'LPUART1'
  47. - type: 'lpuart'
  48. - mode: 'polling'
  49. - custom_name_enabled: 'false'
  50. - type_id: 'lpuart_54a65a580e3462acdbacefd5299e0cac'
  51. - functional_group: 'BOARD_InitPeripherals'
  52. - peripheral: 'LPUART1'
  53. - config_sets:
  54. - lpuartConfig_t:
  55. - lpuartConfig:
  56. - clockSource: 'LpuartClock'
  57. - lpuartSrcClkFreq: 'BOARD_BootClockRUN'
  58. - baudRate_Bps: '38400'
  59. - parityMode: 'kLPUART_ParityDisabled'
  60. - dataBitsCount: 'kLPUART_EightDataBits'
  61. - isMsb: 'false'
  62. - stopBitCount: 'kLPUART_OneStopBit'
  63. - txFifoWatermark: '0'
  64. - rxFifoWatermark: '1'
  65. - enableRxRTS: 'false'
  66. - enableTxCTS: 'false'
  67. - txCtsSource: 'kLPUART_CtsSourcePin'
  68. - txCtsConfig: 'kLPUART_CtsSampleAtStart'
  69. - rxIdleType: 'kLPUART_IdleTypeStartBit'
  70. - rxIdleConfig: 'kLPUART_IdleCharacter1'
  71. - enableTx: 'true'
  72. - enableRx: 'true'
  73. * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/
  74. /* clang-format on */
  75. const lpuart_config_t LPUART1_config = {
  76. .baudRate_Bps = 38400,
  77. .parityMode = kLPUART_ParityDisabled,
  78. .dataBitsCount = kLPUART_EightDataBits,
  79. .isMsb = false,
  80. .stopBitCount = kLPUART_OneStopBit,
  81. .txFifoWatermark = 0,
  82. .rxFifoWatermark = 1,
  83. .enableRxRTS = false,
  84. .enableTxCTS = false,
  85. .txCtsSource = kLPUART_CtsSourcePin,
  86. .txCtsConfig = kLPUART_CtsSampleAtStart,
  87. .rxIdleType = kLPUART_IdleTypeStartBit,
  88. .rxIdleConfig = kLPUART_IdleCharacter1,
  89. .enableTx = true,
  90. .enableRx = true
  91. };
  92. void LPUART1_init(void) {
  93. LPUART_Init(LPUART1_PERIPHERAL, &LPUART1_config, LPUART1_CLOCK_SOURCE);
  94. }
  95. /***********************************************************************************************************************
  96. * DCP initialization code
  97. **********************************************************************************************************************/
  98. /* clang-format off */
  99. /* TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
  100. instance:
  101. - name: 'DCP'
  102. - type: 'dcp'
  103. - mode: 'general'
  104. - custom_name_enabled: 'false'
  105. - type_id: 'dcp_95a1068fdf77eaec189146622e54f5e0'
  106. - functional_group: 'BOARD_InitPeripherals'
  107. - peripheral: 'DCP'
  108. - config_sets:
  109. - config_general:
  110. - settings_common:
  111. - setting_gatherResidualWrites: 'true'
  112. - setting_enableContextCaching: 'false'
  113. - setting_enableContextSwitching: 'true'
  114. - setting_enableChannel: 'kDCP_ch0Enable kDCP_ch1Enable kDCP_ch2Enable kDCP_ch3Enable'
  115. - settings_interrupt:
  116. - setting_enableChannelInterrupt: ''
  117. - setting_interrupt_channel0:
  118. - IRQn: 'DCP_VMI_IRQn'
  119. - enable_priority: 'false'
  120. - priority: '0'
  121. - enable_custom_name: 'false'
  122. - setting_interrupt:
  123. - IRQn: 'DCP_IRQn'
  124. - enable_priority: 'false'
  125. - priority: '0'
  126. - enable_custom_name: 'false'
  127. - quick_selection: 'default'
  128. - config_handles:
  129. - settings_handles: []
  130. * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/
  131. /* clang-format on */
  132. const dcp_config_t DCP_config = {
  133. .gatherResidualWrites = true,
  134. .enableContextCaching = false,
  135. .enableContextSwitching = true,
  136. .enableChannel = kDCP_ch0Enable | kDCP_ch1Enable | kDCP_ch2Enable | kDCP_ch3Enable,
  137. .enableChannelInterrupt = kDCP_chIntDisable,
  138. };
  139. void DCP_init(void) {
  140. /* Initialize DCP. */
  141. DCP_Init(DCP_PERIPHERAL, &DCP_config);
  142. }
  143. /***********************************************************************************************************************
  144. * Initialization functions
  145. **********************************************************************************************************************/
  146. void BOARD_InitPeripherals(void)
  147. {
  148. /* Initialize components */
  149. LPUART1_init();
  150. DCP_init();
  151. }
  152. /***********************************************************************************************************************
  153. * BOARD_InitBootPeripherals function
  154. **********************************************************************************************************************/
  155. void BOARD_InitBootPeripherals(void)
  156. {
  157. BOARD_InitPeripherals();
  158. }