/**
|
******************************************************************************
|
* @file xl_port.c
|
* @author Kirk ,xu.wang
|
* @version 4.5.2
|
* @date Fri Mar 26 17:29:12 2021
|
* @brief This file provide function about PORT firmware program
|
******************************************************************************
|
* @attention
|
*
|
* 2019 by Chipways Communications,Inc. All Rights Reserved.
|
* This software is supplied under the terms of a license
|
* agreement or non-disclosure agreement with Chipways.
|
* Passing on and copying of this document,and communication
|
* of its contents is not permitted without prior written
|
* authorization.
|
*
|
* <h2><center>© COPYRIGHT 2019 Chipways</center></h2>
|
******************************************************************************
|
*/
|
|
#if defined(__cplusplus)
|
extern "C" {
|
#endif /* __cplusplus */
|
|
|
/* Includes ---------------------------------------------------------------*/
|
#include "xl_port.h"
|
|
/** @addtogroup XL6600_StdPeriph_Driver
|
* @{
|
*/
|
|
/** @defgroup PORT PORT Module
|
* @brief PORT Driver Modules Library
|
* @{
|
*/
|
|
/* Private typedef -----------------------------------------------------------*/
|
/* Private define ------------------------------------------------------------*/
|
/* Private macro -------------------------------------------------------------*/
|
/* Private variables ---------------------------------------------------------*/
|
/* Private function prototypes -----------------------------------------------*/
|
/* Private functions ---------------------------------------------------------*/
|
|
/** @defgroup PORT_Private_Functions
|
* @{
|
*/
|
|
/**
|
* @brief PORTĬÈϳõʼ»¯
|
* @param None.
|
* @retval None.
|
*/
|
void PORT_DeInit(void)
|
{
|
/* Deinitializes to default reset values */
|
PORT->IOFLT0 = 0x00C00000;
|
PORT->IOFLT1 = 0x00000000;
|
PORT->PUE0 = 0x00100000;
|
PORT->PUE1 = 0x00000000;
|
PORT->PUE2 = 0x00000000;
|
PORT->HDRVE = 0x00000000;
|
}
|
|
/**
|
* @brief ÉèÖÃÊäÈëÒý½ÅµÄÂ˲¨Æ÷
|
* @param IOflt0ConfigPtr: port_ioflt0_config ÀàÐ͵ÄÖ¸Õ룬°üº¬ÁËPORT IOFLT0 ÍâÉèµÄÅäÖÃÐÅÏ¢
|
* @retval None.
|
*/
|
void PORT_IOFLT0Config(const port_ioflt0_config *IOflt0ConfigPtr)
|
{
|
PORT->IOFLT0 = (uint32_t)(IOflt0ConfigPtr->iofltdiv3 | IOflt0ConfigPtr->iofltdiv2 | \
|
IOflt0ConfigPtr->iofltdiv1 | IOflt0ConfigPtr->iofltnmi | \
|
IOflt0ConfigPtr->iofltkbi1 | IOflt0ConfigPtr->iofltkbi0 | \
|
IOflt0ConfigPtr->iofltrst | IOflt0ConfigPtr->iofltpth | \
|
IOflt0ConfigPtr->iofltptg | IOflt0ConfigPtr->iofltptf | \
|
IOflt0ConfigPtr->iofltpte | IOflt0ConfigPtr->iofltptd | \
|
IOflt0ConfigPtr->iofltptc | IOflt0ConfigPtr->iofltptb | \
|
IOflt0ConfigPtr->iofltpta);;
|
}
|
|
/**
|
* @brief ÉèÖÃÊäÈëÒý½ÅµÄÂ˲¨Æ÷
|
* @param IOflt1ConfigPtr: port_ioflt1_config ÀàÐ͵ÄÖ¸Õ룬°üº¬PORT IOFLT1 ÍâÉèµÄÉèÖÃÐÅÏ¢
|
* @retval None.
|
*/
|
void PORT_IOFLT1Config(const port_ioflt1_config *IOflt1ConfigPtr)
|
{
|
uint16_t tmpreg;
|
|
/*---------------------------- PORT IOFLT1 Configuration ------------------------*/
|
/* get the present value in IOFLT1 Register. */
|
tmpreg = (uint16_t)PORT->IOFLT1 ;
|
/* Clear the bits in IOFLT1. */
|
tmpreg &= ~(uint16_t)(PORT_IOFLT1_FLTI_MASK | PORT_IOFLT1_FLTIRQ_MASK| PORT_IOFLT1_FLTFTM0_MASK | \
|
PORT_IOFLT1_FLTFTM1_MASK | PORT_IOFLT1_FLTPWT_MASK | \
|
PORT_IOFLT1_FLTI2C0_MASK | PORT_IOFLT1_FLTI2C1_MASK);
|
/* Configure the bits. */
|
tmpreg |= (IOflt1ConfigPtr->ioflti2c1 | IOflt1ConfigPtr->ioflti2c0 | \
|
IOflt1ConfigPtr->iofltpwt | IOflt1ConfigPtr->iofltftm1 | \
|
IOflt1ConfigPtr->iofltftm0 | IOflt1ConfigPtr->iofltirq | \
|
IOflt1ConfigPtr->iofltpti);
|
/* data write to IOFLT1 register. */
|
PORT->IOFLT1 = tmpreg ;
|
}
|
|
|
/**
|
* @brief PORTÂ˲¨Æ÷·Ö×é3ʱÖÓÑ¡Ôñ
|
* @param clk: ʱÖÓÑ¡Ôñ²ÎÊý
|
* Õâ¸ö²ÎÊý¿ÉÒÔÈ¡ÏÂÃæµÄÖµ:
|
* @arg Port_FLTDIV3SetLPOCLK: LPOʱÖÓ²»·ÖƵ
|
* @arg Port_FLTDIV3SetLPOCLKDiv2: LPOʱÖÓ2·ÖƵ
|
* @arg Port_FLTDIV3SetLPOCLKDiv4: LPOʱÖÓ4·ÖƵ
|
* @arg Port_FLTDIV3SetLPOCLKDiv8: LPOʱÖÓ8·ÖƵ
|
* @arg Port_FLTDIV3SetLPOCLKDiv16: LPOʱÖÓ16·ÖƵ
|
* @arg Port_FLTDIV3SetLPOCLKDiv32: LPOʱÖÓ32·ÖƵ
|
* @arg Port_FLTDIV3SetLPOCLKDiv64: LPOʱÖÓ64·ÖƵ
|
* @arg Port_FLTDIV3SetLPOCLKDiv128: LPOʱÖÓ128·ÖƵ
|
* @retval None.
|
*/
|
void PORT_FLTDIV3ConSet(uint32_t clk)
|
{
|
PORT->IOFLT0 &= ~PORT_IOFLT0_FLTDIV3_MASK;
|
PORT->IOFLT0 |= clk;
|
}
|
|
/**
|
* @brief PORTÂ˲¨Æ÷·Ö×é2ʱÖÓÑ¡Ôñ
|
* @param clk: ʱÖÓÑ¡Ôñ²ÎÊý
|
* Õâ¸ö²ÎÊý¿ÉÒÔÈ¡ÏÂÃæµÄÖµ:
|
* @arg Port_FLTDIV2SetBUSCLKDiv32: ×ÜÏßʱÖÓ32·ÖƵ
|
* @arg Port_FLTDIV2SetBUSCLKDiv64: ×ÜÏßʱÖÓ64·ÖƵ
|
* @arg Port_FLTDIV2SetBUSCLKDiv128: ×ÜÏßʱÖÓ128·ÖƵ
|
* @arg Port_FLTDIV2SetBUSCLKDiv256: ×ÜÏßʱÖÓ256·ÖƵ
|
* @arg Port_FLTDIV2SetBUSCLKDiv512: ×ÜÏßʱÖÓ512·ÖƵ
|
* @arg Port_FLTDIV2SetBUSCLKDiv1024: ×ÜÏßʱÖÓ1024·ÖƵ
|
* @arg Port_FLTDIV2SetBUSCLKDiv2048: ×ÜÏßʱÖÓ2048·ÖƵ
|
* @arg Port_FLTDIV2SetBUSCLKDiv4096: ×ÜÏßʱÖÓ4096·ÖƵ
|
* @retval None.
|
*/
|
void PORT_FLTDIV2Set(uint32_t clk)
|
{
|
PORT->IOFLT0 &= ~PORT_IOFLT0_FLTDIV2_MASK;
|
PORT->IOFLT0 |= clk;
|
}
|
|
/**
|
* @brief PORTÂ˲¨Æ÷·Ö×é1ʱÖÓÑ¡Ôñ
|
* @param clk: ʱÖÓÑ¡Ôñ²ÎÊý
|
* Õâ¸ö²ÎÊý¿ÉÒÔÈ¡ÏÂÃæµÄÖµ:
|
* @arg Port_FLTDIV1SetBUSCLKDiv2: ×ÜÏßʱÖÓ2·ÖƵ
|
* @arg Port_FLTDIV1SetBUSCLKDiv4: ×ÜÏßʱÖÓ4·ÖƵ
|
* @arg Port_FLTDIV1SetBUSCLKDiv8: ×ÜÏßʱÖÓ8·ÖƵ
|
* @arg Port_FLTDIV1SetBUSCLKDiv16: ×ÜÏßʱÖÓ16·ÖƵ
|
* @retval None.
|
*/
|
void PORT_FLTDIV1Set(uint32_t clk)
|
{
|
PORT->IOFLT0 &= ~PORT_IOFLT0_FLTDIV1_MASK;
|
PORT->IOFLT0 |= clk;
|
}
|
|
/**
|
* @brief NMIÊäÈëÂ˲¨Æ÷Ñ¡Ôñ
|
* @param NMIFilter: NMIÂ˲¨Æ÷²ÎÊýÑ¡Ôñ
|
* Õâ¸ö²ÎÊý¿ÉÒÔÈ¡ÏÂÃæµÄÖµ:
|
* @arg Port_FLTNMINoFilter: ÎÞÂ˲¨Æ÷
|
* @arg Port_FLTNMIFLTDIV1: Â˲¨Æ÷·Ö×é1
|
* @arg Port_FLTNMIFLTDIV2: Â˲¨Æ÷·Ö×é2
|
* @arg Port_FLTNMIFLTDIV3: Â˲¨Æ÷·Ö×é3
|
* @retval None.
|
*/
|
void PORT_FLTNMISET(uint32_t NMIFilter)
|
{
|
PORT->IOFLT0 &= ~PORT_IOFLT0_FLTNMI_MASK;
|
PORT->IOFLT0 |= NMIFilter;
|
}
|
|
/**
|
* @brief KBI1ÊäÈëÂ˲¨Æ÷Ñ¡Ôñ
|
* @param KBI1Filter: KBI1Â˲¨Æ÷²ÎÊýÑ¡Ôñ
|
* Õâ¸ö²ÎÊý¿ÉÒÔÈ¡ÏÂÃæµÄÖµ:
|
* @arg Port_FLTKBI1NoFilter: ÎÞÂ˲¨Æ÷
|
* @arg Port_FLTKBI1FLTDIV1: Â˲¨Æ÷·Ö×é1
|
* @arg Port_FLTKBI1FLTDIV2: Â˲¨Æ÷·Ö×é2
|
* @arg Port_FLTKBI1FLTDIV3: Â˲¨Æ÷·Ö×é3
|
* @retval None.
|
*/
|
void PORT_FLTKBI1SET(uint32_t KBI1Filter)
|
{
|
PORT->IOFLT0 &= ~PORT_IOFLT0_FLTKBI1_MASK;
|
PORT->IOFLT0 |= KBI1Filter;
|
}
|
|
/**
|
* @brief KBI0ÊäÈëÂ˲¨Æ÷Ñ¡Ôñ
|
* @param KBI0Filter: KBI0Â˲¨Æ÷²ÎÊýÑ¡Ôñ
|
* Õâ¸ö²ÎÊý¿ÉÒÔÈ¡ÏÂÃæµÄÖµ:
|
* @arg Port_FLTKBI0NoFilter: ÎÞÂ˲¨Æ÷
|
* @arg Port_FLTKBI0FLTDIV1: Â˲¨Æ÷·Ö×é1
|
* @arg Port_FLTKBI0FLTDIV2: Â˲¨Æ÷·Ö×é2
|
* @arg Port_FLTKBI0FLTDIV3: Â˲¨Æ÷·Ö×é3
|
* @retval None.
|
*/
|
void PORT_FLTKBI0SET(uint32_t KBI0Filter)
|
{
|
PORT->IOFLT0 &= ~PORT_IOFLT0_FLTKBI0_MASK;
|
PORT->IOFLT0 |= KBI0Filter;
|
}
|
|
/**
|
* @brief ResetÊäÈëÂ˲¨Æ÷Ñ¡Ôñ
|
* @param RSTFilter: RESETÂ˲¨Æ÷²ÎÊýÑ¡Ôñ
|
* Õâ¸ö²ÎÊý¿ÉÒÔÈ¡ÏÂÃæµÄÖµ:
|
* @arg Port_FLTRSTNoFilter: ÎÞÂ˲¨Æ÷
|
* @arg Port_FLTRSTFLTDIV1: Â˲¨Æ÷·Ö×é1
|
* @arg Port_FLTRSTFLTDIV2: Â˲¨Æ÷·Ö×é2
|
* @arg Port_FLTRSTFLTDIV3: Â˲¨Æ÷·Ö×é3
|
* @retval None.
|
*/
|
void PORT_FLTRSTSET(uint32_t RSTFilter)
|
{
|
PORT->IOFLT0 &= ~PORT_IOFLT0_FLTRST_MASK;
|
PORT->IOFLT0 |= RSTFilter;
|
}
|
|
/**
|
* @brief FLTHÊäÈëÂ˲¨Æ÷Ñ¡Ôñ
|
* @param FLTHFilter: FLTHÂ˲¨Æ÷²ÎÊýÑ¡Ôñ
|
* Õâ¸ö²ÎÊý¿ÉÒÔÈ¡ÏÂÃæµÄÖµ:
|
* @arg Port_FLTHBUSCLK: ×ÜÏßʱÖÓ
|
* @arg Port_FLTHFLTDIV1: Â˲¨Æ÷·Ö×é1
|
* @arg Port_FLTHFLTDIV2: Â˲¨Æ÷·Ö×é2
|
* @arg Port_FLTHFLTDIV3: Â˲¨Æ÷·Ö×é3
|
* @retval None.
|
*/
|
void PORT_FLTHSET(uint32_t FLTHFilter)
|
{
|
PORT->IOFLT0 &= ~PORT_IOFLT0_FLTH_MASK;
|
PORT->IOFLT0 |= FLTHFilter;
|
}
|
|
/**
|
* @brief FLTGÊäÈëÂ˲¨Æ÷Ñ¡Ôñ
|
* @param FLTGFilter: FLTGÂ˲¨Æ÷²ÎÊýÑ¡Ôñ
|
* Õâ¸ö²ÎÊý¿ÉÒÔÈ¡ÏÂÃæµÄÖµ:
|
* @arg Port_FLTGBUSCLK: ×ÜÏßʱÖÓ
|
* @arg Port_FLTGFLTDIV1: Â˲¨Æ÷·Ö×é1
|
* @arg Port_FLTGFLTDIV2: Â˲¨Æ÷·Ö×é2
|
* @arg Port_FLTGFLTDIV3: Â˲¨Æ÷·Ö×é3
|
* @retval None.
|
*/
|
void PORT_FLTGSET(uint32_t FLTGFilter)
|
{
|
PORT->IOFLT0 &= ~PORT_IOFLT0_FLTG_MASK;
|
PORT->IOFLT0 |= FLTGFilter;
|
}
|
|
/**
|
* @brief FLTFÊäÈëÂ˲¨Æ÷Ñ¡Ôñ
|
* @param FLTFFilter: FLTFÂ˲¨Æ÷²ÎÊýÑ¡Ôñ
|
* Õâ¸ö²ÎÊý¿ÉÒÔÈ¡ÏÂÃæµÄÖµ:
|
* @arg Port_FLTFBUSCLK: ×ÜÏßʱÖÓ
|
* @arg Port_FLTFFLTDIV1: Â˲¨Æ÷·Ö×é1
|
* @arg Port_FLTFFLTDIV2: Â˲¨Æ÷·Ö×é2
|
* @arg Port_FLTFFLTDIV3: Â˲¨Æ÷·Ö×é3
|
* @retval None.
|
*/
|
void PORT_FLTFSET(uint32_t FLTFFilter)
|
{
|
PORT->IOFLT0 &= ~PORT_IOFLT0_FLTF_MASK;
|
PORT->IOFLT0 |= FLTFFilter;
|
}
|
|
/**
|
* @brief FLTEÊäÈëÂ˲¨Æ÷Ñ¡Ôñ
|
* @param FLTEFilter: FLTEÂ˲¨Æ÷²ÎÊýÑ¡Ôñ
|
* Õâ¸ö²ÎÊý¿ÉÒÔÈ¡ÏÂÃæµÄÖµ:
|
* @arg Port_FLTEBUSCLK: ×ÜÏßʱÖÓ
|
* @arg Port_FLTEFLTDIV1: Â˲¨Æ÷·Ö×é1
|
* @arg Port_FLTEFLTDIV2: Â˲¨Æ÷·Ö×é2
|
* @arg Port_FLTEFLTDIV3: Â˲¨Æ÷·Ö×é3
|
* @retval None.
|
*/
|
void PORT_FLTESET(uint32_t FLTEFilter)
|
{
|
PORT->IOFLT0 &= ~PORT_IOFLT0_FLTE_MASK;
|
PORT->IOFLT0 |= FLTEFilter;
|
}
|
|
/**
|
* @brief FLTDÊäÈëÂ˲¨Æ÷Ñ¡Ôñ
|
* @param FLTDFilter: FLTDÂ˲¨Æ÷²ÎÊýÑ¡Ôñ
|
* Õâ¸ö²ÎÊý¿ÉÒÔÈ¡ÏÂÃæµÄÖµ:
|
* @arg Port_FLTDBUSCLK: ×ÜÏßʱÖÓ
|
* @arg Port_FLTDFLTDIV1: Â˲¨Æ÷·Ö×é1
|
* @arg Port_FLTDFLTDIV2: Â˲¨Æ÷·Ö×é2
|
* @arg Port_FLTDFLTDIV3: Â˲¨Æ÷·Ö×é3
|
* @retval None.
|
*/
|
void PORT_FLTDSET(uint32_t FLTDFilter)
|
{
|
PORT->IOFLT0 &= ~PORT_IOFLT0_FLTD_MASK;
|
PORT->IOFLT0 |= FLTDFilter;
|
}
|
|
/**
|
* @brief FLTCÊäÈëÂ˲¨Æ÷Ñ¡Ôñ
|
* @param FLTCFilter: FLTCÂ˲¨Æ÷²ÎÊýÑ¡Ôñ
|
* Õâ¸ö²ÎÊý¿ÉÒÔÈ¡ÏÂÃæµÄÖµ:
|
* @arg Port_FLTCBUSCLK: ×ÜÏßʱÖÓ
|
* @arg Port_FLTCFLTDIV1: Â˲¨Æ÷·Ö×é1
|
* @arg Port_FLTCFLTDIV2: Â˲¨Æ÷·Ö×é2
|
* @arg Port_FLTCFLTDIV3: Â˲¨Æ÷·Ö×é3
|
* @retval None.
|
*/
|
void PORT_FLTCSET(uint32_t FLTCFilter)
|
{
|
PORT->IOFLT0 &= ~PORT_IOFLT0_FLTC_MASK;
|
PORT->IOFLT0 |= FLTCFilter;
|
}
|
|
/**
|
* @brief FLTBÊäÈëÂ˲¨Æ÷Ñ¡Ôñ
|
* @param FLTBFilter: FLTBÂ˲¨Æ÷²ÎÊýÑ¡Ôñ
|
* Õâ¸ö²ÎÊý¿ÉÒÔÈ¡ÏÂÃæµÄÖµ:
|
* @arg Port_FLTBBUSCLK: ×ÜÏßʱÖÓ
|
* @arg Port_FLTBFLTDIV1: Â˲¨Æ÷·Ö×é1
|
* @arg Port_FLTBFLTDIV2: Â˲¨Æ÷·Ö×é2
|
* @arg Port_FLTBFLTDIV3: Â˲¨Æ÷·Ö×é3
|
* @retval None.
|
*/
|
void PORT_FLTBSET(uint32_t FLTBFilter)
|
{
|
PORT->IOFLT0 &= ~PORT_IOFLT0_FLTB_MASK;
|
PORT->IOFLT0 |= FLTBFilter;
|
}
|
|
/**
|
* @brief FLTAÊäÈëÂ˲¨Æ÷Ñ¡Ôñ
|
* @param FLTAFilter: FLTAÂ˲¨Æ÷²ÎÊýÑ¡Ôñ
|
* Õâ¸ö²ÎÊý¿ÉÒÔÈ¡ÏÂÃæµÄÖµ:
|
* @arg Port_FLTABUSCLK: ×ÜÏßʱÖÓ
|
* @arg Port_FLTAFLTDIV1: Â˲¨Æ÷·Ö×é1
|
* @arg Port_FLTAFLTDIV2: Â˲¨Æ÷·Ö×é2
|
* @arg Port_FLTAFLTDIV3: Â˲¨Æ÷·Ö×é3
|
* @retval None.
|
*/
|
void PORT_FLTASET(uint32_t FLTAFilter)
|
{
|
PORT->IOFLT0 &= ~PORT_IOFLT0_FLTA_MASK;
|
PORT->IOFLT0 |= FLTAFilter;
|
}
|
|
/**
|
* @brief FLTEWMÊäÈëÂ˲¨Æ÷Ñ¡Ôñ
|
* @param FLTEWMFilter: FLTEWMÂ˲¨Æ÷²ÎÊýÑ¡Ôñ
|
* Õâ¸ö²ÎÊý¿ÉÒÔÈ¡ÏÂÃæµÄÖµ:
|
* @arg Port_FLTEWMNoFilter: ÎÞÂ˲¨Æ÷
|
* @arg Port_FLTEWMFLTDIV1: Â˲¨Æ÷·Ö×é1
|
* @arg Port_FLTEWMFLTDIV2: Â˲¨Æ÷·Ö×é2
|
* @arg Port_FLTIEWMBUSCLK: ×ÜÏßʱÖÓ
|
* @retval None.
|
*/
|
void PORT_FLTEWMSET(uint32_t FLTEWMFilter)
|
{
|
PORT->IOFLT1 &= ~PORT_IOFLT1_FLTEWM_MASK;
|
PORT->IOFLT1 |= FLTEWMFilter;
|
}
|
|
/**
|
* @brief FLTI2C1ÊäÈëÂ˲¨Æ÷Ñ¡Ôñ
|
* @param FLTI2C1Filter: FLTI2C1Â˲¨Æ÷²ÎÊýÑ¡Ôñ
|
* Õâ¸ö²ÎÊý¿ÉÒÔÈ¡ÏÂÃæµÄÖµ:
|
* @arg Port_FLTI2C1NoFilter: ÎÞÂ˲¨Æ÷
|
* @arg Port_FLTI2C1FLTDIV1: Â˲¨Æ÷·Ö×é1
|
* @arg Port_FLTI2C1FLTDIV2: Â˲¨Æ÷·Ö×é2
|
* @arg Port_FLTI2C1BUSCLK: ×ÜÏßʱÖÓ
|
* @retval None.
|
*/
|
void PORT_FLTI2C1SET(uint32_t FLTI2C1Filter)
|
{
|
PORT->IOFLT1 &= ~PORT_IOFLT1_FLTI2C1_MASK;
|
PORT->IOFLT1 |= FLTI2C1Filter;
|
}
|
|
/**
|
* @brief FLTI2C0ÊäÈëÂ˲¨Æ÷Ñ¡Ôñ
|
* @param FLTI2C0Filter: FLTI2C0Â˲¨Æ÷²ÎÊýÑ¡Ôñ
|
* Õâ¸ö²ÎÊý¿ÉÒÔÈ¡ÏÂÃæµÄÖµ:
|
* @arg Port_FLTI2C0NoFilter: ÎÞÂ˲¨Æ÷
|
* @arg Port_FLTI2C0FLTDIV1: Â˲¨Æ÷·Ö×é1
|
* @arg Port_FLTI2C0FLTDIV2: Â˲¨Æ÷·Ö×é2
|
* @arg Port_FLTI2C0BUSCLK: ×ÜÏßʱÖÓ
|
* @retval None.
|
*/
|
void PORT_FLTI2C0SET(uint32_t FLTI2C0Filter)
|
{
|
PORT->IOFLT1 &= ~PORT_IOFLT1_FLTI2C0_MASK;
|
PORT->IOFLT1 |= FLTI2C0Filter;
|
}
|
|
/**
|
* @brief FLTPWTÊäÈëÂ˲¨Æ÷Ñ¡Ôñ
|
* @param FLTPWTFilter: FLTPWTÂ˲¨Æ÷²ÎÊýÑ¡Ôñ
|
* Õâ¸ö²ÎÊý¿ÉÒÔÈ¡ÏÂÃæµÄÖµ:
|
* @arg Port_FLTPWTNoFilter: ÎÞÂ˲¨Æ÷
|
* @arg Port_FLTPWTFLTDIV1: Â˲¨Æ÷·Ö×é1
|
* @arg Port_FLTPWTFLTDIV2: Â˲¨Æ÷·Ö×é2
|
* @arg Port_FLTPWTFLTDIV3: Â˲¨Æ÷·Ö×é3
|
* @retval None.
|
*/
|
void PORT_FLTPWTSET(uint32_t FLTPWTFilter)
|
{
|
PORT->IOFLT1 &= ~PORT_IOFLT1_FLTPWT_MASK;
|
PORT->IOFLT1 |= FLTPWTFilter;
|
}
|
|
/**
|
* @brief FLTFTM1ÊäÈëÂ˲¨Æ÷Ñ¡Ôñ
|
* @param FLTFTM1Filter: FLTFTM1Â˲¨Æ÷²ÎÊýÑ¡Ôñ
|
* Õâ¸ö²ÎÊý¿ÉÒÔÈ¡ÏÂÃæµÄÖµ:
|
* @arg Port_FLTFTM1NoFilter: ÎÞÂ˲¨Æ÷
|
* @arg Port_FLTFTM1FLTDIV1: Â˲¨Æ÷·Ö×é1
|
* @arg Port_FLTFTM1FLTDIV2: Â˲¨Æ÷·Ö×é2
|
* @arg Port_FLTFTM1FLTDIV3: Â˲¨Æ÷·Ö×é3
|
* @retval None.
|
*/
|
void PORT_FLTFTM1SET(uint32_t FLTFTM1Filter)
|
{
|
PORT->IOFLT1 &= ~PORT_IOFLT1_FLTFTM1_MASK;
|
PORT->IOFLT1 |= FLTFTM1Filter;
|
}
|
|
/**
|
* @brief FLTFTM0ÊäÈëÂ˲¨Æ÷Ñ¡Ôñ
|
* @param FLTFTM0Filter: FLTFTM0Â˲¨Æ÷²ÎÊýÑ¡Ôñ
|
* Õâ¸ö²ÎÊý¿ÉÒÔÈ¡ÏÂÃæµÄÖµ:
|
* @arg Port_FLTFTM0NoFilter: ÎÞÂ˲¨Æ÷
|
* @arg Port_FLTFTM0FLTDIV1: Â˲¨Æ÷·Ö×é1
|
* @arg Port_FLTFTM0FLTDIV2: Â˲¨Æ÷·Ö×é2
|
* @arg Port_FLTFTM0FLTDIV3: Â˲¨Æ÷·Ö×é3
|
* @retval None.
|
*/
|
void PORT_FLTFTM0SET(uint32_t FLTFTM0Filter)
|
{
|
PORT->IOFLT1 &= ~PORT_IOFLT1_FLTFTM0_MASK;
|
PORT->IOFLT1 |= FLTFTM0Filter;
|
}
|
|
/**
|
* @brief FLTIRQÊäÈëÂ˲¨Æ÷Ñ¡Ôñ
|
* @param FLTIRQFilter: FLTIRQÂ˲¨Æ÷²ÎÊýÑ¡Ôñ
|
* Õâ¸ö²ÎÊý¿ÉÒÔÈ¡ÏÂÃæµÄÖµ:
|
* @arg Port_FLTIRQNoFilter: ÎÞÂ˲¨Æ÷
|
* @arg Port_FLTIRQFLTDIV1: Â˲¨Æ÷·Ö×é1
|
* @arg Port_FLTIRQFLTDIV2: Â˲¨Æ÷·Ö×é2
|
* @arg Port_FLTIRQFLTDIV3: Â˲¨Æ÷·Ö×é3
|
* @retval None.
|
*/
|
void PORT_FLTIRQSET(uint32_t FLTIRQFilter)
|
{
|
PORT->IOFLT1 &= ~PORT_IOFLT1_FLTIRQ_MASK;
|
PORT->IOFLT1 |= FLTIRQFilter;
|
}
|
|
/**
|
* @brief FLTIÊäÈëÂ˲¨Æ÷Ñ¡Ôñ
|
* @param FLTAFilter: FLTIÂ˲¨Æ÷²ÎÊýÑ¡Ôñ
|
* Õâ¸ö²ÎÊý¿ÉÒÔÈ¡ÏÂÃæµÄÖµ:
|
* @arg Port_FLTIBUSCLK: ×ÜÏßʱÖÓ
|
* @arg Port_FLTIFLTDIV1: Â˲¨Æ÷·Ö×é1
|
* @arg Port_FLTIFLTDIV2: Â˲¨Æ÷·Ö×é2
|
* @arg Port_FLTIFLTDIV3: Â˲¨Æ÷·Ö×é3
|
* @retval None.
|
*/
|
void PORT_FLTISET(uint32_t FLTIFilter)
|
{
|
PORT->IOFLT1 &= ~PORT_IOFLT1_FLTI_MASK;
|
PORT->IOFLT1 |= FLTIFilter;
|
}
|
|
/**
|
* @brief ÉèÖö˿ÚÒý½ÅÉÏÀ
|
* @param PortPin: ÐèÒª½øÐÐÉÏÀµÄ¶Ë¿ÚÒý½Å(PORT_PTA0~PORT_PTI6)
|
* @param NewState: Òý½ÅÉÏÀ״̬
|
* Õâ¸ö²ÎÊý¿ÉÒÔÈ¡ÏÂÃæµÄÖµ:
|
* @arg ENABLE: ʹÄÜÒý½ÅÉÏÀ
|
* @arg DISABLE: ʧÄÜÒý½ÅÉÏÀ
|
* @retval None.
|
*/
|
void PORT_PullPinCmd(uint8_t PortPin,FunctionalState NewState)
|
{
|
/* while PortPin less than PORT_PTD7 choose PUE0 Regsiter */
|
if(PortPin <= (uint8_t)PORT_PTD7)
|
{
|
if(NewState != DISABLE )
|
{
|
/* enable pinA-D pull up */
|
PORT->PUE0 |= ((uint32_t)1<<PortPin);
|
}
|
else
|
{
|
/* disable pinA-D pull up */
|
PORT->PUE0 &= ~((uint32_t)1<<PortPin);
|
}
|
}
|
else if(PortPin <= (uint8_t)PORT_PTH7)
|
{
|
if(NewState != DISABLE )
|
{
|
/* enable pinE-H pull up */
|
PORT->PUE1 |= ((uint32_t)1<<(PortPin - 32u));
|
}
|
else
|
{
|
/* disable pinE-H pull up */
|
PORT->PUE1 &= ~((uint32_t)1<<(PortPin - 32u));
|
}
|
}
|
else
|
{
|
if(NewState != DISABLE )
|
{
|
/* enable pinI pull up */
|
PORT->PUE2 |= ((uint32_t)1<<(PortPin - 64u));
|
}
|
else
|
{
|
/* disable pinI pull up */
|
PORT->PUE2 &= ~((uint32_t)1<<(PortPin - 64u));
|
}
|
}
|
}
|
|
/**
|
* @brief ÉèÖö˿ÚÒý½ÅµÄ´óµçÁ÷Çý¶¯
|
* @param hdrvePin: ±íʾÐèÒª½øÐÐÉèÖõĶ˿Ú
|
* Õâ¸ö²ÎÊý¿ÉÒÔÈ¡ÏÂÃæµÄÖµ:
|
* @arg PORT_PullPTB4: PTB4´óµçÁ÷Çý¶¯ÄÜÁ¦
|
* @arg PORT_PullPTB5: PTB5´óµçÁ÷Çý¶¯ÄÜÁ¦
|
* @arg PORT_PullPTD0: PTD0´óµçÁ÷Çý¶¯ÄÜÁ¦
|
* @arg PORT_PullPTD1: PTD1´óµçÁ÷Çý¶¯ÄÜÁ¦
|
* @arg PORT_PullPTE0: PTE0´óµçÁ÷Çý¶¯ÄÜÁ¦
|
* @arg PORT_PullPTE1: PTE1´óµçÁ÷Çý¶¯ÄÜÁ¦
|
* @arg PORT_PullPTH0: PTH0´óµçÁ÷Çý¶¯ÄÜÁ¦
|
* @arg PORT_PullPTH1: PTH1´óµçÁ÷Çý¶¯ÄÜÁ¦
|
* @param NewState: ´óµçÁ÷Çý¶¯Ê¹ÄÜ״̬
|
* Õâ¸ö²ÎÊý¿ÉÒÔÈ¡ÏÂÃæµÄÖµ:
|
* @arg ENABLE: ´óµçÁ÷Çý¶¯Ê¹ÄÜ
|
* @arg DISABLE: ´óµçÁ÷Çý¶¯Ê§ÄÜ
|
* @retval None.
|
*/
|
void PORT_HDRVEPinCmd(uint8_t hdrvePin,FunctionalState NewState)
|
{
|
if(NewState != DISABLE )
|
{
|
/* enable pin high drive */
|
PORT->HDRVE |= ((uint32_t)1<<hdrvePin) ;
|
}
|
else
|
{
|
/* disable pin high drive */
|
PORT->HDRVE &= ~((uint32_t)1<< hdrvePin );
|
}
|
}
|
|
/**
|
* @}
|
*/
|
|
/**
|
* @}
|
*/
|
|
/**
|
* @}
|
*/
|
|
#ifdef __cplusplus
|
}
|
#endif /* __cplusplus */
|