ti_msp_dl_config.h 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  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. #define CONFIG_MSPM0G3507
  43. #if defined(__ti_version__) || defined(__TI_COMPILER_VERSION__)
  44. #define SYSCONFIG_WEAK __attribute__((weak))
  45. #elif defined(__IAR_SYSTEMS_ICC__)
  46. #define SYSCONFIG_WEAK __weak
  47. #elif defined(__GNUC__)
  48. #define SYSCONFIG_WEAK __attribute__((weak))
  49. #endif
  50. #include <ti/devices/msp/msp.h>
  51. #include <ti/driverlib/driverlib.h>
  52. #include <ti/driverlib/m0p/dl_core.h>
  53. #ifdef __cplusplus
  54. extern "C" {
  55. #endif
  56. /*
  57. * ======== SYSCFG_DL_init ========
  58. * Perform all required MSP DL initialization
  59. *
  60. * This function should be called once at a point before any use of
  61. * MSP DL.
  62. */
  63. /* clang-format off */
  64. #define POWER_STARTUP_DELAY (16)
  65. #define CPUCLK_FREQ 32000000
  66. /* Defines for I2C_controller */
  67. #define I2C_controller_INST I2C1
  68. #define I2C_controller_INST_IRQHandler I2C1_IRQHandler
  69. #define I2C_controller_INST_INT_IRQN I2C1_INT_IRQn
  70. #define I2C_controller_BUS_SPEED_HZ 100000
  71. #define GPIO_I2C_controller_SDA_PORT GPIOA
  72. #define GPIO_I2C_controller_SDA_PIN DL_GPIO_PIN_16
  73. #define GPIO_I2C_controller_IOMUX_SDA (IOMUX_PINCM38)
  74. #define GPIO_I2C_controller_IOMUX_SDA_FUNC IOMUX_PINCM38_PF_I2C1_SDA
  75. #define GPIO_I2C_controller_SCL_PORT GPIOA
  76. #define GPIO_I2C_controller_SCL_PIN DL_GPIO_PIN_15
  77. #define GPIO_I2C_controller_IOMUX_SCL (IOMUX_PINCM37)
  78. #define GPIO_I2C_controller_IOMUX_SCL_FUNC IOMUX_PINCM37_PF_I2C1_SCL
  79. /* Defines for I2C_target */
  80. #define I2C_target_INST I2C0
  81. #define I2C_target_INST_IRQHandler I2C0_IRQHandler
  82. #define I2C_target_INST_INT_IRQN I2C0_INT_IRQn
  83. #define I2C_target_TARGET_OWN_ADDR 0x48
  84. #define GPIO_I2C_target_SDA_PORT GPIOA
  85. #define GPIO_I2C_target_SDA_PIN DL_GPIO_PIN_0
  86. #define GPIO_I2C_target_IOMUX_SDA (IOMUX_PINCM1)
  87. #define GPIO_I2C_target_IOMUX_SDA_FUNC IOMUX_PINCM1_PF_I2C0_SDA
  88. #define GPIO_I2C_target_SCL_PORT GPIOA
  89. #define GPIO_I2C_target_SCL_PIN DL_GPIO_PIN_1
  90. #define GPIO_I2C_target_IOMUX_SCL (IOMUX_PINCM2)
  91. #define GPIO_I2C_target_IOMUX_SCL_FUNC IOMUX_PINCM2_PF_I2C0_SCL
  92. /* Port definition for Pin Group GPIO_Battery_Charging */
  93. #define GPIO_Battery_Charging_PORT (GPIOB)
  94. /* Defines for PIN_PB0: GPIOB.0 with pinCMx 12 on package pin 47 */
  95. #define GPIO_Battery_Charging_PIN_PB0_PIN (DL_GPIO_PIN_0)
  96. #define GPIO_Battery_Charging_PIN_PB0_IOMUX (IOMUX_PINCM12)
  97. /* Defines for PIN_PB4: GPIOB.4 with pinCMx 17 on package pin 52 */
  98. #define GPIO_Battery_Charging_PIN_PB4_PIN (DL_GPIO_PIN_4)
  99. #define GPIO_Battery_Charging_PIN_PB4_IOMUX (IOMUX_PINCM17)
  100. /* Port definition for Pin Group GPIO_Battery_Discharging */
  101. #define GPIO_Battery_Discharging_PORT (GPIOB)
  102. /* Defines for PIN_PB8: GPIOB.8 with pinCMx 25 on package pin 60 */
  103. #define GPIO_Battery_Discharging_PIN_PB8_PIN (DL_GPIO_PIN_8)
  104. #define GPIO_Battery_Discharging_PIN_PB8_IOMUX (IOMUX_PINCM25)
  105. /* Defines for PIN_PB12: GPIOB.12 with pinCMx 29 on package pin 64 */
  106. #define GPIO_Battery_Discharging_PIN_PB12_PIN (DL_GPIO_PIN_12)
  107. #define GPIO_Battery_Discharging_PIN_PB12_IOMUX (IOMUX_PINCM29)
  108. /* Defines for CRC */
  109. #define CRC_SEED (0xFFFF)
  110. /* clang-format on */
  111. void SYSCFG_DL_init(void);
  112. void SYSCFG_DL_initPower(void);
  113. void SYSCFG_DL_GPIO_init(void);
  114. void SYSCFG_DL_SYSCTL_init(void);
  115. void SYSCFG_DL_I2C_controller_init(void);
  116. void SYSCFG_DL_I2C_target_init(void);
  117. void SYSCFG_DL_CRC_init(void);
  118. #ifdef __cplusplus
  119. }
  120. #endif
  121. #endif /* ti_msp_dl_config_h */