ti_msp_dl_config.h 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. /*
  2. * Copyright (c) 2023, Texas Instruments Incorporated - http://www.ti.com
  3. * All rights reserved.
  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 distribution.
  15. *
  16. * * Neither the name of Texas Instruments Incorporated nor the names of
  17. * its contributors may be used to endorse or promote products derived
  18. * from this software without specific prior written permission.
  19. *
  20. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  21. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
  22. * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  23. * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
  24. * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  25. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  26. * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  27. * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  28. * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  29. * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  30. * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  31. */
  32. /*
  33. * ============ ti_msp_dl_config.h =============
  34. * Configured MSPM0 DriverLib module declarations
  35. *
  36. * DO NOT EDIT - This file is generated for the MSPM0G350X
  37. * by the SysConfig tool.
  38. */
  39. #ifndef ti_msp_dl_config_h
  40. #define ti_msp_dl_config_h
  41. #define CONFIG_MSPM0G350X
  42. #if defined(__ti_version__) || defined(__TI_COMPILER_VERSION__)
  43. #define SYSCONFIG_WEAK __attribute__((weak))
  44. #elif defined(__IAR_SYSTEMS_ICC__)
  45. #define SYSCONFIG_WEAK __weak
  46. #elif defined(__GNUC__)
  47. #define SYSCONFIG_WEAK __attribute__((weak))
  48. #endif
  49. #include <ti/devices/msp/msp.h>
  50. #include <ti/driverlib/driverlib.h>
  51. #include <ti/driverlib/m0p/dl_core.h>
  52. #ifdef __cplusplus
  53. extern "C" {
  54. #endif
  55. /*
  56. * ======== SYSCFG_DL_init ========
  57. * Perform all required MSP DL initialization
  58. *
  59. * This function should be called once at a point before any use of
  60. * MSP DL.
  61. */
  62. /* clang-format off */
  63. #define POWER_STARTUP_DELAY (16)
  64. #define GPIO_HFXT_PORT GPIOA
  65. #define GPIO_HFXIN_PIN DL_GPIO_PIN_5
  66. #define GPIO_HFXIN_IOMUX (IOMUX_PINCM10)
  67. #define GPIO_HFXOUT_PIN DL_GPIO_PIN_6
  68. #define GPIO_HFXOUT_IOMUX (IOMUX_PINCM11)
  69. #define CPUCLK_FREQ 72000000
  70. #define OUTPUT_PORT (GPIOA)
  71. /* Defines for POWER_EN: GPIOA.23 with pinCMx 53 on package pin 43 */
  72. #define OUTPUT_POWER_EN_PIN (DL_GPIO_PIN_23)
  73. #define OUTPUT_POWER_EN_IOMUX (IOMUX_PINCM53)
  74. /* Defines for UART_HMI */
  75. #define UART_HMI_INST UART0
  76. #define UART_HMI_INST_IRQHandler UART0_IRQHandler
  77. #define UART_HMI_INST_INT_IRQN UART0_INT_IRQn
  78. #define GPIO_UART_HMI_RX_PORT GPIOA
  79. #define GPIO_UART_HMI_TX_PORT GPIOA
  80. #define GPIO_UART_HMI_RX_PIN DL_GPIO_PIN_1
  81. #define GPIO_UART_HMI_TX_PIN DL_GPIO_PIN_0
  82. #define GPIO_UART_HMI_IOMUX_RX (IOMUX_PINCM2)
  83. #define GPIO_UART_HMI_IOMUX_TX (IOMUX_PINCM1)
  84. #define GPIO_UART_HMI_IOMUX_RX_FUNC IOMUX_PINCM2_PF_UART0_RX
  85. #define GPIO_UART_HMI_IOMUX_TX_FUNC IOMUX_PINCM1_PF_UART0_TX
  86. #define UART_HMI_BAUD_RATE (19200)
  87. #define UART_HMI_IBRD_36_MHZ_19200_BAUD (117)
  88. #define UART_HMI_FBRD_36_MHZ_19200_BAUD (12)
  89. /* Defines for UART_BAT */
  90. #define UART_BAT_INST UART1
  91. #define UART_BAT_INST_IRQHandler UART1_IRQHandler
  92. #define UART_BAT_INST_INT_IRQN UART1_INT_IRQn
  93. #define GPIO_UART_BAT_RX_PORT GPIOA
  94. #define GPIO_UART_BAT_TX_PORT GPIOA
  95. #define GPIO_UART_BAT_RX_PIN DL_GPIO_PIN_18
  96. #define GPIO_UART_BAT_TX_PIN DL_GPIO_PIN_17
  97. #define GPIO_UART_BAT_IOMUX_RX (IOMUX_PINCM40)
  98. #define GPIO_UART_BAT_IOMUX_TX (IOMUX_PINCM39)
  99. #define GPIO_UART_BAT_IOMUX_RX_FUNC IOMUX_PINCM40_PF_UART1_RX
  100. #define GPIO_UART_BAT_IOMUX_TX_FUNC IOMUX_PINCM39_PF_UART1_TX
  101. #define UART_BAT_BAUD_RATE (19200)
  102. #define UART_BAT_IBRD_36_MHZ_19200_BAUD (117)
  103. #define UART_BAT_FBRD_36_MHZ_19200_BAUD (12)
  104. /* Defines for MCAN0 */
  105. #define MCAN0_INST CANFD0
  106. #define GPIO_MCAN0_CAN_TX_PORT GPIOA
  107. #define GPIO_MCAN0_CAN_TX_PIN DL_GPIO_PIN_12
  108. #define GPIO_MCAN0_IOMUX_CAN_TX (IOMUX_PINCM34)
  109. #define GPIO_MCAN0_IOMUX_CAN_TX_FUNC IOMUX_PINCM34_PF_CANFD0_CANTX
  110. #define GPIO_MCAN0_CAN_RX_PORT GPIOA
  111. #define GPIO_MCAN0_CAN_RX_PIN DL_GPIO_PIN_13
  112. #define GPIO_MCAN0_IOMUX_CAN_RX (IOMUX_PINCM35)
  113. #define GPIO_MCAN0_IOMUX_CAN_RX_FUNC IOMUX_PINCM35_PF_CANFD0_CANRX
  114. #define MCAN0_INST_IRQHandler CANFD0_IRQHandler
  115. #define MCAN0_INST_INT_IRQN CANFD0_INT_IRQn
  116. /* Defines for MCAN0 MCAN RAM configuration */
  117. #define MCAN0_INST_MCAN_STD_ID_FILT_START_ADDR (0)
  118. #define MCAN0_INST_MCAN_STD_ID_FILTER_NUM (1)
  119. #define MCAN0_INST_MCAN_EXT_ID_FILT_START_ADDR (0)
  120. #define MCAN0_INST_MCAN_EXT_ID_FILTER_NUM (0)
  121. #define MCAN0_INST_MCAN_TX_BUFF_START_ADDR (0)
  122. #define MCAN0_INST_MCAN_TX_BUFF_SIZE (0)
  123. #define MCAN0_INST_MCAN_FIFO_1_START_ADDR (0)
  124. #define MCAN0_INST_MCAN_FIFO_1_NUM (32)
  125. #define MCAN0_INST_MCAN_TX_EVENT_START_ADDR (0)
  126. #define MCAN0_INST_MCAN_TX_EVENT_SIZE (32)
  127. #define MCAN0_INST_MCAN_EXT_ID_AND_MASK (0x1FFFFFFFU)
  128. #define MCAN0_INST_MCAN_RX_BUFF_START_ADDR (0)
  129. #define MCAN0_INST_MCAN_FIFO_0_START_ADDR (0)
  130. #define MCAN0_INST_MCAN_FIFO_0_NUM (32)
  131. #define MCAN0_INST_MCAN_INTERRUPTS (DL_MCAN_INTERRUPT_ARA | \
  132. DL_MCAN_INTERRUPT_BEU | \
  133. DL_MCAN_INTERRUPT_BO | \
  134. DL_MCAN_INTERRUPT_DRX | \
  135. DL_MCAN_INTERRUPT_ELO | \
  136. DL_MCAN_INTERRUPT_EP | \
  137. DL_MCAN_INTERRUPT_EW | \
  138. DL_MCAN_INTERRUPT_MRAF | \
  139. DL_MCAN_INTERRUPT_PEA | \
  140. DL_MCAN_INTERRUPT_PED | \
  141. DL_MCAN_INTERRUPT_RF0N | \
  142. DL_MCAN_INTERRUPT_TC | \
  143. DL_MCAN_INTERRUPT_TEFN | \
  144. DL_MCAN_INTERRUPT_TOO | \
  145. DL_MCAN_INTERRUPT_TSW | \
  146. DL_MCAN_INTERRUPT_WDI)
  147. /* clang-format on */
  148. void SYSCFG_DL_init(void);
  149. void SYSCFG_DL_initPower(void);
  150. void SYSCFG_DL_GPIO_init(void);
  151. void SYSCFG_DL_SYSCTL_init(void);
  152. void SYSCFG_DL_UART_HMI_init(void);
  153. void SYSCFG_DL_UART_BAT_init(void);
  154. void SYSCFG_DL_MCAN0_init(void);
  155. void SYSCFG_DL_SYSTICK_init(void);
  156. void DL_SYSCTL_configSYSPLL_copy(DL_SYSCTL_SYSPLLConfig *config);
  157. bool SYSCFG_DL_saveConfiguration(void);
  158. bool SYSCFG_DL_restoreConfiguration(void);
  159. #ifdef __cplusplus
  160. }
  161. #endif
  162. #endif /* ti_msp_dl_config_h */