HAL_syscfg.h 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. /**
  2. ******************************************************************************
  3. * @file HAL_syscfg.h
  4. * @author IC Applications Department
  5. * @version V0.8
  6. * @date 2019_08_02
  7. * @brief This file contains all the functions prototypes for the SYSCFG firmware
  8. * library.
  9. ******************************************************************************
  10. * @attention
  11. *
  12. * <h2><center>&copy; COPYRIGHT 2016 HOLOCENE</center></h2>
  13. *
  14. */
  15. /*!< Define to prevent recursive inclusion -------------------------------------*/
  16. #ifndef __HAL_SYSCFG_H
  17. #define __HAL_SYSCFG_H
  18. #ifdef __cplusplus
  19. extern "C" {
  20. #endif
  21. /*!< Includes ------------------------------------------------------------------*/
  22. #include "HAL_device.h"
  23. /** @addtogroup StdPeriph_Driver
  24. * @{
  25. */
  26. /** @addtogroup SYSCFG
  27. * @{
  28. */
  29. /* Exported types ------------------------------------------------------------*/
  30. /* Exported constants --------------------------------------------------------*/
  31. /** @defgroup SYSCFG_Exported_Constants
  32. * @{
  33. */
  34. /** @defgroup SYSCFG_EXTI_Port_Sources
  35. * @{
  36. */
  37. #define EXTI_PortSourceGPIOA ((uint8_t)0x00)
  38. #define EXTI_PortSourceGPIOB ((uint8_t)0x01)
  39. #define EXTI_PortSourceGPIOC ((uint8_t)0x02)
  40. #define EXTI_PortSourceGPIOD ((uint8_t)0x03)
  41. #define EXTI_PortSourceGPIOE ((uint8_t)0x04)
  42. #define EXTI_PortSourceGPIOF ((uint8_t)0x05)
  43. #define IS_EXTI_PORT_SOURCE(PORTSOURCE) (((PORTSOURCE) == EXTI_PortSourceGPIOA) || \
  44. ((PORTSOURCE) == EXTI_PortSourceGPIOB) || \
  45. ((PORTSOURCE) == EXTI_PortSourceGPIOC) || \
  46. ((PORTSOURCE) == EXTI_PortSourceGPIOD) || \
  47. ((PORTSOURCE) == EXTI_PortSourceGPIOE) || \
  48. ((PORTSOURCE) == EXTI_PortSourceGPIOF))
  49. /**
  50. * @}
  51. */
  52. /** @defgroup SYSCFG_EXTI_Pin_sources
  53. * @{
  54. */
  55. #define EXTI_PinSource0 ((uint8_t)0x00)
  56. #define EXTI_PinSource1 ((uint8_t)0x01)
  57. #define EXTI_PinSource2 ((uint8_t)0x02)
  58. #define EXTI_PinSource3 ((uint8_t)0x03)
  59. #define EXTI_PinSource4 ((uint8_t)0x04)
  60. #define EXTI_PinSource5 ((uint8_t)0x05)
  61. #define EXTI_PinSource6 ((uint8_t)0x06)
  62. #define EXTI_PinSource7 ((uint8_t)0x07)
  63. #define EXTI_PinSource8 ((uint8_t)0x08)
  64. #define EXTI_PinSource9 ((uint8_t)0x09)
  65. #define EXTI_PinSource10 ((uint8_t)0x0A)
  66. #define EXTI_PinSource11 ((uint8_t)0x0B)
  67. #define EXTI_PinSource12 ((uint8_t)0x0C)
  68. #define EXTI_PinSource13 ((uint8_t)0x0D)
  69. #define EXTI_PinSource14 ((uint8_t)0x0E)
  70. #define EXTI_PinSource15 ((uint8_t)0x0F)
  71. #define IS_EXTI_PIN_SOURCE(PINSOURCE) (((PINSOURCE) == EXTI_PinSource0) || \
  72. ((PINSOURCE) == EXTI_PinSource1) || \
  73. ((PINSOURCE) == EXTI_PinSource2) || \
  74. ((PINSOURCE) == EXTI_PinSource3) || \
  75. ((PINSOURCE) == EXTI_PinSource4) || \
  76. ((PINSOURCE) == EXTI_PinSource5) || \
  77. ((PINSOURCE) == EXTI_PinSource6) || \
  78. ((PINSOURCE) == EXTI_PinSource7) || \
  79. ((PINSOURCE) == EXTI_PinSource8) || \
  80. ((PINSOURCE) == EXTI_PinSource9) || \
  81. ((PINSOURCE) == EXTI_PinSource10) || \
  82. ((PINSOURCE) == EXTI_PinSource11) || \
  83. ((PINSOURCE) == EXTI_PinSource12) || \
  84. ((PINSOURCE) == EXTI_PinSource13) || \
  85. ((PINSOURCE) == EXTI_PinSource14) || \
  86. ((PINSOURCE) == EXTI_PinSource15))
  87. /**
  88. * @}
  89. */
  90. /** @defgroup SYSCFG_Memory_Remap_Config
  91. * @{
  92. */
  93. #define SYSCFG_MemoryRemap_Flash ((uint8_t)0x00)
  94. #define SYSCFG_MemoryRemap_SystemMemory ((uint8_t)0x01)
  95. #define SYSCFG_MemoryRemap_SRAM ((uint8_t)0x03)
  96. #define IS_SYSCFG_MEMORY_REMAP(REMAP) (((REMAP) == SYSCFG_MemoryRemap_Flash) || \
  97. ((REMAP) == SYSCFG_MemoryRemap_SystemMemory) || \
  98. ((REMAP) == SYSCFG_MemoryRemap_SRAM))
  99. /**
  100. * @}
  101. */
  102. /** @defgroup SYSCFG_DMA_Remap_Config
  103. * @{
  104. */
  105. #define SYSCFG_DMARemap_TIM17 SYSCFG_CFGR1_TIM17_DMA_RMP /* Remap TIM17 DMA requests from channel1 to channel2 */
  106. #define SYSCFG_DMARemap_TIM16 SYSCFG_CFGR1_TIM16_DMA_RMP /* Remap TIM16 DMA requests from channel3 to channel4 */
  107. #define SYSCFG_DMARemap_UART1Rx SYSCFG_CFGR1_UART1RX_DMA_RMP /* Remap UART1 Rx DMA requests from channel3 to channel5 */
  108. #define SYSCFG_DMARemap_UART1Tx SYSCFG_CFGR1_UART1TX_DMA_RMP /* Remap UART1 Tx DMA requests from channel2 to channel4 */
  109. #define SYSCFG_DMARemap_ADC1 SYSCFG_CFGR1_ADC_DMA_RMP /* Remap ADC1 DMA requests from channel1 to channel2 */
  110. #define IS_SYSCFG_DMA_REMAP(REMAP) (((REMAP) == SYSCFG_DMARemap_TIM17) || \
  111. ((REMAP) == SYSCFG_DMARemap_TIM16) || \
  112. ((REMAP) == SYSCFG_DMARemap_UART1Rx) || \
  113. ((REMAP) == SYSCFG_DMARemap_UART1Tx) || \
  114. ((REMAP) == SYSCFG_CFGR1_TIM3_DMA_RMP) || \
  115. ((REMAP) == SYSCFG_CFGR1_TIM2_DMA_RMP) || \
  116. ((REMAP) == SYSCFG_CFGR1_TIM1_DMA_RMP) || \
  117. ((REMAP) == SYSCFG_CFGR1_I2C1_DMA_RMP) || \
  118. ((REMAP) == SYSCFG_CFGR1_UART3_DMA_RMP) || \
  119. ((REMAP) == SYSCFG_CFGR1_UART2_DMA_RMP) || \
  120. ((REMAP) == SYSCFG_CFGR1_SPI2_DMA_RMP) || \
  121. ((REMAP) == SYSCFG_CFGR1_TIM17_DMA_RMP2) || \
  122. ((REMAP) == SYSCFG_CFGR1_TIM16_DMA_RMP2) || \
  123. ((REMAP) == SYSCFG_DMARemap_ADC1))
  124. /**
  125. * @}
  126. */
  127. /* Exported macro ------------------------------------------------------------*/
  128. /* Exported functions ------------------------------------------------------- */
  129. /* Function used to set the SYSCFG configuration to the default reset state **/
  130. void SYSCFG_DeInit(void);
  131. /* SYSCFG configuration functions *********************************************/
  132. void SYSCFG_MemoryRemapConfig(uint32_t SYSCFG_MemoryRemap);
  133. void SYSCFG_DMAChannelRemapConfig(uint32_t SYSCFG_DMARemap, FunctionalState NewState);
  134. void SYSCFG_I2CFastModePlusConfig(uint32_t SYSCFG_I2CFastModePlus, FunctionalState NewState);
  135. void SYSCFG_IRDAEnvSelection(uint32_t SYSCFG_IRDAEnv);
  136. void SYSCFG_EXTILineConfig(uint8_t EXTI_PortSourceGPIOx, uint8_t EXTI_PinSourcex);
  137. uint32_t SYSCFG_GetPendingIT(uint32_t ITSourceLine);
  138. void SYSCFG_BreakConfig(uint32_t SYSCFG_Break);
  139. FlagStatus SYSCFG_GetFlagStatus(uint32_t SYSCFG_Flag);
  140. void SYSCFG_ClearFlag(uint32_t SYSCFG_Flag);
  141. #ifdef __cplusplus
  142. }
  143. #endif
  144. #endif /*__HAL_SYSCFG_H */
  145. /**
  146. * @}
  147. */
  148. /**
  149. * @}
  150. */
  151. /*-------------------------(C) COPYRIGHT 2016 HOLOCENE ----------------------*/