stm32f4xx_syscfg.c
Go to the documentation of this file.
1 
46 /* Includes ------------------------------------------------------------------*/
47 #include "stm32f4xx_syscfg.h"
48 #include "stm32f4xx_rcc.h"
49 
59 /* Private typedef -----------------------------------------------------------*/
60 /* Private define ------------------------------------------------------------*/
61 /* ------------ RCC registers bit address in the alias region ----------- */
62 #define SYSCFG_OFFSET (SYSCFG_BASE - PERIPH_BASE)
63 
64 /* --- PMC Register ---*/
65 /* Alias word address of MII_RMII_SEL bit */
66 #define PMC_OFFSET (SYSCFG_OFFSET + 0x04)
67 #define MII_RMII_SEL_BitNumber ((uint8_t)0x17)
68 #define PMC_MII_RMII_SEL_BB (PERIPH_BB_BASE + (PMC_OFFSET * 32) + (MII_RMII_SEL_BitNumber * 4))
69 
70 /* --- CMPCR Register ---*/
71 /* Alias word address of CMP_PD bit */
72 #define CMPCR_OFFSET (SYSCFG_OFFSET + 0x20)
73 #define CMP_PD_BitNumber ((uint8_t)0x00)
74 #define CMPCR_CMP_PD_BB (PERIPH_BB_BASE + (CMPCR_OFFSET * 32) + (CMP_PD_BitNumber * 4))
75 
76 /* Private macro -------------------------------------------------------------*/
77 /* Private variables ---------------------------------------------------------*/
78 /* Private function prototypes -----------------------------------------------*/
79 /* Private functions ---------------------------------------------------------*/
80 
91 void SYSCFG_DeInit(void)
92 {
95 }
96 
107 void SYSCFG_MemoryRemapConfig(uint8_t SYSCFG_MemoryRemap)
108 {
109  /* Check the parameters */
110  assert_param(IS_SYSCFG_MEMORY_REMAP_CONFING(SYSCFG_MemoryRemap));
111 
112  SYSCFG->MEMRMP = SYSCFG_MemoryRemap;
113 }
114 
128 void SYSCFG_EXTILineConfig(uint8_t EXTI_PortSourceGPIOx, uint8_t EXTI_PinSourcex)
129 {
130  uint32_t tmp = 0x00;
131 
132  /* Check the parameters */
133  assert_param(IS_EXTI_PORT_SOURCE(EXTI_PortSourceGPIOx));
134  assert_param(IS_EXTI_PIN_SOURCE(EXTI_PinSourcex));
135 
136  tmp = ((uint32_t)0x0F) << (0x04 * (EXTI_PinSourcex & (uint8_t)0x03));
137  SYSCFG->EXTICR[EXTI_PinSourcex >> 0x02] &= ~tmp;
138  SYSCFG->EXTICR[EXTI_PinSourcex >> 0x02] |= (((uint32_t)EXTI_PortSourceGPIOx) << (0x04 * (EXTI_PinSourcex & (uint8_t)0x03)));
139 }
140 
149 void SYSCFG_ETH_MediaInterfaceConfig(uint32_t SYSCFG_ETH_MediaInterface)
150 {
151  assert_param(IS_SYSCFG_ETH_MEDIA_INTERFACE(SYSCFG_ETH_MediaInterface));
152  /* Configure MII_RMII selection bit */
153  *(__IO uint32_t *) PMC_MII_RMII_SEL_BB = SYSCFG_ETH_MediaInterface;
154 }
155 
167 {
168  /* Check the parameters */
170 
171  *(__IO uint32_t *) CMPCR_CMP_PD_BB = (uint32_t)NewState;
172 }
173 
180 {
181  FlagStatus bitstatus = RESET;
182 
183  if ((SYSCFG->CMPCR & SYSCFG_CMPCR_READY ) != (uint32_t)RESET)
184  {
185  bitstatus = SET;
186  }
187  else
188  {
189  bitstatus = RESET;
190  }
191  return bitstatus;
192 }
193 
206 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
void SYSCFG_CompensationCellCmd(FunctionalState NewState)
Enables or disables the I/O Compensation Cell.
FlagStatus
Definition: stm32f4xx.h:706
#define CMPCR_CMP_PD_BB
FunctionalState
Definition: stm32f4xx.h:708
#define IS_EXTI_PIN_SOURCE(PINSOURCE)
void assert_param(int val)
#define IS_FUNCTIONAL_STATE(STATE)
Definition: stm32f4xx.h:709
This file contains all the functions prototypes for the SYSCFG firmware library.
Definition: stm32f4xx.h:706
#define IS_SYSCFG_MEMORY_REMAP_CONFING(REMAP)
#define SYSCFG
Definition: stm32f4xx.h:2089
#define __IO
Definition: core_cm0.h:198
FlagStatus SYSCFG_GetCompensationCellStatus(void)
Checks whether the I/O Compensation Cell ready flag is set or not.
#define IS_EXTI_PORT_SOURCE(PORTSOURCE)
#define SYSCFG_CMPCR_READY
Definition: stm32f4xx.h:10413
void SYSCFG_ETH_MediaInterfaceConfig(uint32_t SYSCFG_ETH_MediaInterface)
Selects the ETHERNET media interface.
void RCC_APB2PeriphResetCmd(uint32_t RCC_APB2Periph, FunctionalState NewState)
Forces or releases High Speed APB (APB2) peripheral reset.
void SYSCFG_MemoryRemapConfig(uint8_t SYSCFG_MemoryRemap)
Changes the mapping of the specified pin.
void SYSCFG_EXTILineConfig(uint8_t EXTI_PortSourceGPIOx, uint8_t EXTI_PinSourcex)
Selects the GPIO pin used as EXTI Line.
#define IS_SYSCFG_ETH_MEDIA_INTERFACE(INTERFACE)
void SYSCFG_DeInit(void)
Deinitializes the Alternate Functions (remap and EXTI configuration) registers to their default reset...
#define PMC_MII_RMII_SEL_BB


rosflight_firmware
Author(s): Daniel Koch , James Jackson
autogenerated on Wed Jul 3 2019 19:59:26