diff python/stm32.py @ 131:04e45faafd1d

Added register view
author Windel Bouwman
date Sat, 19 Jan 2013 18:41:49 +0100
parents 654093a9a1e3
children 14e739ed03ab
line wrap: on
line diff
--- a/python/stm32.py	Sat Jan 19 18:16:04 2013 +0100
+++ b/python/stm32.py	Sat Jan 19 18:41:49 2013 +0100
@@ -20,22 +20,12 @@
 FLASH_F4_CR_SNB_MASK = 0x38
 FLASH_F4_SR_BSY = 16
 
-@registerDevice(0x10016413)
 class Stm32F4(Device):
    """
       Implementation of the specifics of the STM32F4xx device series.
    """
    def __init__(self, iface):
       super().__init__(iface)
-      # Assert the proper size for this device:
-      assert self.FlashSize == 0x100000
-      """
-         from 0x8000000 to 0x80FFFFF
-         4 sectors of 0x4000 (16 kB)
-         1 sector of 0x10000 (64 kB)
-         7 of 0x20000 (128 kB)
-      """
-      self.sectorsizes = [0x4000] * 4 + [0x10000] + [0x20000] * 7
    def __str__(self):
       return 'STM32F4 device size=0x{1:X} id=0x{0:X}'.format(\
          self.UID, self.FlashSize)
@@ -236,3 +226,18 @@
             raise STLinkException(msg)
       return sr & mask == mask
 
+@registerDevice(0x10016413)
+class Stm32F40x(Stm32F4):
+   """ STM32F40x and STM32F41x device series """
+   def __init__(self, iface):
+      super().__init__(iface)
+      # Assert the proper size for this device:
+      assert self.FlashSize == 0x100000
+      """
+         from 0x8000000 to 0x80FFFFF
+         4 sectors of 0x4000 (16 kB)
+         1 sector of 0x10000 (64 kB)
+         7 of 0x20000 (128 kB)
+      """
+      self.sectorsizes = [0x4000] * 4 + [0x10000] + [0x20000] * 7
+