rt-thread/bsp/tkm32F499/Libraries/Hal_lib/inc/HAL_syscfg.h

181 lines
6.3 KiB
C
Raw Normal View History

2021-10-14 18:50:35 +08:00
/**
******************************************************************************
* @file HAL_syscfg.h
* @author IC Applications Department
* @version V0.8
* @date 2019_08_02
2021-10-14 19:46:54 +08:00
* @brief This file contains all the functions prototypes for the SYSCFG firmware
2021-10-14 18:50:35 +08:00
* library.
******************************************************************************
* @attention
*
* <h2><center>&copy; COPYRIGHT 2016 HOLOCENE</center></h2>
*
*/
/*!< Define to prevent recursive inclusion -------------------------------------*/
#ifndef __HAL_SYSCFG_H
#define __HAL_SYSCFG_H
#ifdef __cplusplus
extern "C" {
#endif
2021-10-14 19:46:54 +08:00
2021-10-14 18:50:35 +08:00
/*!< Includes ------------------------------------------------------------------*/
#include "HAL_device.h"
2021-10-14 19:46:54 +08:00
2021-10-14 18:50:35 +08:00
/** @addtogroup StdPeriph_Driver
* @{
*/
2021-10-14 19:46:54 +08:00
2021-10-14 18:50:35 +08:00
/** @addtogroup SYSCFG
* @{
*/
/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/
2021-10-14 19:46:54 +08:00
2021-10-14 18:50:35 +08:00
/** @defgroup SYSCFG_Exported_Constants
* @{
2021-10-14 19:46:54 +08:00
*/
/** @defgroup SYSCFG_EXTI_Port_Sources
2021-10-14 18:50:35 +08:00
* @{
2021-10-14 19:46:54 +08:00
*/
2021-10-14 18:50:35 +08:00
#define EXTI_PortSourceGPIOA ((uint8_t)0x00)
#define EXTI_PortSourceGPIOB ((uint8_t)0x01)
#define EXTI_PortSourceGPIOC ((uint8_t)0x02)
2021-10-14 19:46:54 +08:00
#define EXTI_PortSourceGPIOD ((uint8_t)0x03)
#define EXTI_PortSourceGPIOE ((uint8_t)0x04)
2021-10-14 18:50:35 +08:00
#define EXTI_PortSourceGPIOF ((uint8_t)0x05)
2021-10-14 19:46:54 +08:00
2021-10-14 18:50:35 +08:00
#define IS_EXTI_PORT_SOURCE(PORTSOURCE) (((PORTSOURCE) == EXTI_PortSourceGPIOA) || \
((PORTSOURCE) == EXTI_PortSourceGPIOB) || \
((PORTSOURCE) == EXTI_PortSourceGPIOC) || \
((PORTSOURCE) == EXTI_PortSourceGPIOD) || \
((PORTSOURCE) == EXTI_PortSourceGPIOE) || \
2021-10-14 19:46:54 +08:00
((PORTSOURCE) == EXTI_PortSourceGPIOF))
2021-10-14 18:50:35 +08:00
/**
* @}
*/
2021-10-14 19:46:54 +08:00
/** @defgroup SYSCFG_EXTI_Pin_sources
2021-10-14 18:50:35 +08:00
* @{
2021-10-14 19:46:54 +08:00
*/
2021-10-14 18:50:35 +08:00
#define EXTI_PinSource0 ((uint8_t)0x00)
#define EXTI_PinSource1 ((uint8_t)0x01)
#define EXTI_PinSource2 ((uint8_t)0x02)
#define EXTI_PinSource3 ((uint8_t)0x03)
#define EXTI_PinSource4 ((uint8_t)0x04)
#define EXTI_PinSource5 ((uint8_t)0x05)
#define EXTI_PinSource6 ((uint8_t)0x06)
#define EXTI_PinSource7 ((uint8_t)0x07)
#define EXTI_PinSource8 ((uint8_t)0x08)
#define EXTI_PinSource9 ((uint8_t)0x09)
#define EXTI_PinSource10 ((uint8_t)0x0A)
#define EXTI_PinSource11 ((uint8_t)0x0B)
#define EXTI_PinSource12 ((uint8_t)0x0C)
#define EXTI_PinSource13 ((uint8_t)0x0D)
#define EXTI_PinSource14 ((uint8_t)0x0E)
#define EXTI_PinSource15 ((uint8_t)0x0F)
#define IS_EXTI_PIN_SOURCE(PINSOURCE) (((PINSOURCE) == EXTI_PinSource0) || \
((PINSOURCE) == EXTI_PinSource1) || \
((PINSOURCE) == EXTI_PinSource2) || \
((PINSOURCE) == EXTI_PinSource3) || \
((PINSOURCE) == EXTI_PinSource4) || \
((PINSOURCE) == EXTI_PinSource5) || \
((PINSOURCE) == EXTI_PinSource6) || \
((PINSOURCE) == EXTI_PinSource7) || \
((PINSOURCE) == EXTI_PinSource8) || \
((PINSOURCE) == EXTI_PinSource9) || \
((PINSOURCE) == EXTI_PinSource10) || \
((PINSOURCE) == EXTI_PinSource11) || \
((PINSOURCE) == EXTI_PinSource12) || \
((PINSOURCE) == EXTI_PinSource13) || \
((PINSOURCE) == EXTI_PinSource14) || \
((PINSOURCE) == EXTI_PinSource15))
/**
* @}
*/
2021-10-14 19:46:54 +08:00
/** @defgroup SYSCFG_Memory_Remap_Config
2021-10-14 18:50:35 +08:00
* @{
2021-10-14 19:46:54 +08:00
*/
2021-10-14 18:50:35 +08:00
#define SYSCFG_MemoryRemap_Flash ((uint8_t)0x00)
#define SYSCFG_MemoryRemap_SystemMemory ((uint8_t)0x01)
#define SYSCFG_MemoryRemap_SRAM ((uint8_t)0x03)
#define IS_SYSCFG_MEMORY_REMAP(REMAP) (((REMAP) == SYSCFG_MemoryRemap_Flash) || \
((REMAP) == SYSCFG_MemoryRemap_SystemMemory) || \
((REMAP) == SYSCFG_MemoryRemap_SRAM))
/**
* @}
*/
2021-10-14 19:46:54 +08:00
/** @defgroup SYSCFG_DMA_Remap_Config
2021-10-14 18:50:35 +08:00
* @{
2021-10-14 19:46:54 +08:00
*/
2021-10-14 18:50:35 +08:00
#define SYSCFG_DMARemap_TIM17 SYSCFG_CFGR1_TIM17_DMA_RMP /* Remap TIM17 DMA requests from channel1 to channel2 */
#define SYSCFG_DMARemap_TIM16 SYSCFG_CFGR1_TIM16_DMA_RMP /* Remap TIM16 DMA requests from channel3 to channel4 */
#define SYSCFG_DMARemap_UART1Rx SYSCFG_CFGR1_UART1RX_DMA_RMP /* Remap UART1 Rx DMA requests from channel3 to channel5 */
#define SYSCFG_DMARemap_UART1Tx SYSCFG_CFGR1_UART1TX_DMA_RMP /* Remap UART1 Tx DMA requests from channel2 to channel4 */
#define SYSCFG_DMARemap_ADC1 SYSCFG_CFGR1_ADC_DMA_RMP /* Remap ADC1 DMA requests from channel1 to channel2 */
#define IS_SYSCFG_DMA_REMAP(REMAP) (((REMAP) == SYSCFG_DMARemap_TIM17) || \
((REMAP) == SYSCFG_DMARemap_TIM16) || \
((REMAP) == SYSCFG_DMARemap_UART1Rx) || \
((REMAP) == SYSCFG_DMARemap_UART1Tx) || \
((REMAP) == SYSCFG_CFGR1_TIM3_DMA_RMP) || \
((REMAP) == SYSCFG_CFGR1_TIM2_DMA_RMP) || \
((REMAP) == SYSCFG_CFGR1_TIM1_DMA_RMP) || \
((REMAP) == SYSCFG_CFGR1_I2C1_DMA_RMP) || \
((REMAP) == SYSCFG_CFGR1_UART3_DMA_RMP) || \
((REMAP) == SYSCFG_CFGR1_UART2_DMA_RMP) || \
((REMAP) == SYSCFG_CFGR1_SPI2_DMA_RMP) || \
((REMAP) == SYSCFG_CFGR1_TIM17_DMA_RMP2) || \
((REMAP) == SYSCFG_CFGR1_TIM16_DMA_RMP2) || \
((REMAP) == SYSCFG_DMARemap_ADC1))
/**
* @}
*/
/* Exported macro ------------------------------------------------------------*/
/* Exported functions ------------------------------------------------------- */
/* Function used to set the SYSCFG configuration to the default reset state **/
void SYSCFG_DeInit(void);
2021-10-14 19:46:54 +08:00
/* SYSCFG configuration functions *********************************************/
2021-10-14 18:50:35 +08:00
void SYSCFG_MemoryRemapConfig(uint32_t SYSCFG_MemoryRemap);
void SYSCFG_DMAChannelRemapConfig(uint32_t SYSCFG_DMARemap, FunctionalState NewState);
void SYSCFG_I2CFastModePlusConfig(uint32_t SYSCFG_I2CFastModePlus, FunctionalState NewState);
void SYSCFG_IRDAEnvSelection(uint32_t SYSCFG_IRDAEnv);
void SYSCFG_EXTILineConfig(uint8_t EXTI_PortSourceGPIOx, uint8_t EXTI_PinSourcex);
uint32_t SYSCFG_GetPendingIT(uint32_t ITSourceLine);
void SYSCFG_BreakConfig(uint32_t SYSCFG_Break);
FlagStatus SYSCFG_GetFlagStatus(uint32_t SYSCFG_Flag);
void SYSCFG_ClearFlag(uint32_t SYSCFG_Flag);
#ifdef __cplusplus
}
#endif
#endif /*__HAL_SYSCFG_H */
/**
* @}
2021-10-14 19:46:54 +08:00
*/
2021-10-14 18:50:35 +08:00
/**
* @}
2021-10-14 19:46:54 +08:00
*/
2021-10-14 18:50:35 +08:00
/*-------------------------(C) COPYRIGHT 2016 HOLOCENE ----------------------*/