71x_lib.c
上传用户:yyyd609
上传日期:2022-07-18
资源大小:183k
文件大小:3k
源码类别:

微处理器开发

开发平台:

C/C++

  1. /******************** (C) COPYRIGHT 2003 STMicroelectronics ********************
  2. * File Name          : 71x_lib.c
  3. * Author             : MCD Application Team
  4. * Date First Issued  : 05/16/2003
  5. * Description        : Peripherals pointers initialization
  6. ********************************************************************************
  7. * History:
  8. *  01/01/2004 : V1.2
  9. *  14/07/2004 : V1.3
  10. *******************************************************************************/
  11. #define EXT
  12. #include "71x_map.h"
  13. #ifdef DEBUG
  14. extern u32 T0TIMI_Addr;
  15. /*******************************************************************************
  16. * Function Name  : debug
  17. * Description    : Initialize the pointers to peripherals
  18. * Input          : none
  19. * Output         : none
  20. * Return         : none
  21. *******************************************************************************/
  22. void debug(void)
  23. {
  24.   #ifdef _ADC12
  25.   ADC12 = (ADC12_TypeDef *)ADC12_BASE;
  26.   #endif
  27.   #ifdef _APB
  28.   #ifdef _APB1
  29.   APB1 = (APB_TypeDef *)APB1_BASE;
  30.   #endif
  31.   #ifdef _APB2
  32.   APB2 = (APB_TypeDef *)APB2_BASE;
  33.   #endif
  34.   #endif
  35.   #ifdef _BSPI
  36.   #ifdef _BSPI0
  37.   BSPI0 = (BSPI_TypeDef *)BSPI0_BASE;
  38.   #endif
  39.   #ifdef _BSPI1
  40.   BSPI1 = (BSPI_TypeDef *)BSPI1_BASE;
  41.   #endif
  42.   #endif
  43.   #ifdef _CAN
  44.   CAN = (CAN_TypeDef *)CAN_BASE;
  45.   #endif
  46.   #ifdef _EIC
  47.   EIC = (EIC_TypeDef *)EIC_BASE;
  48.   #endif
  49.   #ifdef _EMI
  50.   EMI = (EMI_TypeDef *)EMI_BASE;
  51.   #endif
  52.   #ifdef _FLASH
  53.   FLASHR = (FLASHR_TypeDef *)FLASHR_BASE;
  54.   FLASHPR = (FLASHPR_TypeDef *)FLASHPR_BASE;
  55.   #endif
  56.   #ifdef _GPIO
  57.   #ifdef _GPIO0
  58.   GPIO0 = (GPIO_TypeDef *)GPIO0_BASE;
  59.   #endif
  60.   #ifdef _GPIO1
  61.   GPIO1 = (GPIO_TypeDef *)GPIO1_BASE;
  62.   #endif
  63.   #ifdef _GPIO2
  64.   GPIO2 = (GPIO_TypeDef *)GPIO2_BASE;
  65.   #endif
  66.   #endif
  67.   #ifdef _I2C
  68.   #ifdef _I2C0
  69.   I2C0 = (I2C_TypeDef *)I2C0_BASE;
  70.   #endif
  71.   #ifdef _I2C1
  72.   I2C1 = (I2C_TypeDef *)I2C1_BASE;
  73.   #endif
  74.   #endif
  75.   #ifdef _PCU
  76.   PCU = (PCU_TypeDef *)PCU_BASE;
  77.   #endif
  78.   #ifdef _RCCU
  79.   RCCU = (RCCU_TypeDef *)RCCU_BASE;
  80.   #endif
  81.   #ifdef _RTC
  82.   RTC = (RTC_TypeDef *)RTC_BASE;
  83.   #endif
  84.   #ifdef _TIM
  85.   #ifdef _TIM0
  86.   TIM0 = (TIM_TypeDef *)TIM0_BASE;
  87.   #endif
  88.   #ifdef _TIM1
  89.   TIM1 = (TIM_TypeDef *)TIM1_BASE;
  90.   #endif
  91.   #ifdef _TIM2
  92.   TIM2 = (TIM_TypeDef *)TIM2_BASE;
  93.   #endif
  94.   #ifdef _TIM3
  95.   TIM3 = (TIM_TypeDef *)TIM3_BASE;
  96.   #endif
  97.   #endif
  98.   #ifdef _UART
  99.   #ifdef _UART0
  100.   UART0 = (UART_TypeDef *)UART0_BASE;
  101.   #endif
  102.   #ifdef _UART1
  103.   UART1 = (UART_TypeDef *)UART1_BASE;
  104.   #endif
  105.   #ifdef _UART2
  106.   UART2 = (UART_TypeDef *)UART2_BASE;
  107.   #endif
  108.   #ifdef _UART3
  109.   UART3 = (UART_TypeDef *)UART3_BASE;
  110.   #endif
  111.   #endif
  112.   #ifdef _USB
  113.   USB = (USB_TypeDef *)USB_BASE;
  114.   #endif
  115.   #ifdef _WDG
  116.   WDG = (WDG_TypeDef *)WDG_BASE;
  117.   #endif
  118.   #ifdef _XTI
  119.   XTI = (XTI_TypeDef *)XTI_BASE;
  120.   #endif
  121.   #ifdef _IRQVectors
  122.   IRQVectors = (IRQVectors_TypeDef *)&T0TIMI_Addr;
  123.   #endif
  124. }
  125. #endif  /* DEBUG */
  126. /******************* (C) COPYRIGHT 2003 STMicroelectronics *****END OF FILE****/