⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 apb.h

📁 基于STR711的PRCCU程序
💻 H
字号:
/******************** (C) COPYRIGHT 2003 STMicroelectronics ********************
* File Name          : apb.h
* Author             : MCD Application Team
* Date First Issued  : 05/30/2003
* Description        : This file contains all the functions prototypes for the
*                      APB bridge software library.
********************************************************************************
* History:
*  01/01/2004 : V1.2
*  14/07/2004 : V1.3
*******************************************************************************/
#ifndef __APB_H
#define __APB_H

#include "71x_lib.h"

/* APB1 Peripherals */
#define  I2C0_Periph      0x0002
#define  I2C1_Periph      0x0004
#define  UART0_Periph     0x0010
#define  UART1_Periph     0x0020
#define  UART2_Periph     0x0040
#define  UART3_Periph     0x0080
#define  USB_Periph       0x0100
#define  CAN_Periph       0x0200
#define  BSPI0_Periph     0x0400
#define  BSPI1_Periph     0x0800
#define  HDLC_Periph      0x2000

/* APB2 Peripherals */
#define  XTI_Periph       0x0002
#define  GPIO0_Periph     0x0004
#define  GPIO1_Periph     0x0008
#define  GPIO2_Periph     0x0010
#define  ADC12_Periph     0x0080
#define  TIM0_Periph      0x0200
#define  TIM1_Periph      0x0400
#define  TIM2_Periph      0x0800
#define  TIM3_Periph      0x1000
#define  RTC_Periph       0x2000
#define  WDG_Periph       0x4000
#define  EIC_Periph       0x8000

/*******************************************************************************
* Function Name  : APB_ClockConfig
* Description    : Enables/Disables the Clock gating for peripherals on the APB
*                  bridge passed in parameters.
* Input          : APBx ( APB1 or APB2 )
*                  NewState ENABLE or DISABLE
*                  NewValue (u16)
* Return         : None
*******************************************************************************/
inline void APB_ClockConfig ( APB_TypeDef *APBx,
                              FunctionalState NewState,
                              u16 NewValue )
{
  if (NewState == ENABLE) APBx->CKDIS &= ~NewValue;
    else APBx->CKDIS |= NewValue;
}

/*******************************************************************************
* Function Name  : APB_SwResetConfig
* Description    : Enables/Disables the software Reset for peripherals on the APB
*                  bridge passed in parameters.
* Input          : APBx ( APB1 or APB2 )
*                  NewState ENABLE or DISABLE
*                  NewValue (u16)
* Return         : None
*******************************************************************************/
inline void APB_SwResetConfig ( APB_TypeDef *APBx,
                                FunctionalState NewState,
                                u16 NewValue )
{
  if (NewState == ENABLE) APBx->SWRES |= NewValue;
    else APBx->SWRES &= ~NewValue;
}

#endif	// __APB_H

/******************* (C) COPYRIGHT 2003 STMicroelectronics *****END OF FILE****/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -