memmap.inc 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /* This file is the part of the Lightweight USB device Stack for STM32 microcontrollers
  2. *
  3. * Copyright ©2016 Dmitry Filimonchuk <dmitrystu[at]gmail[dot]com>
  4. *
  5. * Licensed under the Apache License, Version 2.0 (the "License");
  6. * you may not use this file except in compliance with the License.
  7. * You may obtain a copy of the License at
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. * Unless required by applicable law or agreed to in writing, software
  10. * distributed under the License is distributed on an "AS IS" BASIS,
  11. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. * See the License for the specific language governing permissions and
  13. * limitations under the License.
  14. */
  15. #if defined(STM32L052xx) || defined(STM32L053xx) || \
  16. defined(STM32L062xx) || defined(STM32L063xx) || \
  17. defined(STM32L072xx) || defined(STM32L073xx) || \
  18. defined(STM32L082xx) || defined(STM32L083xx) || \
  19. defined(STM32L432xx) || defined(STM32L433xx) || \
  20. defined(STM32L442xx) || defined(STM32L443xx) || \
  21. defined(STM32L452xx) || defined(STM32L462xx) || \
  22. defined(STM32F042x6) || defined(STM32F048xx) || \
  23. defined(STM32F070x6) || defined(STM32F070xB) || \
  24. defined(STM32F072xB) || defined(STM32F078xx) \
  25. #define USB_EPBASE 0x40005C00
  26. #define USB_REGBASE 0x40005C40
  27. #define USB_CNTR 0x00
  28. #define USB_ISTR 0x04
  29. #define USB_FNR 0x08
  30. #define USB_DADDR 0x0C
  31. #define USB_BTABLE 0x10
  32. #define USB_BCDR 0x18
  33. #define USB_PMABASE 0x40006000
  34. #define RCC_BASE 0x40021000
  35. #define RCC_APB1RSTR 0x28
  36. #define RCC_APB1ENR 0x38
  37. #define UID_BASE 0x1FF80050
  38. #elif defined(STM32L1)
  39. /* common definitions for STM31L100xx STM32L151xx STM32L152xx STM32L162xx */
  40. #define USB_EPBASE 0x40005C00
  41. #define USB_REGBASE 0x40005C40
  42. #define USB_CNTR 0x00
  43. #define USB_ISTR 0x04
  44. #define USB_FNR 0x08
  45. #define USB_DADDR 0x0C
  46. #define USB_BTABLE 0x10
  47. #define USB_PMABASE 0x40006000
  48. #define SYSCFG_BASE 0x40010000
  49. #define SYSCFG_PMC 0x04
  50. #define RCC_BASE 0x40023800
  51. #define RCC_APB1ENR 0x24
  52. #define RCC_APB1RSTR 0x18
  53. #define RCC_APB2ENR 0x20
  54. #if defined(STM32L100xB) || defined(STM32L100xBA) || \
  55. defined(STM32L151xB) || defined(STM32L151xBA)
  56. /* Cat.1 and Cat.2 devices */
  57. #define UID_BASE 0x1FF80050
  58. #else
  59. #define UID_BASE 0x1FF800D0
  60. #endif
  61. #else
  62. #error Unsupported MCU
  63. #endif