drv_common.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /*
  2. * Copyright (c) 2006-2022, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2020-08-20 Abbcc first version
  9. * 2023-03-08 luobeihai modified FLASH and RAM micro definition
  10. */
  11. #ifndef __DRV_COMMON_H__
  12. #define __DRV_COMMON_H__
  13. #include <rtthread.h>
  14. #include <rthw.h>
  15. #ifdef RT_USING_DEVICE
  16. #include <rtdevice.h>
  17. #endif
  18. #include "apm32_msp.h"
  19. #include "apm32f10x_gpio.h"
  20. #include "apm32f10x_rcm.h"
  21. #include "apm32f10x_misc.h"
  22. #include "apm32f10x_rcm.h"
  23. #include "apm32f10x_eint.h"
  24. #include "apm32f10x_usart.h"
  25. #include "apm32f10x_dma.h"
  26. #include "apm32f10x_fmc.h"
  27. #include "apm32f10x_dmc.h"
  28. #if defined(RT_USING_ADC)
  29. #include "apm32f10x_adc.h"
  30. #endif
  31. #if defined(RT_USING_DAC)
  32. #include "apm32f10x_dac.h"
  33. #endif
  34. #if defined(RT_USING_RTC)
  35. #include "apm32f10x_rtc.h"
  36. #include "apm32f10x_pmu.h"
  37. #endif
  38. #if defined(RT_USING_SPI)
  39. #include "apm32f10x_spi.h"
  40. #endif
  41. #if defined(RT_USING_HWTIMER) || defined(RT_USING_PWM)
  42. #include "apm32f10x_tmr.h"
  43. #endif
  44. #if defined(RT_USING_WDT)
  45. #include "apm32f10x_iwdt.h"
  46. #include "apm32f10x_wwdt.h"
  47. #endif
  48. #if defined(RT_USING_SDIO)
  49. #include "apm32f10x_sdio.h"
  50. #endif
  51. #if defined(RT_USING_CAN)
  52. #include "apm32f10x_can.h"
  53. #endif
  54. #if defined(BSP_USING_ETH) || defined(RT_USING_LWIP)
  55. #include "apm32f10x_eth.h"
  56. #endif
  57. #include "drv_gpio.h"
  58. #ifdef __cplusplus
  59. extern "C" {
  60. #endif
  61. #define APM32_FLASH_START_ADRESS ROM_START
  62. #define APM32_FLASH_SIZE ROM_SIZE
  63. #define APM32_FLASH_END_ADDRESS ROM_END
  64. #define APM32_SRAM_SIZE RAM_SIZE
  65. #define APM32_SRAM_START RAM_START
  66. #define APM32_SRAM_END RAM_END
  67. #if defined(__ARMCC_VERSION)
  68. extern int Image$$RW_IRAM1$$ZI$$Limit;
  69. #define HEAP_BEGIN ((void *)&Image$$RW_IRAM1$$ZI$$Limit)
  70. #elif __ICCARM__
  71. #pragma section="CSTACK"
  72. #define HEAP_BEGIN (__segment_end("CSTACK"))
  73. #else
  74. extern int __bss_end;
  75. #define HEAP_BEGIN ((void *)&__bss_end)
  76. #endif
  77. #define HEAP_END APM32_SRAM_END
  78. #ifdef __cplusplus
  79. }
  80. #endif
  81. #ifdef __cplusplus
  82. }
  83. #endif
  84. #endif