Modifications

Sauter à la navigation Sauter à la recherche
Ligne 34 : Ligne 34 :  
Ce code utilise quelques nouveaux concepts:
 
Ce code utilise quelques nouveaux concepts:
   −
* {{fname|stm}} is a module which provides a set of constants for easy access to the registers of the pyboard’s microcontroller. Try running {{fname|import stm}} and then {{fname|help(stm)}} at the REPL. It will give you a list of all the available constants.
+
* {{fname|stm}} est un module qui offre un ensemble de constante pour facilement accéder plus facilement aux différents registres du microcontrôleur de la PyBoard. Essayer d'exécuter {{fname|import stm}} puis {{fname|help(stm)}} sur l'invite REPL. Cela vous fournira toutes les constantes disponibles.
* {{fname|stm.GPIOA}} is the address in memory of the GPIOA peripheral. On the pyboard, the red LED is on port A, pin PA13.
+
* {{fname|stm.GPIOA}} est l'adresse, en mémoire, du périphérique GPIOA. Sur la carte PyBoard, la LED rouge est sur le "port A", broche PA13.
* {{fname|movwt}} moves a 32-bit number into a register. It is a convenience function that turns into 2 thumb instructions: {{fname|movw}} followed by {{fname|movt}}. The {{fname|movt}} also shifts the immediate value right by 16 bits.
+
* {{fname|movwt}} déplace un nombre 32-bit dans un registre. It is a convenience function that turns into 2 thumb instructions: {{fname|movw}} followed by {{fname|movt}}. The {{fname|movt}} also shifts the immediate value right by 16 bits.
 
* {{fname|strh}} stores a half-word (16 bits). The instruction above stores the lower 16-bits of {{fname|r1}} into the memory location {{fname|r0 + stm.GPIO_BSRRL}}. This has the effect of setting high all those pins on port A for which the corresponding bit in {{fname|r0}} is set. In our example above, the 13th bit in {{fname|r0}} is set, so PA13 is pulled high. This turns on the red LED.
 
* {{fname|strh}} stores a half-word (16 bits). The instruction above stores the lower 16-bits of {{fname|r1}} into the memory location {{fname|r0 + stm.GPIO_BSRRL}}. This has the effect of setting high all those pins on port A for which the corresponding bit in {{fname|r0}} is set. In our example above, the 13th bit in {{fname|r0}} is set, so PA13 is pulled high. This turns on the red LED.
  
29 917

modifications

Menu de navigation