bsp.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. *********************************************************************************************************
  3. *
  4. * 模块名称 : BSP模块
  5. * 文件名称 : bsp.h
  6. * 说 明 : 这是底层驱动模块所有的h文件的汇总文件。 应用程序只需 #include bsp.h 即可,
  7. * 不需要#include 每个模块的 h 文件
  8. *
  9. * Copyright (C), 2013-2014, 安富莱电子 www.armfly.com
  10. *
  11. *********************************************************************************************************
  12. */
  13. #ifndef _BSP_H_
  14. #define _BSP_H
  15. #define STM32_V4
  16. //#define STM32_X2
  17. /* 检查是否定义了开发板型号 */
  18. #if !defined (STM32_V4) && !defined (STM32_X2)
  19. #error "Please define the board model : STM32_X2 or STM32_V4"
  20. #endif
  21. /* 定义 BSP 版本号 */
  22. #define __STM32F1_BSP_VERSION "1.1"
  23. /* CPU空闲时执行的函数 */
  24. //#define CPU_IDLE() bsp_Idle()
  25. /* 开关全局中断的宏 */
  26. #define ENABLE_INT() __set_PRIMASK(0) /* 使能全局中断 */
  27. #define DISABLE_INT() __set_PRIMASK(1) /* 禁止全局中断 */
  28. /* 这个宏仅用于调试阶段排错 */
  29. #define BSP_Printf printf
  30. //#define BSP_Printf(...)
  31. #include "stm32f2xx.h"
  32. #include <stdio.h>
  33. #include <string.h>
  34. #include <stdlib.h>
  35. #ifndef TRUE
  36. #define TRUE 1
  37. #endif
  38. #ifndef FALSE
  39. #define FALSE 0
  40. #endif
  41. /*
  42. EXTI9_5_IRQHandler 的中断服务程序分散在几个独立的 bsp文件中。
  43. 需要整合到 stm32f4xx_it.c 中。
  44. 定义下面行表示EXTI9_5_IRQHandler入口函数集中放到 stm32f4xx_it.c。
  45. */
  46. #define EXTI9_5_ISR_MOVE_OUT
  47. #define DEBUG_GPS_TO_COM1 /* 打印GPS数据到串口1 */
  48. /* 通过取消注释或者添加注释的方式控制是否包含底层驱动模块 */
  49. //#include "uart_fifo.h"
  50. #include "nandflash.h"
  51. /* 提供给其他C文件调用的函数 */
  52. void bsp_Init(void);
  53. void bsp_Idle(void);
  54. #endif
  55. /***************************** 安富莱电子 www.armfly.com (END OF FILE) *********************************/